mirror of
https://github.com/morluto/rea
synced 2026-10-26 22:28:27 -04:00
test(javascript): consolidate source analysis and export regressions
This commit is contained in:
@@ -253,56 +253,58 @@ describe("feature seed selection controls", () => {
|
||||
});
|
||||
|
||||
describe("public feature trace from contextBridge source members", () => {
|
||||
it.each(matchingModes)(
|
||||
"traces $match / $value / case-sensitive $case_sensitive",
|
||||
(mode) => {
|
||||
const graph = contextBridgeGraph();
|
||||
const before = structuredClone(graph);
|
||||
const input = {
|
||||
sourceEvidenceId,
|
||||
graph,
|
||||
nativeEvidence: [],
|
||||
direction: "both" as const,
|
||||
};
|
||||
const generic = traceApplicationFeature({
|
||||
...input,
|
||||
seed: { kind: "string", ...mode },
|
||||
});
|
||||
const typed = traceApplicationFeature({
|
||||
...input,
|
||||
seed: { kind: "api", ...mode },
|
||||
});
|
||||
it("traces one exact member seed through the public feature workflow", () => {
|
||||
const mode = {
|
||||
value: "openProject",
|
||||
match: "exact" as const,
|
||||
case_sensitive: true,
|
||||
};
|
||||
const graph = contextBridgeGraph();
|
||||
const before = structuredClone(graph);
|
||||
const input = {
|
||||
sourceEvidenceId,
|
||||
graph,
|
||||
nativeEvidence: [],
|
||||
direction: "both" as const,
|
||||
};
|
||||
const generic = traceApplicationFeature({
|
||||
...input,
|
||||
seed: { kind: "string", ...mode },
|
||||
});
|
||||
const typed = traceApplicationFeature({
|
||||
...input,
|
||||
seed: { kind: "api", ...mode },
|
||||
});
|
||||
|
||||
expect(typed.coverage).toEqual({
|
||||
status: "complete-within-source",
|
||||
source_graph_status: "complete",
|
||||
total_seed_matches: 1,
|
||||
});
|
||||
expect(typed.seed_matches).toEqual(generic.seed_matches);
|
||||
expect(typed.seed_matches).toEqual([
|
||||
{
|
||||
node_id: graph.nodes[0]?.node_id,
|
||||
kind: "context-bridge-api",
|
||||
basis: "property",
|
||||
field: "observations[0].properties.members[1]",
|
||||
},
|
||||
]);
|
||||
expect(typed.graph?.nodes).toEqual(graph.nodes);
|
||||
expect(typed.graph?.edges).toEqual([]);
|
||||
expect(typed.evidence_links).toEqual([sourceEvidenceId]);
|
||||
expect(typed.summary).toMatchObject({
|
||||
matched_seeds: 1,
|
||||
traced_nodes: 1,
|
||||
traced_edges: 0,
|
||||
observed_facts: 1,
|
||||
inferred_facts: 0,
|
||||
unknown_facts: 0,
|
||||
unavailable_facts: 0,
|
||||
});
|
||||
expect(typed.native_handoffs).toEqual([]);
|
||||
expect(graph).toEqual(before);
|
||||
},
|
||||
);
|
||||
expect(typed.coverage).toEqual({
|
||||
status: "complete-within-source",
|
||||
source_graph_status: "complete",
|
||||
total_seed_matches: 1,
|
||||
});
|
||||
expect(typed.seed_matches).toEqual(generic.seed_matches);
|
||||
expect(typed.seed_matches).toEqual([
|
||||
{
|
||||
node_id: graph.nodes[0]?.node_id,
|
||||
kind: "context-bridge-api",
|
||||
basis: "property",
|
||||
field: "observations[0].properties.members[1]",
|
||||
},
|
||||
]);
|
||||
expect(typed.graph?.nodes).toEqual(graph.nodes);
|
||||
expect(typed.graph?.edges).toEqual([]);
|
||||
expect(typed.evidence_links).toEqual([sourceEvidenceId]);
|
||||
expect(typed.summary).toMatchObject({
|
||||
matched_seeds: 1,
|
||||
traced_nodes: 1,
|
||||
traced_edges: 0,
|
||||
observed_facts: 1,
|
||||
inferred_facts: 0,
|
||||
unknown_facts: 0,
|
||||
unavailable_facts: 0,
|
||||
});
|
||||
expect(typed.native_handoffs).toEqual([]);
|
||||
expect(graph).toEqual(before);
|
||||
});
|
||||
|
||||
it("keeps a missing member explicit without changing source coverage", () => {
|
||||
const graph = contextBridgeGraph();
|
||||
|
||||
Reference in New Issue
Block a user