Skip to content

fix(oracle): complete a timed-out chat only after verified recollection - #47

Merged
alphastorm merged 22 commits into
mainfrom
fix/verified-timed-out-chat-completion
Nov 14, 2026
Merged

alphastorm merged 22 commits into
mainfrom
fix/verified-timed-out-chat-completion

Conversation

@alphastorm

@alphastorm alphastorm commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Guarantee

A timed-out ChatGPT chat job becomes complete with recollectionCompletionVerifiedAt only after its archive-anchored identity passes ordinary completion stability and reload verification and this attempt saves the second capture's nonempty response plus metadata, manifest and outcome; a failure before that transition, of identity, completion, the bound reply capture or a propagated persistence error, preserves its deciding failure fields and writes no proof.

Behavior

  • The first successful archive-anchored read must itself supply a message identity matching any identity saved by an earlier attempt; acquiring that read may retry while the page settles. Missing, ambiguous or changed identity refuses collection; a later positional read cannot rescue it.
  • Completion requires inactive generation, the bound turn, ordinary stability, a successful reload and two consecutive captures whose raw text is nonempty after trimming and equal. Markdown, HTML and source addresses of the two captures are not compared. Collection saves the second capture, not another page read. Nothing is sent and Retry is never activated.
  • Timed-out Deep Research and Grok are refused without changing the job or resending. The tool starts no worker; a worker invoked directly takes and releases the recollect lock before refusing, without acquiring runtime/conversation leases or starting a browser. Users lose their previous unverified timeout-recollection path and must reconcile those conversations manually. Already-complete artifact recollection remains available.
  • The completion transition is the commit point and the final write of the deciding fields and collection; normal cleanup bookkeeping follows it. Earlier binding, response/raw/block files, capture metadata, manifests and collection outcomes may remain after failure. They are staging, not authority; an older response cannot count as this attempt’s capture. Changed capture files retain existing history behavior.
  • Only status: "complete" together with the proof field records a verified timeout recollection: the reply's text was verified and saved, not evidence about its artifacts. Optional download and validation failures can yield complete_with_artifact_errors with proof; existing permission changes remain best effort. A failed job can name a response file from an attempt that did not commit. The saved field is projected into structured read details; ordinary runs and already-complete recollections do not initialize it, and later complete-job recollection preserves it without repeating timeout verification.
  • A saved verified reply is pinned to its exact raw text, whitespace included, in the writer's saved redacted form: each later capture's redactTransportSecrets(captured.rawText) bytes must equal the job's saved response.raw.txt. Its whitespace-normalized turnSha256 must also equal the binding's saved hash, even for the same message identity. Different saved-form text, a missing saved hash, or absent/unreadable saved raw text refuses before collection writes, keeping status, phase, error, error code, completedAt, proof, binding, response path and files, manifest and artifact paths, collection status and both missing-requirement lists unchanged, creating no .previous file and recording only recollectionError instead of partial marking. A later capture of the same reply that differs only in whitespace is refused too, keeping the verified response. Equal raw text still permits artifact recollection; byte-identical response files remain untouched. Markdown, HTML and source addresses are not pinned. Proof-bearing jobs deliberately differ from main in two shapes: changed text, or a missing saved hash or absent/unreadable saved raw text. The promise of unchanged behavior applies only to jobs without the proof field.

Deliberate limits

Shutdown is checked in the wait loop, before commit and inside the transition callback. A signal arriving after that callback returns does not stop its write: the job can become complete with a proof that is true of the reply. Before that point it stays failed. An error after the transition, in the completion log line or in cleanup bookkeeping, does not undo the completion or the proof, and the job can then carry a recollection error beside them; this follows from the order of the writes and is not exercised by a case. This does not introduce transactional persistence or redesign cleanup.

On a refused or failed recollection, the deciding fields kept are status, phase, the original error and completedAt; the lifecycle log stays bounded at 64 entries, a refused attempt can append a navigation entry, and a full log drops its oldest entry, which can be the job's terminal event, as for any other appended event.

Equal saved text alone is not sufficient for a later recollection of a verified reply: the binding hash, which is computed before redaction, must match too. A reply whose visible text contains a signed transport address can therefore be refused later because only the address's signature changed, although both captures save the same redacted text; the verified response stays.

Hidden-text rendering, enabled Retry beside a finished reply, artifact-work budgets, heartbeat/cleanup behavior and the ten-minute read backstop are unchanged. The backstop may interrupt a longer saved completion allowance. Rejected child processes still produce the existing tool error, not a newly refreshed job result.

Validation

At 9703f5fa74f66baad9d81862f8c9bbd6d317116e, npm run verify:oracle passed all ten stages: 133 Node tests, 56 syntax-checked modules, extension bundle, platform invariants, three typechecks, sanity and package check. The synthetic npm run proof:capture passed all 27 acceptance cases, killed all 27 mutations and matched all 29 supplied-baseline differential pairs without the proof field. Both commands exited 0. The owned Chromium temporary directory was gone and no process using it remained after the proof. No existing browser, real profile, account or provider was used.

The checked-in synthetic-page cases exercise production wait, reload, capture, collection, reducers and persistence. Proof-bearing whitespace changes are refused on first acquisition, acquisition retry and the collector's capture; missing and unreadable saved raw text are refused, while equal text and equal redacted text still recollect. Mutation cases challenge identity, current-body, failure, receipt, shutdown, Retry and unsupported-mode gates, plus exact saved-text equality, absent-file refusal and redaction before comparison. The explicit old-response fallback exclusion is checked structurally because the nonempty guard makes that fallback unreachable for valid strict captures.

An optional differential compares ordinary runs and complete-job recollections without the proof field, including collector returns and all persisted file bytes, against a caller-supplied source root. It never fetches or vendors a baseline and visibly skips without that root. Qualification against 654c1a9c96a589e2cf3a58560564febc6bee890d is evidence for the tested head, not a comparison automatically available in every checkout. Fixtures cover rich and exact Markdown, anonymous/hash binding and class churn, binding/capture failure, old responses, artifacts and reuse, Grok fallback, completed Research success/failure, and a same-message whitespace-only change without proof.

Attended release gate

One attended run still needs to show current archive-turn identity attributes, generation controls, equal nonempty reloaded raw text and matching saved bytes/metadata/proof, with no send or Retry activation. Establish whether two reload captures of a finished reply differ outside their raw text, including Markdown, HTML and source addresses. Inspect hidden descendants and editor/code content against what is visible, and observe background-tab/rehydration behavior, download-marker binding, interruption, cleanup and read timing. Synthetic fixtures cannot attest hidden provider state or prove that every serialized node was visible.

- Exercise production capture, collection and persistence against isolated DOM fixtures.
- Record timeout, identity, empty-body, persistence, receipt and shutdown acceptance; compare a caller-supplied baseline root.
- Refuse missing or changed anchored identity before collection.
- Preserve collection state on timed-out chat refusal.
- Reuse generation and stability detection with an identity-bound target and no Retry activation.
- Require successful stable reload captures without importing lifecycle budgets.
- Pass the second stable capture directly into the strict collector.
- Require a nonempty serialized body and never borrow an earlier response.
- Propagate strict collection and artifact persistence failures before transition.
- Write the proof only in the transition with three local shutdown checks.
- Keep optional download errors and non-timeout collectors unchanged.
- Project the saved proof field without introducing a second completion authority.
- Explain failed-attempt response files without changing child-exit handling.
- Refuse Deep Research and Grok before read or direct-worker admission changes state.
- Keep completed-job artifact recollection available and explain the lost timeout recovery path.
- Explain identity refusal, commit authority, staging leftovers and unsupported timeouts.
- State the callback publication window and unchanged renderer, timing and cleanup limits.
- Add reload, identity drift, artifact reuse and shutdown-boundary assertions.
- Exercise sixteen mutations and compare collector returns plus complete file maps against a supplied source root.
- Pin the defensive old-response exclusion structurally because the nonempty guard makes that fallback unreachable for valid strict captures.
- Use the production response-failure vocabulary so removing the Retry guard reaches activation.
- Correct the mutation fixture that previously matched only a transient-error phrase.
- Require actual completed Research capture and ordinary Grok fallback from baseline fixtures.
- Exercise matching anonymous hashes with changed rendering classes.
- Extract grokAssistantMessages with the ordinary entrypoint instead of stopping on its missing dependency.
- Require ordinary differential fixtures to reach the real collector before claiming parity.
- Supply the production-recognized Deep research iframe marker in synthetic snapshots.
- Distinguish report-frame failures from accidental clarification failures in differential coverage.
- Capture shutdown logging, preserve the original reload error, and exercise both provider/timeout-text mismatches.
- Require job-scoped refusal wording and add discriminating reload/provider mutations.
- Suppress the completion log when shutdown leaves the transition unchanged and write only the proof just earned.
- Scope refusal wording to unchanged job bytes and describe reload equality as raw-text equality.
- Specify equal nonempty reload raw text, saving the second capture without comparing Markdown, HTML or source addresses.
- Distinguish propagated failures from artifact and permission handling, and name cleanup and direct-worker lock effects.
- Exercise changed text at both capture reads, equal raw text with Markdown-distinct bytes, and a missing saved hash.
- Pin refusal propagation without partial marking and document the short-history lifecycle tuple limit.
- Check the saved raw-text hash on every proof-bearing capture before collection writes.
- Propagate the named refusal without hydration retries or partial-collection marking; preserve no-proof behavior.
- Document proof-bound raw-text refusal and unchanged collection behavior without the field.
- State the retained deciding fields and the existing 64-entry lifecycle eviction limit without changing the log.
- Cover whitespace changes across initial, retry and collector captures.
- Cover missing and unreadable saved raw text, redacted equality and no-proof whitespace compatibility.
- Add normalized-comparison, absent-file and pre-redaction mutations.
- Read response.raw.txt in captureBoundTurn only for jobs carrying the proof timestamp.
- Compare the writer's redacted UTF-8 bytes and retain the saved binding-hash check.
- Refuse differences and missing or unreadable saved text before binding or capture writes.
- Define byte equality in the writer's saved redacted form, including whitespace.
- Document missing or unreadable saved-text refusals and diagnostic-only preservation.
- Limit unchanged behavior to jobs without proof and retain rich-field and lifecycle-log limits.
@alphastorm
alphastorm merged commit 606bc89 into main Nov 14, 2026
1 check passed
@alphastorm
alphastorm deleted the fix/verified-timed-out-chat-completion branch November 14, 2026 22:51
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