Skip to content

fix(bin): retry transient contribution forge reads once before waking - #7302

Merged
kunchenguid merged 13 commits into
kunchenguid:mainfrom
LiamSarsfield:fix/contrib-retry-7262
Oct 15, 2026
Merged

kunchenguid merged 13 commits into
kunchenguid:mainfrom
LiamSarsfield:fix/contrib-retry-7262

Conversation

@LiamSarsfield

@LiamSarsfield LiamSarsfield commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Retry one failed GitHub forge read when gh reports a transient HTTP 5xx, 429, secondary-rate-limit 403, connection, DNS, or TLS error.
Both attempts share the existing per-read and overall deadlines.
Persistent and non-transient failures retain a sanitized read name and error category in the observation record, without response bodies or authentication details.
HTTP 401, 404, other 4xx, and timeouts still report immediately.

Fixes #7262

GraphQL errors, including GitHub's timeout response, are not retried.
A bare EOF connection drop is not yet treated as transient.

Validation

The 54-case contributions suite passed, including recovery from one HTTP 500, a persistent HTTP 500 with one wake and a named read, and a non-retried HTTP 404.
The changed-file test selection passed five suites, and repository lint passed with ShellCheck 0.11.0 and actionlint 1.7.12.
Live fault-injection checks covered 5xx, rate limits, network and TLS failures, timeout bounds, watcher notifications, and multi-poll failure episodes.

Pipeline

Updates from git push no-mistakes

Address review findings for kunchenguid#7262 by parsing only gh status forms, recognizing real DNS errors, refusing GraphQL not-found retries, clearing per-URL diagnostics, and restoring exit-137 handling.
Complete kunchenguid#7262 review fixes by accepting bodyless gh status lines and keeping all GraphQL errors out of transient network classification.
Address review findings for kunchenguid#7262 by parsing only gh status forms, recognizing real DNS errors, refusing GraphQL not-found retries, clearing per-URL diagnostics, and restoring exit-137 handling.
Complete kunchenguid#7262 review fixes by accepting bodyless gh status lines and keeping all GraphQL errors out of transient network classification.
@LiamSarsfield LiamSarsfield changed the title fix(bin): retry transient contribution forge reads once and record which read failed fix(bin): retry transient contribution forge reads once before waking Oct 14, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: reviewed tip 03c0cbb4 vs main 24f3a6b8 after approving fork CI.

Closes claim: author body Fixes #7262 verified — tip adds one retry inside the existing per-read bound for transient forge failures (HTTP 5xx / 429 / secondary-rate-limit 403 / connection / DNS / TLS), keeps 401/404/other 4xx and timeouts immediate, and extends tests. Main forge() still has no retry and still wakes on a single 5xx. This is the help for ready-for-pr #7262.

Contract-class: restore. Contribution observation already promises wakes for lasting forge failure, not transient GitHub blips. Retry-once on classified transients restores that contract without a new default-on captain surface.

VISION.md (each rule):

  • One captain, one interface: aligns — false unavailable wakes are noise.
  • Authority is explicit: aligns — no new grant; real 4xx/auth/timeout still report.
  • Scripts own the mechanics: aligns — retry/classification is exact script work.
  • A restart is a non-event: aligns — observation should reconcile without hand clears.
  • Delegation with a spine: aligns — supervision turns belong to lasting failures.
  • The fleet outlives any vendor: aligns — forge adapter tolerates vendor blips.
  • Scope: aligns — contributions poll on the command layer.

Security: diff is bin/fm-contributions.sh + tests only; error summaries sanitize to status/category (no response bodies / auth material). No security FYI.

Fork CI: approved after diff review (run 38630094465 in progress).

Blocker — no-mistakes: Require no-mistakes failed: This PR was not raised through no-mistakes (Pipeline attestation HTML comment is present, but the required Updates from git push no-mistakes signature is missing from the body). no-mistakes is blocking, so this cannot auto-merge yet.

@LiamSarsfield — when you have a moment, could you re-raise this head through git push no-mistakes so the Pipeline section gets a matching signature (and any live-validation evidence stays attached)? No rush and no demands — happy to re-check once that lands. Until then this stays with you.

Outcome: waiting-author (no-mistakes re-raise). CI approved and running; will re-triage when green + MATCH.

@LiamSarsfield

Copy link
Copy Markdown
Contributor Author

@kunchenguid thanks for the review. The missing signature was my mistake: when I shortened the PR description I dropped the "Updates from git push no-mistakes" line. I've restored it exactly as no-mistakes wrote it for this head (03c0cbb), which hasn't changed since your review. The live-validation evidence from that run is on my fork: https://github.com/LiamSarsfield/firstmate/tree/9325dedaa57f7bd6d808fb4fb0052913fabd9873/.no-mistakes/evidence/fix/contrib-retry-7262. The compliance check for the edit is waiting for workflow approval: https://github.com/kunchenguid/firstmate/actions/runs/38647969146. Could you approve it and re-check when you have a moment?

@kunchenguid
kunchenguid merged commit 4f77bb3 into kunchenguid:main Oct 15, 2026
21 of 22 checks passed

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @LiamSarsfield — really appreciate you taking the time on this.

Squash landed as 4f77bb37 on main. Closes #7262. Tip restores one retry on classified transient forge failures inside the existing per-read bound; 401/404/other 4xx and timeouts stay immediate. no-mistakes MATCH after you restored the signature; Behavior CI was green.

valerius21 added a commit to valerius21/firstmate that referenced this pull request Oct 15, 2026
* fix: require explicit authority for Firstmate upstream contributions (kunchenguid#7172)

* feat(bin): gate firstmate-upstream publication behind a declared home role

Users who clone firstmate and run it as-is got a surprise: when their
agent hit a firstmate bug, it could drive a pull request at upstream
because nothing distinguished the maintainer's home from an ordinary
user's. Every home now resolves to user/operator unless the gitignored
config/firstmate-role grants a maintainer scope, or a single task
carries the captain's recorded --upstream-consent on the brief, spawn,
and promotion. fm-brief, fm-spawn, and fm-promote apply one fail-closed
gate in bin/fm-role-lib.sh; the role is never inferred from gh identity,
remotes, permissions, or CI, and secondmates honor only receipt-proven
inherited grants so a child cannot grant itself. Session start reports
the resolved role with no network call. Ordinary project delivery and
the clone-and-run setup flow are unchanged.

* no-mistakes(review): Harden firstmate role parsing, normalization, and inheritance

* no-mistakes(review): Detect firstmate by lineage; drop consent fallback;