Skip to content

fix: reconcile joined phase replies without repeating providers - #1415

Draft
taras wants to merge 3 commits into
mainfrom
codex/joined-phase-result-recovery
Draft

taras wants to merge 3 commits into
mainfrom
codex/joined-phase-result-recovery

Conversation

@taras

@taras taras commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Why

A role can finish its native turn while the workflow rejects the captured result and preserves a hold. Repeating the role spends another prompt and can lose the relationship to the original attempt. Related: #1400.

What changes

Before: an incidental complete array in ordinary prose could confuse result selection, and a joined-response hold had no explicit path to validate its original reply.

After: result selection consumes a complete prose array without treating its children as results. An explicit reconciliation action can validate an eligible joined reply and return the same consumer to its original feedback gate.

How it works

The recovery overlay runs before the consumer's prepared owning components. It binds the held record, original assignment and reply, native completion, source definitions and current permissions. A successful validation writes separate derivative receipts and advances through the owning continuation APIs. Reservations and retained publication evidence govern repeats.

held original call -> validate original proof -> derivative receipts -> original feedback gate

Review guide

Start with examples/adversarial-implementation/recovery/README.md and the recovery decision in specs/decisions.md. Then review canonical Phase/Extract.ts, Ticket/ReconcileResponse.md, the proof/source correspondence helpers, and the native owning-pin fixture.

Look closely at proof framing, source correspondence, reservation/publication failures and confirmed repeats. Main's standalone Delivery suites are retained during integration.

What must stay true

  • Competing result objects, result-position arrays and malformed recognized boundaries refuse.
  • Reconciliation starts no provider prompt and preserves the failed original call, role identity and consumed allowances.
  • Only the actual confirmed successor permits a confirmed repeat. Matching files alone do not acknowledge publication.
  • Recovered results enter the original feedback gate and carry the separately recorded missing acceptance findings.

How to verify it

The focused recovery suite exercises 64 cases under Deno and Node, including the supplied newline-framed prompt and whole-log completion descriptors, natural failed-entry imports, wrong proof/source/session, unchanged originals, interruption and repeat behavior. Markdown boundary and explicit typing checks cover the example modules and their production callers. The integrated source is a31dbe18a9530ebbbc128a730cfcec9cb652a690, with parents 23db04f1 and main b31a5cbc. Its focused runtime and Deno/Node typing commands all passed; the retained tested index matches the committed tree. Independent Codex Astra review returned PASS on this exact head. Fable’s quota-failed partial attempt is preserved. The original Planner also returned PASS on this exact head against frozen P1-P9. Required CI is queued; current main CI passed.

Scope

Included: canonical result extraction, explicit joined-response reconciliation, owning-pin composition, documentation and deterministic regression fixtures.

The historical #1400 consumer remains unapplied. Its original Sol/Haiku owners and unproved A6/A4/A8/A2/A7 and unfinished-root qualifications remain with that consumer.

New abstractions

Ticket.ReconcileResponse accepts the original record and its proof descriptor because recovery must bind an existing failed call to joined native evidence. It delegates ordinary phase validation, feedback and publication to the owning components.

Risks and limitations

A false positive could advance the wrong result or repeat a publication. Ambiguous, incomplete, changed or unproved evidence stays held. The historical consumer has not been recovered as part of this source PR.

Scope confirmation

  • Every changed file supports the purpose described above.
  • Unrelated cleanup and formatting changes are excluded.
  • Generated or mechanical changes are identified.
  • The description matches the current diff and completed verification; remaining delivery gates are listed.

This branch has not been deployed

No deployments
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