mirror of
https://github.com/morluto/rea.git
synced 2026-10-22 13:52:32 -05:00
fix(javascript): bound semantic unknown retention at projection
Admit unknowns before canonical construction and provenance interning. Offer independent per-file and application capacities through CLI, Evidence and the owned analysis worker, and reject over-allocation during streamed decoding. Report examined omitted emission occurrences by family and reason without retaining discarded identities. Preserve omission-free graph identities and distinguish node truncation from overall partial coverage. Fixes #4797
This commit is contained in:
1 parent
926e18b3fc
commit
f4322b15ed
34 files changed
+892
-293
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import type { JavaScriptSemanticProjectionCapacity } from "../../domain/javascript/javascriptSemanticFileProjection.js";
|
||||
import { createHash, randomUUID } from "node:crypto";
|
||||
import { readFile, rm, stat, writeFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
@@ -154,7 +155,7 @@ export class JavaScriptAnalysisWorker {
|
||||
/** Analyze inert source; hard worker failure does not terminate this process. */
|
||||
async analyze(
|
||||
file: JavaScriptArtifactFile,
|
||||
nodeBudget: number,
|
||||
capacity: JavaScriptSemanticProjectionCapacity,
|
||||
signal?: AbortSignal,
|
||||
): Promise<
|
||||
Result<JavaScriptAnalyzedSource, JavaScriptSourceAnalysisFailure>
|
||||
@@ -203,7 +204,8 @@ export class JavaScriptAnalysisWorker {
|
||||
let offeredResultBudget = 0;
|
||||
const request = javaScriptWorkerRequestSchema.parse({
|
||||
id,
|
||||
node_budget: nodeBudget,
|
||||
node_budget: capacity.nodes,
|
||||
unknown_budget: capacity.unknowns,
|
||||
text_sha256: createHash("sha256").update(file.text.value).digest("hex"),
|
||||
file: metadata,
|
||||
});
|
||||
@@ -344,7 +346,7 @@ export class JavaScriptAnalysisWorker {
|
||||
descriptor,
|
||||
file,
|
||||
deadline.signal,
|
||||
retainGraph,
|
||||
retainGraph ? capacity : null,
|
||||
);
|
||||
module = decoded.module;
|
||||
projection = decoded.projection;
|
||||
|
||||
Reference in new issue
Block a user