Repository navigation
fix(javascript): preserve graphs within parent capacity - #1921
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Reserve the next sequential static checkpoint using its protocol size and existing retained-expansion accounting instead of 80% of the parent budget. Preserve total/live heap protections and explain parent admission failures with effective capacity, retention estimates and usable retained facts. Fixes #1911 Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <[email protected]>
N0zoM1z0
force-pushed
the
fix/1911-javascript-checkpoint-reserve
branch
from
October 11, 2026 18:04
6825525 to
e11aa90
Compare
3 tasks done
2 tasks done
10 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two JavaScript source files could lose the earlier file's completed semantic graph because the parent reserved 80% of its original result budget while another source remained. Reserve the next sequential static checkpoint using the existing protocol bound and retention accounting, so useful graphs survive within the available capacity. Fixes #1911.
Problem and expected behavior
An inert 400-function ES module followed by a small module returned no semantic functions for the earlier source. A directory with ten later small sources has the same problem. Admission should protect the next checkpoint and enforce actual retained/live-heap capacity rather than an arbitrary fraction of the original budget.
Change and scope
The worker owner reserves one maximum 8-MiB checkpoint at its existing retained expansion of six, matching the sequential producer. Previously retained facts stay charged to the existing ledger. Remove the superseded static-reserve ledger. Genuine parent-side rejections now report effective available capacity and module/graph retention estimates, and point callers to the facts that survived.
Contract and boundary impact
JavaScriptAnalysisWorker, at parent checkpoint and transfer admission.Evidence and regression coverage
Add public CLI cases for one and ten later sources, plus a 600-function source under a 448-MiB parent heap that must reject the graph while preserving static/module facts and accurate recovery guidance. The negative case exceeds even the otherwise-empty parent's available budget, so acceptance cannot depend on GC timing.
Base replay fails the earlier-source semantic preservation assertion.
Representative failure now includes
parent_available_result_budget_bytes,module_retention_estimate_bytesandgraph_retention_estimate_bytes; remediation explains that increasing the worker heap alone does not increase parent capacity.Real Linux CLI and fresh stdio MCP checks on two generated modules of 439,680 and 438,705 bytes complete without worker-heap failure or parent-budget rejection. CLI retains 20,000 semantic nodes from each source. Semantic coverage remains explicitly partial.
Remaining proof gaps: the manual resource-limited workflow was run on Linux/Node, not Bun or other operating systems. The heap-specific CLI cases explicitly skip Bun, whose runtime does not enforce the V8 flags.
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 check— typecheck, lint, formatting, unused-code, metadata and architecture guards passed.npm run verify:test-discovery— all 862 test files discovered exactly once; final CLI cases also passed after test typing corrections and deterministic capacity sizing.Compatibility, safety, and release
Review checklist
type(scope): outcome.