Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions docs/o08-durable-resume-decision-packet.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
22 changes: 14 additions & 8 deletions docs/offline-orchestration-prototype.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
9 changes: 9 additions & 0 deletions src/offline-orchestration-prototype/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
60 changes: 60 additions & 0 deletions tests/offline-orchestration-prototype/local-file-store.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,66 @@ 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: {
...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 }));
Expand Down
Loading