Skip to content

fix(bin): keep GitHub readers paused across re-registration - #5286

Open
connectwithclayton wants to merge 3 commits into
kunchenguid:mainfrom
connectwithclayton:fm/fm-github-read-pause-durability
Open

connectwithclayton wants to merge 3 commits into
kunchenguid:mainfrom
connectwithclayton:fm/fm-github-read-pause-durability

Conversation

@connectwithclayton

Copy link
Copy Markdown

Intent

Treat the non-durable no-GitHub-read pause as a Firstmate safety bug and route the smallest owner-side fix. Start from the operator-visible reproduction: while a no-GitHub-read credential-safety pause is active, startup or later PR registration can silently re-arm contribution observation or merge polling. Separate trigger, masking condition, and visible symptom; compare the re-arming paths with the supported local-only retirement path; inspect relevant history; test the smallest counterfactual and disconfirming evidence. Implement only if the cause is proven, turning both startup and PR-registration reproductions into regression tests. Preserve PR/head metadata, contribution records, and sidecars needed for later resumption. Do not release or weaken the pause, perform GitHub or Vault operations, touch the currently retired live observers, publish, or merge. Use the project standard validation path when credentials become safely available; until then preserve a clean implementation and report the evidence.

What Changed

  • Add a durable GitHub-read pause command that retires contribution observation and GitHub merge polling without deleting resumable records.
  • Prevent startup, contribution polling, PR registration, and watcher snapshots from performing or re-arming GitHub reads while paused, while preserving PR/head metadata and poll sidecars.
  • Add regression coverage for startup and PR-registration re-arming, marker-first races, idempotent pauses, record preservation, and unaffected GitLab polling.

Risk Assessment

✅ Low: The requested status mode removal is complete, and the remaining change is a well-bounded durable pause implementation with no newly substantiated material issues beyond the previously reviewed and explicitly ignored finding.

Testing

Live isolated CLI registration and startup confirmed that no GitHub reader was armed, no GitHub CLI was available, and PR/head metadata plus resumable sidecars remained intact. The focused six-scenario regression passed but was not live product validation, so its adversarial and scope-boundary scenario is untested under this contract.

  • Live validation: ⚠️ inconclusive - 2 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Registering a GitHub PR during an active pause records resumable metadata without GitHub access or re-arming observers ✅ pass live Live durable GitHub-read pause transcript
Starting Firstmate during an active pause leaves contribution observation and merge polling retired while preserving PR metadata and sidecars byte-for-byte ✅ pass live Live durable GitHub-read pause transcript
The pause is idempotent, blocks an already-snapshotted reader, preserves durable records, and does not retire GitLab polling or alter normal unpaused behavior ⏸️ untested no The prior payload cited only a test command and explicitly recorded live=false, so it did not establish this scenario against the live running product.
Evidence: Live durable GitHub-read pause transcript

Source: Live durable GitHub-read pause transcript

LIVE SCENARIO: active durable pause, GitHub CLI absent from PATH
gh available: no
ACTION: register PR while pause is active
recorded: state/delivery.pr-poll (GitHub reads paused)
STATE AFTER REGISTRATION:
absent  delivery.check.sh
absent  contributions.check.sh
absent  contributions.check-trust
present delivery.pr-poll
present delivery.pr-poll-registration
present delivery.meta
present .github-read-pause
ACTION: run local startup while pause is active
MISSING: tmux (install: brew install tmux  # or the platform's package manager)
MISSING: treehouse (install: curl -fsSL https://kunchenguid.github.io/treehouse/install.sh | sh)
MISSING: node (install: brew install node  # or the platform's package manager)
MISSING: gh (install: brew install gh  # or the platform's package manager)
MISSING: no-mistakes (install: curl -fsSL https://raw.githubusercontent.com/kunchenguid/no-mistakes/main/docs/install.sh | sh)
MISSING: gh-axi (install: npm install -g gh-axi && gh-axi setup hooks)
MISSING: chrome-devtools-axi (install: npm install -g chrome-devtools-axi && chrome-devtools-axi setup hooks)
MISSING: tasks-axi (install: npm install -g tasks-axi)
MISSING: quota-axi (install: npm install -g quota-axi)
PRESENTATION_UNAVAILABLE: lavish-axi (requires >=0.1.46; install: npm install -g lavish-axi && lavish-axi setup hooks) - nonvisual work may proceed with plain-text decisions and reports; install or upgrade before using Lavish
STATE AFTER STARTUP:
absent  delivery.check.sh
absent  contributions.check.sh
absent  contributions.check-trust
present delivery.pr-poll
present delivery.pr-poll-registration
present delivery.meta
present .github-read-pause
PR poll preserved byte-for-byte: yes
PR registration preserved byte-for-byte: yes
metadata: worktree=/var/folders/nz/2_wts0tj2_s7x1flcwlpvvdh0000gn/T//fm-pause-live.MDi13k/home/wt kind=ship pr=https://github.com/o/r/pull/8 pr_head=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
- Outcome: ⚠️ 1 warning across 1 run (4m34s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed ✅
  • 🚨 bin/fm-github-read-pause.sh:93 - The pause classifies a runnable check solely from the adjacent .pr-poll sidecar. A stale GitHub sidecar can coexist with a later custom check registered under the same task ID, causing pause to delete that non-GitHub check. Concurrent GitLab registration can likewise replace a GitHub poll after classification and then be deleted. Serialize with the task publication/control locks and validate that the current registered artifacts still form the GitHub poll before unregistering.
  • ⚠️ bin/fm-github-read-pause.sh:43 - The new status mode is not required by the stated durable-pause fix and expands the command's user-facing surface beyond the required pause owner. The smallest implementation can omit this mode; remove it unless separate status behavior is explicitly desired.

🔧 Fix applied.
✅ Re-checked - no issues remain.

⚠️ **Test** - 1 warning
  • ⚠️ live validation verdict: inconclusive (2 of 3 scenarios were driven live against the product); untested: The pause is idempotent, blocks an already-snapshotted reader, preserves durable records, and does not retire GitLab polling or alter normal unpaused behavior
  • Live validation: ⚠️ inconclusive - 2 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Registering a GitHub PR during an active pause records resumable metadata without GitHub access or re-arming observers ✅ pass live Live durable GitHub-read pause transcript
Starting Firstmate during an active pause leaves contribution observation and merge polling retired while preserving PR metadata and sidecars byte-for-byte ✅ pass live Live durable GitHub-read pause transcript
The pause is idempotent, blocks an already-snapshotted reader, preserves durable records, and does not retire GitLab polling or alter normal unpaused behavior ⏸️ untested no The prior payload cited only a test command and explicitly recorded live=false, so it did not establish this scenario against the live running product.
  • bash tests/fm-github-read-pause.test.sh
  • Live isolated bin/fm-pr-check.sh delivery https://github.com/o/r/pull/8 with an active pause and gh absent from PATH
  • Live isolated bin/fm-bootstrap.sh with FM_BOOTSTRAP_NETWORK=skip, an active pause, and gh absent from PATH
  • Inspected persisted observer, PR-poll, registration, metadata, and pause-marker state before and after startup
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@connectwithclayton

Copy link
Copy Markdown
Author

Maintainer action requested for exact head e2d80b9d15fdd6001ca9a3b913c8e4e207151dbc: the contribution author's upstream permission is read-only, so I cannot approve the required fork workflows. Please approve and run CI (https://github.com/kunchenguid/firstmate/actions/runs/35732908196) and Require no-mistakes (https://github.com/kunchenguid/firstmate/actions/runs/35732908187). No check waiver or merge is requested.

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