mirror of
https://github.com/morluto/rea.git
synced 2026-10-27 09:55:46 +00:00
refactor(javascript)!: share semantic evidence at fact construction
Intern shared provenance in a graph-scoped context registry while retaining exact locations on every fact. Semantic traces carry their referenced context subset, and portable graph validation rejects stale or dangling commitments. BREAKING CHANGE: Semantic graph facts now store evidence context IDs and locations. Graph and semantic trace results require an inline evidence_contexts table.
This commit is contained in:
1 parent
9c4a68bc19
commit
e3bbb9ac45
25 files changed
+1109
-464
No files matched your search
@@ -13,6 +13,7 @@ import {
|
||||
import {
|
||||
createJavaScriptSemanticGraph,
|
||||
createJavaScriptSemanticGraphNode,
|
||||
JavaScriptSemanticEvidenceContextRegistry,
|
||||
} from "../../domain/javascript/javascriptSemanticGraph.js";
|
||||
import { JAVASCRIPT_SEMANTIC_RELATION_FAMILIES } from "../../domain/javascript/javascriptSemanticGraphSchemas.js";
|
||||
import { javascriptApplicationAnalysisResultSchema } from "../../domain/javascript/javascriptApplicationAnalysis.js";
|
||||
@@ -184,30 +185,35 @@ const exampleEvidence = (property: "count" | "total") => {
|
||||
coverage: partialApplicationCoverage([], null),
|
||||
limitations,
|
||||
});
|
||||
const module = createJavaScriptSemanticGraphNode({
|
||||
kind: "module",
|
||||
identity: {
|
||||
artifact_sha256: artifact.sha256,
|
||||
module_path: modulePath,
|
||||
source_range: null,
|
||||
role_key: "example-module",
|
||||
const evidenceContexts = new JavaScriptSemanticEvidenceContextRegistry();
|
||||
const module = createJavaScriptSemanticGraphNode(
|
||||
{
|
||||
kind: "module",
|
||||
identity: {
|
||||
artifact_sha256: artifact.sha256,
|
||||
module_path: modulePath,
|
||||
source_range: null,
|
||||
role_key: "example-module",
|
||||
},
|
||||
function_node_id: null,
|
||||
application_node_ids: [exported.node_id],
|
||||
label: modulePath,
|
||||
properties: {},
|
||||
evidence: {
|
||||
...evidence,
|
||||
authority: "ast-static-analysis",
|
||||
state: "observed",
|
||||
confidence: "exact",
|
||||
},
|
||||
},
|
||||
function_node_id: null,
|
||||
application_node_ids: [exported.node_id],
|
||||
label: modulePath,
|
||||
properties: {},
|
||||
evidence: {
|
||||
...evidence,
|
||||
authority: "ast-static-analysis",
|
||||
state: "observed",
|
||||
confidence: "exact",
|
||||
},
|
||||
});
|
||||
evidenceContexts,
|
||||
);
|
||||
const semanticGraph = createJavaScriptSemanticGraph({
|
||||
schema: "JavaScriptSemanticRelationGraph",
|
||||
root_artifact_sha256: metadata.root_artifact_sha256,
|
||||
application_graph_id: graph.graph_id,
|
||||
root_node_ids: [module.node_id],
|
||||
evidence_contexts: evidenceContexts.contexts,
|
||||
nodes: [module],
|
||||
relations: [],
|
||||
fingerprints: [],
|
||||
|
||||
Reference in new issue
Block a user