Add an AGENTS.md line-budget pre-commit check to scripts/lint.py to prevent cumulative prompt context inflation
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 68/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- developer-experience, tooling
Direzione di ricerca
Inizia da scripts/lint.py e dall'hook spec-hierarchy-sync in .pre-commit-config.yaml, dato che la proposta scripts/check_agents_budget.py deve seguire lo stesso schema di scripts/check_spec_hierarchy.py. Conferma con un maintainer il limite del budget (350 righe) prima di scrivere il codice. È completato quando python scripts/lint.py --all-files passa sull'attuale AGENTS.md di 324 righe e fallisce con l'errore di budget una volta che il file supera il limite.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened
On PR #257, fullsend-ai-coder added 40 lines of new meta-rules to AGENTS.md, growing the file from 324 lines to 364 lines (over 2,300 words). ProtoBot's pre-commit suite and offline hook runner (python scripts/lint.py) passed without error, as did CI workflows (e.g. run 37963244752). The PR underwent 4 review rounds and 3 fix iterations before being closed unmerged by maintainer John Strunk due to token bloat ("That's a lot of tokens to add to AGENTS for a simple heading change.").
Historical analysis of AGENTS.md reveals that the file originated at 6 lines and 31 words (commit 1c05265) and has grown 65-fold over 30+ commits—primarily driven by successive retro-generated issues that added extensive meta-governance and prescriptive "Review agents must check..." instructions. AGENTS.md is injected into the system prompt of every agent dispatched in the repository (triage, code, review, fix, retro).
What could go better
ProtoBot has no deterministic gate preventing AGENTS.md from expanding indefinitely. Pre-commit hooks already validate formatting, yaml syntax, Go code, secrets, and spec hierarchy synchronization (scripts/check_spec_hierarchy.py), but line count and context budget for AGENTS.md are completely unconstrained.
If the repository maintained a line-budget check (e.g., hard cap of 350 lines or requiring consolidation for rule additions), the code agent on PR #257 would have caught the budget violation locally during pre-commit execution (python scripts/lint.py), preventing a bloated 40-line diff from being submitted and avoiding 4 review runs, 3 fix iterations, and $8.64 in wasted agent execution.
Confidence: High. ProtoBot already uses local Python scripts in scripts/ hooked into .pre-commit-config.yaml and scripts/lint.py for repository-specific invariants.
Proposed change
In redhat-et/ProtoBot:
- Create a lightweight check script
scripts/check_agents_budget.pythat:- Counts non-empty lines in
AGENTS.md. - Enforces a maximum ceiling (e.g., 350 lines;
AGENTS.mdis currently 324 lines). - Exits non-zero with a clear error message if
AGENTS.mdexceeds the budget:ERROR: AGENTS.md exceeds the 350-line budget (%d lines). Consolidate existing rules or migrate instructions to on-demand skills before adding new prose.
- Counts non-empty lines in
- Register
check_agents_budget.pyas a local hook in.pre-commit-config.yamlunderrepo: local(similar tospec-hierarchy-sync) and wire it intoscripts/lint.py. - Add
AGENTS.mdbudget verification to offline pre-commit runs so coding agents catch prompt bloat locally before committing.
Validation criteria
- Running
python scripts/lint.py --all-filespasses against the current 324-lineAGENTS.md. - Artificially adding >26 lines to
AGENTS.mdcausespython scripts/lint.pyandgit committo fail with the line-budget error. - The next 5 PRs modifying
AGENTS.mdinredhat-et/ProtoBotremain under the 350-line budget or consolidate existing sections rather than inflating prompt size.
Generated by retro agent from https://github.com/redhat-et/ProtoBot/pull/257
- Lingua principale
- Go
- Stelle
- 6
- Fork
- 8
- Merge medio
- 1g 2h
- PR unite (30g)
- 96
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 redhat-et/ProtoBot
-
Group fullsend and agents package updates in Renovate configurationForse già presa @JohnStrunk l’ha presa 2 giorni fa. Apertaenhancement feature infra ready-for-triage triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
redhat-et/ProtoBot#277 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement feature infra ready-for-triage triaged
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
redhat-et/ProtoBot#288 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Scope AGENTS.md specification-document sibling reading rule to avoid whole-repo doc reading on localized editsForse già presa @cplegendre l’ha presa 2 giorni fa. Apertadocumentation ready-for-triage ready-to-code
redhat-et/ProtoBot#283 · 2 commenti · 2 reazioni · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Support multiple proposed change sets in selfhost_test.go to prevent fixture test failures during registered artifact updatesForse già presa @fullsend-ai-coder l’ha presa 2 giorni fa. Apertabug component:ears-manager ready-for-triage ready-to-code
Difficoltà 3/5 Mezza giornata Idoneità per principianti 25/100
redhat-et/ProtoBot#282 · 3 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Add CI and pre-commit validation for .fullsend/harness/*.yaml base URL SHA-256 integrityForse già presa @JohnStrunk l’ha presa 2 giorni fa. Apertaenhancement feature infra ready-for-triage triaged
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
redhat-et/ProtoBot#279 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di redhat-et/ProtoBot
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Gentleman-Programming/engram#1899 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
OpenTollGate/tollgate-module-basic-go#949 ·
I maintainer di solito rispondono entro 1 giorno