Repository navigation
feat(brief): refit the relevance gate on four repositories (#906) - #911
Merged
Merged
Conversation
…#906) For the symbols a prompt names (or quotes, or whose words the best files spell) the brief now carries the definition with its doc comment and body, its usage sites each inside the function that holds it, the functions that use it with their call sites, and its tests by name with the first assertion, as line-numbered blocks of exact source under one directive line. A stale or missing graph falls back to the text search for the declaration. The text may exceed one hook's cap: Pack::text is the whole of it and split_parts cuts it at block boundaries into parts of 9 800 characters, at most three (PIXEL_BRIEF_PARTS, default 1 until the installer registers more). PIXEL_BRIEF_PACK=0 restores the packet. The decision log gains pack_bytes, pack_parts, pack_targets and fallback. Refs #906 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… accept Pi and OpenCode run `pixel brief` and drop any output over 4 000 bytes, so a pack of up to 9 800 characters would have silenced them. The command now prints at most 3 900 bytes unless PIXEL_BRIEF_PARTS says the host takes more; the prompt hooks keep one part of 9 800. Refs #906 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
) Merge origin/main (#907 multi-hook delivery). The pack's part count is the number of hooks that deliver the brief: part 1 of `--part 1/N` builds for N, a host with one hook for 1. PIXEL_BRIEF_PARTS stays as an override, and the `brief` command keeps its 3 900-byte cap for Pi and OpenCode. The local text index is opened once per brief instead of once per search, which cut a region-pack brief on the local route from 275 ms to 76 ms. Refs #906 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pack of a cut packet ends on the lead line, the pack_parts metric counts the slices the hooks deliver, and the CLI tests assert the values they claim. Refs #906 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gate (four features, fitted on Pixel prompts alone) returned no brief for 7 of the 13 census answer prompts and 13 of the 19 census prompts it sees, across excalidraw, requests, ripgrep and pixel. - eval/brief-gate/prompts-multirepo.jsonl: the 20 census prompts, 30 written for each non-pixel repo and 40 off-topic ones (scored against every repo), split dev/test 50/50 by stratum; scripts/research-gate/multirepo_set.py. - gate_multirepo.py refits the logistic on dev across both sets with a fifth feature, `coverage` (shared / informative keywords, repo-size independent), and calibrates HIGH/LOW at 5 / 10 % FP out of fold; test read once. Thresholds 1.298 / 0.731 -> 1.184 / 0.613. The Pixel-only model is kept as results/gate-model-pixel-only.json. - A low-tier prompt now gets one part of the region pack, as a lead. Refs #906 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 16
Comment |
|
could not resolve conflicts in ARCHITECTURE.md, changelog.d/906-region-pack.added.md, crates/pixel/src/execution_brief/chain.rs, crates/pixel/src/execution_brief/region_pack.rs, crates/pixel/tests/cli/region_pack_cli.rs after 6 pass(es) |
|
Pixelio — needs human. Attempt budget exhausted. Last failure: |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LivioGama
added a commit
that referenced
this pull request
Nov 25, 2026
* feat(brief): region pack, the source an agent reads before it answers (#906) For the symbols a prompt names (or quotes, or whose words the best files spell) the brief now carries the definition with its doc comment and body, its usage sites each inside the function that holds it, the functions that use it with their call sites, and its tests by name with the first assertion, as line-numbered blocks of exact source under one directive line. A stale or missing graph falls back to the text search for the declaration. The text may exceed one hook's cap: Pack::text is the whole of it and split_parts cuts it at block boundaries into parts of 9 800 characters, at most three (PIXEL_BRIEF_PARTS, default 1 until the installer registers more). PIXEL_BRIEF_PACK=0 restores the packet. The decision log gains pack_bytes, pack_parts, pack_targets and fallback. Refs #906 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(brief): keep the region pack under what the brief command's hosts accept Pi and OpenCode run `pixel brief` and drop any output over 4 000 bytes, so a pack of up to 9 800 characters would have silenced them. The command now prints at most 3 900 bytes unless PIXEL_BRIEF_PARTS says the host takes more; the prompt hooks keep one part of 9 800. Refs #906 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(brief): answer the CodeRabbit findings on the region pack (#906) A pack of a cut packet ends on the lead line, the pack_parts metric counts the slices the hooks deliver, and the CLI tests assert the values they claim. Refs #906 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(brief): refit the relevance gate on four repositories (#906) The gate (four features, fitted on Pixel prompts alone) returned no brief for 7 of the 13 census answer prompts and 13 of the 19 census prompts it sees, across excalidraw, requests, ripgrep and pixel. - eval/brief-gate/prompts-multirepo.jsonl: the 20 census prompts, 30 written for each non-pixel repo and 40 off-topic ones (scored against every repo), split dev/test 50/50 by stratum; scripts/research-gate/multirepo_set.py. - gate_multirepo.py refits the logistic on dev across both sets with a fifth feature, `coverage` (shared / informative keywords, repo-size independent), and calibrates HIGH/LOW at 5 / 10 % FP out of fold; test read once. Thresholds 1.298 / 0.731 -> 1.184 / 0.613. The Pixel-only model is kept as results/gate-model-pixel-only.json. - A low-tier prompt now gets one part of the region pack, as a lead. Refs #906 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Refs #906
Stacked on #909 (base
feat/906-region-pack; retarget tomainwhen it merges).Summary
The relevance gate was fitted on Pixel prompts alone. On the tool census (excalidraw, requests, ripgrep, pixel) it returned no brief for 7 of the 13 answer prompts and 13 of the 19 census prompts it sees (the 20th names a symbol and skips the gate). This refits it on four repositories and lets a low-tier prompt carry one part of the region pack.
Diagnosis, from
pixel brief --jsonfeatures at the pinned commits (the old gate: HIGH 1.298, LOW 0.731; closed = score <= LOW):questionworth 1.64 is missing; every other feature is a perfect matchcommit, 0.11)The shared cause:
question(coefficient 1.64) is the only thing separating a statement from a question, so a prompt that is wholly in the repository's words but not phrased as a question lands 0.2-1.0 under LOW. The thresholds, set on 35 Pixel off-topic rows, were also tight (one false positive allowed at HIGH).What changes
eval/brief-gate/prompts-multirepo.jsonl(150 rows): the 20 census prompts, 30 plain-English prompts written for each of excalidraw, requests and ripgrep at their pinned SHAs, 40 off-topic ones (chat, git/release/CI, generic programming, other applications' bugs; scored against all four repos, counted once). Dev/test 50/50, stratified by repo and topic. Built byscripts/research-gate/multirepo_set.py.scripts/research-gate/gate_multirepo.py: refit on dev across both sets (features aspixel brief --jsonlogs them,results/multirepo-features.json), L2 logistic C=0.3, balanced, 20x repeated grouped 5-fold; HIGH/LOW at the 5/10 % points of the pooled out-of-fold off-topic scores; test read once. New featurecoverage= shared / informative (repo-size independent).gate_model.rs,relevance.rs,gate_reference.pyandgate_parity.jsonfollow; the Pixel-only model stays asresults/gate-model-pixel-only.json.Evidence
results/multirepo-fit.txt(rates; off-topic multirepo prompts weigh once):On the Pixel set no TPR falls and the FPR is equal or lower on test; the one exception is the high tier on dev, 0.03 to 0.07 (2 more of 30 off-topic prompts, in sample for the threshold). Per repo on test: excalidraw 0.65/0.00 and 0.71/0.00, requests 0.44/0.00 and 0.62/0.00, ripgrep 0.71/0.00 and 0.88/0.00. The off-topic multirepo prompts are easy (generic or other-stack), so their 0.00 says less than the Pixel set's
other-reporows. 53 prompts per repo is small: read these to about +-0.1.Census gate, 19 prompts: opened 6 before, 9 now (gained pixel-5, excalidraw-1, excalidraw-3, ripgrep-3; lost ripgrep-5, 0.76 to 0.43). The overview, review and flow prompts stay closed.
Region-pack coverage,
score_brief.py --sessions allwithPIXEL_BRIEF_PARTS=3, line coverage, before (#909 head, old gate) vs this head:Tests:
cargo test -p pixel-cli1110 unit + 369 CLI pass; workspace clippy-D warnings, fmt, SPDX clean; the Rust score equalsgate_reference.pyon the 7 recorded blocks (regenerated), a test holdsgate_model.rsto the json (5 features, sha), new tests forcoverageand the low-tier pack. Not run: a live agent re-run.Honest limits: the model without
coveragewas also read on test as an ablation (0.64 / 0.07 high, 0.72 / 0.07 high or low on all test rows) after the choice was made on dev; it decided nothing.log(files_considered)and prompt word count improved pooled dev CV but failed to transfer between the two sets, so they are out. The gate still closes prompts that do not use the repository's words (overview, "review the latest commit", flow); that needs a different signal, not a threshold.Merge Danger
Door: two-way. The constants and thresholds are one file; reverting restores the old gate. No wire or index version moves;
brief-decisions.jsonlkeeps its fields (the loggedmodelstring changes).Blast radius: every weak or plain-language prompt: more of them open (TPR +6 to +11 points on test, FPR equal or lower on test), and a low-tier one now carries up to 9 800 characters instead of three file names.
Docs touched
ARCHITECTURE.md(the gate and the region pack),eval/brief-gate/README.md,scripts/research-gate/README.md,changelog.d/906-gate-multirepo.changed.md.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit