Repository navigation
feat(javascript)!: bound semantic graphs by serialized Evidence bytes - #2092
coleleavitt wants to merge 55 commits into
Conversation
…nsion The parent charged 8x transfer bytes, 6x static checkpoints and an 8x application-projection forecast against half of its heap. On the Grok Bot app.asar at the default 4 GB heap this rejected application relationships for 492 of 579 sources and semantic analysis for 491, although the same run with a 28 GB heap peaked at 1.5 GB RSS. Measured retained heap is 1.23x-1.42x of the parsed JSON, and the summed application forecast was 9.7x the retained application graph. Use those measurements; the halved heap budget still covers sealing copies. The default-heap run now projects every source (3:07, 1.55 GB peak RSS).
Replace the default 100,000-node graph ceiling and 20,000-node file ceiling with a byte budget derived from resources. One application Evidence may occupy the parent heap divided by twelve (at most one V8 string): measured consumers peak at about six times the Evidence bytes, and compare_application_versions holds two records. Each source is offered the remaining budget in proportion to its share of unanalyzed source bytes, capped by the parent's free result heap. Caller-selected max_semantic_nodes and max_semantic_nodes_per_file still apply and close admission the same way; omitted, only the byte budget bounds the graph. Within a source, nodes are charged only when an admitted relation, fingerprint or unknown frontier references them, and frontiers are offered after every relation, so unknowns no longer flood the budget and a truncated source keeps a connected, source-ordered prefix. Refused facts are counted exactly. The ceiling truncated the Grok Bot app.asar to its first 58 of 579 sources without naming the omitted ones. Every source is now projected and reported in semantic_graph.coverage.files with its retained bytes, exact omitted node/relation/fingerprint counts and unknown totals by family and reason. The per-source byte budget derives from the analyzing process's V8 heap, so graph_byte_budget is recorded only for truncated sources; complete sources keep identical Evidence identities across hosts with different heaps. BREAKING CHANGE: semantic_graph.coverage.families[].unknown_ids is replaced by retained_unknowns and omitted_unknowns, coverage.files is added, the default semantic_graph_node_ceiling and semantic_graph_file_node_ceiling limits are removed (they appear only when the caller selects a node capacity), and truncation by the byte budget reports javascript_analysis_evidence_budget_bytes.
Grok Bot's main-app.cjs failed semantic analysis with "Maximum call stack size exceeded". Its undici classes read `this[symbol].name` in about twenty getters. The unknown key selected every getter again on each hop, so class lookups enumerated every ordering of getter names and spread the resulting arrays into push(). After one unknown-key hop, escape every field value and getter result of the receiver class instead of enumerating paths; an escape covers effects at any depth, so writes through those getters stay conservative. Duplicate references are dropped and results are appended without spreads. main-app.cjs now completes in 7 s under a 1 GiB heap.
…CP boundary The resource boundary test relied on the former 8x application-projection forecast. Twelve thousand findings still exceed a 512 MiB parent's result budget under the measured forecast.
…ontiers Add semantic_files and semantic_unknowns page collections for JavaScript application Evidence. semantic_files returns each source's semantic byte budget, retained bytes, exact omitted counts and unknown totals by family and reason; semantic_unknowns returns retained frontiers ordered by source, family and reason. The summary reports source counts by status instead of repeating every file, and its unknowns name both pages. Document the serialized-byte budget and its coverage, and verify the budget, exact counts and both pages through the public CLI.
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 670685c475
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
dandgabr
left a comment
There was a problem hiding this comment.
Review suggestion
- P2 — Bound deferred unknown-frontier retention.
addSemanticGraphUnknown()stores every frontier infileBudget.deferredUnknownsuntil finalization, even after the source budget has closed. A source that exceeds its serialized-byte offer early can still accumulate an unbounded map of full frontier objects and candidate-node arrays, defeating per-file truncation and potentially exhausting the analysis worker heap. After closure, aggregate exact omitted counts by family/reason instead of retaining each object; also bound any deferred frontier storage while the budget remains open.
|
@greptileai review |
[High impact] The PR changes how JavaScript application analysis budgets, builds, and reports semantic graph results across its callers. The PR should not merge until the existing instance-field mutation finding is fixed. Findings
Fix with agent prompt### Issue 1
src/domain/javascript/javascriptSemanticMemberMutations.ts:2010-2011
The new `initializedBefore` value reaches `"instance"` lookups too. For example, `class B { static early = (new B().child.x = 2); child = shared; }` constructs an instance with `child` already installed. But `instanceFieldReferences` slices the class body before `early`, removing `child` from the lookup. The mutation walk then misses the write to `shared.x`, allowing its old literal to remain known.
Keep static initialization progress separate from instance-field progress. A static marker must not exclude fields of a newly constructed instance.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThe PR bounds JavaScript graphs by serialized Evidence bytes and adds per-source coverage pages. The latest changes make value projection yield between groups of bindings and stop further work after its byte budget closes.
Review-history decisions:
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
Sources[Selected sources] --> Worker[Static checkpoint and source analysis]
Ledger[One Evidence budget per analysis] --> Worker
Worker --> Semantic[Byte-bounded semantic facts]
Worker --> Forecast[Application fact forecasts]
Forecast --> Actual[Replace forecasts with actual graph charges]
Ledger --> Actual
Semantic --> Linked[Bind application links and admit final facts]
Actual --> Linked
Linked --> Check[Check completed Evidence bytes]
Check -->|Fits| Evidence[Deliver Evidence]
Actual -->|Does not fit| Refusal[Resource refusal with artifact inventory]
Check -->|Does not fit| Refusal
Reviews (26) · Last reviewed commit: "fix(javascript): stop projection after g..." · Reviewed by Greptile |
…ings Reserve pending nodes and frontiers, admit complete semantic facts atomically, retain unknown omission totals when projection stops early, and share Evidence admission with unavailable-source coverage, export forecasts and final links. Resolve receiver/private-field escapes and page the retained frontier order. Preserve pinned-main integration and static-only parse-failure coverage. Validation: source inspection and git diff checks only. Tests, builds, static checks and CI reruns were skipped at the maintainer's explicit request. Resource costs and real large-application workflows were not remeasured. BREAKING CHANGE: skipped semantic node, fingerprint and frontier totals can be null; bounded coverage may report omitted_files for unrepresented sources.
Merge main 2f3dee3 while retaining semantic budget corrections. Carry both allocation ownership and conservative escape facts through getter references, deduplicate references by owner initializer identity, and preserve ownership when widening effects. Keep main's array/assignment receiver handling and its new public workflow coverage. Validation: source inspection and Git diff checks only; tests, builds, static checks and CI reruns skipped at the maintainer's explicit request.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3477430bd5
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. Addressed in 3477430. Unavailable files previously bypassed byte admission. The production reconstruction now passes the worker's shared Evidence admission owner to semantic projection. recordUnavailableFile builds file-local, budgeted facts and reserves both facts and the coverage row before adoption. When a row cannot fit, omitted_files records its omission and the summary exposes unknown individual coverage instead of retaining an unbounded inventory of roots/frontiers. Source inspection and Git diff checks completed. Tests, builds, static checks and CI reruns were skipped at the user's explicit request; runtime behavior and resource costs were not remeasured. Addressed in 3477430. Application IDs were added after initial measurement. Binding now shares the immutable location-index arrays until admission, measures ID-array expansion without building a combined JSON string, and re-admits linked nodes plus dependent facts under the shared remaining Evidence budget. Per-file retained_graph_bytes is remeasured after binding; refusals update coverage and unknown totals. Source inspection and Git diff checks completed. Tests, builds, static checks and CI reruns were skipped at the user's explicit request; runtime behavior and resource costs were not remeasured. Addressed in 3477430. Endpoint admission mutated state before the complete relationship fit. admitSemanticFact now gathers missing endpoints and function owners, dry-runs their complete batch with the relation/context bytes, and commits reservations/nodes only after the whole batch fits. A refusal retains neither a newly admitted endpoint nor a partially charged relationship. Source inspection and Git diff checks completed. Tests, builds, static checks and CI reruns were skipped at the user's explicit request; runtime behavior and resource costs were not remeasured. Addressed in 3477430. A refused module could return before examining the IR while reporting exact zeroes. Projection now marks that early stop incomplete and uses nullable node, relation, fingerprint and frontier totals. The aggregate family omitted counts also remain unknown when any contributing source was not exhausted. Source inspection and Git diff checks completed. Tests, builds, static checks and CI reruns were skipped at the user's explicit request; runtime behavior and resource costs were not remeasured. Addressed in 3477430. A zero-node or insufficient-byte offer stops projection before its facts are examined. Coverage now represents skipped node/fingerprint/frontier totals as null and propagates unknown omission coverage to aggregate families. Regression expectations were updated to distinguish bounded retained facts from unexamined totals. Source inspection and Git diff checks completed. Tests, builds, static checks and CI reruns were skipped at the user's explicit request; runtime behavior and resource costs were not remeasured. Addressed in 3477430. Pending full nodes and deferred frontiers previously had no retention admission. SemanticFileGraphBudget now reserves their fact/context bytes before storing them and accounts for retained plus pending storage. Refusal stops projection; closed sources retain only bounded family/reason counters, never additional frontier objects/candidate arrays. Unexamined totals remain null. This also addresses the human review about deferred unknown-frontier retention. Source inspection and Git diff checks completed. Tests, builds, static checks and CI reruns were skipped at the user's explicit request; runtime behavior and resource costs were not remeasured. Addressed in 3477430. Export/application facts were missing from the Evidence ledger. The shared projection-resource owner now forecasts source/export observations and measures flattened return-shape projections, caching each callable's measurement. The child subtracts that reservation before offering semantic graph bytes, and the parent charges the same forecast to Evidence and retained-result capacity before retaining the module/graph. Source inspection and Git diff checks completed. Tests, builds, static checks and CI reruns were skipped at the user's explicit request; runtime behavior and resource costs were not remeasured. Addressed in 3477430. The widening fallback returned raw getter expressions whose this/private-field aliases were then dropped. It now walks receiver data, private/public fields, constructor field references and direct callable results once with visited sets, translating member access into conservative escapes of receiver-resolved values. The concrete repeated-unknown-key/private-state/shared-object counterexample was added to getter receiver coverage. Final integration preserves main's initializer ownership, deduplicates by initializer object identity and forwards ownership when widening effects. Source inspection and Git diff checks completed. Tests, builds, static checks and CI reruns were skipped at the user's explicit request; runtime behavior and resource costs were not remeasured. Addressed in 3477430. The view previously copied/decorated/sorted the entire unknown inventory on every page. It now slices the sealed graph's stable retained order first and adds module_path only to selected rows. The acceptance expectation follows the producer's first retained unknown ID, preserving paging identity without repeated full sorts. Source inspection and Git diff checks completed. Tests, builds, static checks and CI reruns were skipped at the user's explicit request; runtime behavior and resource costs were not remeasured. Addressed in 3477430. Fact admission is now transactional: admitSemanticFact gathers endpoints and function owners, and SemanticFileGraphBudget.admitBatch checks node/byte/context capacity before committing any of them. A refused target or relationship leaves newly required source nodes pending rather than isolated in the retained graph; bounded finalization discards refused pending nodes. Source inspection and Git diff checks completed. Tests, builds, static checks and CI reruns were skipped at the user's explicit request; runtime behavior and resource costs were not remeasured. Addressed in 3477430. Successful static-only parse failures returned projection:null and skipped both prior coverage paths. JavaScriptArtifactAnalysis now records unavailable semantic coverage for every null projection, independently of whether an analysis error exists. That path shares the same budgeted unavailable-file admission and bounded omitted_files disclosure. A malformed-source service regression was added. Source inspection and Git diff checks completed. Tests, builds, static checks and CI reruns were skipped at the user's explicit request; runtime behavior and resource costs were not remeasured. |
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. Fixed in 6f494ff. Root cause: Coverage-row omission set graph truncation independently of truncated source rows, while effective limits were gated only by the latter. Structural fix: Graph coverage now includes the offering byte/node limits whenever omitted_files contributes to truncation, including the zero-retained-row case. Source validation: Inspected final row reservation, aggregate truncation, and the graph coverage verifier’s effective-limit requirement. Targeted formatting used pinned Node 24.18.0 with two threads; git diff --check passed. Tests, typechecks, lint, builds, provider workloads, and CI reruns were intentionally not executed at the user’s request. Authored regressions remain unexecuted. Remaining cleanup: no directly related source cleanup identified in this bounded pass. Runtime/provider behavior remains unverified by this revision. Fixed in 6f494ff. Root cause: Inventory order admitted unavailable files before later caller-selected sources and spent their remaining node/byte capacity. Structural fix: Streaming analysis now iterates selected sources first, then inventory-only files, without copying source contents or changing selected-file relative order. Unavailable rows still use the same bounded admission owner. Source validation: Added a public application-analysis regression with an alphabetically earlier unselected file and a one-node total ceiling; inspected source-selection cancellation and final inventory coverage. Targeted formatting used pinned Node 24.18.0 with two threads; git diff --check passed. Tests, typechecks, lint, builds, provider workloads, and CI reruns were intentionally not executed at the user’s request. Authored regressions remain unexecuted. Remaining cleanup: no directly related source cleanup identified in this bounded pass. Runtime/provider behavior remains unverified by this revision. Fixed in 6f494ff. Root cause: Final linked-node accounting omitted the separate serialized root_node_ids array. Structural fix: Each root’s encoded ID and array punctuation are now charged in the same atomic batch as its node. Mandatory fallback reservations also include their serialized root array. Refused roots are removed with their admission. Source validation: Inspected the batch dry-run/commit path, fallback reservation, root removal, and final Evidence construction. Targeted formatting used pinned Node 24.18.0 with two threads; git diff --check passed. Tests, typechecks, lint, builds, provider workloads, and CI reruns were intentionally not executed at the user’s request. Authored regressions remain unexecuted. Remaining cleanup: no directly related source cleanup identified in this bounded pass. Runtime/provider behavior remains unverified by this revision. Fixed in 6f494ff. Root cause: Indexing staged full nodes before offering the facts that connected them, so staging exhaustion closed admission before an otherwise useful prefix was committed. Structural fix: Callable/fingerprint pairs are admitted atomically during indexing; binding/definition relations and resolved call endpoints are likewise offered before staging the next item. Deferred end-of-pass duplicates were removed, and admitted fingerprints survive early generator closure. Scratch reservation and atomic relation refusal remain enforced. Source validation: Added the 40-function/30-node regression expecting 29 retained callable fingerprints and unknown skipped totals. Inspected the existing atomic second-endpoint and connected-prefix regressions and preserved their structural guarantees. Targeted formatting used pinned Node 24.18.0 with two threads; git diff --check passed. Tests, typechecks, lint, builds, provider workloads, and CI reruns were intentionally not executed at the user’s request. Authored regressions remain unexecuted. Remaining cleanup: no directly related source cleanup identified in this bounded pass. Runtime/provider behavior remains unverified by this revision. Fixed in 6f494ff. Root cause: CLI assertions still required positive omission counts after the producer contract changed skipped, unexamined totals to null. Structural fix: Both node-capacity and checkpoint-reserve CLI expectations now accept unknown skipped totals. The checkpoint test’s guard no longer throws on null omissions, and final linked bytes are checked against the separately reported shared allowance when present. Source validation: Inspected both complete/truncated assertion branches and updated the existing CLI coverage rather than removing it. Targeted formatting used pinned Node 24.18.0 with two threads; git diff --check passed. Tests, typechecks, lint, builds, provider workloads, and CI reruns were intentionally not executed at the user’s request. Authored regressions remain unexecuted. Remaining cleanup: no directly related source cleanup identified in this bounded pass. Runtime/provider behavior remains unverified by this revision. Fixed in 6f494ff. Root cause: Application-wide splice spread converted every retained fingerprint into a call argument and could exceed Node’s argument limit. Structural fix: Sealing now clears arrays and copies records with loops. The same cleanup covers application coverage rows and per-file fingerprint adoption, removing the related spread mutation sites. Source validation: Inspected graph sealing and all push/splice spread mutations in the semantic graph builder/construction files. Targeted formatting used pinned Node 24.18.0 with two threads; git diff --check passed. Tests, typechecks, lint, builds, provider workloads, and CI reruns were intentionally not executed at the user’s request. Authored regressions remain unexecuted. Remaining cleanup: no directly related source cleanup identified in this bounded pass. Runtime/provider behavior remains unverified by this revision. Fixed in 6f494ff. Root cause: The size forecast materialized flattened return-shape objects and their full JSON before checking capacity, allowing repeated ancestor paths to expand inside the worker. Structural fix: Forecasting now traverses the owning semantic return representation, counts escaped pointer components and repeated path bytes arithmetically, and stops at the supplied allowance without constructing flattened outputs or ancestor strings. Both worker and parent supply their remaining capacity; saturation diagnostics explicitly report an estimated lower bound. Source validation: Added deep long-key cutoff and escaped-pointer/payload regressions. Inspected both forecast callers and the canonical return/slot projection owners. Performance and memory costs were not measured in this source-only pass. Targeted formatting used pinned Node 24.18.0 with two threads; git diff --check passed. Tests, typechecks, lint, builds, provider workloads, and CI reruns were intentionally not executed at the user’s request. Authored regressions remain unexecuted. Remaining cleanup: no directly related source cleanup identified in this bounded pass. Runtime/provider behavior remains unverified by this revision. Fixed in 6f494ff. Root cause: Final linking overwrote each already-truncated source’s original offer with the whole application allowance even when no facts were removed. Structural fix: graph_byte_budget now preserves the original source offer. The additive final_shared_graph_byte_budget is recorded only when final linking removes facts or expands retained bytes beyond that offer. Complete unchanged rows retain host-independent coverage. Documentation and the checkpoint CLI consumer describe/use the separate allowance. Source validation: Inspected file/page schema flow, final per-file measurement, row reservation, and complete versus truncated Evidence behavior. Targeted formatting used pinned Node 24.18.0 with two threads; git diff --check passed. Tests, typechecks, lint, builds, provider workloads, and CI reruns were intentionally not executed at the user’s request. Authored regressions remain unexecuted. Remaining cleanup: no directly related source cleanup identified in this bounded pass. Runtime/provider behavior remains unverified by this revision. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f494ff7b7
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93ca89bb14
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ce3f9f03f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 81b061edd5
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58159133eb
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab30ff51c2
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| kind: t.isClass(node) ? "static" : "instance", | ||
| ...(initializedBefore === undefined ? {} : { initializedBefore }), |
There was a problem hiding this comment.
Instance writes keep old values
The new initializedBefore value reaches "instance" lookups too. For example, class B { static early = (new B().child.x = 2); child = shared; } constructs an instance with child already installed. But instanceFieldReferences slices the class body before early, removing child from the lookup. The mutation walk then misses the write to shared.x, allowing its old literal to remain known.
Keep static initialization progress separate from instance-field progress. A static marker must not exclude fields of a newly constructed instance.
Knowledge Base Used: JavaScript and desktop reconstruction
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/domain/javascript/javascriptSemanticMemberMutations.ts
Line: 2010-2011
Comment:
**Instance writes keep old values**
The new `initializedBefore` value reaches `"instance"` lookups too. For example, `class B { static early = (new B().child.x = 2); child = shared; }` constructs an instance with `child` already installed. But `instanceFieldReferences` slices the class body before `early`, removing `child` from the lookup. The mutation walk then misses the write to `shared.x`, allowing its old literal to remain known.
Keep static initialization progress separate from instance-field progress. A static marker must not exclude fields of a newly constructed instance.
**Knowledge Base Used:** [JavaScript and desktop reconstruction](https://app.greptile.com/-/switch-tenant?tenant=pre&next=%2Fcustom-context%2Fknowledge-base%2Fmorluto%2Frea%2F-%2Fdocs%2Fjavascript-and-desktop-reconstruction.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 157af47b58
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| budget.pendingNodes.set(node.node_id, node); | ||
| return node; |
There was a problem hiding this comment.
Include staged property reads in the flow lookup
For reads without a resolvable slot, such as return object[key] or consume(object[key]), the occurrence now remains only in pendingNodes until file finalization. However, objectReadOccurrences still indexes only state.nodes, and projectCalls uses that cached index for argument and return aliases edges before finalization. Consequently, even an untruncated projection retains the read and its unknown frontier but loses their link to the returned or passed value. Make the lookup consume the object projection's staged read occurrences as well.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
| await completeJavaScriptAnalysisSteps( | ||
| enforceEvidenceBudget(evidence), | ||
| options.signal, | ||
| ); |
There was a problem hiding this comment.
Apply the final byte check to reconstruction's partial Evidence
If source analysis is interrupted after collecting facts, the failure !== null branch in reconstructJavaScriptArtifact creates partial Evidence and throws it through retainPartialObservation before reconstructed is assigned. Neither this check nor the late-cancellation check runs, and the catch returns that Evidence unchanged. A near-budget interrupted analysis can therefore retain and deliver Evidence exceeding the advertised cap after the independently budgeted route_inventory and envelope are included. Enforce the limit at the shared Evidence-producing boundary so both completed and partial results receive it.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
| if (t.isPrivateName(callee.property)) { | ||
| if (!t.isThisExpression(receiverExpression)) return []; | ||
| return owner.body.body.flatMap((member): GetterInvocation[] => |
There was a problem hiding this comment.
Check the receiver brand before following static private methods
When an inherited static getter is widened, this branch resolves its lexical owner's private method even when the receiver is a subclass. For example, if A.s returns this.#read() and s is read on B extends A, the actual call throws because static private brands are not inherited. Here, A.#read is nevertheless scheduled and its result is escaped, which can turn an otherwise unchanged literal return into unknown. Reuse the owner/receiver rule already enforced by privateReceiverProjection before following static private calls.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55f18dc821
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (const nodeId of budget.pendingNodes.keys()) { | ||
| if (!admitSemanticFact(state, budget, [nodeId])) budget.omitNode(nodeId); |
There was a problem hiding this comment.
Retain already-reserved facts after source byte exhaustion
When byte exhaustion occurs during indexing—for example, in a source containing many unresolved top-level calls—the previously reserved call-site nodes are still in pendingNodes, but reservePending() has set budget.closed. Every admitSemanticFact() here then fails at admitBatch()'s closed check, discarding the entire pending prefix even though its reservations fit the allowance. An isolated check retained seven pending calls within 991 of 1,000 bytes without overflow, but retained none after one additional call was refused. Large call-heavy sources can therefore return only their module root instead of useful bounded semantics. Preserve the already-reserved prefix during finalization, or admit it incrementally before closing new construction.
AGENTS.md reference: AGENTS.md:L97-L97
Useful? React with 👍 / 👎.
| kind: t.isClass(node) ? "static" : "instance", | ||
| ...(initializedBefore === undefined ? {} : { initializedBefore }), |
There was a problem hiding this comment.
Keep static initialization cutoffs out of fresh instance fields
When a static initializer or block writes through a newly constructed instance of the same class, this unconditionally passes the static initialization cutoff into instance-field lookup. For example, with const shared = {x: 1}; class R { static run = (new R().v.x = 2); child = shared; get v() { return this.child; } }, instanceFieldReferences() excludes child because it appears after run, although new R() has already initialized every instance field. The mutation walk consequently misses the write to shared.x, allowing subsequent return analysis to retain the stale literal 1 instead of recognizing the mutation. Distinguish the static receiver's initialization phase from the fully initialized fresh instance.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
Large JavaScript applications can exceed the parent Evidence budget even when their source analysis succeeds. This change admits semantic facts and application graph records against a shared serialized-byte budget, and reports per-source coverage and retained unknown frontiers through paged views. Oversized application facts return a resource constraint with the artifact inventory instead of an oversized Evidence record.
Caller-selected node ceilings still apply; omitted node ceilings have no fixed default. Unknown-record capacities remain independently configurable. Source analysis reserves application forecasts and retained semantic facts, final graph admission charges actual nodes, observations, edges and metadata, and delivery checks the completed Evidence. A separate ledger per analysis keeps these reservations independent when an owned worker is reused. Receiver widening also preserves superclass, computed-name and object/private-method behavior.
This changes the semantic graph contract: family unknown IDs become retained/omitted counts, file coverage is added, and unexamined omission totals may be null. Selected sources receive capacity before unselected inventory rows. Source-byte shares do not guarantee a minimum root allowance for every later selected source, and large alias-chain performance remains an open limitation.
Validation on the merged branch:
npm run check:fastandnpm run docs:checkpassed.The latest review fixes preserve an explicitly unbounded expression capacity, migrate semantic coverage fixtures, retain the scanned inventory when final Evidence delivery is refused, and remove the unused duplicate array-selection owner. The source suites passed 39 tests plus 10 analysis-step tests; public budget and final-refusal boundaries passed 6 tests, and application service and reconstruction boundaries passed 66 tests. The final-refusal long-path fixture passed on macOS and is skipped on Windows.
A follow-up tightened the reconstruction graph-binding test to validate the public result before testing a mismatch, and removed unused duplicate JSON and export-link helpers. The reconstruction boundary suite passed 49 tests;
npm run check:fastandnpm run format:checkpassed.These are local test and fixture results; no real-provider verification or new large-application performance measurement was performed after the merge.
Latest review follow-up
semantic_filespages the retained rows. Static class field selection now takes precedence over same-name methods regardless of declaration order (06a7f3d).npm run check:fastpassed. Source admission also reserves measured later roots before distributing surplus (ab30ff5). Allocation tests cover unequal roots and zero-byte sources; 18 real-worker and 17 application-service boundary tests, check:fast, and format:check passed. Later static facts may still consume shared capacity independently.Static initialization follow-up
The semantic mutation walk retains the active static initializer or block when selecting getter and method descriptors (157af47). Receiver and alias tests, the CLI/MCP return-shape workflow, check:fast and format:check passed; tests distinguish field initialization before and after the write.
Author readiness
Human owner: