feat: prop-flow — per-instance data attribution (C1, the headline case)#14
Merged
Merged
Conversation
Step 2.2 (TRACKER). THE step this project exists for: - resolvePropFlow: every instance's expression props trace back to the data populating them in the parent scope, emitting data-source --provides-data--> instance edges (via: propName). Origins: useState pairs (setter call sites → data-source in the same statement), direct results (useQuery/useApi, incl. await/as-cast wrapping), project-hook results (hook's fetches-from edges), and simple derivations (data ?? [], raw.items) — depth-capped. - traceLineage: instance traces include incoming provides-data sources; definition traces return a perInstance breakdown, NEVER merged — merging is exactly the C1 poison. - c1-shared-datatable expectedFail markers removed (the xfail→green ritual): DataTable@UsersPage → /api/users only; @InvoicesPage → /api/invoices only. - New fixture c1-prop-variants (react-query result prop through ?? [], custom-hook result prop) with cross-page poison assertions. - Scorecard: 108 pass / 0 fail / 0 xfail; precision 1.000, recall 1.000 (was 0.895), match accuracy 1.000. Thresholds ratcheted to 0.95/0.95. 77 unit tests. Milestone M2 achieved. 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 2.2 — the step this project exists for. The same
<DataTable>component on two pages now reports two different APIs, correctly, per call site:How
resolvePropFlowtraces every instance's expression props to the data populating them in the parent scope, emittingdata-source --provides-data--> instanceedges tagged with the prop name. Origins handled (depth-capped):const [rows, setRows] = useState()→ everysetRowscall site → the data-source call in the same statement (fetch("/api/users").then(…).then(setRows))const { data } = useQuery(...),const r = useApi("/x"), includingawait/as-cast wrappingconst { members } = useMembers()→ the hook's ownfetches-fromedgesdata ?? [],raw.items→ recurse on the underlying identifiertraceLineagenow includes incomingprovides-datasources for instance traces; definition-level traces return aperInstancebreakdown, never merged — merging is exactly the C1 poison the fixtures forbid.The xfail → green ritual
The two
expectedFailmarkers that have gated the scorecard since step 0.2 are removed in this PR — the eval harness forced the removal by reportingunexpected-pass, exactly as designed. Recall jumps 0.895 → 1.000.c1-prop-variants(react-query + hook-result props) with cross-page poison assertions.Test plan
pnpm evalgate OKDocumentation
TRACKER.md— 2.2 done (milestone M2), Status → 2.3🤖 Generated with Claude Code