Repository navigation
Commit e33ce65
fix(rulesets): preserve existing policy and reject incomplete reads (#54)
The branch ruleset applier treated a failed ruleset lookup as permission
to create `Base`, and a failed repository enumeration as a successful
empty run. Updating a baseline also replaced review, scanning,
deployment, bypass and branch-scope settings while retaining only
status-check names.
Repair an existing active repository-owned `Base` or `Optimus-Branch`
additively. Preserve its full policy and other ruleset layers; reject
failed, malformed, truncated, inherited or ambiguous reads. Missing
baselines now require profile-specific provisioning instead of being
created by the legacy hard-coded payload. Add `--repo NAME` for a
bounded pilot, save the pre-change ruleset, recheck for concurrent
edits, and verify the PUT by reading it back. An ambiguous write is
reported without an automatic retry. Dry-run outcomes are reported
separately from verified updates.
Adopt the already-merged Governance reusable workflow at standards
`a8f7249c3c5aef1ed6dfa16e637f13dfde815464`. This brings the consumer the
upstream fixes for the missing lock wrapper and the separation of the
tree allowlist check from credential-dependent administrative
verification. The caller has no `HYPATIA_SCAN_PAT`: the live-policy
advisory reports unavailable coverage, while the tree and lock gates
remain enforced. An authenticated run of the authoritative live-policy
checker independently passed for this repository (`allowed=all`,
`sha_pin=true`).
Package the maintenance CLI in `Containerfile.maintenance`, with an
immutable Ubuntu base, current distribution updates, and the
checksum-verified GitHub CLI 2.100.0 release. The distribution's older
CLI failed the required `--slurp` capability check. Run as UID/GID 10001
and include only the maintenance CLI, its shared library, owner
configuration and tests in the build context. This packages the
maintenance component; it does not claim to package the separate Elixir
TUI or provide a reproducible build of distribution packages.
Validation: 29 offline cases pass, including zero-write failure paths,
preservation of review rules/App-bound checks/bypass actors/scope, a
baseline on the second API page, case-insensitive repository identity,
reordered rules with full parameter checking, and an idempotent second
apply. The original script fails the repository-enumeration negative
control by exiting successfully after the API error. Bash syntax,
ShellCheck, `git diff --check`, the authoritative packaging-policy
check, and `gh actions-lock .github/workflows/governance.yml --no-fix`
pass. The container builds, its entry point works, and all 29 tests pass
as its runtime user with no network, a read-only root filesystem and
dropped Linux capabilities. The test's temporary mount permits its
executable `gh` test double. Governance CI runs the source tests,
container build and restricted-runtime tests.
Live pilot: this repository's Optimus-Branch ruleset #14936593 gained
exactly the missing `non_fast_forward` rule. Full before/after
comparison confirmed no rules removed, all other branch-policy fields
retained, and tag ruleset #18111316 unchanged. A second live apply was a
no-op. Pre-change snapshots and reports were retained in the execution
ledger.
This is the safe repair path for existing baselines. Profile selection,
missing-baseline provisioning, policy changes to existing bypass actors,
and estate-wide rollout remain separate work. The pre-PUT recheck
narrows the concurrent-edit window; it is not an atomic
compare-and-swap.
---------
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>1 parent 81d902b commit e33ce65
7 files changed
Lines changed: 502 additions & 98 deletions
File tree
- .github/workflows
- scripts
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
48 | 79 | | |
49 | 80 | | |
50 | 81 | | |
| |||
0 commit comments