Self-scan context pack: per-issue "read file:X-Y" pointers from the master DB for churn workers
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 44/100
Direzione di ricerca
Start by reading tests/tools/self_scan.py, the self-scan orientation doc, and the master DB schema for file_data, function_data, class_data, fcall_data, and edge_data. Build the context pack around the issue text, then check its output and token cap against the listed fixture cases and five recent closed churn issues. Done means the tests pass, each pack stays within 3,000 tokens and names files changed by the merged PRs, runtime stays under 10 seconds, and the stated doc fixes are handled.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Why
A cost audit of nyx's churn workers (2026-10-18, 16 worker sessions, 10 merged PRs at ~$2/PR) found:
- Workers get only the issue number and title. Each one finds the code itself, taking 5-14 grep/
sed -nrequests before its first edit. Orientation accounts for ~45% of worker spend, though most of that is the fixed ~40k-token starting context that every request re-reads. - Whole-file reads are the main trap.
gitgalaxy/core/detector.pyis ~135k tokens, and seven files are over 60k tokens each. The golden-master JSON fixtures run up to 606k lines. - The self-scan already has what is needed to point a worker straight at the code, but nothing turns it into a per-issue slice:
- The master DB's
function_datahasstart_line,loc, complexity, fan-in/fan-out andtoken_mass. fcall_dataholds the resolved call graph andedge_datathe import edges.file_datahastoken_mass, churn and blast radius.- The existing LLM brief (
_llm.md) is ~137 KB (~34k tokens), too big to inject.
- The master DB's
What
Add a tool, e.g. tests/tools/context_pack.py <issue> [--db docs/self_scan/gitgalaxy_master.db] [--max-tokens 3000]. Given an issue, it would:
- Pull out the paths, file names, function, class and symbol names, and backticked identifiers named in the issue body and title (
gh issue view --json title,body). - Resolve them against the master DB (
file_data,function_data,class_data). Fuzzy-match bare names and rank matches by how often they are mentioned. - For each hit, emit
path:start-end(fromstart_line+loc), complexity and token size. Add one hop of callers and callees fromfcall_data, each with its ownpath:start-end, and import fan-in fromedge_data. - Flag large files (
token_mass> 8k, asdev_agent_firewalldoes) with "read only the named ranges". - Print a Markdown block capped at about 1-3k tokens that a worker brief can include verbatim. If nothing resolves, print nothing; never pad.
Freshness: keep one DB per origin/main commit (tests/tools/self_scan.py already does delta mode, ~6-8 s; a full scan is ~1.5 min). Run the pack before the worker launches, so a stale DB is off by at most the commits since the last refresh. Line ranges are hints and the worker still reads the code.
Integration (separate PR in squid-protocol/promoter-bot): churn worker runs the tool and adds its output to prompt.md under "Where to look". That is a few lines once the tool exists.
Related cleanups found during the audit
CLAUDE.md:103points agents atdocs/gitgalaxy_architecture_brief.md. That file moved to thegeneratedbranch, so a local checkout has nothing there.docs/agents/self-scan-orientation.mdsays the DB "has no line numbers". That is stale:function_data.start_lineis populated.- Delta-mode briefs written into worker worktrees (e.g.
churn-5464_galaxy_llm.md) report "0 analyzed artifact(s), 0 LOC". Either fix them or stop writing them.
Acceptance
-
context_pack.pyproduces a pack of 3k tokens or less for at least 5 recent closed churn issues, and for each one the pack names the file(s) the merged PR actually changed. Show the hit rate in the PR body. - Unit tests on a small fixture DB: exact path, bare function name, class name, no matches (empty output) and the token cap.
- Runs in under 10 s against an existing DB. It needs no network access apart from
gh issue view, and it accepts--body-filefor offline use. - The doc fixes above.
- Follow-up issue or PR filed on promoter-bot to wire it into
churn worker.
- Lingua principale
- Python
- Stelle
- 57
- Fork
- 11
- Merge medio
- 1h 41m
- PR unite (30g)
- 978
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di squid-protocol/gitgalaxy
-
lane:nyx needs:corpus priority: medium testing
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
squid-protocol/gitgalaxy#5784 ·
I maintainer di solito rispondono entro 1 giorno
-
lane:nyx needs:corpus priority: medium testing
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
squid-protocol/gitgalaxy#5783 ·
I maintainer di solito rispondono entro 1 giorno
-
keyword-rosetta: ACS (acs) has no control folder; author data/acs/ and backfill its cost recordApertalane:nyx needs:corpus priority: medium testing
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
squid-protocol/gitgalaxy#5782 ·
I maintainer di solito rispondono entro 1 giorno
-
lane:nyx needs:corpus priority: medium testing
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
squid-protocol/gitgalaxy#5781 ·
I maintainer di solito rispondono entro 1 giorno
-
keyword-rosetta: F# (fsharp) has no control folder; author data/fsharp/ and backfill its cost recordApertalane:nyx needs:corpus priority: medium testing
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
squid-protocol/gitgalaxy#5780 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di squid-protocol/gitgalaxy
Issue simili
-
[Bug]: `hermes plugins update` clones an entire monorepo twice - `subdir` is resolved but dropped at both catalog-update call sitesForse già presa @HootRock l’ha presa oggi. Apertacomp/cli P2 type/perf
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NousResearch/hermes-agent#142417 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug enhancement python
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
DewaldOosthuizen/tech-cheat-sheets-and-notes#392 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
bug p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Restore postgresql_vm_test_charm actions.yaml change (removed in canonical/postgresql-operator#2054)Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
canonical/postgresql-single-kernel-library#390 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni