feat(parser-react): endpoint resolution — constant folding, route patterns, base-URL stripping#7
Merged
officialCodeWork merged 1 commit intoJul 13, 2026
Conversation
…terns, base-URL stripping
Step 1.1 (TRACKER). Failure modes C2 (constants half), C3:
- resolveEndpoint/resolveStringValue: cross-file constant folding via
go-to-definition (named constants, ENDPOINTS.X object members, + concat,
as/satisfies unwrap, depth-capped), template literals with unknown parts
normalized to :param placeholders (/api/users/${user.id} → /api/users/:id),
configured baseUrls stripped from resolved endpoints.
- DataSourceNode gains raw (source text) + resolved (full|partial|none);
endpoint is now the canonical pattern — the cross-graph join key.
- Fixtures c2-endpoint-constants (object member / named const / concat) and
c3-dynamic-endpoints (dynamic id + dynamic resource segment), both with
<dynamic>-collapse forbidden assertions.
- Thresholds ratcheted: minLineagePrecision 0.9, minLineageRecall 0.8.
Scorecard: 38 pass / 0 fail / 2 xfail; precision 1.000, recall 0.833
(was 0.714), match accuracy 1.000. 33 unit tests.
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 1.1 — the parser starts surviving real code. Real codebases don't call
fetch("/api/users")inline; endpoints hide behind constants, object maps, concatenation, and template literals.What resolves now
fetch(ENDPOINTS.USERS)(declared in another file)/api/usersfullfetch(HEALTH_URL)/api/healthfullfetch(API_PREFIX + "/reports")/api/reportsfullfetch(`/api/orders/${orderId}`)/api/orders/:orderIdpartialfetch(`/api/${entity}/list`)/api/:entity/listpartialfetch(buildUrl())<dynamic>noneDataSourceNodegainsraw+resolved—endpointis now the canonical pattern (constants folded,:paramplaceholders), which is the value attribution matches on and the future cross-graph join key (G6).rawpreserves the source expression for evidence.baseUrlsscan option strips environment prefixes so graphs stay environment-independent.Eval movement
c2-endpoint-constants,c3-dynamic-endpoints, each with a forbidden assertion that the endpoint must never collapse to<dynamic>(the regression poison for this feature).minLineagePrecision: 0.9,minLineageRecall: 0.8.Test plan
pnpm evalgate OK; demo-app golden updated to pattern form (/api/users/:id)Documentation
TRACKER.md— 1.1 done, Gate 0 recorded (CI green + red-path on ci: Gate 0 pipeline — build, typecheck, tests, eval gate, scorecard artifact #5/[throwaway] CI red-path check — do not merge #6), Status → 1.2🤖 Generated with Claude Code