Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

CTL-003 blames PreToolUse hook wiring for staleness its own writer schedules

オープン
#67 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
shell
領域
devtools

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Shell
スター
16
フォーク
6
平均マージ
6時間 24分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DimitriGeelen/agentic-engineering-framework のほかの issue

DimitriGeelen/agentic-engineering-framework の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。