mirror of
https://github.com/morluto/rea
synced 2026-10-26 22:28:27 -04: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:
@@ -68,6 +68,11 @@ export const queryJavaScriptSemanticGraph = (
|
||||
result.retainedRelations,
|
||||
input,
|
||||
);
|
||||
const retainedContextIds = new Set([
|
||||
...result.retainedNodes.map(({ evidence }) => evidence.context_id),
|
||||
...result.retainedRelations.map(({ evidence }) => evidence.context_id),
|
||||
...relevantUnknowns.map(({ evidence }) => evidence.context_id),
|
||||
]);
|
||||
const assessment = assessJavaScriptSemanticQuery({
|
||||
graph,
|
||||
totalSeeds: seeds.length,
|
||||
@@ -83,6 +88,9 @@ export const queryJavaScriptSemanticGraph = (
|
||||
direction: input.direction,
|
||||
status: assessment.status,
|
||||
seed_node_ids: retainedSeeds,
|
||||
evidence_contexts: graph.evidence_contexts.filter(({ context_id }) =>
|
||||
retainedContextIds.has(context_id),
|
||||
),
|
||||
nodes: result.retainedNodes,
|
||||
relations: result.retainedRelations,
|
||||
unknowns: relevantUnknowns,
|
||||
|
||||
Reference in New Issue
Block a user