Skip to content

feat(stage): add the stage approval setting - #136

Merged
cabljac merged 1 commit into
gate/01-stage-sourcefrom
gate/02-approval-setting
Oct 19, 2026
Merged

cabljac merged 1 commit into
gate/01-stage-sourcefrom
gate/02-approval-setting

Conversation

@cabljac

@cabljac cabljac commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

The approval gate needs one setting per mirror that every clone reads. This adds a top-level approval field to venfork-config (reviewed, two-person, or absent for off) and venfork stage approval [on|reviewed|two-person|off] to show or set it. on means two-person, and off prints a warning. Any other stored value, such as a level from a newer venfork or a non-string, is kept by every config write and refused by approvalOf with a ConfigError, so an older CLI never reads it as off.

The setting is a stage subcommand to keep the command list short. The cost is one more reserved word: a branch named approval uses venfork stage branch approval, and the usage errors name that form. The grouped venfork help screen has no row for it (36-line cap); stage --help covers it. Stage does not enforce the level yet.

Tests, red first: tests/unit/config.test.ts, tests/unit/stage-args.test.ts and tests/integration/approval.test.ts. bun run verify exits 0. Counts: unit 1260 to 1272, integration 474 to 477.

Not verified: e2e tiers and live GitHub.

The mirror config gains a top-level `approval` field: `reviewed`,
`two-person`, or absent for off. `venfork stage approval` prints the
level; `venfork stage approval <on|reviewed|two-person|off>` sets it,
where `on` means two-person. Turning it off prints a warning. Any other
stored value (a level from a newer venfork, or a non-string) is kept on
read and by every other config write, and approvalOf refuses it with a
ConfigError that suggests `venfork stage approval two-person`, so an
older CLI never reads it as off. Only "off" and "" read as off.

The setting lives under stage instead of a new top-level command, to
keep the command list short. `approval` becomes a reserved stage word
like `issue` and `branch`: `venfork stage approval` no longer stages a
branch named approval; use `venfork stage branch approval`. The unknown
level and branch-flag usage errors name that form. Stage does not
enforce the level yet.
@cabljac
cabljac force-pushed the gate/02-approval-setting branch from e2e4fbe to 5adc86a 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 3651e9f 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