# v3.19.3 — complete codebase ingest (pagination, stride, dedup, wiki pages)

Third entry in the 3.19.x ingest-reliability series. 3.19.1 stopped the stdio
deadlock; 3.19.2 stopped stale-graph reuse; this release stops the *silent
truncation* that made every ingest incomplete even when it succeeded.

## What it fixes

Four verified wiring bugs between Cortex and automatised-pipeline ≥0.4.0
(RCA 2026-06-11) truncated every `ingest_codebase` run:

1. **Byte-budget pagination ignored.** Upstream pages `query_graph` responses
   (`truncated` + `next_offset`); `_run_query` read only the first page, so
   `iter_call_edges`'s `len(rows) < page_size` end-check fired mid-stream —
   only ~887 of 4 669 call edges landed per run. `_run_query` now drains the
   cursor, with a non-advancing-cursor guard.
2. **`LIMIT 500` injection capped LIMIT-less queries.** `fetch_files` sent no
   LIMIT, so upstream injected `LIMIT 500` — 500 of 1 233 files, forever.
   It now pages with explicit SKIP/LIMIT. Dead `fetch_top_symbols` (same
   flaw, zero callers) removed.
3. **Symbol page stride mismatch.** `_ingest_entities` advanced its offset by
   `page_size` while each per-label query consumed only `page_size // 3` rows,
   skipping the rows in between (≈2 000 of 3 645 Functions). New
   `symbol_page_stride()` keeps LIMIT and stride in one function.
4. **Process wiki pages keyed on fields that never existed.** The renderer
   read `symbols`/`symbol_count`/`bfs_depth`; `get_processes` emits
   `node_count`/`depth`. Every process counted 0 symbols and **zero** codebase
   wiki pages were ever written. The reader now follows the verified contract,
   the process list paginates, and pages are enriched with real participating
   symbols via `ParticipatesIn_<Label>_Process` edges.

Plus: entity dedup was **domain-blind** (a symbol name seen in ANY domain
blocked inserts under every other domain, crediting all code entities to the
first domain ever ingested). Dedup now scopes to `(LOWER(name), domain)`;
edge endpoint JOINs scope to the same domain and compare against
`LOWER(domain)` to match the `normalize_domain()` trigger. The response now
reports true `entities_written` (sink inserts) alongside `entities_seen`.

## Verified result

A force-reindexed run on the Cortex repo itself now lands **8 106 symbols +
1 234 files (9 340 entities, exact conservation), 11 680 call + 6 414
containment edges, and 572 process wiki pages** under `reference/codebase/` —
vs. ~2 110 symbols / 500 files / 0 wiki pages before.

## Recovering from earlier truncated ingests

Earlier runs left partial, possibly wrongly-domained data. Re-ingest cleanly:

```
ingest_codebase(project_path="<repo>", force_reindex=true)
```

Stale entities credited to old version-domains (e.g. `code:3.18.4`) can be
purged; the re-ingest writes the complete set under the project domain.
