mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 01:13:39 +00: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
@@ -265,6 +265,22 @@ function* checkCoverageSteps(
|
||||
graph: GraphRecord,
|
||||
context: GraphIssueReporter,
|
||||
): Generator<void> {
|
||||
const omittedUnknowns = graph.coverage.omitted_unknown_occurrences ?? [];
|
||||
sortedUniqueIssue(
|
||||
omittedUnknowns.map(({ family, reason }) => `${family}:${reason}`),
|
||||
["coverage", "omitted_unknown_occurrences"],
|
||||
"Unknown omission coverage",
|
||||
context,
|
||||
);
|
||||
if (
|
||||
omittedUnknowns.length > 0 &&
|
||||
(!graph.coverage.truncated || graph.coverage.status !== "partial")
|
||||
)
|
||||
context.addIssue({
|
||||
code: "custom",
|
||||
path: ["coverage"],
|
||||
message: "Omitted unknown occurrences require truncated partial coverage",
|
||||
});
|
||||
const families = graph.coverage.families.map(({ family }) => family);
|
||||
if (
|
||||
canonicalJson(families, "JavaScript semantic graph") !==
|
||||
@@ -333,7 +349,8 @@ function* checkCoverageSteps(
|
||||
family.status === "complete" &&
|
||||
(family.omitted_relations !== 0 ||
|
||||
family.unknown_ids.length > 0 ||
|
||||
unknownFamilies.has(family.family))
|
||||
unknownFamilies.has(family.family) ||
|
||||
omittedUnknowns.some((omitted) => omitted.family === family.family))
|
||||
)
|
||||
context.addIssue({
|
||||
code: "custom",
|
||||
@@ -759,6 +776,18 @@ const normalizeGraphInput = (
|
||||
canonicalJson(right, "JavaScript semantic graph"),
|
||||
),
|
||||
),
|
||||
...(parsed.coverage.omitted_unknown_occurrences === undefined
|
||||
? {}
|
||||
: {
|
||||
omitted_unknown_occurrences: [
|
||||
...parsed.coverage.omitted_unknown_occurrences,
|
||||
].sort((left, right) =>
|
||||
compareUnicodeCodePoints(
|
||||
`${left.family}:${left.reason}`,
|
||||
`${right.family}:${right.reason}`,
|
||||
),
|
||||
),
|
||||
}),
|
||||
families: [...parsed.coverage.families]
|
||||
.map((family) => ({
|
||||
...family,
|
||||
|
||||
Reference in new issue
Block a user