feat(core): schema v2 — instance nodes, evidence, confidence, query envelopes#2
Merged
Merged
Conversation
…nvelopes Step 0.1 (TRACKER). Addresses C1/D2 schema halves, A5, B5 foundations: - InstanceNode: one per JSX call site (id instance:<file>:<line>#<Name>), wired owner --renders--> instance --instance-of--> definition; staticProps captured. parentInstanceId lands with the Phase 2.1 instance tree. - Evidence + Confidence types; QueryResult<T> envelope with ok/ambiguous/ declined — no query API returns a bare value. matchComponentsByText returns ambiguous + disambiguation question on ties, declined(no-signal) on misses; traceLineage accepts definition or instance ids and walks through instances. - EdgeCondition (flag/role/branch/response) + via on edges; GraphMeta stub; graph version bumped to 2. - vitest wired into core + parser-react: 18 tests (envelope invariants, tie/ decline behavior, instance emission on the demo app, transitive trace). - CLI prints confidence, evidence, instance call sites. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TRACKER Step 0.1 — the schema rework everything else builds on. Fixes the v0.1 design flaw where the graph only had definition nodes, which makes per-call-site API attribution (failure mode C1, the headline case) structurally impossible.
Changes
instance:<file>:<line>#<Name>), withstaticPropscaptured. Parser emits one per project-component JSX usage, wiredowner --renders--> instance --instance-of--> definition.parentInstanceIdstays null until the Phase 2.1 cross-file instance tree.Evidence[]+Confidence, or an honestambiguous(with a generated disambiguation question) /declined(with a machine-readable reason).matchComponentsByText: ties →ambiguous, no hits →declined("no-signal")traceLineage: accepts definition or instance ids, walks through instances,declined("not-found"/"invalid-target")on bad targetsflag/role/branch/response) andviaon edges (B5/G5 foundations);GraphMetastub for SHA tagging (0.3); graphversion: 2.Acceptance criteria (from TRACKER 0.1)
UserCard: 1 definition + 1 instance (rendered byUserList)matchComponentsByText/traceLineagereturnQueryResultenvelopesTest plan
pnpm buildgreen (strict TS, all packages)pnpm test— 18/18 passingDocumentation
TRACKER.md— 0.1 marked done, Status block advanced to 0.2🤖 Generated with Claude Code