CTL-003 blames PreToolUse hook wiring for staleness its own writer schedules
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start with the CTL-003 check in agents/audit/audit.sh around line 2700 and the counter/recheck logic in agents/context/budget-gate.sh around lines 108 and 237-240. Compare the wall-clock freshness check with the invocation-based rewrite cadence; the downstream patch and regression test are described in the issue, but no test path in this repository is named. Done means CTL-003 distinguishes a live gate from a stale one using the counter heartbeat and reports only evidence it measured.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
- Framework version: 1.6.258
- Project: 050-email-archive (shared-tooling mode)
- Reported: 2026-09-25T02:28:03Z
Description
Symptom
[WARN] CTL-003: Budget status file stale (5min old)
Evidence: Budget gate may not be running during active session
Mitigation: Check PreToolUse hook wiring for budget-gate.sh
Both the Evidence and Mitigation lines were false. Measured at the moment of the WARN, in an
actively-working session:
cat .context/working/.budget-gate-counter -> 396 (incrementing)
stat -c %Y .context/working/.budget-status -> 1790302032
date +%s -> 1790302101 (69s old)
The hook was wired and firing. The same check reported PASS 23 minutes earlier in the same
session with no configuration change in between.
Root cause
Two thresholds set independently in two files, with nothing coupling them:
| value | source | |
|---|---|---|
gate rewrites .budget-status every |
5 invocations (RECHECK_INTERVAL) |
agents/context/budget-gate.sh:108, early-exit at :240 |
| CTL-003 requires the file younger than | 5 minutes | agents/audit/audit.sh:2700 |
The gate cadence is counted in tool calls; the check threshold is wall-clock. CTL-003 therefore
fires whenever five consecutive tool calls span more than five minutes, which is ordinary for a
session running long commands or doing extended reasoning. The check reports on how fast the
session is working, not on whether the gate is alive.
The 5-120 minute window makes it sharper: above 120 minutes CTL-003 PASSes again ("no active
session"). So it passes when the gate is definitely idle and warns when it is definitely working.
.budget-gate-counter is written on EVERY invocation (budget-gate.sh:237), before the recheck
early-exit, so it is a true heartbeat and was available but unused.
Patch applied downstream
-# CTL-003 OE: Budget Gate — status file is fresh during active session
+# CTL-003 OE: Budget Gate — the gate is alive during an active session
BUDGET_FILE="$CONTEXT_DIR/working/.budget-status"
+GATE_COUNTER_FILE="$CONTEXT_DIR/working/.budget-gate-counter"
if [ -f "$BUDGET_FILE" ]; then
budget_age=$(find "$BUDGET_FILE" -mmin -5 2>/dev/null)
+ gate_live=$([ -f "$GATE_COUNTER_FILE" ] && find "$GATE_COUNTER_FILE" -mmin -5 2>/dev/null)
if [ -n "$budget_age" ]; then
pass "CTL-003: Budget status file fresh (< 5min old)"
+ elif [ -n "$gate_live" ]; then
+ pass "CTL-003: Budget gate live (counter touched <5min ago; status rewritten every Nth call)"
else
budget_mtime=$(stat -c %Y "$BUDGET_FILE" 2>/dev/null || echo 0)
now=$(date +%s)
age_min=$(( (now - budget_mtime) / 60 ))
+ gate_mtime=$(stat -c %Y "$GATE_COUNTER_FILE" 2>/dev/null || echo 0)
+ if [ "$gate_mtime" -eq 0 ]; then
+ gate_age_desc="never written"
+ else
+ gate_age_desc="$(( (now - gate_mtime) / 60 ))min old"
+ fi
if [ "$age_min" -gt 120 ]; then
pass "CTL-003: Budget status file stale (${age_min}min — no active session)"
else
warn "CTL-003: Budget status file stale (${age_min}min old)" \
- "Budget gate may not be running during active session" \
+ "Gate counter is also stale (${gate_age_desc}) — the gate itself has not run" \
"Check PreToolUse hook wiring for budget-gate.sh"
fi
fi
A downstream regression test pins the contract:
src/backend/tests/ctl003GateLivenessContract.test.js (6 assertions, including that
budget-gate.sh still writes its counter before the recheck early-exit — if that ever changes,
the counter stops being a heartbeat and this fix silently becomes wrong again).
Class, not incident
This is the fourth check in this audit surface found asserting an unmeasured cause: a
probe-failure WARN that emitted hardcoded evidence contradicting reality (#65), a headline that
did not match its own payload (#64), and D3 commit velocity comparing a partial day against
complete-day averages. The general rule worth adopting: a control may report what it measured;
it may not assert a cause it never inspected. Where discriminating evidence is already on disk,
it should be read before the claim is printed.
Reported via fw upstream report from field installation
- Lingua principale
- Shell
- Stelle
- 16
- Fork
- 6
- Merge medio
- 6h 24m
- PR unite (30g)
- 5
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun 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 DimitriGeelen/agentic-engineering-framework
-
area:cli bug severity:low status:fixed-on-bleeding-edge triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
DimitriGeelen/agentic-engineering-framework#100 · 5 commenti ·
-
area:cli bug severity:medium status:fixed-on-bleeding-edge triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
DimitriGeelen/agentic-engineering-framework#97 · 5 commenti ·
-
area:context bug severity:low status:accepted triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
DimitriGeelen/agentic-engineering-framework#96 · 3 commenti ·
-
area:cli bug severity:medium status:accepted triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
DimitriGeelen/agentic-engineering-framework#95 · 3 commenti ·
-
area:watchtower bug severity:low status:released triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
DimitriGeelen/agentic-engineering-framework#94 · 4 commenti ·
Tutte le issue di DimitriGeelen/agentic-engineering-framework
Issue simili
-
e2e-failure ready-to-code
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
redhat-developer/rhdh-plugin-export-overlays#4485 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
maintenance
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
fix(session-flow): redact.py misses bare sk-ant-oat01- tokens and stateless ghs_ tokens with dotsApertaneeds-human
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
melodic-software/claude-code-plugins#9026 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug raised-by:verifier
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
medici-finance/assay#4008 ·
I maintainer di solito rispondono entro 1 giorno
-
bug: `curl NAME` exports an unquoted, uninterpolated command that is not runnableForse già presa @dannyward630 l’ha presa oggi. Apertabug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
yunaremaia/git-api#61 ·
I maintainer di solito rispondono entro 1 giorno