Skip to content

fix(bin): throttle crew-state no-mistakes and GitHub PR reads to stop rate-limit exhaustion - #7516

Closed
Authentis wants to merge 262 commits into
kunchenguid:mainfrom
Authentis:fm/fm-ratecap-substrate-1019
Closed

Authentis wants to merge 262 commits into
kunchenguid:mainfrom
Authentis:fm/fm-ratecap-substrate-1019

Conversation

@Authentis

Copy link
Copy Markdown
Contributor

Intent

Open one fork pull request on Authentis/firstmate-upstream that carries the nm-cache substrate (starting at 637a87f, plus only the commits the throttle fix needs — expected about 10 commits, list them all in the PR body) plus the throttle fix at d4513c5, all based on the fork main. Stop with the PR checks green so it can be landed with a plain merge and no force-push. Everything else in the local private stack stays out. Purpose: give the crew host an update path that contains the substrate the rate-limit fix needs, so the fix can finally be installed there.

Rulings on this PR (supervisor decisions, verbatim; they only narrow what the review may flag and never add a requirement):

  • 002 (2026-10-18T21:36:52Z, firstmate): SKIP the rebase onto origin/main. The accepted contract is a fork-only PR based on fork/main 1079f44; rebasing onto kunchenguid upstream would pull unrelated commits into it.
  • 008 (2026-10-18T23:00:25Z, firstmate): Leave serial 8 and Herdr alone (baseline, proven).
  • 013 (2026-10-19T01:41:27Z, firstmate): Keep the change minimal (route the GitHub branch at bin/fm-pr-poll.sh:69 through the throttle, no other behavior change).

What Changed

  • Cache for no-mistakes status reads (bin/fm-nm-run-lib.sh, bin/fm-crew-state.sh). When fm-crew-state.sh reads axi, axi status or runs, it now reuses a successful result for FM_NM_CACHE_TTL seconds (default 120). The cache lives in state/nm-cache, and a per-key flock lets only one writer refresh it. If the lock wait times out, the read gets the stale value instead. A cache generation belongs to one token or invocation. Across all lanes, at most FM_NM_STATUS_SLOTS status reads run at once (default 4, wait FM_NM_STATUS_WAIT). Every call sets NO_MISTAKES_NO_UPDATE_CHECK=1, and lanes that are already landed skip the no-mistakes lookups entirely. FM_NM_LOWLOAD=0 turns all of this off. Teardown and the DoD custody gate in fm-dod-lib.sh still read live and never use the cache.
  • Shared throttle for GitHub PR reads (bin/fm-pr-lib.sh, new bin/fm-pr-read.sh). On each machine, a PR's state is fetched from GitHub at most once per FM_PR_READ_TTL seconds (default 300). Reads are serialized, back off on rate limits, and fall back to the cached answer when the lock times out. fm-crew-state.sh uses this throttle. Per ruling 013, the only other behavior change is that the GitHub branch of bin/fm-pr-poll.sh now calls fm-pr-read.sh when that script sits beside it, and calls gh pr view directly otherwise.
  • Docs and tests. New knobs are documented in docs/configuration.md and fm-pr-read.sh is listed in docs/scripts.md. Test coverage is in the new tests/fm-pr-read-throttle.test.sh plus additions to tests/fm-crew-state.test.sh, tests/fm-bearings-snapshot.test.sh and tests/fm-pr-check-security.test.sh.

Scope

The fork base is fork/main at 1079f44c, so per ruling 002 this was not rebased onto kunchenguid upstream. Against that base the PR touches 13 files (+1222/−123) in the 20 commits below. The first 11 are the nm-cache substrate and the next 9 are the PR-read throttle and its fix. 2f585770 is the fix that routes fm-pr-poll.sh through the throttle. No other part of the local stack is included.

  1. b148c003 perf(bin): cache crew-state no-mistakes reads, skip update checks and landed lanes
  2. 13f1be3c fix(bin): hold the cache lock for every refresh, recover orphaned locks, serve stale on wait timeout
  3. d9e8124c fix(bin): make cache lock recovery ownership-safe and drop the lockless refresh fallback
  4. 6d1c8746 fix(bin): replace the cache mkdir lock with an ownership-safe ticket queue
  5. 19dcc033 fix(bin): replace the cache ticket queue with a slotted lease lock
  6. 335e943e fix(bin): guard the status cache with a process-owned flock
  7. 7763de2c fix(bin): keep the lock off the CLI, make teardown ignore the cache, and clean lint
  8. c02638cf fix(bin): never replay an expired cache entry past the TTL and keep CLI exit codes off the lock sentinels
  9. 95065298 fix(bin): keep the cache library pure-shell at source time, hash keys with SHA-256, and kill only fixture children
  10. 3309d624 fix(bin): read file ages with GNU stat first and resolve the library path without external tools
  11. 6d0cf9b1 fix(tests): silence SC2016 on the empty-PATH library probe
  12. 11a13923 feat(bin): throttle GitHub PR state reads to one per PR per 5 minutes with rate-limit backoff
  13. b657b124 feat(bin): limit concurrent no-mistakes status reads across lanes to two
  14. 345a2bf0 fix(bin): make the PR read throttle's window, lock, and status slots hold under failure
  15. 59b2e31c no-mistakes(review): Serve cached PR state on lock timeout; scope cache generations
  16. ee66c9e1 fix(tests): bound bearings read overlap by the status-read limit, repair the dead-holder fixture, and keep shellcheck source-following clean
  17. 23282243 no-mistakes(review): Read DoD custody gate live, raise status slots to four
  18. 22325003 fix(bin): name a status-cache generation by token and let one invocation fill it
  19. 2f585770 fix(bin): read a GitHub merge poll through the shared PR read throttle
  20. 2a48cd85 no-mistakes(document): Document FM_PR_READ_TTL throttle knob in configuration

🤖 Generated with Claude Code

Risk Assessment

⚠️ Medium: The throttle and cache logic traces correctly and the earlier review decisions are implemented. However, changing the merge-poll template's bytes will invalidate every armed PR poll on the host that installs this update, and nothing re-arms them automatically.

Testing

I ran the real bin/fm-pr-poll.sh in the form the watcher uses (--validated) and bin/fm-pr-read.sh against real GitHub (merged PR Authentis#17 and open PR #20). A logging shim sat in front of gh to count requests and to inject rate-limit and SAML 403 refusals, with a private throttle cache. I covered: the poll going through the throttle and sharing its window with fm-pr-read, an open PR staying silent, the global rate-limit backoff and its doubling, a SAML 403 not triggering a global backoff, a stale cached record being served when the lock times out, and a copy outside bin/ falling back to a direct read. For the no-mistakes cache I stood up an isolated no-mistakes instance (its own NM_HOME daemon and a throwaway repo under /tmp) and ran the cache library and the real bin/fm-crew-state.sh against real axi status, axi and runs reads. The second heartbeat gave the same verdict with zero new spawns, a live read bypassed the cache, and failures and daemon status probes were never cached. I also ran the targeted throttle and poll-security test files, plus the 20 nm-cache crew-state tests (the 8x3 cold-heartbeat bound, four status slots, and the DoD custody gate reading live), extracted with a temporary runner that I deleted afterwards. Those tests are the only coverage for the DoD custody gate and cold-heartbeat scenario, so that scenario is recorded as untested live. The lab daemon was stopped, the LaunchAgent that no-mistakes init registered for the lab NM_HOME was uninstalled, and all scratch dirs were removed. init also printed that it reinstalled its /no-mistakes skill at user level; that skill was already installed. The worktree is clean. No UI surface was involved, so there are no screenshots.

  • Live validation: ✅ go - 9 of 10 scenarios driven live against the product
Scenario Result Live Evidence
The watcher's GitHub merge poll (bin/fm-pr-poll.sh --validated) prints 'merged' for a merged PR and reads through the throttle: a repeat poll makes no second gh request ✅ pass live pr-throttle-live-transcript.txt S1: two polls of #17 printed merged, 1 gh call in total, and a cache record (epoch/MERGED/true) was written
The merge poll and fm-pr-read.sh share one per-PR window ✅ pass live pr-throttle-live-transcript.txt S2: fm-pr-read #17 printed state=MERGED merged=true and made no new gh call
An open PR leaves the merge poll silent with exit 0 ✅ pass live pr-throttle-live-transcript.txt S3: #20 printed nothing, and its record holds OPEN/false
Adversarial: a rate-limit refusal sets a 60s machine-wide backoff that blocks reads of every PR, the last good state is still served, and a repeat refusal doubles the delay ✅ pass live pr-throttle-live-transcript.txt S4: the backoff file was set to now+60; a poll of a different PR during the backoff made 0 gh calls; the delay doubled to 120 on the next refusal after both window and…
Adversarial: a non-rate-limit HTTP 403 (SAML enforcement) does not set the global backoff, and other PRs keep reading ✅ pass live pr-throttle-live-transcript.txt S5: no backoff file was written, and the next #17 poll made a real gh read
Adversarial: while the machine-wide lock is held past the 4s wait, a stale record (900s old) is still served instead of 'unknown' ✅ pass live pr-throttle-live-transcript.txt S6: fm-pr-read returned rc=0 state=MERGED after 4s, the poll printed merged, and 0 gh calls were made
A copy of the poll outside bin/ (no fm-pr-read.sh beside it) still reads gh directly ✅ pass live pr-throttle-live-transcript.txt S7: the copy printed merged with 1 direct gh call
A repeat crew-state heartbeat on a lane reuses cached no-mistakes run-inventory reads (axi status, axi, runs) and gives the same verdict, with every spawn skipping the update check ✅ pass live nm-cache-live-transcript.txt: the second real bin/fm-crew-state.sh invocation against the isolated no-mistakes instance made 0 new spawns, the verdict was identical, and every spawn carried NO_MISTAKE…
A live read (FM_NM_CACHE_DIR unset, as teardown and the DoD custody gate use) bypasses the cache; TTL=0 disables it; failed reads and daemon status probes are never cached ✅ pass live nm-cache-live-transcript.txt: a live read and a TTL=0 read each spawned once more; an uninitialised-repo failure was re-spawned and nothing was cached; daemon status was spawned on every call
The DoD custody gate reads the run live past a cached pass, and a cold heartbeat of 8 lanes x 3 reads fits the snapshot bound with four status slots ⏸️ untested no The prior payload did not establish a live result for this scenario. Its only support was the targeted tests in crew-state-nm-cache-tests.txt, which use a fake no-mistakes CLI. Driving it live needs a…
Evidence: PR throttle and merge poll live transcript (real GitHub)

Source: PR throttle and merge poll live transcript (real GitHub)

== S1 watcher poll of a merged GitHub PR (real gh) reads through the throttle
poll #17 -> merged
[exit=0]
gh calls: 1
cache record:
  1792375392
  MERGED
  true
poll #17 again -> merged
[exit=0]
gh calls after 2nd poll (expect 1): 1
== S2 fm-pr-read.sh and the poll share one window
fm-pr-read #17:
  state=MERGED
  merged=true
gh calls (expect still 1): 1
== S3 open PR: poll stays silent
poll #20 -> '[exit=0]'
gh calls (expect 2): 2
  #20 rec: 1792375392
  #20 rec: OPEN
  #20 rec: false
== S4 rate-limit refusal sets the global backoff; later polls make no request
poll #17 at now+400 with gh rate-limited -> merged
[exit=0]
gh calls (expect 1): 1
backoff file: 1792375853 60  (expect 1792375853 60)
poll #20 at now+410 during backoff -> '[exit=0]'
gh calls (expect still 1 - backoff blocks every PR): 1
poll #17 after backoff and window expiry (now+701), limited again:
backoff file: 1792376214 120  (expect delay doubled to 120)
== S5 a non-rate-limit 403 (SAML) does not set a global backoff
poll #20 with SAML 403 -> '[exit=0]'
backoff file present? no
poll #17 right after (real gh) -> merged
[exit=0]
gh calls (expect 2): 2
== S6 machine-wide lock held past the 4s wait: stale last-good record is served
fm-pr-read #17 (record 900s stale, lock busy) rc=0 after 4s:
  state=MERGED
merged=true
poll #17 under the same conditions -> merged
[exit=0]
gh calls (expect 0): 0
== S7 a copy of the poll run outside bin/ reads gh directly
copy poll #17 -> merged
gh calls (expect 1, direct read, cache untouched): 1
== done
Evidence: nm-cache and crew-state live transcript (isolated no-mistakes instance)

Source: nm-cache and crew-state live transcript (isolated no-mistakes instance)

== cached read 1 (cold)
rc=1 first line: error: repo not initialized (run 'no-mistakes init' first)|help[1]: Run `no-mistakes init` to set up the gate in this repository|
== cached read 2 (warm, same invocation)
rc=1 identical=yes
spawns so far (expect 1):
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 axi status
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 axi status
cache entries:
  f5d29178f2af301282c41146be756071873afd45.lock
== live read (FM_NM_CACHE_DIR unset, as teardown / DoD custody gate do)
rc=1
spawns (expect 2):
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 axi status
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 axi status
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 axi status
== TTL expiry: FM_NM_CACHE_TTL=0 disables the cache
spawns (expect 3): 4
== cached read 1 (cold)
rc=0 first line: no-mistakes version v1.94.0 (6915613) 2026-10-11T13:39:09Z|
== cached read 2 (warm, same invocation)
rc=0 identical=yes
spawns so far (expect 1):
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 --version
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 --version
cache entries:
ls: /tmp/fmthr-01M58/nmcache: No such file or directory
== live read (FM_NM_CACHE_DIR unset, as teardown / DoD custody gate do)
rc=0
spawns (expect 2):
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 --version
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 --version
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 --version
== TTL expiry: FM_NM_CACHE_TTL=0 disables the cache
spawns (expect 3): 4

######## isolated NM_HOME instance, real axi status ########
== cached read 1 (cold)
rc=0 first line: current_branch: lab-feature|runs_on_current_branch: 0|runs: 0 runs yet in this repository|
== cached read 2 (warm, same invocation)
rc=0 identical=yes
spawns so far (expect 1):
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 axi status
cache entries:
  4265d639ea73ff506f75c941654d717a5220af75.gen
  e5c26e44c262e196218a2bcb8aa489c6ab5c7d15.58925.872219169.1792375993.out
  e5c26e44c262e196218a2bcb8aa489c6ab5c7d15.lock
== live read (FM_NM_CACHE_DIR unset, as teardown / DoD custody gate do)
rc=0
spawns (expect 2):
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 axi status
spawn NO_MISTAKES_NO_UPDATE_CHECK=1 axi status
== TTL expiry: FM_NM_CACHE_TTL=0 disables the cache
spawns (expect 3): 3
== cached axi status from a second crew-state invocation within TTL reuses the entry
spawns (expect 4): 3
== daemon status (liveness probe) is never cached
spawns (expect 6): 5
NOTE (driver labels corrected): 'expect 4' was a harness mislabel - a second invocation reading a key that already exists in the current generation is by design a cache hit (only a key the generation LACKS from a foreign invocation starts a new generation), so 3 spawns is correct; the two uncached daemon-status probes then take it to 5, as observed.

######## real bin/fm-crew-state.sh against the isolated no-mistakes instance (lane worktree /tmp/fmnm/repo) ########
-- crew-state invocation 1:
state: unknown · source: none · backend target gone: fm:fm-lab-x
   cumulative no-mistakes spawns:
     spawn NO_MISTAKES_NO_UPDATE_CHECK=1 axi status
     spawn NO_MISTAKES_NO_UPDATE_CHECK=1 axi
     spawn NO_MISTAKES_NO_UPDATE_CHECK=1 runs --limit 200
-- crew-state invocation 2:
state: unknown · source: none · backend target gone: fm:fm-lab-x
   cumulative no-mistakes spawns:
     spawn NO_MISTAKES_NO_UPDATE_CHECK=1 axi status
     spawn NO_MISTAKES_NO_UPDATE_CHECK=1 axi
     spawn NO_MISTAKES_NO_UPDATE_CHECK=1 runs --limit 200
-- cache dir:
   30609024cd6a5a0e1dd7ab212381a788d02bf09b.21117.205008553.1792376023.out
   30609024cd6a5a0e1dd7ab212381a788d02bf09b.lock
   4265d639ea73ff506f75c941654d717a5220af75.gen
   d30f0b9d1445473117e93a1317ea6136117556d0.21117.205008553.1792376023.out
   d30f0b9d1445473117e93a1317ea6136117556d0.lock
   e5c26e44c262e196218a2bcb8aa489c6ab5c7d15.21117.205008553.1792376023.out
   e5c26e44c262e196218a2bcb8aa489c6ab5c7d15.lock
Evidence: nm-cache crew-state targeted tests

Source: nm-cache crew-state targeted tests

ok - status cache hit skips the second spawn and every call skips the update check
ok - status reads across lanes are limited to four at once with the update check skipped
ok - a cold heartbeat of 8 lanes x 3 reads fits the snapshot bound
ok - DoD custody gate reads the run live past a cached pass
ok - status cache expires after the TTL and TTL=0 disables it
ok - landed lane skips every no-mistakes spawn
ok - parallel cold reads spawn the CLI once
ok - a dead holder's lock is released by the kernel and the refresh publishes once
ok - a live holder past the reader's timeout is never overtaken, nor an expired entry replayed
ok - readers with different timeouts share one lock
ok - a process left by the CLI cannot pin the cache lock
ok - a process left by the CLI cannot pin a status slot
ok - concurrent crew-state runs share one axi status spawn
ok - cache mtime survives GNU stat semantics
ok - the library resolves its own path without external tools
ok - publish prunes entries older than a few TTLs
ok - a never-read key refreshes the sibling reads of the same worktree
ok - undeclared callers never share a generation
ok - one invocation fills a generation across a clock tick
ok - FM_NM_LOWLOAD=0 restores uncached, update-checking calls
selected nm-cache crew-state tests passed
/opt/homebrew/bin/bash tests/.tmp-nmcache-runner.test.sh  10.42s user 9.96s system 37% cpu 54.443 total
rc=0
Evidence: PR read throttle tests

Source: PR read throttle tests

ok - one provider read per PR per window
ok - concurrent callers serialize
ok - secondary limit backs off globally and keeps the per-PR window
ok - limit serves last good record
ok - a non-rate-limit 403 spends only its own PR's window
ok - lock timeout serves last good record
tests/fm-pr-read-throttle.test.sh: line 138: 38055 Alarm clock: 14            PATH="$d/fakebin:$PATH" FM_FAKE_LOG="$d/log" FM_PR_READ_CACHE_DIR="$d/cache" FM_PR_READ_NOW=5000 perl -e 'alarm 2; exec @ARGV' "$READ" o r 11 > /dev/null 2>&1
ok - a killed read still spends the window
tests/fm-pr-read-throttle.test.sh: line 165: 45453 Killed: 9                  PATH="$d/fakebin:$PATH" FM_FAKE_LOG="$d/log" FM_PR_READ_CACHE_DIR="$d/cache" FM_PR_READ_NOW=6000 "$READ" o r 12 > /dev/null 2>&1
ok - dead lock holder never blocks the next reader
ok - one request per attempt, gh-axi only when gh is absent
ok - the merge poll shares the read window and honours the global backoff
rc=0
Evidence: PR poll security tests

Source: PR poll security tests

ok - raw-byte parser accepts canonical URLs and rejects the complete adversarial matrix
ok - GitLab merge requests are followed on any instance and never wake falsely
ok - Forgejo poll reads one pull request by number through tea api and wakes only on merged true
ok - Forgejo login match parses tea's JSON in every line shape, in the helper and the static poll
ok - the Gerrit watch wakes only on an explicit merged status and never on submittability
ok - Gerrit arming records no patch set revision and the merge path refuses to submit
ok - Gerrit arming accepts a published HEAD only by the change's current patch set tree
ok - a no-mistakes Gerrit ready report requires the pipeline's fixes recovered into the published copy
ok - validated merged polls notify once and retire before the next watcher cycle
ok - a repeat identical merged poll for an already-notified task is absorbed, never queued as a main-blocking row
ok - a failed upward merge report keeps its poll armed for repair and retry
ok - staged self-merge and poll interleavings are never silent
ok - queued merges retain their away authority after captain return
ok - poll distinguishes attended authorization from external landing
ok - accepted merge authority refuses rebound task metadata
ok - accepted merge authority persists under the lifecycle lock
ok - teardown cannot race merged-poll authority consumption
ok - poll retirement preserves a replacement authority record
ok - a merge detected by the poll is reported upward from a secondmate home exactly once
ok - a different merged PR for the same task gets its own first notification
ok - a merged poll on a persistent secondmate retires silently: no outcome, marker, or wake, and every lifecycle artifact preserved
ok - queue, receipt, and every fixed-path removal crash point recover without loss or repeated execution
ok - open/red, closed-unmerged, malformed, and forge errors remain armed until an exact merged transition
ok - replacement, nonterminal, tampered, and custom results receive no deletion authority
ok - queue failure and untrusted receipts preserve canonical poll evidence
ok - GitHub and GitLab exact merged results share one retirement path
ok - PR and teardown entrypoints reject invalid arguments before every side effect
ok - arming refuses a draft pull request, naming it, and arms a ready or unreadable one
ok - fm-pr-check refuses to record a PR or arm a merge watch on a secondmate record
ok - fm-pr-check refuses to register a PR whose named head is only in the worker copy
ok - fm-pr-check refuses a direct-PR registration while a later commit is only in the copy
ok - valid direct and merge flows record exact metadata and reject multiline head metadata
ok - rejected metacharacter bytes remain inert at generation and watcher time
ok - static poll is silent except for one merged line and remains watcher-bounded
ok - interrupted atomic preparation cleans private temporaries and publishes nothing
ok - concurrent watchers observe only complete private poll publications
ok - poll publication paths refuse symlinks and directories
ok - live poll and custom-check artifacts require private single-link files
ok - a poll armed before a volume renumber is re-recorded under the control lock and keeps detecting merges
ok - a renumbered registration is never re-recorded around a tampered artifact: swapped-check altered-check swapped-sidecar altered-sidecar altered-template-hash wrong-mode hardlinked-check split-device (foreign-device not exercisable on Darwin), or a pending retirement
ok - direct re-arm publication waits without replacing an armed poll
ok - device re-record publication waits without rewriting its registration
ok - post-rename poll validation faults revoke both names and allow a clean retry
ok - bootstrap does not rewrite unauthenticated checks or emit retired migration diagnostics
ok - watcher signals promptly stop custom checks and clean private state
ok - returned custom check descendants are drained on installed and fallback timeout paths
ok - teardown removes safe poll artifacts and refuses directory-shaped check files without traversal
rc=0

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

⏭️ **Rebase** - skipped
  • ⚠️ tests/fm-crew-state.test.sh - merge conflict rebasing onto origin/main
⚠️ **Review** - 2 issues (1 warning, 1 info)
  • ⚠️ bin/fm-pr-poll.sh:70 - This change edits bin/fm-pr-poll.sh, and every armed merge poll is authenticated by checking it byte-for-byte against that file: cmp -s &#34;$template&#34; &#34;$check&#34; and the recorded template hash in fm_pr_poll_artifacts_content_valid (bin/fm-pr-lib.sh:720 and :732). Each state/<id>.check.sh is a copy of the old bytes, so after the update lands on the crew host every poll armed before it (GitHub, GitLab, Gerrit and Forgejo alike) stops matching. fm_pr_poll_snapshot_capture then fails, and fm-watch.sh puts the poll in rejected_checks (bin/fm-watch.sh:3040/3071). The watcher wakes with 'check: rejected unauthenticated state checks' (:3156) on each sweep and stops following those PRs to merge. No path re-arms them automatically: nothing in session-start, bootstrap or the watcher calls fm-pr-check.sh. Concrete case: a lane has an open GitHub PR with a poll armed, the host installs this PR, the PR merges, and no merge wake ever fires while the watcher keeps raising the rejection wake. Ruling 013 authorizes editing line 69, so the change itself is in scope. What needs a decision is how to handle this upgrade step: either tell the operator in the PR body to re-run fm-pr-check.sh for each armed lane after the update, or add a re-arm or migration path. A migration path would extend the change, so it needs authorization.
  • ℹ️ tests/fm-bearings-snapshot.test.sh:3170 - The rewritten overlap assertion requires the peak number of reads in flight to be exactly 4 ([ &#34;$max&#34; = 4 ]) with 5 lanes and 1s fake reads. On a slow runner the five crew-state processes may not all reach axi status within the same 1s window, so the peak can read 3 even though nothing is wrong. -ge 2 &amp;&amp; -le 4 would still catch both serialized reads and a broken slot limit, so it is the more robust bound. This is noted for the test step and needs no action now.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 9 of 10 scenarios driven live against the product
Scenario Result Live Evidence
The watcher's GitHub merge poll (bin/fm-pr-poll.sh --validated) prints 'merged' for a merged PR and reads through the throttle: a repeat poll makes no second gh request ✅ pass live pr-throttle-live-transcript.txt S1: two polls of #17 printed merged, 1 gh call in total, and a cache record (epoch/MERGED/true) was written
The merge poll and fm-pr-read.sh share one per-PR window ✅ pass live pr-throttle-live-transcript.txt S2: fm-pr-read #17 printed state=MERGED merged=true and made no new gh call
An open PR leaves the merge poll silent with exit 0 ✅ pass live pr-throttle-live-transcript.txt S3: #20 printed nothing, and its record holds OPEN/false
Adversarial: a rate-limit refusal sets a 60s machine-wide backoff that blocks reads of every PR, the last good state is still served, and a repeat refusal doubles the delay ✅ pass live pr-throttle-live-transcript.txt S4: the backoff file was set to now+60; a poll of a different PR during the backoff made 0 gh calls; the delay doubled to 120 on the next refusal after both window and…
Adversarial: a non-rate-limit HTTP 403 (SAML enforcement) does not set the global backoff, and other PRs keep reading ✅ pass live pr-throttle-live-transcript.txt S5: no backoff file was written, and the next #17 poll made a real gh read
Adversarial: while the machine-wide lock is held past the 4s wait, a stale record (900s old) is still served instead of 'unknown' ✅ pass live pr-throttle-live-transcript.txt S6: fm-pr-read returned rc=0 state=MERGED after 4s, the poll printed merged, and 0 gh calls were made
A copy of the poll outside bin/ (no fm-pr-read.sh beside it) still reads gh directly ✅ pass live pr-throttle-live-transcript.txt S7: the copy printed merged with 1 direct gh call
A repeat crew-state heartbeat on a lane reuses cached no-mistakes run-inventory reads (axi status, axi, runs) and gives the same verdict, with every spawn skipping the update check ✅ pass live nm-cache-live-transcript.txt: the second real bin/fm-crew-state.sh invocation against the isolated no-mistakes instance made 0 new spawns, the verdict was identical, and every spawn carried NO_MISTAKE…
A live read (FM_NM_CACHE_DIR unset, as teardown and the DoD custody gate use) bypasses the cache; TTL=0 disables it; failed reads and daemon status probes are never cached ✅ pass live nm-cache-live-transcript.txt: a live read and a TTL=0 read each spawned once more; an uninitialised-repo failure was re-spawned and nothing was cached; daemon status was spawned on every call
The DoD custody gate reads the run live past a cached pass, and a cold heartbeat of 8 lanes x 3 reads fits the snapshot bound with four status slots ⏸️ untested no The prior payload did not establish a live result for this scenario. Its only support was the targeted tests in crew-state-nm-cache-tests.txt, which use a fake no-mistakes CLI. Driving it live needs a…
  • /tmp/fmthr-01M58/drive.sh (deleted afterwards): runs real bin/fm-pr-poll.sh --validated and bin/fm-pr-read.sh against real GitHub PRs #17 (merged) and #20 (open) through a logging gh shim and a private FM_PR_READ_CACHE_DIR
  • /tmp/fmthr-01M58/nmdrive.sh (deleted afterwards): fm_nm_run_checked against the real no-mistakes CLI, isolated NM_HOME=/tmp/fmnm/home and a throwaway repo initialised with no-mistakes init
  • FM_STATE_OVERRIDE=/tmp/fmnm/state bin/fm-crew-state.sh lab-x run twice against the isolated no-mistakes instance
  • bash tests/fm-pr-read-throttle.test.sh
  • bash tests/fm-pr-check-security.test.sh
  • the 20 nm-cache tests in tests/fm-crew-state.test.sh (test_status_cache_hit_skips_second_spawn_and_update_check through test_lowload_kill_switch_restores_old_behavior, including test_cold_heartbeat_of_eight_lanes_fits_the_snapshot_bound and test_dod_custody_gate_bypasses_the_status_cache), run through a temporary runner that was deleted afterwards
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

holu and others added 30 commits September 18, 2026 10:51
…ests

The imported steward-exemption tests used bare GNU-only `sed -i`,
which fails under BSD/macOS sed with no backup suffix argument.
Match the repo's existing sed -i.bak convention.
…osures

reconcile close requires a board-created reconcile request, so an OPEN
DECISIONS reconciliation that finds a moot call with no pending request
has no truthful completion path, and closing it under answer would
fabricate captain provenance for words the captain never gave.

Add fm-captain-hold.sh rule: it records the same evidentiary standard as
reconcile close (a non-empty evidence file, never an assertion) under a
distinct Firstmate ruling label, closes an actively held call without the
board-request precondition, and retroactively attaches the same record to
a task already closed with no resolution record so a truthful ordinary
closure can satisfy verify without impersonating a captain answer. An
exact retry is idempotent; drifted evidence or an incompatible existing
resolution mode is refused rather than relabeled.
(cherry picked from commit 9d00a76d8b22ae39c72d20256c600737b9820129)
The registered `axi respond --action fix --findings <ids>` interface only
advances the findings a round selects; an unselected finding is not
re-surfaced by the tool's own output on a later round and had no durable
firstmate-side record, so a worker could report everything addressed while
silently dropping open findings (observed run 01M1TB9ZZQGN0JQ1RYV3WERD4S,
review round3).

Add bin/fm-nm-findings-lib.sh as the single owner of a durable, append-only
JSONL finding-retention ledger and its fold/report/completion logic: every
finding a gate presents is retained under its original identity, verbatim
text, and provenance until an explicit fixed/skipped-closed/deferred
disposition names it, with deferred requiring both an external owner and id.
A disposition for a finding never seen is not fabricated into a closure, and
an absent or malformed ledger degrades safely rather than erroring.

Wire the worker-side contract into bin/fm-dod-lib.sh's no-mistakes
Definition-of-done block and its ask-user escalation block (both single
policy owners), so a driving worker hand-appends to the ledger at every gate
and folds it before reporting done, and extend the two fm_dod_block call
sites (bin/fm-brief.sh, bin/fm-promote.sh) with the data-dir argument the new
ledger path needs.

(cherry picked from commit a5ac620d184655e256e53989569a9ffa2f2f927e)
A spawn whose treehouse-get never reaches an isolated worktree refused
at the deadline but left the window it had just created behind: no task
record named it, nothing else could ever close it, and the clean retry
refused on "window <session>:fm-<id> already exists".

The abort trap now runs a transactional rollback that closes exactly the
endpoint this spawn created, and only after proving it still answers as
this spawn's own endpoint, holds no agent and no composer work, has no
task record (partial ones included), and acquired no isolated copy - so
a pre-existing or replaced endpoint is never closed and no project path
or other task's worktree is touched. Armed on tmux and herdr, the
backends whose liveness classifier is recovery-grade; disarmed the
moment the task record publishes and teardown takes ownership.

Adds executable race/negative tests: the incident's refused-isolation
shape rolls its window back and retries cleanly, and pre-existing
window, partial metadata, and live agent each block the rollback.

(cherry picked from commit ea4715d91c8c45dd2867e9eaa313020d25dec83a)
Absorbs:
- daaffdb fix(bin): create captain-hold rows when Beads requires due (kunchenguid#4854)
- 1bb72cc fix: disable compact adviser for spawned agents (kunchenguid#4877)
Absorbs:
- 4812db8 fix(bin): preserve Claude lock ownership after helper recycling (kunchenguid#4894)
- 65a3bac feat: park main under the away posture on Pi (kunchenguid#4889)
- 2bcb88c ci: standardize workflow timeouts into three tiers (kunchenguid#4910)
A separated Pi composer was rejected while the agent was working, leaving lifecycle restart unable to queue a control command. Admit working only after the existing identity and blank-pair proof; blocked Pi panes still defer because their prompts intercept input.
…fresh-20260920

# Conflicts:
#	docs/architecture.md
Defect: when `no-mistakes axi status`'s overview is truncated (a task's
own branch has zero rows among the shown ones), fm_nm_select_run's
Python fallback derived the repo identity for its direct SQLite query
from a `repo: <path>` line it expected in the overview text. The real
CLI never emits that line, truncated or not (see the genuine capture at
tests/captures/no-mistakes-v1.70.1/overview.toon, which has only
`count:`/`runs[...]:`), so the lookup always failed and reported
"unreadable runs table" for a task that simply has no run on its
branch. On a fleet with many concurrent runs, every idle-branch task
hits the truncated-overview path routinely, so this fired every few
minutes and drowned genuine unreadable/blocked verdicts in noise.

Fix: derive the repo identity from the task worktree path instead,
which is exactly the value `no-mistakes` records as a repo's
`working_path` (confirmed against the existing capped-overview test
fixtures, which already register repos by worktree path). A worktree
path that is not absolute cannot be matched and still reads as
unreadable rather than being guessed at. Also raise the reader's
SQLite busy timeout from 1s to 30s so ordinary lock contention on a
busy fleet cannot masquerade as an unreadable database.

Safety: every other verdict byte-for-byte unchanged - the repo lookup
still requires exactly one matching row (a genuinely corrupt or
mismatched repos table still reports unreadable, per the existing
`repo` failure-mode test), the branch query and row validation are
untouched, and a zero-row result for the branch still flows through
the same recursive re-parse that already turns an empty `runs[0]{...}`
table into `absent`. Added a regression test
(test_capped_overview_without_repo_line_and_no_runs_reports_absent)
that reproduces the real overview shape - capped, zero rows for the
task's branch, no `repo: ` line - and asserts the crew state falls
through to the pane/busy verdict instead of reporting unknown or
"unreadable". Full fm-crew-state.test.sh suite passes unchanged
otherwise.
Two independent defects in the published --secondmate-home-summary path
made a healthy home read as invalid, burying real alarms under false ones.

1. bin/fm-nm-run-lib.sh: a pooled lane is a git worktree whose
   `git rev-parse --git-common-dir` resolves to the primary checkout, and
   the no-mistakes daemon files every lane's runs under ONE repo row keyed
   by that primary path. fm_nm_select_run's capped-overview reader looked
   up repository identity by the lane's own exact worktree path, which
   never matches that row, so a live run on the lane's branch was reported
   as "complete same-branch run inventory unreadable" - unknown run-step,
   which then surfaced as child_current_unavailable. The reader now also
   tries the lane's resolved primary-checkout path (derived from its
   common dir) as a second identity candidate, and, when neither path
   matches a repo row, falls back to a runs-by-branch lookup that is
   trusted only when the branch resolves to exactly one repo_id (two repos
   coincidentally sharing a branch name stays unresolved, preserving the
   cross-repo safety the exact-path lookup exists for). A genuinely
   unreadable database still reports unreadable.

2. bin/fm-fleet-snapshot.sh: unknown_children can only exempt a child via
   a steward exemption when a matching "hold" identity row exists in
   durable_steward_rows, and that row was synthesized from live
   current-state only for the parked/paused/blocked states - never for
   unknown or stopped, the two states unknown_children actually gates on.
   A plain in-flight child with no backlog hold at all (current_role ==
   "worker") could therefore never be exempted once its endpoint read
   unknown or stopped: even a fully valid, date-current,
   state-and-detail-matching steward exemption stayed permanently
   inactive, and the home stayed invalid. The child-state row generator
   now also fires for unknown and stopped, matching the doc comment at the
   top of the file, which already promised this coverage. A record with no
   matching exemption at all is unaffected and still reads unknown.
…eadable

fm_nm_select_run's deep SQLite reader rebuilds a `count:`/`runs[...]:`
overview and re-runs it through the same awk selection pass. When that
rebuilt inventory has zero rows for the branch, the row-matching loop never
executes, so its counters (`seen`) stay at awk's uninitialized empty string
while `expected` and `shown` are plain strings parsed from the header text.
Comparing an uninitialized value against a non-numeric string uses string
comparison, so "" != "0" is true, and the END block takes the "unreadable
runs table" branch instead of falling through to the correct "absent"
verdict for a branch with genuinely zero runs.

Coerce the affected END comparisons with `+0` so they are always numeric,
matching seen/expected/shown/total regardless of whether awk classified
them as strings or numeric strings. A truncated or genuinely malformed
inventory still differs numerically and still reports unreadable.
… lines

The rule-command regression test predates upstream's status-line
timestamping and compared raw parent-channel content, so every stamped
line broke it after the merge.
A user systemd unit does not inherit the login PATH (~/.local/bin, the
nvm node dir), so fm-fleet-steward.sh arm's generated
next-up-refresh.service ran refresh with a PATH missing tools such as
br, and every scheduled run exited 1 with "required tool not found:
br". The scheduled refresh therefore never regenerated the verified
ready queue after the first arm, and data/next-up.md silently went
stale while still listing already-merged work.

Worse, that failure was invisible: refresh only exited nonzero into a
journald line nobody reads, so a day-stale ready list looked no
different from a healthy one to the rest of the fleet-steward
machinery.

Fix both halves:
- action_arm's generated service unit now carries a single
  Environment=PATH=... line copied from the arming shell's own PATH
  (the environment an interactive arm already proved works), so the
  scheduled run resolves the same tools an interactive run does.
- action_refresh now writes a durable failure record
  (state/.fleet-steward-refresh-failure) on every failure path instead
  of only returning nonzero, and the registered check surfaces each
  new failure once as a fleet-steward wake, clearing the record (and
  its report marker) on the next successful refresh.

Adds behavioral tests covering: a missing required tool produces the
visible failure record and a nonzero exit; a refresh run with exactly
the armed unit's own PATH still resolves every tool; the check
surfaces a new failure once and stays silent on a repeat poll; and the
generated unit actually carries the PATH line.
Defect: a remote secondmate's idle Pi pane read composer state `unknown`
forever even though herdr's own `agent get` reported the Pi idle, so
`bin/fm-remote-secondmate-control.sh relaunch` refused to type the `/quit`
exit command it needs to recover a supervisor agent. The captain had to
type the exit command by hand.

Cause: `_fm_composer_scan_screen`'s Pi handling only proves a composer
when it sees a matched PAIR of horizontal separator rows bounding a
(possibly blank) content region - the classic rule/blank/rule sandwich.
A live capture from the affected pane (preserved at
data/fm-overlay-pi-composer-idle-unknown-0921-capture.txt) shows a newer
Pi rendering that draws only ONE separator for a genuinely empty
composer: unrelated transcript/queued-follow-up text sits above the rule,
and directly below it Pi draws its own status furniture instead of a
second rule - a cwd+branch line, then a resource-usage line shaped like
`↑<tokens> ↓<tokens> R<mem>M <pct>%/<ctx>K (<mode>)`. With only one
separator ever drawn, the pairing state machine never completes a pair,
so every caller fails closed to `unknown`.

Fix: `_fm_composer_scan_screen` gains a fallback that runs only when no
ordinary pair was found and a lone separator exists. It checks whether
the screen's own last row matches the resource line and, optionally,
whether the row above that matches the branch line; if so it treats the
footer's start as a synthetic closing separator, so the gap between the
lone rule and the footer becomes the composer's content region, scanned
by the same `_fm_composer_classify_pi_rows` a real second rule would
feed. Every other verdict path (identity, blocked, the max-line bound,
non-blank content) is unchanged, and a normal two-rule pair never reaches
this fallback at all.

Safety: the resource line's arrows and fixed `R<n>M`/`%/<n>K` tokens are
not something a human composes by accident, so recognizing it is new
positive structural proof, not a relaxation of the strict blank-row rule
that already refuses an unidentified blank composer row. The fallback
still requires the identity+structure conjunction the rest of the Pi
path enforces (missing or foreign identity, or a blocked status, stays
`unknown`), and content between the rule and the footer that fails to
resolve empty still reads `pending`, never a forced `empty`.

Tests: tests/fm-composer-lib.test.sh gains
test_matrix_pi_lone_separator_footer, pinning the real capture's shape
and asserting idle -> empty, typed content -> pending, blocked -> unknown,
missing/foreign identity -> unknown, a malformed footer -> unknown, and
an over-tall gap -> unknown. The full fm-composer-lib.test.sh and
fm-composer-ghost.test.sh suites, plus fm-lint.sh and shellcheck, pass
unchanged. docs/verification/runtime-backends.md records the dated
evidence and the still-owed live-guard refresh once a Pi release that
renders this footer is reachable from a fresh isolated tmux session.
# Conflicts:
#	bin/fm-composer-lib.sh
#	bin/fm-dod-lib.sh
#	bin/fm-nm-run-lib.sh
#	tests/fm-crew-state.test.sh
The doorbell, generated brief, and relaunch note told a worker to
acknowledge a steering-inbox record with a literal mv naming the inbox
directory by its absolute path on both sides. Some worker-environment
command guards refuse a file-relocation command that names an absolute
path under a user home, so the worker understood and intended the
acknowledgement but had it refused at execution time: the record stayed
unhandled, the watcher re-rang forever, and the lane looked stuck.

Add bin/fm-inbox-ack.sh, invoked by its own absolute path (an ordinary
script invocation, not itself a relocation command) and performing the
actual mv using paths relative to the inbox directory after cd'ing into
it. The doorbell (fm_task_inbox_doorbell_line), the generated brief
scaffold, and the relaunch progress note all now name this helper
instead of mv directly.
…r unasked confirmations

Two independent workers on different harnesses closed their own no-mistakes
gate findings the same day, and three lanes froze silently on confirmation
prompts they could not answer. Add both rules as plain sentences to every
ship mode's Definition of done, wording only.
…e both real files

fm-ensure-agents-md.sh refused a project that deliberately keeps both files
real (e.g. decision-os) with only "reconcile them manually", leaving a worker
told to record project memory and blocked from the pointer convention with no
sanctioned path, pushing toward hand-writing AGENTS.md directly.
A worker's done: event is treated as a completion signal regardless of
whether it matches the ready shape its recorded delivery mode promises
(a pull request URL for no-mistakes/direct-PR, "ready in branch" for
local-only). Two 2026-09-21 mode=no-mistakes instances reported done
naming only a branch and a commit, with no pull request in any state,
and neither was caught until a supervisor checked the forge by hand.

kunchenguid dbc0bc4 does not cover this: it only strengthens a done
report that CLAIMS a pull request by reading it back from the forge, so
a report claiming none stays invisible to it.

Add a pure shape comparison against the already-recorded mode
(status_done_mode_shape_ok, bin/fm-classify-lib.sh) and wire it into
the wake annotation firstmate actually reads (fm_wake_print_annotations,
bin/fm-wake-lib.sh), so a mismatched done line is called out as a
DONE SHAPE MISMATCH instead of presented as an ordinary completion. No
new record: both the mode and the event text were already being read.
… fm-tool-update-check.sh

bin/fm-tool-update.sh is the mechanical applier for config/watched-tools.json,
in the shape of bin/fm-update.sh plus the updatefirstmate skill. It never
passes --force to anything and treats a tool's own nonzero exit, or git's own
refusal of pull --ff-only, as authoritative proof an update should not
proceed - reported skipped, never retried or worked around. A command tool is
verified before and after its update_args run, so an update that exits 0
without moving the version is reported failed, not done. Fleet dispatch
applies on this host and on every host registered in data/secondmates.md.

The updatetools skill drives it from a captain invocation or the existing
tool-updates check wake becoming actionable.
Teardown removes state/<id>.status and state/<id>.meta once a task
lands, destroying exactly the decision and merge provenance most
worth auditing on the tasks that just finished. Move two writes to
data/<id>/, which cleanup never touches: fm-send.sh --resolve-key now
durably records a gate finding's full, untruncated disposition to
data/<id>/decisions.md alongside the capped status-log close line, and
fm-pr-merge.sh now records who merged and against which verified head
to data/<id>/merge-proof.md alongside state/<id>.merge-authority.
Authentis and others added 27 commits October 13, 2026 06:23
Fork keeps: review-receipt gate docs, trim-guard hardening, no-mistakes
mirror tests, squash-preserve behavior and its tests. Upstream brings:
Forgejo tea merge path, wake-fold/Codex-checkpoint docs, FORGE_RULE_LINE
scaffold refactor, Forgejo teardown tests.
…test shard (#16)

* fix(tests): repair the eight baseline CI failures on the fleet fork

Reconcile fixtures and one type error with behavior that already landed:
Pi extension handlers narrow the before_agent_start event union before
reading prompt; Pi secondmate fixtures name an explicit model and run the
first-call fake; the wake-fold suite follows the scan exclusion of a remote
mate's own parent channel; the kimi launch expectation carries the spawner
PATH export; and three lint findings are cleared.

* no-mistakes(test): Make busy-adapter and session-start test fixtures hermetic

* fix(tests): give the supervision-host test its own portable serial shard

The hosted rerun of Behavior portable serial 2 was cancelled at the 30-minute
limit: tests/fm-supervision-host.test.sh took 1030s and then 1620s against a
789s planning hint, and the planner had packed about 150s of other scripts
behind it. Raise its hint to the lane budget so the planner leaves it alone in
its shard, require that isolation in the runner test, and record the reason in
the shard doc. No test is skipped and no timeout changes.

* no-mistakes(document): Fix stale wake-fold echo reference in supervision-host docs

---------

Co-authored-by: Authentis <authentis@users.noreply.github.com>
… each launch took a turn (#17)

* feat(bin): check worker models against the harness catalog and verify each launch took a turn

Adds the launch-check verb, the shared Pi/OpenCode catalog rule, launch-registered provider handling, and the custody-first completed/held/failed verdicts, with regression and live-guard tests.

* no-mistakes(document): Align control-plane docs with the launch-check verb

* no-mistakes(review): Remove host-load rule from worker briefs and its test
…ks, serve stale on wait timeout

(cherry picked from commit e2cce5d)
…ss refresh fallback

(cherry picked from commit 8c85324)
…LI exit codes off the lock sentinels

(cherry picked from commit 7b08029)
… with SHA-256, and kill only fixture children

(cherry picked from commit 5176349)
…path without external tools

(cherry picked from commit a4e458b)
… with rate-limit backoff

Concurrent GraphQL reads plus a gh-axi fallback on every failure exhausted
GitHub's secondary limit. Reads now share a machine-wide cache and lock, back
off exponentially on a rate-limit refusal, and never fall back while limited.
Adds bin/fm-pr-read.sh so timer-driven scripts can share the throttle, and
collapses four duplicate bounded readers in fm-crew-state.sh.

(cherry picked from commit af1890f)
A heartbeat fanning out over many lanes spawned one status read per lane at
once, since each cache key lock serializes only its own lane. Reads now take
one of FM_NM_STATUS_SLOTS (default 2) machine-wide flock slots and fail to
unknown after FM_NM_STATUS_WAIT seconds. The update check was already skipped
on these reads and stays covered by the existing test.

(cherry picked from commit 6d52fc0)
…hold under failure

Stamp the per-PR attempt before the request so a killed or limited read still
spends the window, and keep it composed with the global backoff. Replace the
pid-file lock with a kernel flock so a dead holder can never be reclaimed
unsafely. Make one request per attempt (gh, else gh-axi) with no second
provider after a failure. Close the status-slot descriptor before the CLI runs
so a leftover child cannot pin a slot.

(cherry picked from commit d4513c5)
…air the dead-holder fixture, and keep shellcheck source-following clean

The large-snapshot test now gives each lane its own worktree and asserts the in-flight read count (1 serialized, 2 concurrent) instead of a wall-clock saving.
The dead-holder fixture kills the process that owns the flock, recorded by the holder itself.
fm_pr_github_read_record names its cache directory cache_dir so followed sources no longer raise SC2031 in callers.
…ion fill it

The no-mistakes status cache decided generation membership by whole-second
mtimes, so a key first read in the same second a sibling was published kept
that sibling serving the pre-read answer, and a fill that straddled a second
boundary respawned its own earlier reads.

A generation is now a token in the worktree's .gen record, carried in every
entry's file name. A key the generation lacks joins it only when the same
invocation started it (fm-crew-state sets FM_NM_CACHE_INVOCATION; any other
caller is its own process); from another invocation it starts a new token and
orphans the siblings, whatever the clock says. The regression tests drop the
one-second pause and cover both directions.
The watcher's merge poll ran gh pr view directly every sweep, so it spent no
read window, ignored the global rate-limit backoff, and let two homes or two
tasks on one pull request each read it. When the watcher runs it from bin/, the
GitHub branch now reads through fm-pr-read.sh; a copy run elsewhere keeps the
direct read. The security fixtures answer the throttle's query and keep a
private cache, and the throttle test covers the poll sharing the window and
honouring the backoff.
@Authentis

Copy link
Copy Markdown
Contributor Author

Opened against the wrong base repo by mistake; superseded by the fork PR Authentis#20, which carries this content.

@Authentis Authentis closed this Oct 19, 2026
@Authentis
Authentis deleted the fm/fm-ratecap-substrate-1019 branch October 19, 2026 05:15
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.

1 participant