Garry Tan and Claude Opus 4.7
0a94216397
feat(v0.34 W0c): within-file two-pass symbol resolver + edges_backfilled_at watermark
...
Codex's outside-voice review caught that the v0.20.0 graph stores BARE
callee tokens (`render`, `find`, `execute`) — not qualified names. Pre-v0.34
recursive blast/flow would alias every same-named function across classes.
W0c is the foundation that fixes this: resolve `code_edges_symbol` rows by
matching `to_symbol_qualified` against the SAME-FILE chunks'
`symbol_name_qualified`, then write the outcome to `edge_metadata`.
This commit is the resolver primitive + schema. The cycle-phase wiring
that calls it on every quick-cycle tick lands in the next commit.
Schema (v51 migration `edges_backfilled_at_v0_34`):
* `content_chunks.edges_backfilled_at TIMESTAMPTZ` — resume watermark.
Chunks where the column is NULL OR older than EDGE_EXTRACTOR_VERSION_TS
get re-walked next tick. SIGINT/OOM/sleep mid-backfill loses at most
one batch.
* Indexes per D11 from eng review:
- `idx_code_edges_symbol_resolver(source_id, to_symbol_qualified)` —
composite for the resolver's per-source lookup.
- `idx_content_chunks_symbol_lookup(page_id, symbol_name_qualified)`
WHERE `symbol_name_qualified IS NOT NULL` — file-batched candidate
fetch; also reused by W4-5 cluster recompute.
- `idx_content_chunks_edges_backfill(edges_backfilled_at)` WHERE
`edges_backfilled_at IS NULL` — fast unresumed-row scan.
Module (`src/core/chunkers/symbol-resolver.ts`):
* `resolveSymbolEdgesIncremental(engine, {sourceId, maxChunks?, onProgress?})`
walks stale chunks in 200-chunk batches. For each chunk, loads its
unresolved edges, finds same-page candidates by symbol_name_qualified,
and writes outcome to `edge_metadata`:
- exactly 1 candidate → `{resolved_chunk_id: <id>}`
- 2+ candidates → `{ambiguous: true, candidates: [...]}`
- 0 candidates → unchanged (cross-file; two-pass.ts handles those)
Each batch bumps `edges_backfilled_at = NOW()` for the chunks.
* `readEdgeResolution(metadata)` — public helper for downstream code
(two-pass.ts, code_blast op, eval-capture) to consume the resolver's
output without parsing JSON directly. Returns a tagged union.
* `EDGE_EXTRACTOR_VERSION_TS` exported constant — bump when extractor
shape changes and the next cycle re-walks all chunks.
Tests (5 E2E in test/e2e/symbol-resolver-pglite.test.ts, all PGLite,
no DATABASE_URL): unambiguous match, ambiguous multi-match, no match,
watermark advance + idempotency, source isolation (no cross-source
candidate leak).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-11 12:34:43 -07:00
..
2026-05-10 20:50:40 -07:00
2026-04-25 12:25:34 -07:00
2026-05-09 16:57:47 -07:00
2026-05-11 12:34:43 -07:00
2026-05-10 12:49:14 -07:00
2026-05-04 12:59:52 -07:00
2026-05-10 11:28:01 -07:00
2026-05-10 20:06:31 -07:00
2026-04-29 23:46:36 -07:00
2026-05-07 21:52:58 -07:00
2026-05-10 20:06:31 -07:00
2026-05-09 16:57:47 -07:00
2026-05-02 08:41:11 -07:00
2026-05-06 21:14:34 -07:00
2026-04-18 16:57:38 +08:00
2026-04-21 18:35:45 -07:00
2026-05-08 13:25:48 -07:00
2026-05-08 13:25:48 -07:00
2026-04-11 21:25:44 -10:00
2026-04-14 19:41:34 -10:00
2026-04-22 01:34:22 -07:00
2026-04-20 07:30:00 +08:00
2026-04-20 07:30:00 +08:00
2026-05-07 21:52:58 -07:00
2026-05-02 08:41:11 -07:00
2026-04-30 20:47:32 -07:00
2026-05-07 21:52:58 -07:00
2026-05-10 20:50:40 -07:00
2026-05-02 22:01:05 -07:00
2026-04-20 23:14:38 +08:00
2026-04-29 10:12:10 -07:00
2026-05-10 20:06:31 -07:00
2026-04-21 11:51:32 -07:00
2026-04-25 12:25:34 -07:00
2026-05-10 13:20:07 -07:00
2026-05-02 08:41:11 -07:00
2026-04-09 12:25:04 -10:00
2026-04-25 12:25:34 -07:00
2026-05-09 21:18:53 -07:00
2026-04-25 12:25:34 -07:00
2026-04-29 23:46:36 -07:00
2026-05-09 19:47:56 -07:00
2026-05-07 13:41:46 -07:00
2026-05-09 19:47:56 -07:00
2026-05-02 08:41:11 -07:00
2026-05-07 10:03:38 -07:00
2026-05-09 20:46:34 -07:00
2026-04-25 12:25:34 -07:00
2026-04-25 12:25:34 -07:00
2026-04-25 12:25:34 -07:00
2026-05-11 12:19:14 -07:00
2026-05-09 22:58:19 -07:00
2026-04-06 16:50:15 -07:00
2026-05-08 13:25:48 -07:00
2026-04-26 15:49:48 -07:00
2026-05-06 20:39:56 -07:00
2026-05-06 20:39:56 -07:00
2026-05-06 20:39:56 -07:00
2026-04-29 22:13:05 -07:00
2026-05-09 16:57:47 -07:00
2026-04-30 01:23:29 -07:00
2026-05-08 17:07:51 -07:00
2026-05-09 20:46:34 -07:00
2026-05-09 20:46:34 -07:00
2026-05-09 20:46:34 -07:00
2026-04-14 19:41:34 -10:00
2026-05-08 13:25:48 -07:00
2026-04-22 16:24:23 -07:00
2026-05-03 20:41:39 -07:00
2026-04-29 22:21:07 -07:00
2026-04-20 21:54:36 +08:00
2026-04-26 15:49:48 -07:00
2026-05-10 18:59:11 -07:00
2026-05-07 22:56:22 -07:00
2026-05-10 13:33:05 -07:00
2026-04-30 01:23:29 -07:00
2026-05-02 22:01:05 -07:00
2026-04-20 21:54:36 +08:00
2026-04-25 12:25:34 -07:00
2026-05-07 21:52:58 -07:00
2026-05-04 12:59:52 -07:00
2026-05-06 20:58:19 -07:00
2026-05-07 21:52:58 -07:00
2026-04-11 00:01:09 -10:00
2026-05-07 10:03:38 -07:00
2026-05-10 06:34:40 -07:00
2026-04-14 19:41:34 -10:00
2026-04-20 07:30:00 +08:00
2026-04-25 12:25:34 -07:00
2026-05-01 09:02:43 -07:00
2026-05-01 09:02:43 -07:00
2026-05-01 09:02:43 -07:00
2026-05-01 09:02:43 -07:00
2026-05-07 19:49:46 -07:00
2026-05-01 09:02:43 -07:00
2026-05-01 09:02:43 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 06:34:40 -07:00
2026-04-13 21:03:40 -10:00
2026-05-02 22:01:05 -07:00
2026-05-09 20:46:34 -07:00
2026-04-29 10:12:10 -07:00
2026-05-10 06:34:40 -07:00
2026-05-06 21:14:34 -07:00
2026-05-09 20:46:34 -07:00
2026-05-10 12:49:14 -07:00
2026-05-09 16:57:47 -07:00
2026-05-09 16:57:47 -07:00
2026-05-10 12:49:14 -07:00
2026-05-10 12:49:14 -07:00
2026-05-09 16:57:47 -07:00
2026-05-10 12:49:14 -07:00
2026-05-09 16:57:47 -07:00
2026-05-10 12:49:14 -07:00
2026-05-09 16:57:47 -07:00
2026-05-10 12:49:14 -07:00
2026-05-10 12:49:14 -07:00
2026-05-10 20:06:31 -07:00
2026-05-10 12:49:14 -07:00
2026-05-10 12:49:14 -07:00
2026-05-09 16:57:47 -07:00
2026-05-09 16:57:47 -07:00
2026-05-09 16:57:47 -07:00
2026-05-09 16:57:47 -07:00
2026-05-09 16:57:47 -07:00
2026-05-09 16:57:47 -07:00
2026-05-09 16:57:47 -07:00
2026-05-09 16:57:47 -07:00
2026-04-20 07:30:00 +08:00
2026-04-14 21:40:48 -10:00
2026-04-25 12:25:34 -07:00
2026-04-09 10:17:13 -07:00
2026-04-13 07:49:13 -10:00
2026-04-16 23:03:15 -07:00
2026-04-13 07:49:13 -10:00
2026-04-23 19:34:27 -07:00
2026-04-29 23:46:36 -07:00
2026-04-29 23:46:36 -07:00
2026-04-26 20:45:05 -07:00
2026-04-29 23:26:25 -07:00
2026-04-26 20:45:05 -07:00
2026-04-29 23:46:36 -07:00
2026-05-09 19:47:56 -07:00
2026-05-06 21:14:34 -07:00
2026-04-18 18:16:18 +08:00
2026-04-29 22:13:05 -07:00
2026-05-09 22:58:19 -07:00
2026-05-01 09:02:43 -07:00
2026-04-19 07:14:24 +08:00
2026-05-07 10:03:38 -07:00
2026-04-09 10:17:13 -07:00
2026-04-12 07:48:47 -10:00
2026-04-25 12:25:34 -07:00
2026-05-07 22:56:22 -07:00
2026-04-18 16:57:38 +08:00
2026-04-16 23:03:15 -07:00
2026-04-22 01:34:22 -07:00
2026-04-25 12:25:34 -07:00
2026-04-25 12:25:34 -07:00
2026-05-07 10:03:38 -07:00
2026-04-26 20:45:05 -07:00
2026-04-11 21:25:44 -10:00
2026-05-07 13:41:46 -07:00
2026-05-07 19:49:46 -07:00
2026-04-26 20:45:05 -07:00
2026-04-24 00:08:54 -07:00
2026-05-09 19:47:56 -07:00
2026-05-07 22:56:22 -07:00
2026-05-04 21:11:15 -07:00
2026-05-01 09:02:43 -07:00
2026-04-21 21:14:17 -07:00
2026-05-08 13:25:48 -07:00
2026-05-10 06:34:40 -07:00
2026-04-26 20:45:05 -07:00
2026-05-10 12:49:14 -07:00
2026-05-09 20:46:34 -07:00
2026-05-09 20:46:34 -07:00
2026-04-18 16:57:38 +08:00
2026-04-18 16:57:38 +08:00
2026-04-18 18:16:18 +08:00
2026-04-19 07:14:24 +08:00
2026-04-22 01:34:22 -07:00
2026-04-20 07:30:00 +08:00
2026-04-29 23:46:36 -07:00
2026-04-22 01:34:22 -07:00
2026-04-25 12:25:34 -07:00
2026-04-25 12:25:34 -07:00
2026-04-26 20:45:05 -07:00
2026-05-07 10:03:38 -07:00
2026-05-10 06:34:40 -07:00
2026-04-22 01:34:22 -07:00
2026-04-24 01:09:28 -07:00
2026-04-29 23:06:16 -07:00
2026-05-10 20:06:31 -07:00
2026-05-02 22:01:05 -07:00
2026-05-02 22:01:05 -07:00
2026-05-10 13:33:05 -07:00
2026-05-03 20:41:39 -07:00
2026-05-10 12:49:14 -07:00
2026-05-09 19:47:56 -07:00
2026-05-09 20:46:34 -07:00
2026-04-30 01:23:29 -07:00
2026-05-07 21:52:58 -07:00
2026-05-02 22:01:05 -07:00
2026-05-06 21:14:34 -07:00
2026-05-07 10:03:38 -07:00
2026-05-03 20:41:39 -07:00
2026-04-25 12:25:34 -07:00
2026-04-08 23:26:11 -10:00
2026-05-09 20:46:34 -07:00
2026-04-29 22:21:07 -07:00
2026-04-12 17:38:48 -07:00
2026-04-23 19:34:27 -07:00
2026-05-02 08:41:11 -07:00
2026-04-20 07:30:00 +08:00
2026-04-21 18:35:45 -07:00
2026-05-09 20:46:34 -07:00
2026-05-03 20:16:15 -07:00
2026-04-29 23:46:36 -07:00
2026-04-30 20:47:32 -07:00
2026-05-01 09:02:43 -07:00
2026-04-12 13:23:55 -10:00
2026-04-21 21:14:17 -07:00
2026-04-25 12:25:34 -07:00
2026-05-07 10:03:38 -07:00
2026-05-07 21:52:58 -07:00
2026-05-07 21:52:58 -07:00
2026-04-16 23:03:15 -07:00
2026-04-22 01:34:22 -07:00
2026-04-22 01:34:22 -07:00
2026-05-07 21:52:58 -07:00
2026-05-07 21:52:58 -07:00
2026-05-03 20:16:15 -07:00
2026-04-23 19:34:27 -07:00
2026-04-25 12:25:34 -07:00
2026-04-19 07:14:24 +08:00
2026-05-10 13:20:07 -07:00
2026-04-11 21:25:44 -10:00
2026-04-25 12:25:34 -07:00
2026-04-21 18:35:45 -07:00
2026-05-10 13:20:07 -07:00
2026-04-24 01:39:58 -07:00
2026-04-22 01:34:22 -07:00
2026-05-06 16:32:11 -07:00
2026-05-08 13:25:48 -07:00
2026-04-30 23:17:54 -07:00
2026-04-23 19:34:27 -07:00
2026-05-07 21:52:58 -07:00
2026-04-29 23:46:36 -07:00
2026-05-10 12:49:14 -07:00
2026-04-27 22:59:08 -07:00
2026-05-06 21:14:34 -07:00
2026-05-07 10:03:38 -07:00
2026-04-25 12:25:34 -07:00
2026-04-16 23:03:15 -07:00
2026-04-18 18:16:18 +08:00
2026-04-29 23:46:36 -07:00
2026-04-30 20:47:32 -07:00
2026-05-07 13:17:27 -07:00
2026-05-09 22:58:19 -07:00
2026-04-09 10:17:13 -07:00
2026-04-23 19:34:27 -07:00
2026-04-22 02:07:00 -07:00
2026-05-06 20:39:56 -07:00
2026-04-18 16:57:38 +08:00
2026-04-30 23:17:54 -07:00
2026-04-23 19:34:27 -07:00
2026-05-02 08:41:11 -07:00
2026-04-14 19:41:34 -10:00
2026-04-11 10:52:30 -10:00
2026-05-10 13:33:05 -07:00
2026-04-29 22:21:07 -07:00
2026-05-06 21:14:34 -07:00
2026-05-06 21:14:34 -07:00
2026-05-06 21:14:34 -07:00
2026-04-22 16:24:23 -07:00
2026-05-06 11:54:06 -07:00
2026-05-09 22:58:19 -07:00
2026-05-03 20:41:39 -07:00
2026-04-22 16:24:23 -07:00
2026-04-29 22:21:07 -07:00
2026-04-29 22:21:07 -07:00
2026-04-29 22:21:07 -07:00
2026-04-29 22:21:07 -07:00
2026-04-29 22:21:07 -07:00
2026-04-13 07:49:13 -10:00
2026-04-21 21:14:17 -07:00
2026-04-21 21:14:17 -07:00
2026-04-22 01:34:22 -07:00
2026-05-08 17:07:51 -07:00
2026-04-22 01:34:22 -07:00
2026-04-09 10:17:13 -07:00
2026-05-06 11:54:06 -07:00
2026-04-29 23:06:16 -07:00
2026-04-25 12:25:34 -07:00
2026-04-29 22:53:41 -07:00
2026-04-25 12:25:34 -07:00
2026-05-09 20:46:34 -07:00
2026-04-29 22:53:41 -07:00
2026-04-25 12:25:34 -07:00
2026-05-09 21:18:53 -07:00
2026-05-09 20:46:34 -07:00
2026-05-10 06:34:40 -07:00
2026-05-07 23:07:00 -07:00
2026-05-09 20:46:34 -07:00
2026-05-07 23:07:00 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 06:34:40 -07:00
2026-05-09 20:46:34 -07:00
2026-05-07 23:07:00 -07:00
2026-05-10 06:34:40 -07:00
2026-05-10 18:59:11 -07:00
2026-05-06 21:14:34 -07:00
2026-04-29 23:46:36 -07:00
2026-04-14 19:41:34 -10:00
2026-05-07 21:52:58 -07:00
2026-04-20 23:14:38 +08:00
2026-05-04 21:11:15 -07:00
2026-04-25 12:25:34 -07:00
2026-05-08 13:25:48 -07:00
2026-05-09 20:46:34 -07:00
2026-05-08 13:25:48 -07:00
2026-04-19 18:23:02 +08:00
2026-05-07 21:52:58 -07:00
2026-05-08 13:25:48 -07:00
2026-05-07 13:41:46 -07:00
2026-05-10 13:33:05 -07:00
2026-04-22 01:34:22 -07:00
2026-05-06 21:14:34 -07:00
2026-05-06 11:54:06 -07:00
2026-04-20 07:30:00 +08:00
2026-04-09 10:17:13 -07:00
2026-05-06 11:54:06 -07:00