feat: expand autonomous fleet operations and delivery safeguards - #2038
Closed
quinnbot-ai wants to merge 4 commits into
Closed
quinnbot-ai wants to merge 4 commits into
quinnbot-ai wants to merge 4 commits into
Conversation
#97) * feat(gh): route pipeline PR creation through a configurable credential The no-mistakes pipeline opens pull requests by shelling out to `gh`, and a GitHub fine-grained personal access token is forbidden from the createPullRequest mutation, so an ambient token of that class breaks the PR step at the end of an otherwise green run while every earlier step succeeds. Investigation of the installed v1.41.2 binary and upstream source at release 1.46.0 found no supported configuration seam: the GitHub provider executes `gh` by bare name with no binary-path or credential knob, while Bitbucket Cloud reads its credentials from named environment variables. The step execution layer already honors a step-scoped PATH and credential environment through StepContext.Env, but that field is declared test-only and the production executor never populates it. Add the firstmate-side mitigation instead of patching the tool: - fm-gh.sh runs one command with the credential prefix from config/gh-credential, and execs unchanged when unconfigured. - fm-gh-shim.sh routes only `pr create` and `pr edit` through that wrapper and delegates everything else to the real gh. - fm-gh-shim-install.sh installs, removes, and verifies PATH precedence, and is never run automatically. Interception must sit on the daemon's PATH because the PR step runs in the daemon, so it cannot be scoped to a task worktree; that limit is documented rather than papered over. docs/proposals/nm-pr-step-interception.md specifies the upstream config seam that would retire the shim. The wrapper expands its prefix as ${PREFIX[@]+"${PREFIX[@]}"} because bash 3.2, the system bash macOS ships, rejects an empty array expansion under `set -u` and would otherwise break every unconfigured home. * no-mistakes(review): Harden PR credential routing and shim ownership * no-mistakes(document): Correct PR credential routing documentation * test(gh): create the fixture root before normalizing it The gh shim suite resolves its fixture root with `cd` so its installer cases can compare against the installer's own normalized output. A cleanup trap registered inside the `fm_test_tmproot` command substitution can remove that directory before it is ever used, which made the normalizing `cd` fail and collapse every fixture path to the filesystem root. Create the directory before normalizing so the suite holds regardless of when the cleanup trap runs. --------- Co-authored-by: QuinnBot <quinnbot@proton.me>
* fix(ci): fall back to exact-head workflow runs * no-mistakes(review): Harden exact-head CI fallback guarantees * no-mistakes(review): Narrow CI fallback to exact monitor failures * no-mistakes(review): Match observed statusCheckRollup permission denial * no-mistakes(document): Refresh GitHub shim verification evidence --------- Co-authored-by: QuinnBot <quinnbot@proton.me>
* fix(gh): pin shim PR target to origin * no-mistakes(review): Fix gh shim repository option parsing * no-mistakes(review): Fix long option repository flag confusion --------- Co-authored-by: QuinnBot <quinnbot@proton.me>
…llback GitHub now reports the fine-grained personal-token denial for gh pr checks with a deeper GraphQL error path (.contexts.nodes.0 appended), so the exact literal signature match never activated the bounded CI fallback and an active no-mistakes run looped on the denial even with a green exact-head workflow. Match the denial sentence plus a whole statusCheckRollup path component at any depth instead. Denials for other APIs, and paths that only begin with those characters, still replay unchanged. Supported argument shapes and exact-head workflow verification are untouched.
quinnbot-ai
force-pushed
the
fm/fm-gh-ci-fallback-signature
branch
from
August 10, 2026 00:02
82a6389 to
bc0dc7e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Fix bin/fm-gh-ci-fallback.sh so it recognizes GitHub's CURRENT permission-denial signature for
gh pr checksunder a fine-grained personal access token.The bug (live, blocking a real delivery): the no-mistakes daemon's
gh pr checkscall under a fine-grained PAT now exits 1 with 'GraphQL: Resource not accessible by personal access token (node.statusCheckRollup.nodes.0.commit.statusCheckRollup.contexts.nodes.0)'. The bounded CI fallback in bin/fm-gh-ci-fallback.sh activated only on a denial signature ending directly after 'statusCheckRollup)'. GitHub appended the deeper '.contexts.nodes.0' path segment, so the fallback never activated and an active no-mistakes run loops on the denial forever even when the exact head's workflow is green.Required change, as accepted:
Acceptance criteria: with the new signature the fallback activates and the CI verdict comes from the exact-head workflow verification path exactly as it did for the old signature; unrelated errors still do not activate the fallback; tests colocated and green; shellcheck-clean per repo conventions.
Decisions and tradeoffs made while implementing, which a reviewer reading only the diff would not know:
What Changed
Risk Assessment
✅ Low: The focused matcher change safely recognizes whole-component statusCheckRollup denial paths while preserving argument-shape and exact-head fallback boundaries, with appropriate positive and negative regression coverage.
Testing
The supplied baseline reported shim, merge, lint, and documentation checks green; this phase independently reran the targeted shim suite and direct CLI scenarios, confirming both valid denial signatures return the green exact-head workflow verdict while the unrelated lookalike is replayed unchanged without fallback API calls.
Evidence: Direct fallback CLI transcript
Evidence: Colocated behavioral suite
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
.agents/skills/ahoy/SKILL.md- branch carries 55 commit(s) that exist on your local main branch but were never pushed to origin/main; rebasing would bundle this unrelated work (224 file(s)) into the PR:Push main to origin, or rebase your branch onto origin/main, before gating.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
tests/fm-gh-shim.test.shManualgh pr checks 7 --repo o/r --json name,state,bucket,completedAtscenarios for the old denial, current deeper denial, andstatusCheckRollupSummarynear-miss, recording exit status, JSON output, and API trace.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.