Skip to content

feat(stage): bypass the approval gate with --force - #139

Merged
cabljac merged 1 commit into
gate/04-weakening-guardfrom
gate/05-force-bypass
Oct 19, 2026
Merged

cabljac merged 1 commit into
gate/04-weakening-guardfrom
gate/05-force-bypass

Conversation

@cabljac

@cabljac cabljac commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

A vendor sometimes has to ship without an approval, for example when the only reviewer is away. venfork stage <branch> --force runs the gate as usual. When it refuses and the branch has an open mirror PR, a person must confirm the bypass at a terminal; --yes never answers it, and without a terminal stage stops with reason bypass-unconfirmed. Just before the push, stage posts a comment on the mirror PR that names the gh login, the level, the commit and the refusal. A failed comment pushes nothing.

--force never bypasses branch-moved, so the comment always names the commit on the mirror PR, and a branch moved during the confirm still ships the confirmed commit. A bypass with no mirror to record on is refused. The comment is the only record: nothing goes to venfork-config, the published commits, the fork or upstream.

Tests, red first: tests/integration/approval-force.test.ts and --force cases in tests/unit/stage-args.test.ts. bun run verify exits 0. Counts: unit 1283 to 1285, integration 510 to 519.

Not verified: e2e tiers and live GitHub. The gh calls are proven only against the stub in tests/harness/gh-mirror.ts.

`venfork stage <branch> --force` runs the gate as usual. When it
refuses and the branch has an open mirror PR, a person must confirm the
bypass at a terminal; --yes never answers that confirm, and without a
terminal stage stops with ApprovalError reason bypass-unconfirmed. Just
before the push, stage posts a comment on the mirror PR naming the gh
login, the level, the commit staged and the refusal, through netExec
with the body on stdin. A comment that fails pushes nothing. With
approval off, --force only warns.

--force never bypasses branch-moved: a local head that differs from the
mirror PR head is refused, also when another refusal comes first. A
branch with no open mirror PR cannot be forced, and a bypass that cannot
find the mirror to record on throws a precondition error and pushes
nothing. A branch moved during the bypass confirm ships the confirmed
commit.

The mirror PR comment is the only record. Stage writes nothing about
the bypass to venfork-config (anyone with write access can push it),
and nothing about approval or the bypass reaches the published
commits, the public fork or upstream. --force with --dry-run, stage
issue or stage approval is a usage error.
@cabljac
cabljac force-pushed the gate/05-force-bypass branch from a2605eb to dc7c642 Compare October 19, 2026 17:26
@cabljac
cabljac marked this pull request as ready for review October 19, 2026 17:29
@cabljac
cabljac added this pull request to stack #142 October 19, 2026 17:29
@cabljac
cabljac merged commit 150fb27 into main Oct 19, 2026
4 checks passed
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