From f2d5b9288ee814656f85dc3c96d394a10a929d99 Mon Sep 17 00:00:00 2001 From: Andrew Peris Date: Tue, 10 Nov 2026 12:17:35 -0500 Subject: [PATCH 1/5] Verify trailing retry production reference --- src/offline-orchestration-prototype/runner.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/offline-orchestration-prototype/runner.js b/src/offline-orchestration-prototype/runner.js index c7b8993..cc3fa3f 100644 --- a/src/offline-orchestration-prototype/runner.js +++ b/src/offline-orchestration-prototype/runner.js @@ -2365,6 +2365,15 @@ function createRunner({ runtime = defaultRuntime, store = new InMemoryPrototypeS || entries.indexOf(orphanPrepared[0]) <= (priorChain.resumeWindowIndex ?? priorChain.terminalIndex)) { return reconciliationRequired(); } + const orphanProduction = orphanPrepared[0].production; + if (!orphanProduction || typeof orphanProduction !== 'object' || Array.isArray(orphanProduction)) { + return reconciliationRequired(); + } + try { + if (canonicalJson(orphanProduction) !== canonicalJson(admitted.production)) return reconciliationRequired(); + } catch { + return reconciliationRequired(); + } const orphanExecutionId = orphanPrepared[0].execution_id; const orphanDispatch = orphanDispatches[0]; const orphanOutcome = orphanOutcomes[0]; From b6f5944a962f358bbe5f4b343c994dcdd4d0d9a1 Mon Sep 17 00:00:00 2001 From: Andrew Peris Date: Tue, 10 Nov 2026 12:17:49 -0500 Subject: [PATCH 2/5] Cover trailing retry production link corruption --- .../local-file-store.test.js | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tests/offline-orchestration-prototype/local-file-store.test.js b/tests/offline-orchestration-prototype/local-file-store.test.js index 827dd63..331dbf0 100644 --- a/tests/offline-orchestration-prototype/local-file-store.test.js +++ b/tests/offline-orchestration-prototype/local-file-store.test.js @@ -966,6 +966,63 @@ test('reopened inspection rejects an unfinished ordinary orphan retry mapping', assert.equal(calls, 2); }); + +test('reopened inspection rejects missing or replaced production links on a trailing resultless retry', async t => { + for (const linkCase of ['missing', 'replaced']) { + await t.test(linkCase, async t => { + const root = temporaryDirectory(); + t.after(() => rmSync(root, { recursive: true, force: true })); + const store = new LocalFilePrototypeStore(root); + const clockState = { now: 10_000 }; + const controlledRuntime = { ...runtime(), now: () => clockState.now }; + let calls = 0; + const value = prototype(store, ({ phase }) => { if (phase === 'dispatch-confirmed') calls++; }, controlledRuntime); + const first = await value.submit({ + productionSource, + noOutputResultVersion: '1.1.0', + mockOutcome: { kind: 'rate-limit', retry_after_ms: 10 } + }); + clockState.now += 10; + const stopped = await value.retry({ authorizeRetry: true, mockOutcome: { kind: 'output-validation' } }); + assert.equal(stopped.status, 'contract-mapping-blocked'); + assert.equal(stopped.job_closed, true); + assert.equal(calls, 2); + + const events = structuredClone(store.readEvents(first.job_id)); + const admitted = events.find(item => item.type === 'admitted'); + const prepared = events.find(item => item.type === 'prepared' && item.attempt_id === stopped.attempt_id); + assert.ok(admitted && prepared); + assert.deepEqual(prepared.production, admitted.production); + const privateSentinel = 'TRAILING-RETRY-PRODUCTION-PRIVATE-SENTINEL'; + if (linkCase === 'missing') { + delete prepared.production; + } else { + prepared.production = { + ...prepared.production, + identity_sha256: 'sha256:' + '0'.repeat(64), + private_content: privateSentinel + }; + } + writeLocalEventLog(root, first.job_id, events); + + const reopened = new LocalFilePrototypeStore(root); + let restartedCalls = 0; + const restarted = prototype(reopened, () => { restartedCalls++; }, controlledRuntime); + const beforeEvents = structuredClone(reopened.readEvents(first.job_id)); + const beforeBlobs = reopened.blobCount; + assertSafeReconciliation(restarted.inspectRecovery(first.job_id), [ + root, first.job_id, first.attempt_id, first.execution_id, + stopped.attempt_id, stopped.execution_id, first.result.result_id, + privateSentinel + ]); + assert.deepEqual(reopened.readEvents(first.job_id), beforeEvents); + assert.equal(reopened.blobCount, beforeBlobs); + assert.equal(restartedCalls, 0); + assert.equal(calls, 2); + }); + } +}); + test('reopened inspection accepts an unfinished provider-timeout orphan mapping', async t => { const root = temporaryDirectory(); t.after(() => rmSync(root, { recursive: true, force: true })); From 53169bc7d6348ba886f52425bd424f24a34b367d Mon Sep 17 00:00:00 2001 From: Andrew Peris Date: Tue, 10 Nov 2026 12:17:58 -0500 Subject: [PATCH 3/5] Clarify verified unmappable retry recovery --- docs/offline-orchestration-prototype.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/offline-orchestration-prototype.md b/docs/offline-orchestration-prototype.md index 79ee9ad..b892508 100644 --- a/docs/offline-orchestration-prototype.md +++ b/docs/offline-orchestration-prototype.md @@ -317,12 +317,17 @@ or a successful response with mismatched output) closes the **host job** after confirming the `contract-mapping-blocked` event and `job-closed` append. It returns `status: 'contract-mapping-blocked', job_closed: true`. The prior terminal result and both provider outcomes remain immutable; no second Comic result or terminal -result link is fabricated. Recovery reports the host job as terminal. - -This closes an exhausted job, not the unresolved contract mapping. Uncertain -outcome/readback/index/close writes and provider timeouts still require -reconciliation and do not claim confirmed closure. The store's existing -one-job lifetime limit remains in force even after confirmed closure. +result link is fabricated. When the host close and lifecycle links verify, +read-only `inspectRecovery()` reports `contract-mapping-blocked`, not +`terminal`: the host stopped while the Comic mapping remains unresolved. +Missing, malformed, or inconsistent links require reconciliation rather than a +terminal-result claim. Provider timeouts that leave a valid resultless mapping +unclosed remain an explicitly unresolved, value-free mapping diagnostic. + +This closes an exhausted host job, not the unresolved contract mapping. +Uncertain outcome/readback/index/close writes require reconciliation and do +not claim confirmed closure. The store's existing one-job lifetime limit +remains in force even after confirmed closure. The candidate validator's bounded no-output path requires exactly one prompt binding. Schema-valid productions with zero or multiple prompt bindings receive @@ -393,8 +398,9 @@ store. Coverage is limited to the pinned synthetic no-context local path, including successful and no-output rate-limit results, reopened inspection, retry and reopen, and corruption cases for orphan/interleaved attempts, malformed -production links, inconsistent result outcomes, resume-window links, and -schema-valid output compatibility tampering. This does not authenticate +production links on result-bearing and trailing resultless retries, +inconsistent result outcomes, resume-window links, and schema-valid output +compatibility tampering. This does not authenticate same-account edits to the local store, establish power-loss durability or support for other filesystems, add providers or infrastructure, use production data, or close Studio issue #110. From 57969bb3bc6da17a16558300010141dcb58f0e2b Mon Sep 17 00:00:00 2001 From: Andrew Peris Date: Tue, 10 Nov 2026 12:18:09 -0500 Subject: [PATCH 4/5] Update O08 packet after O09 merge --- docs/o08-durable-resume-decision-packet.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/o08-durable-resume-decision-packet.md b/docs/o08-durable-resume-decision-packet.md index 4700761..386c054 100644 --- a/docs/o08-durable-resume-decision-packet.md +++ b/docs/o08-durable-resume-decision-packet.md @@ -410,7 +410,7 @@ This reconciliation uses Platform `main` at `0b6dbfb3f2334626ec251a634ee677ecae2 | Finite transient, exhausted-attempt, authorized-resume and denied-resume fixtures; one adapter/effect boundary | Covered for the pinned Comic Manifest fixture, synthetic authorities, local filesystem and `MockTextAdapter`. No context-enabled resume, live provider, production storage or other effect boundary is covered. | | No generic exactly-once claim | Preserved. The local atomic claim limits concurrent/repeated local resume attempts and uncertain dispatch is never automatically replayed; this is not provider-level deduplication or a general exactly-once guarantee. | -**O08 receives a scoped pass** for the accepted synthetic, no-context, local-filesystem behavior, including termination as stopping automatic execution while preserving ambiguous outcomes for reconciliation. This verdict relies on actual runner/store and subprocess tests; `resume-proposal-harness.test.js` is a reference-only model and is not counted as runtime evidence. The pass does not claim provider deduplication, generic exactly-once behavior, context-enabled restart, power-loss durability, support for other filesystems, or live-provider support. Studio issues #106–#109 remain open; this documentation does not close them. O09 has not been started or unblocked. +**O08 receives a scoped pass** for the accepted synthetic, no-context, local-filesystem behavior, including termination as stopping automatic execution while preserving ambiguous outcomes for reconciliation. This verdict relies on actual runner/store and subprocess tests; `resume-proposal-harness.test.js` is a reference-only model and is not counted as runtime evidence. The pass does not claim provider deduplication, generic exactly-once behavior, context-enabled restart, power-loss durability, support for other filesystems, or live-provider support. Studio issues #106–#109 remain open; this documentation does not close them. The bounded O09 result-link inspection was merged in platform PR #75. This follow-up adds a trailing-retry production-reference check; Studio issue #110 remains open, and no broader durability or acceptance claim follows. ## Scope estimate and exclusions @@ -420,7 +420,8 @@ The no-context writable slice above is likewise narrow; durable-resume claims beyond the scoped pass remain unsupported and subject to separate review and contract gates. Production-grade -persistent storage, an authenticated integrity root, provider-specific -deduplication, and O09's result linkage remain separate decisions. This slice -does not introduce a provider, alter current retry behavior, close O08, or -unblock O09. +persistent storage, an authenticated integrity root, and provider-specific +deduplication remain separate decisions. O09's bounded result-link inspection +was merged in platform PR #75; this follow-up checks the production reference +on a trailing resultless retry. It does not introduce a provider or claim +broader durability or acceptance, and it does not close O08 or issue #110. From 45be4fce9d7996e78b21bcc218f8e9c0bb3eee91 Mon Sep 17 00:00:00 2001 From: Andrew Peris Date: Tue, 10 Nov 2026 12:21:13 -0500 Subject: [PATCH 5/5] Test a replaced trailing production identity --- .../local-file-store.test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/offline-orchestration-prototype/local-file-store.test.js b/tests/offline-orchestration-prototype/local-file-store.test.js index 331dbf0..ff7677b 100644 --- a/tests/offline-orchestration-prototype/local-file-store.test.js +++ b/tests/offline-orchestration-prototype/local-file-store.test.js @@ -999,8 +999,11 @@ test('reopened inspection rejects missing or replaced production links on a trai } else { prepared.production = { ...prepared.production, - identity_sha256: 'sha256:' + '0'.repeat(64), - private_content: privateSentinel + identity: { + ...prepared.production.identity, + sha256: 'sha256:' + '0'.repeat(64), + private_content: privateSentinel + } }; } writeLocalEventLog(root, first.job_id, events);