Skip to content

RFC draft: build attempt identity and result lifecycle - #21

Merged
andrewperis merged 4 commits into
mainfrom
rfc/o02-attempt-result-lifecycle
Oct 28, 2026
Merged

andrewperis merged 4 commits into
mainfrom
rfc/o02-attempt-result-lifecycle

Conversation

@andrewperis

@andrewperis andrewperis commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Draft Codex RFC for Studio O02 #103. It defines a bounded transition table and finite synthetic fixture expectations for one exact Comic Manifest revision and exactly one offline mock Provider Execution call per attempt.

  • Keeps build-attempt, per-call execution, and result IDs distinct; a protected append-only index associates the one execution ID with its attempt and preserves caller-supplied correlation_id. Multi-call attempts are deferred.
  • Defines prepared, result-prepared, persisting, terminal, and reconciliation-required host states. An attempt is terminal only after immutable result bytes are read back and verified and its terminal index entry is confirmed.
  • Proposes retry lineage and existing partial/failed plus CANCELLED handling. Retry eligibility remains with O03/caller policy.
  • Defers Provider Execution timed-out mapping: the current Comic Manifest diagnostic enum has no timeout value, so a timed-out attempt stays nonterminal pending a versioned contract decision.

Decision boundary

This remains a draft, not an accepted contract. Owner review is needed for the proposed index/identity linkage, cancellation mapping, and immutable-write/integrity boundary. Timeout mapping is explicitly deferred to a versioned contract decision. No existing schema is changed or accepted; no runtime, storage, release, or production work is included.

Validation

  • git diff --check passed; all 7 relative Markdown links and local heading anchors resolve.
  • Exact-head Contract conformance CI run 40564400362 passed npm ci --ignore-scripts and npm test on Node 22 and 24.
  • Finite fixture expectations are documented in the RFC; they are proposals, not separately executed tests.

@andrewperis
andrewperis marked this pull request as ready for review October 28, 2026 16:54
@andrewperis
andrewperis merged commit 9525188 into main Oct 28, 2026
2 checks passed
@andrewperis
andrewperis deleted the rfc/o02-attempt-result-lifecycle branch October 28, 2026 16:54
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T16:56:47.088922Z 0de9e55 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0de9e55daf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

| Prepared | Execute once | Invoke exactly one Provider Execution request using the recorded `execution_id`; do not replace a caller-supplied `correlation_id` with the `attempt_id`. Wait for its single normalized result; the host state is `executing` until that result is durably recorded. | A second execution call under this attempt; hidden adapter retry; correlation value rewritten to imply attempt identity. |
| Executing | Record the returned outcome | Append and confirm a protected immutable `provider-outcome` record containing the exact normalized result and canonical byte size/digest, keyed by `execution_id`, before discarding the returned outcome or interpreting it for a Comic Manifest result. | Proceeding without a confirmed outcome record; losing the outcome before its protected record is confirmed. |
| Outcome-recorded | Successful outcome and build-result verification | Construct one candidate `comic-build-result` with a distinct `result_id`, the same `attempt_id` and exact production reference. Preserve actual inputs, ordered transformations, verified outputs, status `complete`, and no diagnostics. This is `result-prepared`, not terminal. | Missing/mismatched required input, transformation, or output identity; an unverified output treated as successful. |
| Outcome-recorded | Normalized failure or cancellation | Prepare a candidate result using existing status/diagnostic fields; transition to `result-prepared`. Proposed mapping: use `partial` only when verified outputs are retained; otherwise use `failed`. Use an applicable existing diagnostic, including `CANCELLED` for cancellation. Neither result is release-eligible. This remains nonterminal until persisted and confirmed. | Claiming `complete` with diagnostics or incomplete/unverified outputs; inventing a diagnostic or emitting unsafe diagnostic content. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Define mappings for all normalized provider failures

When the mock returns a schema-valid failure such as rate-limit, provider-unavailable, transport, or internal, none of the Comic Manifest diagnostics accurately represents that outcome, while every failed or partial result requires at least one diagnostic. Only timeout is deferred and output-validation/cancellation receive explicit mappings, so this transition otherwise forces implementations either to misclassify the failure or leave the attempt stranded; define or defer mappings for the remaining Provider Execution failure categories.

Useful? React with 👍 / 👎.

| No attempt | Prepare | Allocate fresh `attempt_id` and `execution_id`; bind both to the exact production reference and record `retry_of_attempt_id: null` for a first attempt. Append and confirm this `prepared` entry before any execution side effect. | Missing/mismatched production identity; reused ID; protected index unavailable; execution begins before preparation is confirmed. |
| Prepared | Execute once | Invoke exactly one Provider Execution request using the recorded `execution_id`; do not replace a caller-supplied `correlation_id` with the `attempt_id`. Wait for its single normalized result; the host state is `executing` until that result is durably recorded. | A second execution call under this attempt; hidden adapter retry; correlation value rewritten to imply attempt identity. |
| Executing | Record the returned outcome | Append and confirm a protected immutable `provider-outcome` record containing the exact normalized result and canonical byte size/digest, keyed by `execution_id`, before discarding the returned outcome or interpreting it for a Comic Manifest result. | Proceeding without a confirmed outcome record; losing the outcome before its protected record is confirmed. |
| Outcome-recorded | Successful outcome and build-result verification | Construct one candidate `comic-build-result` with a distinct `result_id`, the same `attempt_id` and exact production reference. Preserve actual inputs, ordered transformations, verified outputs, status `complete`, and no diagnostics. This is `result-prepared`, not terminal. | Missing/mismatched required input, transformation, or output identity; an unverified output treated as successful. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add a transition for successful calls with invalid build output

When Provider Execution returns succeeded but the resulting artifact is missing a required rendition or fails integrity/validation, the rejection column correctly prevents a complete result, but no row transitions the attempt to a failed/partial result or another defined state. Provider success explicitly does not establish output quality, so this reachable case leaves the attempt permanently at Outcome-recorded; map it to the existing OUTPUT_MISSING, OUTPUT_INTEGRITY, or VALIDATION_FAILED diagnostics as appropriate.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant