Skip to content

test(cli): repair analysis-view finalization cancellation seams - #6431

Merged
gensokyo-dev merged 1 commit into
mainfrom
fix/analysis-view-cancellation-test-boundaries
Oct 23, 2026
Merged

gensokyo-dev merged 1 commit into
mainfrom
fix/analysis-view-cancellation-test-boundaries

Conversation

@gensokyo-dev

@gensokyo-dev gensokyo-dev commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Repair three consistently failing analysis-view cancellation tests on main. The tests spied on inspectAnalysisViewValidated, but the service calls that function lexically inside its own module, bypassing the spy and never scheduling the intended interrupt.

Observe the imported domain projector and Evidence resolver instead, while executing their real implementations. Assert that projection is reached exactly once when expected, and authenticate the retained partial Evidence, its complete normalized result, subject and parent link. Rename the missing-parent scenario to source-resolution failure, its actual stage. All 20 existing lifecycle scenarios remain.

Contract and boundary impact

Test-only correction at the injection boundary; no CLI/MCP, provider, Evidence, package or generated-metadata changes. Ordinary maintenance within existing authority; a maintainer scope decision is not applicable. The separate Ghidra marker failure already has #6400 and is outside this PR.

Evidence and validation

  • Base 9eb829aca34be36ff112826337996f6139f82eff: main CI shard fails the same three scenarios as a local exact run (17 pass, 3 fail).
  • Fixed exact run: all 20 pass with one worker. A controlled removal of queued-interrupt dispatch makes six scenarios fail, including projection and error-preserving signal exit codes. The temporary mutation was restored before validation and is absent from the diff.
  • Executed npm run test:focused -- tests/process-global/commandFinalizationCancellation.test.ts tests/boundary/cli/analysisViewCli.test.ts tests/boundary/mcp/analysisViewMcp.test.ts tests/acceptance/analysisViewCallerPath.test.ts src/application/analysisView/AnalysisViewService.test.ts: 117 pass across five files. This includes built CLI subprocesses, real OS SIGINT/SIGTERM, HAR/Grafana-shaped capture inputs, Evidence bundles, caller-path preservation and an in-memory MCP SDK transport. Controlled injection establishes the finalization interleavings; it does not establish real-provider behavior.
  • Executed npm run check:fast, targeted oxfmt --check, targeted oxlint, and git diff --check: pass.
  • Node 24.18.0 / npm 11.16.0, Linux x64. The focused workflow used one CPU and one worker: 261.865 s elapsed including a cold runtime build, 261.177 s user+system CPU, peak sampled process-family RSS 2229.7 MiB. RSS was sampled every 100 ms; shared pages may be double-counted and short-lived/reparented children missed. Static checking ran concurrently on one other CPU. These are resource measurements, not an equivalent-work speedup comparison. Agent token costs were not measured.

No new real-engine compatibility claim is made. No lifecycle scenarios, timeouts or retries were removed or relaxed. No separate issue was opened because the current main CI run above is the direct report.

Hosted validation for a5f94a635: complete CI run passed, including all eight built shards, source tests (15,389 passed; 12 platform/prerequisite skips), report merging and CI required. The repaired lifecycle file passed all 20 tests on the runner. Greptile review passed; Codex review is still running.

Author readiness

Human owner: @gensokyo-dev

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Human readiness was explicitly declared by the owner in the maintenance session after reviewing this final diff and the validation above.

Inject interrupts through imported projection and Evidence resolution boundaries so lexical service calls cannot bypass the test. Retain exact normalized partial results, authenticated Evidence provenance and conventional signal exit codes.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
@gensokyo-dev
gensokyo-dev marked this pull request as ready for review October 23, 2026 03:10
@chatgpt-codex-connector

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 🔄 Running since 2026-10-23T03:10:14.372566Z a5f94a6 Draft marked ready
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The test-only changes appear safe to merge.

Summary

Repairs cancellation tests by observing imported production functions rather than a same-module export.

  • Cancellation tests now interrupt at the analysis-view boundaries.

No actionable issues or introduced security concerns were found. Tests were not rerun during this review. Whether another PR supersedes this one could not be checked because GitHub access required authentication.

Reviews (1) · Last reviewed commit: "test(cli): repair analysis-view finaliza..." · Reviewed by Greptile

@gensokyo-dev
gensokyo-dev merged commit f850b7c into main Oct 23, 2026
45 of 46 checks passed
@gensokyo-dev
gensokyo-dev deleted the fix/analysis-view-cancellation-test-boundaries branch October 23, 2026 03:30
Afloat16 added a commit to Afloat16/rea that referenced this pull request Oct 23, 2026
Merge main e32a049, including the repaired analysis-view cancellation injection seams from morluto#6431. Preserve the existing WebSocket producer-reachability fix and its regression coverage.
@morluto morluto added the area: cli CLI adapter and one-shot commands label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants