Skip to content

feat: structural scout platform + search determinism fixes (clean port onto main)#169

Open
jahala wants to merge 3 commits into
mainfrom
feat/scout-on-main
Open

feat: structural scout platform + search determinism fixes (clean port onto main)#169
jahala wants to merge 3 commits into
mainfrom
feat/scout-on-main

Conversation

@jahala

@jahala jahala commented Jul 2, 2026

Copy link
Copy Markdown
Owner

What

A clean port of the validated scout line onto main — three commits, rebuilt from main tip rather than merged from the integration workbench:

  • Scout platform (048e8e3): optional local-inference layer (src/infer/, Cargo feature infer, zero default-build weight), tilth scout CLI (--job context|rerank, --warm, --hook), reactive tilth_scout MCP tool, tilth model pull, trimmed locate core (the footer/git-fusion experiments are deliberately left behind), TILTH_NO_* bisect kill-switches, determinism fixes (deterministic tilth_files, sorted blast radii, no volatile bytes in MCP results), size-independent embed index (.gitignore-aware walker, on-demand pool embedding, warm-only union, format-versioned cache), CoreML compiled-model cache (fixes the $TMPDIR leak).
  • Search determinism + honest disclosure (d67fc1b): removes the racy early-quit in all three parallel search walkers — identical searches previously returned different match sets run-to-run, and capped regex/content results could silently read as complete. Walks now complete, results are byte-deterministic, headers disclose "N of M matches".
  • Instruction lines (9127759): restores the two measured steering lines (grok for call-chains; batching for multi-symbol/multi-section calls) with updated byte-lock tests.

Receipts

  • A/B (main tip vs this branch, Haiku, 15 tasks × 3 reps/arm): −3.1% cost-per-correct, accuracy identical 45/45 — verdict LAND (do-no-harm gate for the platform; the win is lineage hygiene + determinism).
  • Scout deep-trace A/B (150 runs): hook payload delivery 75/75 correct anchors, 0 stray fires, accuracy unchanged — the tool is safe; the hook remains opt-in (tilth install --with-scout) pending the re-aimed value test.
  • Gates: full test suite green, clippy -D warnings clean, fmt --check clean; MCP fire-map verified on the release --features infer build.

Not in this PR

No version bump (release PR comes separately per the release workflow). No footer (measured net-negative; not ported). No hook-by-default. Follow-up branches stack on this and arrive as separate PRs: grok qualified-name resolver, language-coverage fixes (Ruby/C/C++/Go), response-format v2.

🤖 Generated with Claude Code

jahala and others added 3 commits July 2, 2026 01:17
… integration line

Deliberate port-not-merge: the integration workbench accumulated multiple
experiment lines (footer variants, git-fusion ranking, a transitive trace
tool — all A/B-losers or unvalidated); this branch rebuilds only the wanted
work directly on main.

Ported:
- Local-inference layer (src/infer: CoreML-backed reranker + embedder,
  compiled-model cache, format-versioned embed index, on-demand pool scoring,
  size-independent queries, explicit --warm) behind the `infer` feature;
  `tilth model pull` (+optional model-pull-http).
- The scout pipeline in lib.rs: locate ∪ embed-recall pool, noise filter,
  rrf(CE, embed) on flattened symbol texts, ce1_winner gate, grok trace
  skeleton; CLI `tilth scout` (+--hook, --warm), `tilth_scout` MCP tool,
  `install --with-scout` (absolute hook path + timeout).
- A trimmed locate core (density ranking, symbol ranking, test/nav-noise
  classifiers) — the footer engine, git-fusion, and their A/B-losing variants
  are deliberately NOT ported.
- Bisect kill-switches (TILTH_NO_RDALLOC/QTRUNC/OGATE/THINWRAP) with
  race-free env helper + old-behavior tests.
- Determinism fixes: tilth_files collect-sort-cap (selection was
  thread-timing dependent), blast-radius caller ordering, volatile timing
  stripped from MCP scout results.

Verified: 583+ tests green, clippy clean (default + infer), release fire-map
matches the validated workbench behavior (deepchain/kong/comrak fire with
correct anchors; easy prompts silent; hook emits skeleton-only or nothing),
tilth_files byte-deterministic across runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…osure

The parallel search walkers (symbol, content/regex, batch callers) quit on a
racy shared counter, making the discovered match SET thread-timing dependent:
identical calls returned different totals and different displayed matches
(observed: 6 distinct outputs over 8 identical runs), and a regex search
silently surfaced matches from 1 file when 12 contained them — the walk quit
before reaching the rest, and the result read as complete.

- Remove the early-quit from all three walkers: the walk always completes,
  per-file work is already bounded (size caps, minified skips, bloom
  prefilter), and ranking + display caps apply deterministically after the
  walk. Common-token searches remain fast (~40 ms on this repo).
- Keep the callers exists-check quit (boolean outcome — order-independent).
- Honest rendering: the search header now says "N of M matches" whenever the
  display cap bit, and content/regex results (which carry no per-facet
  totals) emit the global "... and K more matches" tail on the faceted path.

Failing-tests-first: completeness (a file beyond the old quit threshold must
be counted), run-to-run determinism, and rendered disclosure — all red on the
old code, green now.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The k configuration — the first to beat the native-tool baseline — carried
two instruction lines with measured effect (grok adoption 57%→78% on trace
tasks) that never landed in the prompts lineage: the tilth_grok call-chain
steering and the multi-symbol/multi-section batching directive. Both are now
in mcp-base.md, byte-locked so they cannot silently drift out again, and
AGENTS.md is regenerated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant