[PR #2092] feat(javascript)!: bound semantic graphs by serialized Evidence bytes #5020

Open
opened 2026-10-31 00:58:15 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2092
Author: @coleleavitt
Created: 10/12/2026
Status: 🔄 Open

Base: main ← Head: pr/javascript-semantic-budget


📝 Commits (10+)

  • 83a2950 fix(javascript): calibrate parent result retention from measured expansion
  • 6798412 feat(javascript)!: bound semantic facts by serialized Evidence bytes
  • 780465c fix(javascript): bound getter expansion through unknown receiver keys
  • 20266cb test(javascript): exceed the calibrated application forecast at the MCP boundary
  • 670685c feat(analysis-view): page JavaScript semantic coverage and unknown frontiers
  • 67d8d40 fix(javascript)!: reconcile semantic budget ownership and review findings
  • 3477430 fix(javascript): integrate latest main getter ownership
  • d9f828b fix(javascript): preserve bounded semantic prefixes and projections
  • 6f494ff fix(javascript): merge captured main and preserve bounded getter ownership
  • c304ffc fix(javascript): charge static fallback and preserve unavailable coverage

📊 Changes

48 files changed (+2957 additions, -605 deletions)

View changed files

📝 docs/javascript-artifact-reconstruction.md (+50 -11)
📝 src/application/javascript/JavaScriptArtifactAnalysis.ts (+19 -7)
📝 src/application/javascript/JavaScriptArtifactReconstruction.ts (+14 -9)
📝 src/application/javascript/JavaScriptModuleRelationships.ts (+6 -31)
➕ src/application/javascript/JavaScriptSemanticFileGraphBudget.ts (+230 -0)
📝 src/application/javascript/JavaScriptSemanticGraphBuilder.test.ts (+270 -128)
📝 src/application/javascript/JavaScriptSemanticGraphBuilder.ts (+529 -180)
📝 src/application/javascript/JavaScriptSemanticGraphConstruction.ts (+308 -41)
📝 src/application/javascript/JavaScriptSemanticGraphElectronProjection.test.ts (+3 -2)
📝 src/application/javascript/JavaScriptSemanticGraphFingerprintProjection.ts (+34 -22)
📝 src/artifacts/ArtifactResourceScope.test.ts (+1 -0)
📝 src/artifacts/javascript/JavaScriptSourceAnalysis.ts (+3 -2)
📝 src/composition/javascriptAnalysisWorkerProcess.ts (+30 -3)
📝 src/contracts/analysisViewToolContracts.ts (+1 -1)
📝 src/contracts/javascript/javascriptExportShapeComparisonExample.ts (+3 -1)
📝 src/contracts/javascript/javascriptRuntimeReconciliationExample.ts (+3 -1)
📝 src/domain/analysisView/analysisView.ts (+11 -1)
📝 src/domain/analysisView/binaryLayoutView.ts (+2 -2)
📝 src/domain/analysisView/javascriptApplicationView.ts (+67 -9)
📝 src/domain/javascript/javascriptAnalysisResourceControls.ts (+3 -5)

...and 28 more files

📄 Description

Large JavaScript applications need semantic facts to remain useful within the parent Evidence and result-retention budgets. This change replaces fixed default node ceilings with serialized-fact admission and exposes per-source coverage and retained unknown-frontier pages.

The final implementation:

  • Uses one Evidence admission owner for analyzed semantic facts, unavailable-source records, coverage rows, exported application observations and final application-node links.
  • Reserves pending nodes and deferred frontiers before retaining them. A closed source retains bounded family/reason counters and stops projection.
  • Admits each relationship together with its required endpoints, function owners and evidence contexts. Refused facts leave no newly retained isolated endpoints.
  • Measures application-node ID arrays before final admission without eagerly copying their expansion across nodes, and updates retained-byte accounting after binding.
  • Reports unexamined omission totals as unknown. If a coverage row cannot fit, omitted_files records its omission while source paths remain available in the application inventory.
  • Records unavailable coverage for successful static-only parse failures.
  • Pages the sealed graph's stable unknown order before decorating selected rows.
  • Resolves receiver/private-field aliases before widening repeated dynamic getter reads to escapes, preserving current main's initializer ownership and array/assignment receiver handling.

Caller-selected total/per-file node capacities still apply; omitted capacities have no default ceiling. Sources initially share the remaining semantic offer in proportion to their source bytes. Exported return-shape forecasts reduce the semantic offer before projection. Final linked facts undergo admission against the shared remaining Evidence capacity.

Breaking changes include replacing family unknown_ids with retained/omitted counts, adding file coverage, removing default node ceilings, and allowing skipped node, fingerprint and frontier totals to be null. Bounded coverage can also report omitted_files for unrepresented sources.

Validation for the final revision was source inspection and Git diff checks only. Tests, builds, static checks, generated-document checks and CI reruns were skipped at the maintainer's explicit request. Runtime behavior, schema conversion, resource costs and real large-application workflows were not reverified or remeasured after these review fixes. Earlier branch measurements do not establish the final revision's behavior.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2092 **Author:** [@coleleavitt](https://github.com/coleleavitt) **Created:** 10/12/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/javascript-semantic-budget` --- ### 📝 Commits (10+) - [`83a2950`](https://github.com/morluto/rea/commit/83a2950c4c0c3370fc4e6489da274580328465fd) fix(javascript): calibrate parent result retention from measured expansion - [`6798412`](https://github.com/morluto/rea/commit/6798412a56fb0ffa8c103d9d6df1f3f1c441b7bc) feat(javascript)!: bound semantic facts by serialized Evidence bytes - [`780465c`](https://github.com/morluto/rea/commit/780465c64fdc3f3609193049bf08fbeadce70ae5) fix(javascript): bound getter expansion through unknown receiver keys - [`20266cb`](https://github.com/morluto/rea/commit/20266cb617988c6b91c7db14c88406f126702640) test(javascript): exceed the calibrated application forecast at the MCP boundary - [`670685c`](https://github.com/morluto/rea/commit/670685c475b8f9990b4aa199dcdc7f24274fb198) feat(analysis-view): page JavaScript semantic coverage and unknown frontiers - [`67d8d40`](https://github.com/morluto/rea/commit/67d8d40f89806225410ad7dc81e8f2ad984a5c2c) fix(javascript)!: reconcile semantic budget ownership and review findings - [`3477430`](https://github.com/morluto/rea/commit/3477430bd5faefa0ef17c1d64e9ab1e02eaf234d) fix(javascript): integrate latest main getter ownership - [`d9f828b`](https://github.com/morluto/rea/commit/d9f828b581856e775a0d17faf7c30a6349fe58df) fix(javascript): preserve bounded semantic prefixes and projections - [`6f494ff`](https://github.com/morluto/rea/commit/6f494ff7b79b7c36e2fea226e7e7aa33fbde222d) fix(javascript): merge captured main and preserve bounded getter ownership - [`c304ffc`](https://github.com/morluto/rea/commit/c304ffc1f79ac0efa7559e39ef7b33e74814e943) fix(javascript): charge static fallback and preserve unavailable coverage ### 📊 Changes **48 files changed** (+2957 additions, -605 deletions) <details> <summary>View changed files</summary> 📝 `docs/javascript-artifact-reconstruction.md` (+50 -11) 📝 `src/application/javascript/JavaScriptArtifactAnalysis.ts` (+19 -7) 📝 `src/application/javascript/JavaScriptArtifactReconstruction.ts` (+14 -9) 📝 `src/application/javascript/JavaScriptModuleRelationships.ts` (+6 -31) ➕ `src/application/javascript/JavaScriptSemanticFileGraphBudget.ts` (+230 -0) 📝 `src/application/javascript/JavaScriptSemanticGraphBuilder.test.ts` (+270 -128) 📝 `src/application/javascript/JavaScriptSemanticGraphBuilder.ts` (+529 -180) 📝 `src/application/javascript/JavaScriptSemanticGraphConstruction.ts` (+308 -41) 📝 `src/application/javascript/JavaScriptSemanticGraphElectronProjection.test.ts` (+3 -2) 📝 `src/application/javascript/JavaScriptSemanticGraphFingerprintProjection.ts` (+34 -22) 📝 `src/artifacts/ArtifactResourceScope.test.ts` (+1 -0) 📝 `src/artifacts/javascript/JavaScriptSourceAnalysis.ts` (+3 -2) 📝 `src/composition/javascriptAnalysisWorkerProcess.ts` (+30 -3) 📝 `src/contracts/analysisViewToolContracts.ts` (+1 -1) 📝 `src/contracts/javascript/javascriptExportShapeComparisonExample.ts` (+3 -1) 📝 `src/contracts/javascript/javascriptRuntimeReconciliationExample.ts` (+3 -1) 📝 `src/domain/analysisView/analysisView.ts` (+11 -1) 📝 `src/domain/analysisView/binaryLayoutView.ts` (+2 -2) 📝 `src/domain/analysisView/javascriptApplicationView.ts` (+67 -9) 📝 `src/domain/javascript/javascriptAnalysisResourceControls.ts` (+3 -5) _...and 28 more files_ </details> ### 📄 Description Large JavaScript applications need semantic facts to remain useful within the parent Evidence and result-retention budgets. This change replaces fixed default node ceilings with serialized-fact admission and exposes per-source coverage and retained unknown-frontier pages. The final implementation: - Uses one Evidence admission owner for analyzed semantic facts, unavailable-source records, coverage rows, exported application observations and final application-node links. - Reserves pending nodes and deferred frontiers before retaining them. A closed source retains bounded family/reason counters and stops projection. - Admits each relationship together with its required endpoints, function owners and evidence contexts. Refused facts leave no newly retained isolated endpoints. - Measures application-node ID arrays before final admission without eagerly copying their expansion across nodes, and updates retained-byte accounting after binding. - Reports unexamined omission totals as unknown. If a coverage row cannot fit, `omitted_files` records its omission while source paths remain available in the application inventory. - Records unavailable coverage for successful static-only parse failures. - Pages the sealed graph's stable unknown order before decorating selected rows. - Resolves receiver/private-field aliases before widening repeated dynamic getter reads to escapes, preserving current main's initializer ownership and array/assignment receiver handling. Caller-selected total/per-file node capacities still apply; omitted capacities have no default ceiling. Sources initially share the remaining semantic offer in proportion to their source bytes. Exported return-shape forecasts reduce the semantic offer before projection. Final linked facts undergo admission against the shared remaining Evidence capacity. Breaking changes include replacing family `unknown_ids` with retained/omitted counts, adding file coverage, removing default node ceilings, and allowing skipped node, fingerprint and frontier totals to be `null`. Bounded coverage can also report `omitted_files` for unrepresented sources. Validation for the final revision was source inspection and Git diff checks only. Tests, builds, static checks, generated-document checks and CI reruns were skipped at the maintainer's explicit request. Runtime behavior, schema conversion, resource costs and real large-application workflows were not reverified or remeasured after these review fixes. Earlier branch measurements do not establish the final revision's behavior. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5020
No description provided.