Repository navigation
refactor(dispatch): replace the code outline database with dispatch-time file checks - #6776
Conversation
…ime file checks
Owner decision 2026-11-24: agents search files on demand, so the outline
("skeleton") database goes. Its data was a month stale, and autoscan ran
`git diff` and `git ls-files` every 30 s per repository.
Each consumer now reads the files a task names, at dispatch or gate time,
through src/lib/repo-files/lookup.ts:
- `git ls-files`, cached per repository until HEAD or the index changes
- line counts and export lines read from the files
- one `git grep` (PCRE, ERE fallback) for importers
- async and time-bounded (2 s); never on a timer
Consumers:
- overlap hold: predicted files come from the tracked-path list; a single
queued task is now also held against a running task naming the same file
- read budget, edge-case sites: the targets' own imports and their importers;
each runs once per task and file list, not on every headless tick
- preservation envelope and file-size guard: line counts and exports of the
named files (file-level mentions only)
- merge gate: line counts of changed files at the base branch, one
`git cat-file --batch`
Removed: src/lib/skeleton (scanner, store, autoscan, renderer), the scans on
repo add, clone, create, repoint, open and bootstrap, /api/panel/skeleton,
the Targets panel route with src/lib/targeting and the `o8_targets` MCP tool,
and the Code Map in the chat system prompt (it now uses the file tree it
already fell back to). Database tables stay on disk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔍 PR Review Bot
|
… default The queue ran require-approval-merge and implementation-notes for the first time since #6185 made new projects PR-first; a hosted baseline on main fails the same 22 cases (run 45530887277). The require-approval fixtures now opt the default project into direct integration, and the worker-notes case asserts its subject (no diff-budget blocker) instead of a merge the PR-first and durable-review gates hold. One slow spoken-review merge case gets 60 s. Also pins that a missed or timed-out base line-count lookup gives the merge gate no count, so no budget, as an outline-database miss did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Queue failure (run 45529692712) was main drift, not the merge gate: a hosted baseline of main's code with only a comment changed (#6777, run 45530887277, job 138925612348) failed the same 21 require-approval-merge cases and the implementation-notes case. Merges were refused with |
The queue's Linux runner finished `git cat-file` inside the 1 ms floor that a spent deadline still got, so the merge gate received a correct line count from a lookup that should not have run. A spent deadline now returns no facts before Git starts, for both the batch reader and plain Git reads. The test forces each miss deterministically (absent ref, missing repository, spent deadline with a cleared path cache) and checks the same read with time left does count the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner decision 2026-11-24 (item 16): replace the code outline ("skeleton") database with checks run at dispatch or gate time. The data was a month stale, and autoscan ran
git diffandgit ls-filesevery 30 s per repository.New:
src/lib/repo-files/lookup.tsEvery check runs only for the files a task names, when the task is dispatched or the lane reaches the merge gate:
git ls-files, cached per repository until HEAD or the Git index changes (key: HEAD contents plus index inode, size and mtime).exportlines, read from the files (at most 64 files, 2 MB each).git grep -ofor importers. PCRE is tried first, with ERE as the fallback; each match is resolved back to a path, so a shared basename does not count as an importer.git cat-file --batch.Consumers
computePredictedFiles/filterOverlappingPackets)o8_targetsMCP toolsrc/lib/llm/context.ts/api/v2/proxy/llm, which the phone's action route uses). The section rendered the whole-repo symbol map, which has no cheap fresh replacement, so the prompt now always uses the file tree it already fell back to.Read budget and edge-case checks run once per task and file list, so the 10 s headless tick does not search the repository again for a queued task that found nothing.
Cost (o8 repo, 10,026 tracked files, median of 5)
git grep75 ms, file reads 1–2 ms, cached path list 0.3 ms).skeleton-autoscanloop (git diffplusgit ls-filesevery 30 s per registered repository), the scans on repo add, clone, create, repoint, open and bootstrap, and about 1,800 outline lines loaded at server startup.Removed
src/lib/skeleton(scanner, parser, store, renderer, chunker, import graph, autoscan),/api/panel/skeleton,/api/panel/targetswithsrc/lib/targetingand theo8_targetsMCP tool. Tables stay on disk.Tests
tests/dispatch-file-checks-real-path.test.ts, run against a real Git repo:merge-gate.test.tspasses without a pre-scan.delegate-dispatch-mergecases and onews-work-soakcase. They are already recorded there as failing on main; I removed their skeleton seeding, so the queue will select these files.typecheck:fast, lint, hermetic units, the nine enumerating suites and the focused dispatch tests pass. In verify:ci's changed-file integration run,require-approval-merge(21 cases) and oneimplementation-notescase fail locally with "the current application CLI could not be built or verified". They fail the same way on main in this checkout.🤖 Generated with Claude Code