Skip to content

fix(javascript): retain completed facts through cancellation - #1934

Merged
morluto merged 2 commits into
mainfrom
codex/refactor-analysis-failure-boundaries
Oct 11, 2026
Merged

morluto merged 2 commits into
mainfrom
codex/refactor-analysis-failure-boundaries

Conversation

@morluto

@morluto morluto commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Summary

Keep completed JavaScript source facts when cancellation arrives during analyzer cleanup, graph construction, Evidence sealing, or final publication. Previously these later checkpoints could return cancelled without the partial Evidence already recoverable from owned source facts. Found during the ongoing failure-boundary audit; no existing issue covers this specific handoff loss.

Problem and expected behavior

After source analysis completed, an aborting checkpoint could throw before the reconstruction's partial-Evidence branch. Later service checkpoints likewise discarded an already reconstructed result or sealed Evidence. A cancellation must stop remaining source acquisition/analysis while preserving the facts REA already owns.

Change and scope

  • After source adoption and worker cleanup, latch cancellation while finishing the existing graph projection cooperatively. Preserve cleanup/source interruption precedence and the existing cancellation error fields.
  • Keep the service's completed reconstruction, validated result and Evidence until publication. On cancellation, finish only missing validation/sealing stages without further progress callbacks and retain the resulting Evidence.
  • Strengthen phase tests, add cleanup/handoff timing regressions, exercise real CLI SIGINT during graph construction and hashing, and verify SDK cancellation at final publication preserves inspectable Evidence and a reusable session.
  • Remove the test file's empty grouping wrapper and document the completion behavior.

Contract and boundary impact

  • Semantic owner and earliest changed stage: JavaScript application workflow, immediately after source-fact adoption and analyzer cleanup.
  • CLI and MCP/tool-catalog contract: existing cancellation errors now retain partial Evidence at later phases; tool inputs/catalog unchanged. CLI SIGINT still exits 130.
  • Provider, bridge, target-format, or platform compatibility: static directory/ASAR workflows; no deep-provider or executable-target behavior changes.
  • Evidence, artifact, provenance, or reconstruction contract: preserve completed source facts, graph identity and prior session Evidence on cancellation. Final projection remains cooperative.
  • Process execution, authorization, cleanup, or containment impact: worker release precedes retained projection; existing cleanup failure precedence and resource ownership remain intact.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

  • The new cleanup/handoff regression failed on the base revision because partial_observation was missing, then passed with retained import relationships and source statistics.

  • Existing phase cases now require completed parsed facts through graph/result/Evidence phases and final publication.

  • Public CLI checks retain complete partial Evidence after SIGINT. SDK checks verify server completion, prior Evidence, retained analysis inspection, and another successful request.

  • MCP intermediate progress is rate-throttled, so the SDK publication case uses its guaranteed terminal notification rather than assuming every fast graph phase is emitted.

  • Remaining proof gaps: POSIX SIGINT cases skip native Windows; no real deep-analysis provider is involved or claimed. The full repository suite was not run.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run build:cached — passed with pinned Node 24.18.0.
  • Five focused JavaScript reconstruction/cancellation files — 56 tests passed in 11.40s, including real compiled CLI and SDK/MCP boundaries. Each case used a 5s deadline; none exceeded it.
  • npm run check:fast — passed.
  • npm run docs:check — passed.
  • Formatting, diff checks and pre-commit hooks — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: static local artifacts, real CLI and MCP on macOS; no deep-provider/runtime-target execution.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: caller-selected input and source provenance remain preserved; no configuration writes or new process authority.

Review checklist

  • Concrete evidence-retention bug, found during maintenance.
  • Focused outcome and Conventional Commit title.
  • Cancellation and completed-fact behavior verified across owning boundaries.
  • Owning documentation updated.
  • Representative CLI/MCP behavior exercised.
  • Diff checked for unrelated changes and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 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-11T18:39:22.583590Z 2cdf2c1 New commits
ℹ️ 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.

@morluto
morluto merged commit b6651cb into main Oct 11, 2026
29 checks passed
@morluto
morluto deleted the codex/refactor-analysis-failure-boundaries branch October 11, 2026 18:39
@github-actions github-actions Bot mentioned this pull request Oct 11, 2026
3 tasks done
@morluto morluto added bug Something isn't working area: domain Domain logic, errors, and pure functions labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant