refactor(javascript): own coverage facts and reuse block prefixes

Separate syntax, semantic uncertainty, examination limits and observed Electron applicability at the static producer, then preserve them through worker, graph and retained/inline summary views. Derive the established parse_status from the same facts and leave historical measurements unknown. Give semantic resource-limit classifications one schema owner.

Replace repeated block-prefix searches and copies with collector-scoped syntax indexes. Keep invocation environments separate, charge indexing/replay to the existing work budget and yield during prefix work. Remove the superseded synchronous collector entrypoint.

Validated producer, worker, CLI/MCP, historical and partial-coverage regressions, plus actual cancellation during indexing. Bounded authored 128/256-call controls preserved all prior facts while replacing repeated search/copy work with one index pass; this is not a throughput or agent-token benchmark.
This commit is contained in:
morluto committed 2026-10-25 09:49:26 +08:00
1 parent c8269ca497
commit f62a2baad8
21 files changed
+898 -125

No files matched your search

@@ -130,6 +130,11 @@ describe("skipped JavaScript parse reporting", () => {
const context = contextFor(file, analysisFor([skippedEntry(file)]));
addJavaScriptArtifactFiles(context);
expect(fileObservation(context).parse_status).toBe("skipped");
expect(fileObservation(context).analysis_coverage).toMatchObject({
syntax: { status: "not-examined", error_count: null },
semantics: { unknown_findings: null },
examination: { status: "not-examined" },
});
});
it("keeps parse_status null for a JavaScript file never attempted", () => {
@@ -157,6 +162,21 @@ describe("skipped JavaScript parse reporting", () => {
const context = contextFor(file, analysisFor([entry]));
addJavaScriptArtifactFiles(context);
expect(fileObservation(context).parse_status).toBe(javascript.parse_status);
expect(fileObservation(context).analysis_coverage).toEqual(
javascript.analysis_coverage,
);
});
it("does not reconstruct coverage from a historical overall summary", () => {
const file = skippedFile();
const { analysis_coverage: _coverage, ...javascript } =
analyzeJavaScriptStaticSource(file.text.included ? file.text.value : "");
const context = contextFor(
file,
analysisFor([{ file, javascript, semantic: null }]),
);
addJavaScriptArtifactFiles(context);
expect(fileObservation(context)).not.toHaveProperty("analysis_coverage");
});
});