Skip to content

fix(bin): stop tool-update check blaming tools for its own budget and re-announcing pending updates - #7482

Open
AgardnerAU wants to merge 4 commits into
kunchenguid:mainfrom
AgardnerAU:fm/fm-tool-update-false-alerts
Open

AgardnerAU wants to merge 4 commits into
kunchenguid:mainfrom
AgardnerAU:fm/fm-tool-update-false-alerts

Conversation

@AgardnerAU

Copy link
Copy Markdown
Contributor

Intent

"yes to a and b" - on 2026-10-18 the captain approved starting the grouped fixes a triage of the owner's queued firstmate bug reports recommended. Each becomes a new upstream PR to kunchenguid/firstmate from the fork AgardnerAU/firstmate.

This fix: Two fixes to bin/fm-tool-update-check.sh, in one PR: (1) a tool that is slow or not reached because the check's own time budget ran out must be reported as timed out or not checked, never as a failed tool; (2) a still-pending update must be announced once, and a finding leaving the set must not re-announce the ones that remain (compare as sets, report only new members).

The triage (2026-10-18) confirmed each defect is still present on current code and that no upstream PR or issue covers it. The original bug reports, verbatim:

===== fm-tool-update-check-blames-tools-for-own-budget
title: "firstmate: the watched-tool update check reports healthy tools as failed when its own time budget runs out"
kind: ship
repo: firstmate
created: 2026-09-16
body: "Observed repeatedly on 2026-09-16 while the captain was away. The armed watched-tool poll woke firstmate several times reporting, for example: "gh-axi check failed: ~/.nvm/versions/node/v22.23.1/bin/gh-axi did not answer when asked for its update announcement; quota-axi check failed: ...; chrome-devtools-axi check failed: ...; check incomplete: the time budget ran out before tasks-axi".\n\nTHE TOOLS ARE FINE. Verified by hand at the time, all answering normally:\ngh-axi 0.1.35, quota-axi 0.1.43, chrome-devtools-axi 0.1.34, tasks-axi 0.2.5, lavish-axi 0.1.67.\n\nTHE PROBE IS FINE TOO. Running the exact announce_args the check uses returns cleanly and promptly:\n $ gh-axi update --check\n update: package gh-axi, current 0.1.35, latest 0.1.35, available false\n rc=0\n\nREADING. Three of the ten watched tools use announce_args ["update", "--check"], each of which makes its own network round trip. The check appears to run them in sequence against one FM_CHECK_TIMEOUT budget, so the slow ones are reported as having "did not answer" and the budget is exhausted before the remaining tools are reached at all. The message therefore blames the tool for what is the check's own scheduling, which is the same failure shape the fleet-tool-quirks note already warns about: "That poll reports its OWN budget exhaustion as tool failure."\n\nWHY IT MATTERS. It is a false alarm that fires repeatedly, and while away it burns supervisor escalations. Worse, it is indistinguishable from a real tool breakage, so a genuine failure would be dismissed as this.\n\nDIRECTION, not a prescription: the per-tool probe needs its own bounded budget separate from the whole-check budget, a tool that exceeds its own budget should be reported as "timed out" rather than "did not answer", and tools not reached should be reported as "not checked" rather than folded into an incomplete-run sentence that reads like a fault.\n\nDISTINCT from fm-tool-update-report-refires-on-finding-removal, which is about a still-pending update re-announcing when an unrelated finding leaves the set. This one is about working tools being reported as failed."

===== fm-tool-update-report-refires-on-finding-removal
title: "firstmate: a still-pending tool update re-announces when an unrelated finding LEAVES the set"
kind: task
repo: firstmate
created: 2026-09-13
body: "Observed live 2026-09-13 during an away-mode session: the SAME pending update announced three times\nin about an hour.\n\nWHAT HAPPENED.\nSweep 1, epoch 1789246703, reported two findings: "no-mistakes update available: v1.64.0 -> v1.72.0"\nAND "lavish-axi check failed: ... did not answer when asked for its update announcement". Both were\nwritten to state/.tool-updates as one reported= string.\nSweep 2, epoch 1789247643, found only the no-mistakes item - the lavish probe answered that round, so\nits finding was gone. The findings string differed from the recorded one, and the SAME still-pending\nno-mistakes update was announced again.\nSweep 3, epoch 1789251370, the lavish finding returned, the string changed again, and the unchanged\nno-mistakes item was announced a third time.\n\nTHE DEFECT is at bin/fm-tool-update-check.sh:735:\n if [ -n "$line" ] && [ "$FINDINGS" != "$RECORD_REPORTED" ]; then\nThat is whole-string inequality, so the report fires when the set CHANGES in any direction. The\nscript's own header states the intended contract correctly - "the same pending update is reported\nonce rather than on every poll while a new finding that lands past the one-line cut is still news" -\nso the intent is a test for NEW findings. A finding LEAVING the set is not news and must not\nre-announce the ones that remain.\n\nTHE FLAP THAT TRIGGERS IT IS STRUCTURAL, NOT RANDOM. lavish-axi's configured announce probe is\nupdate --check, and it takes 10.6 seconds - measured three times: 10601 ms, 10614 ms, 10624 ms. The\nwhole check runs under FM_CHECK_TIMEOUT, default 30 seconds, shared across every watched tool. One\ntool deterministically consumes a third of the entire budget, so whether the sweep finishes depends\non how the other probes happen to run that round - which is why it alternates rather than failing\nconsistently. (lavish-axi --help also blocks ~10.6s at 0% cpu, so the cost looks like a network\nround trip the tool makes regardless of subcommand.)\n\nWHY THIS MATTERS rather than being cosmetic: on this machine the set changes on roughly every other\nsweep, so every genuinely pending update is re-announced indefinitely. A check that cries wolf is a\ncheck operators learn to ignore, which defeats the point of watched-tool monitoring entirely.\n\nTHE FIX HAS TWO HALVES, and the first is the important one.\n1. Compare as SETS and report only when the set gains a member not in the recorded set. Keep writing\n the full current set to the record either way, so a finding that disappears and returns is still\n news on its return. Preserve the existing behaviour that a sweep killed part way through leaves no\n record and is retried. This makes the flap harmless whatever its cause.\n2. Separately, decide whether a 10.6-second probe belongs in a 30-second shared budget at all: give\n lavish-axi a cheaper announcement source, drop its announce_args and watch its version only, or\n give slow probes their own budget. Config is config/watched-tools.json.\n\nTEST TO PIN IT: record holds findings A and B; sweep produces only A; nothing is reported and the\nrecord becomes A. Then sweep produces A and B again; B is reported, A is not. Also keep a case\nproving a brand-new finding landing past the one-line cut is still reported.\n\n--- INTERIM MITIGATION APPLIED 2026-09-13 BY FIRSTMATE, symptom only ---\n\nAfter a FOURTH announcement of the same unchanged update, the noise was degrading supervision - it\nwas waking the away-mode supervisor roughly every half hour with nothing new. Firstmate removed\nannounce_args and announce_pattern from the lavish-axi entry in config/watched-tools.json, so\nthat tool's version is still watched but its 10.6-second network probe no longer runs. Previous file\ncopied to /tmp/watched-tools.backup.json. This is remedy option 2 above, taken in its crudest form.\n\nTHIS MASKS THE DEFECT, IT DOES NOT FIX IT. The dedupe at line 735 still reports on any set change in\nany direction, so the next watched tool whose probe is slow, flaky or network-dependent will\nreproduce this exactly. Remedy 1 is still required and is still the important half. Do not close this\ntask on the strength of the noise having stopped.\n\nCOST OF THE MITIGATION, so it can be reversed deliberately: we will no longer be told automatically\nwhen lavish-axi has an update; only a version change we happen to notice will show it. Restore the\ntwo keys once remedy 1 lands and the budget question in remedy 2 is settled properly."

What Changed

  • bin/fm-tool-update-check.sh no longer reports a failed tool when a time limit runs out. A probe that overruns its own FM_TOOL_UPDATE_PROBE_SECS limit is reported as timed out. A probe that the sweep budget cut short, or a tool that the sweep never reached, is reported as not checked. Each unreached tool is now named. Before, they were folded into one "check incomplete" finding. This applies to version probes, announcement probes, version_url fetches (including curl exit 28) and git probes.
  • Repeat reporting now compares finding sets, not the whole report string. The record (state/.tool-updates, schema fm-tool-updates-v2) stores one found= line for each finding. Only findings that are not in the recorded set get reported. Thus a still-pending update is announced once, a finding that leaves the set does not announce the findings that remain, and a finding that leaves and comes back is reported again. The check still reads v1 records, so an upgrade does not announce all pending findings again. A sweep that is stopped part way through still writes no record.
  • Updated docs/configuration.md to describe the timeout and set-based reporting rules. Added test cases in tests/fm-tool-update-check.test.sh for timed-out and not-checked reporting and for set-based deduplication.

🤖 Generated with Claude Code

Risk Assessment

⚠️ Medium: Both required fixes are implemented correctly for the main paths, and the tests reproduce the reported sequences. Two gaps remain: the version_url probe still reports a timeout as a failed tool, and the combined unreached-tools finding brings back whole-string re-announcement when the budget flaps. Both are small, contained fixes.

Testing

I ran the real check CLI live against a throwaway home and stand-in tools for 6 scenarios, and compared each with the base commit where the scenario applies. The base build blamed slow or unreached tools as "check failed" or "check incomplete" and re-announced the same pending no-mistakes update on sweeps 3 and 5. The branch reports "timed out" or "not checked" instead, announces the pending update once over 5 flapping sweeps, keeps one finding per unreached tool so a change to that list does not re-announce D, handles the version_url timeout cases correctly, and still reports real breakages as "check failed". The targeted test file for the script passed all 51 cases, including the test where the armed check wakes the watcher. That test is not a live run, so the watcher-wake scenario is marked untested. The throwaway home was removed by a trap, and the worktree is clean.

  • Live validation: ✅ go - 6 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Slow update --check probes sharing the sweep budget: tools cut short or never reached are reported as not checked, never as check failed or check incomplete ✅ pass live drive-transcript.txt S1: base says 'chrome-axi check failed ... did not answer; check incomplete: ... before tasks-axi'. Branch says 'chrome-axi not checked: the sweep time budget ran out while ... wa…
A probe that runs past its own per-probe bound is reported as timed out, not failed ✅ pass live drive-transcript.txt S2: base says 'gh-axi check failed ... did not answer'. Branch says 'gh-axi timed out: ... did not answer within 2s when asked for its update announcement'
Adversarial: a tool that is really broken or missing is still reported as check failed, so real failures stay distinguishable ✅ pass live drive-transcript.txt S3: 'broken check failed: ... did not report a version; absent check failed: absent-fx-nope is not on PATH'
A pending update is announced once, a finding leaving the set announces nothing, and a returning finding is news again ✅ pass live drive-transcript.txt S4: base re-announces the no-mistakes update on sweeps 3 and 5. Branch announces it only on sweep 1; sweep 3 reports only the returning lavish timeout; sweeps 2, 4 and 5 are silen…
Each unreached tool is its own finding, so a change to the unreached list does not re-announce a tool already reported ✅ pass live drive-transcript.txt S5: sweep 1 reports c and d as not checked separately; sweep 2, with only d still unreached, is silent
A version_url read that runs out of time is reported as timed out or not checked, while a read that answers with no version is still check failed ✅ pass live drive-transcript.txt S6: curl exit 28 gives 'claude timed out: ... within 5s'; a hung curl while the budget is cut gives 'claude not checked: the sweep time budget ran out while ...'; a body with no v…
The armed check still reaches the watcher as an ordinary check wake ⏸️ untested no The prior payload did not establish a live result: this scenario was covered only by the repository test case in tests/fm-tool-update-check.test.sh, not by a run against a live long-running watcher pr…
Evidence: Live CLI transcript, base commit compared with branch, all scenarios

Source: Live CLI transcript, base commit compared with branch, all scenarios

===== S1: 2026-09-16 shape - three slow update --check probes + two tools after them, sweep budget 10s, probe bound 5s
--- OLD (base 1aa2a21eOLD)
tool updates: chrome-axi check failed: /var/folders/41/64hrmnwx11q5lw3l9d7zmfgr0000gn/T//fm-tuc-lab.085fAC/tools/chrome-axi-fx did not answer when asked for its update announcement; check incomplete: the time budget ran out before tasks-axi
[exit=0]
--- NEW (NEWbranch 29fb827c)
tool updates: chrome-axi not checked: the sweep time budget ran out while /var/folders/41/64hrmnwx11q5lw3l9d7zmfgr0000gn/T//fm-tuc-lab.085fAC/tools/chrome-axi-fx was asked for its update announcement; tasks-axi not checked: the sweep time budget ran out before it was reached; lavish-axi not checked: the sweep time budget ran out before it was reached
[exit=0]

===== S2: one tool whose announce probe overruns its own bound (probe 2s, tool takes 4s, ample budget)
--- OLD
tool updates: gh-axi check failed: /var/folders/41/64hrmnwx11q5lw3l9d7zmfgr0000gn/T//fm-tuc-lab.085fAC/tools/gh-axi-fx did not answer when asked for its update announcement
[exit=0]
--- NEW
tool updates: gh-axi timed out: /var/folders/41/64hrmnwx11q5lw3l9d7zmfgr0000gn/T//fm-tuc-lab.085fAC/tools/gh-axi-fx did not answer within 2s when asked for its update announcement
[exit=0]

===== S3: adversarial - a genuinely broken tool is still a check failure, distinguishable from timeouts
tool updates: broken check failed: /var/folders/41/64hrmnwx11q5lw3l9d7zmfgr0000gn/T//fm-tuc-lab.085fAC/tools/broken-fx did not report a version; absent check failed: absent-fx-nope is not on PATH
[exit=0]

===== S4: 2026-09-13 set flap - A=pending no-mistakes update, B=slow lavish probe that flaps
--- OLD
sweep 1 (lavish slow): tool updates: no-mistakes update available: A new version of no-mistakes is available: v1.64.0 -> v1.72.0; lavish-axi check failed: /var/folders/41/64hrmnwx11q5lw3l9d7zmfgr0000gn/T//fm-tuc-lab.085fAC/tools/lav-fx did not answer when asked for its update announcement [exit=0]
sweep 2 (lavish fast): tool updates: no-mistakes update available: A new version of no-mistakes is available: v1.64.0 -> v1.72.0 [exit=0]
sweep 3 (lavish slow): tool updates: no-mistakes update available: A new version of no-mistakes is available: v1.64.0 -> v1.72.0; lavish-axi check failed: /var/folders/41/64hrmnwx11q5lw3l9d7zmfgr0000gn/T//fm-tuc-lab.085fAC/tools/lav-fx did not answer when asked for its update announcement [exit=0]
sweep 4 (lavish slow): [exit=0]
sweep 5 (lavish fast): tool updates: no-mistakes update available: A new version of no-mistakes is available: v1.64.0 -> v1.72.0 [exit=0]
record after sweep 5:
    fm-tool-updates-v1
    epoch=1792327395
    reported=no-mistakes update available: A new version of no-mistakes is available: v1.64.0 -> v1.72.0
--- NEW
sweep 1 (lavish slow): tool updates: no-mistakes update available: A new version of no-mistakes is available: v1.64.0 -> v1.72.0; lavish-axi timed out: /var/folders/41/64hrmnwx11q5lw3l9d7zmfgr0000gn/T//fm-tuc-lab.085fAC/tools/lav-fx did not answer within 2s when asked for its update announcement [exit=0]
sweep 2 (lavish fast): [exit=0]
sweep 3 (lavish slow): tool updates: lavish-axi timed out: /var/folders/41/64hrmnwx11q5lw3l9d7zmfgr0000gn/T//fm-tuc-lab.085fAC/tools/lav-fx did not answer within 2s when asked for its update announcement [exit=0]
sweep 4 (lavish slow): [exit=0]
sweep 5 (lavish fast): [exit=0]
record after sweep 5:
    fm-tool-updates-v2
    epoch=1792327404
    found=no-mistakes update available: A new version of no-mistakes is available: v1.64.0 -> v1.72.0

===== S5: unreached-tool list flaps (C,D unreached, then only D) - D not re-announced
sweep 1: tool updates: slowtool not checked: the sweep time budget ran out while /var/folders/41/64hrmnwx11q5lw3l9d7zmfgr0000gn/T//fm-tuc-lab.085fAC/tools/slowtool-fx was asked for its update announcement; c not checked: the sweep time budget ran out before it was reached; d not checked: the sweep time budget ran out before it was reached [exit=0] 
sweep 2 (C reached/removed, D still unreached): [exit=0] 

===== S6: version_url read out of time
curl exits 28 (own --max-time): tool updates: claude timed out: https://downloads.example.invalid/latest did not answer within 5s when asked for its published version 
curl hangs, budget 2s < probe 10s: tool updates: claude not checked: the sweep time budget ran out while https://downloads.example.invalid/latest was asked for its published version 
curl answers with no version: tool updates: claude check failed: https://downloads.example.invalid/latest did not report a version 
Evidence: Driver script for the live scenarios

Source: Driver script for the live scenarios

#!/usr/bin/env bash
# Live driver: runs the real fm-tool-update-check.sh (this branch, and the base
# commit for comparison) against a disposable FM_HOME with fixture tools.
set -u
WT=~/.no-mistakes/worktrees/c272d8f3fc4c/01M57FN8JSQ6GH0HYQXBK60E3W
LAB=$(mktemp -d "${TMPDIR:-/tmp}/fm-tuc-lab.XXXXXX")
trap 'rm -rf "$LAB"' EXIT
mkdir -p "$LAB/base"; git -C "$WT" archive 1aa2a21ec35e2d0644ac836b7b5d3cb36669ef33 bin | tar -x -C "$LAB/base"
NEW="$WT/bin/fm-tool-update-check.sh"; OLD="$LAB/base/bin/fm-tool-update-check.sh"
B="$LAB/tools"; mkdir -p "$B"
# "axi" tools: --version is fast, `update --check` does a slow network round trip
mk_axi() { cat > "$B/$1" <<SH
#!/usr/bin/env bash
if [ "\$1" = update ]; then sleep $2; echo "update: package $1, current 0.1.0, latest 0.1.0, available false"; exit 0; fi
echo "$1 0.1.0"
SH
chmod +x "$B/$1"; }
mk_axi gh-axi-fx 4; mk_axi quota-axi-fx 4; mk_axi chrome-axi-fx 4
for t in tasks-axi-fx lavish-axi-fx; do printf '#!/usr/bin/env bash\necho "%s 0.2.5"\n' $t > "$B/$t"; chmod +x "$B/$t"; done
axi() { printf '{"name":"%s","command":"%s","announce_args":["update","--check"],"announce_pattern":"available true"}' "${1%-fx}" "$1"; }
plain() { printf '{"name":"%s","command":"%s"}' "${1%-fx}" "$1"; }
home() { local h="$LAB/home-$1"; mkdir -p "$h/state" "$h/config"; echo "$h"; }
run() { local script=$1 h=$2; shift 2
  env -u FM_ROOT_OVERRIDE -u FM_STATE_OVERRIDE -u FM_CONFIG_OVERRIDE FM_CHECK_TIMEOUT=30 FM_TOOL_UPDATE_INTERVAL=0 "$@" FM_HOME="$h" PATH="$B:$PATH" bash "$script" check; echo "[exit=$?]"; }

echo "===== S1: 2026-09-16 shape - three slow update --check probes + two tools after them, sweep budget 10s, probe bound 5s"
CFG="{\"tools\":[$(axi gh-axi-fx),$(axi quota-axi-fx),$(axi chrome-axi-fx),$(plain tasks-axi-fx),$(plain lavish-axi-fx)]}"
for which in OLD NEW; do h=$(home s1-$which); echo "$CFG" > "$h/config/watched-tools.json"
  echo "--- $which (${which/OLD/base 1aa2a21e}${which/NEW/branch 29fb827c})"; run "${!which}" "$h" FM_TOOL_UPDATE_BUDGET_SECS=10 FM_TOOL_UPDATE_PROBE_SECS=5; done

echo; echo "===== S2: one tool whose announce probe overruns its own bound (probe 2s, tool takes 4s, ample budget)"
CFG="{\"tools\":[$(axi gh-axi-fx)]}"
for which in OLD NEW; do h=$(home s2-$which); echo "$CFG" > "$h/config/watched-tools.json"
  echo "--- $which"; run "${!which}" "$h" FM_TOOL_UPDATE_PROBE_SECS=2; done

echo; echo "===== S3: adversarial - a genuinely broken tool is still a check failure, distinguishable from timeouts"
printf '#!/usr/bin/env bash\necho "garbage"\n' > "$B/broken-fx"; chmod +x "$B/broken-fx"
h=$(home s3); echo "{\"tools\":[$(plain broken-fx),{\"name\":\"absent\",\"command\":\"absent-fx-nope\"}]}" > "$h/config/watched-tools.json"
run "$NEW" "$h"

echo; echo "===== S4: 2026-09-13 set flap - A=pending no-mistakes update, B=slow lavish probe that flaps"
cat > "$B/nm-fx" <<'SH'
#!/usr/bin/env bash
[ "$1" = --version ] && { echo "no-mistakes version v1.64.0"; exit 0; }
echo "A new version of no-mistakes is available: v1.64.0 -> v1.72.0"
SH
chmod +x "$B/nm-fx"
cat > "$B/lav-fx" <<SH
#!/usr/bin/env bash
[ "\$1" = --version ] && { echo "lavish 0.1.67"; exit 0; }
[ -e "$LAB/slow" ] && sleep 4; echo ok
SH
chmod +x "$B/lav-fx"
CFG='{"tools":[{"name":"no-mistakes","command":"nm-fx","version_args":["--version"],"announce_args":["--help"],"announce_pattern":"A new version of no-mistakes is available: [^ ]+ -> [^ ]+"},{"name":"lavish-axi","command":"lav-fx","announce_args":["update","--check"],"announce_pattern":"available true"}]}'
for which in OLD NEW; do h=$(home s4-$which); echo "$CFG" > "$h/config/watched-tools.json"; echo "--- $which"
  for sweep in "1 slow" "2 fast" "3 slow" "4 slow" "5 fast"; do set -- $sweep
    if [ "$2" = slow ]; then touch "$LAB/slow"; else rm -f "$LAB/slow"; fi
    printf 'sweep %s (lavish %s): ' "$1" "$2"; out=$(run "${!which}" "$h" FM_TOOL_UPDATE_PROBE_SECS=2); echo "${out//$'\n'/ }"
  done
  echo "record after sweep 5:"; sed 's/^/    /' "$h/state/.tool-updates"; done

echo; echo "===== S5: unreached-tool list flaps (C,D unreached, then only D) - D not re-announced"
mk_axi slowtool-fx 30; for t in c-fx d-fx; do printf '#!/usr/bin/env bash\necho "%s 1.0.0"\n' $t > "$B/$t"; chmod +x "$B/$t"; done
h=$(home s5)
echo "{\"tools\":[$(axi slowtool-fx),$(plain c-fx),$(plain d-fx)]}" > "$h/config/watched-tools.json"
printf 'sweep 1: '; run "$NEW" "$h" FM_TOOL_UPDATE_PROBE_SECS=10 FM_TOOL_UPDATE_BUDGET_SECS=2 | tr '\n' ' '; echo
echo "{\"tools\":[$(axi slowtool-fx),$(plain d-fx)]}" > "$h/config/watched-tools.json"
printf 'sweep 2 (C reached/removed, D still unreached): '; run "$NEW" "$h" FM_TOOL_UPDATE_PROBE_SECS=10 FM_TOOL_UPDATE_BUDGET_SECS=2 | tr '\n' ' '; echo

echo; echo "===== S6: version_url read out of time"
printf '#!/usr/bin/env bash\necho "2.1.271 (Claude Code)"\n' > "$B/claude-fx"; chmod +x "$B/claude-fx"
CB="$LAB/curl28"; mkdir -p "$CB"; printf '#!/usr/bin/env bash\nexit 28\n' > "$CB/curl"; chmod +x "$CB/curl"
CS="$LAB/curlslow"; mkdir -p "$CS"; printf '#!/usr/bin/env bash\nsleep 30; echo 2.1.273\n' > "$CS/curl"; chmod +x "$CS/curl"
CE="$LAB/curlempty"; mkdir -p "$CE"; printf '#!/usr/bin/env bash\necho "no version here"\n' > "$CE/curl"; chmod +x "$CE/curl"
CFG='{"tools":[{"name":"claude","command":"claude-fx","version_url":"https://downloads.example.invalid/latest"}]}'
for c in "curl28:curl exits 28 (own --max-time)" "curlslow:curl hangs, budget 2s < probe 10s" "curlempty:curl answers with no version"; do d=${c%%:*}
  h=$(home s6-$d); echo "$CFG" > "$h/config/watched-tools.json"; printf '%s: ' "${c#*:}"
  extra=(); [ $d = curlslow ] && extra=(FM_TOOL_UPDATE_PROBE_SECS=10 FM_TOOL_UPDATE_BUDGET_SECS=2)
  env -u FM_ROOT_OVERRIDE FM_CHECK_TIMEOUT=30 FM_TOOL_UPDATE_INTERVAL=0 ${extra[@]+"${extra[@]}"} FM_HOME="$h" PATH="$LAB/$d:$B:$PATH" bash "$NEW" check | tr '\n' ' '; echo
done
Evidence: Targeted test file run output

Source: Targeted test file run output

ok - PATH skew is reported by asking every copy on PATH for its own version
ok - no report when PATH already resolves the newest installed copy
ok - two copies of the same version are not skew
ok - one copy reached through two PATH entries is probed once as one install
ok - a copy that reports no version is a check failure, not a pass
ok - a watched command missing from PATH is reported
ok - a tool's own update announcement is read from its output
ok - an announcement naming an already-installed version is not also reported as an available update
ok - an announcement naming a version newer than every installed copy is still reported as available
ok - an announcement carried by another command is read from that command
ok - an announce_pattern that cannot be used is reported instead of read as silence
ok - a broken pattern is reported for its own tool and the rest of the sweep still reports
ok - an announcement source the budget could not reach is reported, not read as current
ok - an announcement probe that does not answer is reported, not read as current
ok - a version probe past its own bound is reported as timed out, not as a failed tool
ok - a probe cut short by the sweep budget, and a tool never reached, are reported as not checked
ok - each tool the sweep did not reach is its own finding, reported once
ok - a tool that announces nothing stays silent
ok - a version_url newer than every installed copy is reported as an available update
ok - a version_url no newer than an installed copy reports only PATH skew when needed
ok - a version_url that matches the PATH version is silent
ok - a version_url that does not answer with a version is a check failure
ok - a version_url read that runs out of time is timed out or not checked, not a failed tool
ok - a missing curl is a check failure
ok - version_url is validated as one https URL beside a command
ok - commits behind the origin branch are reported without touching the repository
ok - an omitted branch is detected from the remote's default branch
ok - the default branch is asked of the remote when the clone has no local record
ok - a repository that is current or ahead of its origin branch is silent
ok - an unusable git source is reported as a check failure
ok - a remote that cannot be read is reported as unreadable, not as a missing branch
ok - a branch a readable remote does not have is still reported as missing
ok - git probes stop and name their tool once the sweep budget is gone
ok - a git probe that does not answer is reported as a failure, never as an update
ok - a stalled repository probe is reported as no answer, not as not a repository
ok - no watched tool registry means no output at all
ok - a malformed registry is reported instead of quietly skipped
ok - the same pending update is reported once, and a change is reported again
ok - a finding leaving the set is not news, and only a new finding is reported
ok - a record from before set comparison still keeps its findings from repeating
ok - an over-long report is cut with the shared truncation marker
ok - a finding that lands past the cut is still reported as news
ok - probes run once per interval, not on every poll
ok - a budget that cannot fit the watcher bound is cut and reported, and the sweep keeps working
ok - an out of range bound or unknown action refuses instead of guessing
ok - arm registers a trusted check and disarm removes every trace
ok - a symlink at the shim path is refused instead of followed
ok - a failed registration never leaves a shim without a matching trust binding
ok - a re-arm that loses the trust binding leaves no shim behind
ok - a relative home is resolved before it is persisted into the shim
ok - the armed check reaches the watcher as an ordinary check wake
Evidence: S4 flap: base compared with branch
OLD: sweep1 nm+lavish failed | sweep2 nm AGAIN | sweep3 nm AGAIN + lavish | sweep4 silent | sweep5 nm AGAIN
NEW: sweep1 nm + lavish timed out | sweep2 silent | sweep3 lavish timed out only | sweep4 silent | sweep5 silent
NEW record: fm-tool-updates-v2 / found=no-mistakes update available: ... v1.64.0 -> v1.72.0

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ⚠️ bin/fm-tool-update-check.sh:540 - The version_url probe was not converted. If the read runs out of time, it is still reported as $name check failed: $version_url did not report a version (line 543). This applies both when curl hits --max-time (exit 28) and when fm_run_timed returns 124/137. It also applies when the sweep budget had already cut probe_bound. The intent requires that a slow probe, or one cut by the check's own budget, is "reported as timed out or not checked, never as a failed tool". Failing sequence: a tool has version_url, and earlier tools use most of the budget, so probe_bound returns 1-2s. The download takes 3s, so the report says 'claude check failed'. Fix: capture bound=$(probe_bound) once, use it for both fm_run_timed and --max-time, and send a timeout status (fm_timed_out or curl status 28) to emit_probe_timeout "$name" "$bound" "$version_url" ... (the message wording needs a small adjustment) before the generic failure branch.
  • ⚠️ bin/fm-tool-update-check.sh:808 - All unreached tools go into one finding string ('not checked, the sweep time budget ran out first: A, B'). The set comparison then works on that whole string, so any change to the list counts as a new member, even when every tool in it was already announced. Failing sequence: sweep 1 does not reach C and D, and reports 'ran out first: C, D'. Sweep 2 reaches C but not D, and announces 'ran out first: D' again, although D was already reported and nothing new happened. This is the same whole-string re-announcement the intent forbids ("compare as sets, report only new members"), moved to a coarser level, and it fires on budget flap, which is the structural trigger in the bug report. Fix: emit one finding per unreached tool, for example "$name not checked: the sweep time budget ran out before it was reached", in the loop at line 802, and drop the unreached accumulator. Update the assertion in tests/fm-tool-update-check.test.sh to match (test_tools_the_sweep_budget_did_not_reach_are_not_checked_not_failed and test_git_probes_stop_when_the_sweep_budget_is_gone).
  • ℹ️ bin/fm-tool-update-check.sh:418 - emit_probe_timeout and git_probe use bound -lt PROBE_SECS to decide whether the sweep budget cut the bound. When FM_TOOL_UPDATE_PROBE_SECS=1, probe_bound raises a depleted budget up to PROBE_MIN_SECS=1, which equals PROBE_SECS. A probe that only ran out because the sweep budget was gone is then reported as 'timed out' and not as 'not checked'. This happens only with a non-default configuration, and the message still does not say 'check failed', so it is noted for information only.

🔧 Fix applied.
1 info still open:

  • ℹ️ bin/fm-tool-update-check.sh:418 - emit_probe_timeout and git_probe use bound -lt PROBE_SECS to decide whether the sweep budget cut the bound. When FM_TOOL_UPDATE_PROBE_SECS=1, probe_bound raises a depleted budget up to PROBE_MIN_SECS=1, which equals PROBE_SECS. A probe that only ran out because the sweep budget was gone is then reported as 'timed out' and not as 'not checked'. This happens only with a non-default configuration, and the message still does not say 'check failed', so it is noted for information only.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 6 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Slow update --check probes sharing the sweep budget: tools cut short or never reached are reported as not checked, never as check failed or check incomplete ✅ pass live drive-transcript.txt S1: base says 'chrome-axi check failed ... did not answer; check incomplete: ... before tasks-axi'. Branch says 'chrome-axi not checked: the sweep time budget ran out while ... wa…
A probe that runs past its own per-probe bound is reported as timed out, not failed ✅ pass live drive-transcript.txt S2: base says 'gh-axi check failed ... did not answer'. Branch says 'gh-axi timed out: ... did not answer within 2s when asked for its update announcement'
Adversarial: a tool that is really broken or missing is still reported as check failed, so real failures stay distinguishable ✅ pass live drive-transcript.txt S3: 'broken check failed: ... did not report a version; absent check failed: absent-fx-nope is not on PATH'
A pending update is announced once, a finding leaving the set announces nothing, and a returning finding is news again ✅ pass live drive-transcript.txt S4: base re-announces the no-mistakes update on sweeps 3 and 5. Branch announces it only on sweep 1; sweep 3 reports only the returning lavish timeout; sweeps 2, 4 and 5 are silen…
Each unreached tool is its own finding, so a change to the unreached list does not re-announce a tool already reported ✅ pass live drive-transcript.txt S5: sweep 1 reports c and d as not checked separately; sweep 2, with only d still unreached, is silent
A version_url read that runs out of time is reported as timed out or not checked, while a read that answers with no version is still check failed ✅ pass live drive-transcript.txt S6: curl exit 28 gives 'claude timed out: ... within 5s'; a hung curl while the budget is cut gives 'claude not checked: the sweep time budget ran out while ...'; a body with no v…
The armed check still reaches the watcher as an ordinary check wake ⏸️ untested no The prior payload did not establish a live result: this scenario was covered only by the repository test case in tests/fm-tool-update-check.test.sh, not by a run against a live long-running watcher pr…
  • bash ~/.no-mistakes/evidence/01M57FN8JSQ6GH0HYQXBK60E3W/drive.sh - runs the real check script (branch and base commit 1aa2a21e, extracted with git archive) against a throwaway mktemp FM_HOME and stand-in tool and curl scripts, with 6 scenarios
  • S1: the 2026-09-16 shape - three slow update --check announce probes followed by two quick tools, budget 10s, probe bound 5s
  • S2: an announce probe that runs past its own 2s bound
  • S3 (adversarial): a tool that prints rubbish and a missing command must still be reported as check failed
  • S4: the 2026-09-13 flap over 5 sweeps - a pending no-mistakes update plus a lavish probe that alternates slow and fast, then the record contents
  • S5: the list of unreached tools changes from C,D to D only
  • S6: version_url read with curl exit 28, a curl that hangs while the budget is cut, and curl answering with no version
  • bash tests/fm-tool-update-check.test.sh (only the test file for the changed script, including test_armed_check_wakes_the_watcher_with_the_skew_report and the set-comparison cases)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

… re-announcing pending updates

A probe that overruns its own bound is now reported as timed out, and a probe
whose bound the sweep budget had cut, or a tool the sweep never reached, is
reported as not checked, instead of "check failed" or "check incomplete".

Findings are now compared as sets: only a finding missing from the recorded set
is reported, so a finding leaving the set no longer re-announces the ones that
remain. The record holds one finding per line (fm-tool-updates-v2) and still
reads the earlier joined record so an upgrade does not repeat every finding.
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @AgardnerAU. The base-vs-branch transcripts make both false alarms easy to see.

I read the whole diff against main 1aa2a21e. It touches 3 files (bin/fm-tool-update-check.sh, docs/configuration.md, and the script's test), with no workflow, CI-script, or secret surface, so I approved the fork CI runs (CI 39128801638, Require no-mistakes 39128801729). The no-mistakes attestation matches head 81c7289f, and live validation is 6/7 go. The only untested scenario is the live watcher wake, which is covered by the repo test.

VISION verdict (head 81c7289 vs main 1aa2a21):

  • One captain, one interface: aligns. No more false "check failed" wakes caused by the check's own budget, and no re-announcing a pending update. That's less noise, and a real failure still reads as check failed.
  • Authority is explicit: aligns. Still report-only.
  • Scripts own mechanics: aligns. Bounds and set comparison live in the script.
  • Restart is a non-event: aligns. The record moves to a one-finding-per-line v2 and still reads v1, so an upgrade doesn't re-announce everything.
  • Delegation with a spine: aligns. Real breakages stay distinguishable (adversarial S3), with targeted tests.
  • Fleet outlives vendor: aligns.
  • Scope: aligns.

Contract-class: restore. The watched-tool check only runs in a home that has config/watched-tools.json and has armed it, so an unconfigured run is unchanged. For armed homes, this restores what the docs already promise: "the same pending update is reported once", and the check no longer blames tools for its own scheduling.

Overlap: #3841 (yours, the published npm/GitHub probe) edits the same script. It uses budget_allows, which this PR removes, and it reports a timed-out published read as check failed. Whichever lands second will need a rebase, and ideally published timeouts should follow this PR's timed out / not checked wording.

Next step: we're waiting on CI only. Nothing is needed from you right now. If CI and no-mistakes come back green and the PR is still clean, I'll merge it on a later pass.

…fm/fm-tool-update-false-alerts

# Conflicts:
#	bin/fm-tool-update-check.sh
#	docs/configuration.md
#	tests/fm-tool-update-check.test.sh
@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect reports from the watched-tool check and its existing watcher wake.

Fix the version-probe timeout path before merging so slow tools are not still reported as broken.

Reviews (1) · Last reviewed commit: "Merge branch 'main' of https://github.co..." · Reviewed by Greptile

Comment on lines +482 to +485
# A copy that ran out of time never had the chance to report a version.
if fm_timed_out "$status"; then
emit_probe_timeout "$name" "$bound" "$hit" "for its version"
[ "$resolved_path" != "$hit" ] || resolved_timed_out=1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Slow tools still look broken

A version probe that prints a version before hanging skips the timeout check because it sits inside if [ -z "$version" ]. With published configured, the saved timeout status then produces check failed: ... exited 124 instead of timed out or not checked. Without published, the timeout can go unreported.

Check the timeout status independently of whether partial output contains a version, and add a printed-version-then-hang test.

reported=*)
[ "$schema" = "$RECORD_SCHEMA_V1" ] || continue
line=${line#reported=}
[ -z "$line" ] || RECORD_FOUND="${line//; /$nl}$nl"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Upgrade repeats an update

The v1 reader splits every ; , including text inside a single finding. An announcement such as Update available; install 2.0.0 becomes two recorded entries. The next sweep cannot match the original finding and announces it again during upgrade.

Match current findings against the old joined record without assuming every ; starts another finding, and cover an announcement containing that text.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @AgardnerAU for merging main into this tip (424fa78a).

Waiting on you for two gates:

  1. Attestation is stale. The body still binds 81c7289f, not current head 424fa78a. Please re-raise through git push no-mistakes so a fresh attestation binds this tip with every step completed (no skipped steps).
  2. Greptile P1 is open on bin/fm-tool-update-check.sh ("Slow tools still look broken"): a version probe that prints a version before hanging skips the timeout check because it sits inside if [ -z "$version" ]. Please fix (or reply on the thread if you disagree), resolve it, and cover a printed-version-then-hang case. The P2 about v1 ; splitting is worth a look on the same pass.

Contract-class stays restore (provisional; re-checked on the attested tip). #3841 already merged, so that overlap is gone. Rockets: none. Unlabelled Full suite failure is our label gate, not yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants