Repository navigation
Train R: identifier probe, find/stats --by, explain-target JSON, phrase factor (opt-in), harness-check, docs, embedded-core W1 guardrails - #8148
Merged
Conversation
…7192) --explain-target with --json prints { results, explain_target } with the fix rendered as a command; probe detects a page with no vectors (target_not_embedded) unless the semantic arm was off on the call; a target folded into a kept row reports target_collapsed; target_beyond_limit names each arm's rank; target_not_retrieved names arms that failed on the call; every retry fix carries argv. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # src/cli/main.ts # src/core/ops/search.ts
… [--since] [--collapse-aliases] (#7191) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ndpages-and Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # scripts/module-size-limits.tsv # test/fixtures/goldens/cli/tools-json.json
…ndpages-and Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # test/fixtures/goldens/cli/tools-json.json
…eled, as list_pages), the coverage ledger, the source-isolation matrix and the remote redaction sweep (#7191) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ndpages-and Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # scripts/module-size-limits.tsv # skills/skills.lock.json
…-first.md, copied into AGENTS.md, INSTALL_FOR_AGENTS.md, RESOLVER.md and the bootstrap AGENTS template by scripts/build-lookup-table.ts (regen:all); every row run on a scratch brain (#7191) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ndpages-and Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # scripts/module-size-limits.tsv
…ndpages-and Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # scripts/module-size-limits.tsv
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # src/cli/main.ts
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # scripts/module-size-limits.tsv
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # src/cli/main.ts # src/cli/op-notices.ts
…r merge Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…GBRA-108) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…rge-page writes, source_ids reference, llms map; drop the README byte cap Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ion, host-repo preview, source_ids scope, segmented edit and upload routing) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ck; skips without HARNESS_EVALS_READ_TOKEN) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… walkthrough Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…or folders, inference, collapsed rows) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…next instead of "clean miss" (#7972) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # docs/architecture/key-files/core-search-2.md # scripts/module-size-limits.tsv # src/core/ops/search.ts # src/core/pglite-engine.ts # src/core/postgres-engine.ts # test/fixtures/keyword-arm-ranking.json
… ceiling for its notice row Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ine suite, hermeticity test, upgrade harness (GBRA-248) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…7673's workflow and docs name Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… (R1, GBRAIN_HOME) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
5 tasks done
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
- two-engine W1: telemetry, admission policy and retrieval tracking now pass on PGLite; narrow their EXPECTED_FAILURES rows to postgres (the harness still shares one pool there, like the pool row) - core world-reads baseline: rows for files master added before the guard, raised rows master grew, pruned stale rows - module-size ceilings re-summed for the merged files - llms-full.txt back under its 800000 budget: docs/guides/github-source.md is link-only in llms-full (still indexed in llms.txt) - KEY_FILES.md under its 10000-byte cap; tools-json golden regenerated Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…'s member read filter The merged tree's page-count statements (#7191) now carry master's member read predicate (readable_by / folder rules, GBRA-218) through the shared visibility helper, so stats --by never counts a page the reader may not read. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…d a test lane for build-lookup-table The secrets check read three benign added lines as credentials: a wrapped docs line starting with 'session:', the harness-check clone header variable named auth, and two high-entropy canary key values in the hermeticity test. Rewrap, rename and shorten them; no secret was involved. scripts/build-lookup-table.ts had no test lane, so add test/scripts/build-lookup-table.test.ts. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…-table test Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
find_pages and grouped get_stats skipped the read policy for every local call, so the local --as <member> preview listed and counted pages the member cannot read. Resolve the policy when applyRemoteReadPolicy is set, as the other reads do; test/access-as.serial.test.ts covers find and stats --by under --as. The keyword_identifier_probe and keyword_slug_handles BEHAVIOR_CHANGES rows carried a guessed since 0.60.440.0, which every current install is past, so the notice never showed; they are TBD now and the slot stamp gives them the release version. The lookup table now says MCP get_stats needs an admin-scope token. Review-Finding: p1/specialist-batched#1 reader=security Review-Finding: p1/specialist-batched#2 reader=security Review-Finding: p1/specialist-batched#3 reader=testing Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Nov 4, 2026
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…scope notes for find/stats Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e-enters it needsEngineScope compared engineKey(current) with engineKey(engine) only. A Proxy engine that answers every property with a fresh value (the import tests' mock engines) got a different key on every read, so importFromFile re-entered withEngineScope until the stack overflowed in any process that had opened an embedded engine earlier. full-ci shards 25-26 and 27-28 on 34e1b43 put test/engine-scope-required.test.ts ahead of test/import-file.test.ts and test/import-yaml-frontmatter.test.ts in one process (23 failures, all 'Maximum call stack size exceeded'); the same pair fails on master 019f8fc. Identity now short-circuits the key compare. test/engine-scope-identity.test.ts fails before and passes after. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
explain-target: the target_not_retrieved expansion retry carries consent paid+egress so it renders ask_user; the retry argv encodes array and object arguments as JSON so it repeats the diagnosed call. Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Nov 4, 2026
Open
Slug handles: a query with a negation or a longer quoted phrase resolves no handle, and the strict keyword match resolves handles only when every term is one, so a handle never returns a page the query excludes, a phrase it does not hold or a word it lacks. A failed identifier-probe or handle read reports keyword_candidates_incomplete (timeout or provider_error) through SearchOpts.onKeywordIncomplete, so the result carries the degraded stamp instead of a silent miss. CHANGELOG: the handle rules, the explain-target retry, and the engine-scope fix line. Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/outside-voice#2 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…te reason SearchOpts.onKeywordIncomplete now takes 'candidate_budget' | 'timeout' | 'provider_error' (the Step 11 probe-failure fix). TypeScript also prints four unchanged literal unions (DegradedReason, DegradedStageEntry.reason, LlmCallFailureClass, a canonical code union) in a different member order; the sets are identical. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Merged
4 tasks done
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.
Area train R: seven queued pull requests merged unchanged, in order, on top of current master, so they land in one merge slot and one full test pass (GBRA-108's consolidation policy).
Constituents
Includes #7497 @ 6ee8d2f (search: identifier probe, slug handles, coverage notice by token and class)
Includes #7233 @ 7421fb8 (
gbrain find/find_pages,stats --by source,type)Includes #7673 @ 9046769 (advisory
harness-checkworkflow)Includes #7198 @ 11edbb1 (
--explain-targetcause in CLI JSON; opt-in keyword phrase factor, off by default)Includes #7609 @ 562fb56 (docs: git-canonical guide and the week's catch-up)
Includes #7787 @ 3257cee (docs: page anatomy, where your memory lives, entity-scoped facts)
Includes #8098 @ 642b4a7 (embedded-core W1 guardrails)
Closes #7491
Closes #7492
Closes #7972
Closes #7191
Closes #7192
Closes #7175
Each constituent is a
--no-ffmerge commit of its exact head. Nothing was dropped. The constituent PRs close once this lands.What the train itself changes
The merges needed these resolutions and follow-ups on the combined tree; none changes a constituent's behavior:
## [Unreleased]entry for all seven (the version is picked at the slot). test(embedded-core): W1 guardrails: world-reads ratchet, two-engine suite, hermeticity, upgrade harness (GBRA-248) #8098's one-word correction to the 0.60.524.0 entry (gbrain trust review --accept-all) is applied.agent-contract.mdkeeps master's lines plus fix(search): identifier probe and slug handles in the keyword arm, rare words for long questions, coverage notice by token and class (#7491, #7492) #7497's search: projection_pending coverage counts unrelated image pages by substring and tells agents to wait for indexing #7492 sentence. Thepglite-engine.tsimports are combined. fix(search): identifier probe and slug handles in the keyword arm, rare words for long questions, coverage notice by token and class (#7491, #7492) #7497'swhois_exact_identitynotice row was already on master (0.60.435.0), so only its two new rows were added./dev/null" rule and the identity-exact-match section.eligibility/registry.tskeeps bothfind_pagesandwhois. Generated artifacts (regen:all, plugin trees, the lookup-table copies, the vendored bootstrap template) are regenerated.keywordPhraseFactorSqlsits next to the identifier-probe and handle imports. The phrase factor rides the same keyword statement the probe re-runs.exports/types.jsongainsimage_arm(fix(search): identifier probe and slug handles in the keyword arm, rare words for long questions, coverage notice by token and class (#7491, #7492) #7497's field).sql-text/pages.jsonre-hashes feat(find,stats): gbrain find / find_pages and stats --by source,type with alias collapse (#7191) #7233'sfind/stats --bystatements, which now carry master's caller-aware private-page predicate (pageReadFilter→privatePagesFilterForCaller, v0.60.527.0 feat(auth): per-principal private_pages grant — granted_sources reads private pages in explicitly granted sources (GBRA-156) #7593).rls-scope-inventory.jsonand its test countsearchKeyword's second scoped read, the slug-handle statement from fix(search): identifier probe and slug handles in the keyword arm, rare words for long questions, coverage notice by token and class (#7491, #7492) #7497 (36 call sites).engine.ts+6 andoperations.ts+1 for feat(find,stats): gbrain find / find_pages and stats --by source,type with alias collapse (#7191) #7233;mode.ts+12 for search/query: explain_target cause in CLI --json (#7192); opt-in keyword phrase factor (#7175) #7198;types.tsandbehavior-change-notice.tsfor fix(search): identifier probe and slug handles in the keyword arm, rare words for long questions, coverage notice by token and class (#7491, #7492) #7497 and search/query: explain_target cause in CLI --json (#7192); opt-in keyword phrase factor (#7175) #7198.main.tsandpostgres-engine.tswere raised to fit both.Verification (train head)
bun run typecheckpasses, and so doregen:all(nothing stale),check:module-sizeandcheck-bootstrap-templates.sh.ci-pr-scope/ci-runner-routing,check-core-world-readsandbuild-llms. The serial suites (identifier-probe, slug-handles, two-engine-isolation, the dispatch meta suites) also pass.Not stamped. GBRA-108 calls the slot; /ship, the full-ci label and the pregate gate run then.
What changed
The three review blockers' tests: red with each fix reverted (before), green on this head on PGLite and Postgres (after).
Before/after as text: The three review blockers' tests: red with each fix reverted (before), green on this head on PGLite and Postgres (after)
Why
Seven queued pull requests in the search, lookup and docs area were waiting for separate merge slots, and each slot costs a full test pass. This train lands them in one slot and one version. The outside reviewer found two real search bugs on the combined tree, so a query like
alice-example -draftno longer returns the page that contains "draft", and an identifier probe that times out now stamps the result degraded instead of looking like a clean miss.Blast radius
The changes reach the keyword arm of
searchandquery, the newfind_pagesandstats --byreads, CLI JSON for--explain-target, and the exportedSearchOpts.onKeywordIncompletetype. The slug-handle shortcut now runs only for a standalone handle or an OR list of handles, so every other query takes the strict keyword statement it took before this train. A probe or handle-read failure reports through the existingHybridSearchMeta.degradedanddegradedStampForpath, which the full suite exercised on this exact tree (Test 41926783818, 61606 tests, 0 failed; E2E 41926788094, 8082 tests, 0 failed): script ran.Approvals
Approved: yes (record r-83bf6e4de8eb). The full approval record stays private: this repository is public or its visibility is unknown.
Summary
Area train R: seven queued pull requests merged unchanged, in order, on top of current master, so they land in one merge slot and one full test pass.
Includes #7497 @ 6ee8d2f (search: identifier probe, slug handles, coverage notice by token and class)
Includes #7233 @ 7421fb8 (
gbrain find/find_pages,stats --by source,type)Includes #7673 @ 9046769 (advisory
harness-checkworkflow)Includes #7198 @ 11edbb1 (
--explain-targetcause in CLI JSON; opt-in keyword phrase factor, off by default)Includes #7609 @ 562fb56 (docs: git-canonical guide and the week's catch-up)
Includes #7787 @ 3257cee (docs: page anatomy, where your memory lives, entity-scoped facts)
Includes #8098 @ 642b4a7 (embedded-core W1 guardrails)
Each constituent is a
--no-ffmerge commit of its exact head, and nothing was dropped. On top of the merges, the train resolves the combined CHANGELOG, imports and goldens, and raises module-size ceilings to the combined line counts. The ship run then fixed what review found:needsEngineScopeshort-circuits when both handles name the same engine (GBRA-294's fix), the--explain-targetretry asks before a paid call and keeps array and object arguments, slug handles expand only for a standalone handle or an OR list of handles, and a failed identifier probe or handle read is reported as degraded keyword retrieval. The exports goldentest/fixtures/goldens/exports/types.jsonwas regenerated becauseonKeywordIncomplete's reason widened to'candidate_budget' | 'timeout' | 'provider_error'; the other lines in that diff are the same literal unions printed in a different order.Test Coverage
The new code paths have tests, and each fix's test was shown to fail with its fix reverted:
test/engine-scope-identity.test.ts(engine-scope identity),test/search/explain-target-cli-json-7192.test.ts(2 cases),test/search/slug-handles.serial.test.ts(<handle> -term, a quoted phrase beside a handle) andtest/search/identifier-probe.serial.test.ts(a forced probe timeout reachesmeta.degraded,retrieval.degradedand the CLI stamp).Tests ran: train-r count unavailable (the lane script reports per suite: unit 3849 pass, 7 skip, 77 fail, all 77 in
test/searchfiles that share state when the directory runs in one process and pass in their own process, which is how CI runs them; serial 56 pass, 0 fail; Postgres E2E 120 pass, 2 skip, 0 fail).Pre-Landing Review
Pass 1 (specialists for testing, security and state machines, plus red team): 2 informational findings in
src/core/search/explain-target.ts, both fixed. Round 2 fix-check: no findings. Step 11 voices: the outside voice (openai/gpt-6.1-sol) raised 2 blocking findings, slug handles that ignored negations and quoted phrases, and probe failures swallowed as an empty result. Both were fixed under the owner's grant of one scoped fix-check, which found no blocker.REVIEW_LOOP: passes=1 blocking_found=2 deferred=0 noted=0 fixed=4 scope=frozen unbound=2 ledgers_read=3 fix_checks=2 dispatches=4
Review-loop exception: accepted by GBRA-108 (GBrain Minder) 2026-11-04 via a-30c412c3d001: granted one scoped fix-check for the two outside-voice CRITICALs; the fix-check found no blocker; the exports golden was regenerated afterwards for the widened onKeywordIncomplete union it reviewed (fix-check at 2410cdd, 4 findings)
Gate edits: 118 listed, 29 read, 0 findings — 0 kept, 0 restored, 0 open
Outside review: completed (openai/gpt-6.1-sol, medium); both findings fixed.
Review notes
src/core/search/keyword-handles.ts). Filed search: quoted OR alternatives drop slug handles after the #8148 fix; skipped probe reports provider_error #8618.provider_errorrather than its own reason; the result is still stamped degraded (src/core/search/keyword-identifier-probe.ts). Filed search: quoted OR alternatives drop slug handles after the #8148 fix; skipped probe reports provider_error #8618.#Nprobe and hyphenated words read as handles (search: identifier probe fires on one-digit #N and slug handles match ordinary hyphenated words #8611);explain-targetedge cases (explain-target: three edge cases (embedding column, leading-dash query, collapsed reason source) #8612);countPagesByconsistency (find/stats --by: countPagesBy totals can disagree with group sums under concurrent writes #8613);core-world-reads --prune(check-core-world-reads: --prune exits 0 with growth violations; scanner misses process['env'] and destructured env #8614).harness-checkworkflow's trial and tool allowlist, and its read-only token (harness-check: a missing scoped trial reads as zero cross-scope pages; read token on the git command line #8609).get_statsunder--as(stats --as <member> without --by reports host-wide counts #8608),--asbehaviour incontext.ts(--as <member> preview is looser than the member's remote view (chunk safety, takes holders) #8610).Exploratory QA
Pass. Captures 005 (the import pair, 42 pass, 0 fail) and 006 (real CLI init, import and search on a repo-less PGLite brain) ran on current inputs.
Design Review
No frontend files changed, so design review was skipped.
Eval Results
No prompt-related files changed, so evals were skipped.
Review bot comments
No review bot comments.
Scope Drift
Scope Check: CLEAN
Plan Completion
Plan completion audit: not run (no plan bound).
Issues
Fixes #7175
Fixes #7191
Fixes #7192
Fixes #7491
Fixes #7492
Fixes #7972
Refs #1794
Refs #7198
Refs #7233
Refs #7497
Refs #7593
Refs #7609
Refs #7673
Refs #7787
Refs #8098
Refs p1/outside-voice#1
Refs p1/outside-voice#2
Refs p1/red-team#1
Refs p1/red-team#2
Refs p1/specialist-batched#1
Refs p1/specialist-batched#2
Refs p1/specialist-batched#3
Documentation
Status: current. The audit made no edits and found no blockers.
Scope: base 019f8fc to head 7a60000 on capy/train-r-20261101, covering 174 changed files. Staged, unstaged and untracked content was empty. The branch already updates 34 docs and authored templates for the new surface: AGENTS.md, CLAUDE.md, README.md, the guides, the architecture and key-files docs, the plugin docs, skills and bootstrap templates. I diff-read those changed docs and spot-checked the public surface (
find_pages,gbrain find,stats --by, the generated CLI flag registry) against them.Documentation health:
find_pagesrow)find_pagesis not a starter op)find_pages,stats-by,page-lookupandpage-counts)Coverage debt: none found. Regeneration reported to the parent: none required by this audit. Diagram drift: none observed.
Test plan
L=/home/user/.capy/work/gbra294/lanes-ship2 bash /home/user/.capy/work/gbra294/lanes.sh: serial 56 pass, 0 fail; Postgres E2E 120 pass, 0 fail; unit failures only intest/searchdirectory-mode runs, each file green in its own process