Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add an AGENTS.md line-budget pre-commit check to scripts/lint.py to prevent cumulative prompt context inflation

Chiusa Adatta ai principianti
#262 4 commenti 1 reazione 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@JohnStrunk ci sta già lavorando.

Dal 12/10/2026.

  • #271 di @fullsend-ai-coder — integrata

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

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

enhancement feature infra ready-for-triage triaged

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:

  1. Create a lightweight check script scripts/check_agents_budget.py that:
    • Counts non-empty lines in AGENTS.md.
    • Enforces a maximum ceiling (e.g., 350 lines; AGENTS.md is currently 324 lines).
    • Exits non-zero with a clear error message if AGENTS.md exceeds 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.
  2. Register check_agents_budget.py as a local hook in .pre-commit-config.yaml under repo: local (similar to spec-hierarchy-sync) and wire it into scripts/lint.py.
  3. Add AGENTS.md budget verification to offline pre-commit runs so coding agents catch prompt bloat locally before committing.

Validation criteria

  1. Running python scripts/lint.py --all-files passes against the current 324-line AGENTS.md.
  2. Artificially adding >26 lines to AGENTS.md causes python scripts/lint.py and git commit to fail with the line-budget error.
  3. The next 5 PRs modifying AGENTS.md in redhat-et/ProtoBot remain 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di redhat-et/ProtoBot

Tutte le issue di redhat-et/ProtoBot

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.