Skip to content

fix: use branch-protection PATCH endpoint - #5

Merged
atrawog merged 2 commits into
mainfrom
fix/branch-protection-patch
Jul 14, 2026
Merged

atrawog merged 2 commits into
mainfrom
fix/branch-protection-patch

Conversation

@atrawog

@atrawog atrawog commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Change the required-status-check update from the unsupported whole-resource
    PUT route to GitHub's documented PATCH route.
  • Add a hermetic gh contract test covering preflight-before-write, exact
    method/path/payload, sole-context replacement, and post-write verification.

Root cause

PR #4 validated discovery and read-only preflight but did not execute its new
write path. GitHub accepts PATCH on the whole
required_status_checks resource; PUT applies only to the nested contexts
resource. The first live write returned 404 before any repository changed.

Read-back confirms all 12 managed repositories still require exactly
charly/claude-validation with strict=true.

Change class

Workflow script and regression test.

Validation

bash -n scripts/branch-protection.sh scripts/branch-protection_test.sh
PASS

shellcheck scripts/branch-protection.sh scripts/branch-protection_test.sh
PASS — zero findings

scripts/branch-protection_test.sh
alpha: charly/claude-validation -> charly/pr-validator
beta: charly/claude-validation -> charly/pr-validator
alpha: verified charly/pr-validator
beta: verified charly/pr-validator
branch-protection contract: PASS

R0–R10 and pillars

  • R0: Git workflow, agents, check, strict-policy, and RCA guidance applied.
  • R1: The 404 was root-caused before remediation; zero remote mutations confirmed.
  • R2: The write-path control gap and its regression coverage are fixed together.
  • R3/R4: One central updater; no fallback route, retry, or dual context.
  • R5: The unsupported method is removed completely.
  • R6: Append-only fix PR; no rewrite, force, or direct-main push.
  • R7/R10: Changed write path executes in the contract test; live reads retain proof of the 12-repository pre-state.
  • R8: Exact API method, path, strict flag, and sole context are asserted.
  • R9/ADE/SDD: N/A — no binary, candy plan, or schema.
  • RDD: Live failure established the API assumption; the regression test proves the corrected mechanism before another live apply.
  • Architecture: Fix remains in the central organization protection owner.

After a fresh PASS and merge under the legacy required check, run the merged
apply once and immediately verify all 12 repositories.

Assisted-by: Codex OpenAI GPT-5.6 Sol (analysed on a live system)

atrawog added 2 commits July 14, 2026 19:40
Assisted-by: Codex OpenAI GPT-5.6 Sol (analysed on a live system)
Assisted-by: Codex OpenAI GPT-5.6 Sol (fully tested and validated)
@atrawog

atrawog commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

PR validation: PASS

  • Exact head: 75775354879e964a0828311b51e1a204c42894f4
  • bash -n: PASS
  • shellcheck: PASS, zero findings
  • Exact ordered API transcript test: PASS
  • Preflight-before-write and post-write verification: PASS
  • PATCH method, full path, strict flag, and sole context payload: PASS
  • Live state: all 12 managed repositories remain consistently on the legacy context
  • Append-only update of the existing PR: PASS
  • Placement: CORRECT

Safe to merge under the legacy required check, then run the merged apply and
immediate verify once.

Assisted-by: Codex OpenAI GPT-5.6 Sol (fully tested and validated)

@atrawog
atrawog merged commit c877b44 into main Jul 14, 2026
@atrawog
atrawog deleted the fix/branch-protection-patch branch July 14, 2026 17:47
github-actions Bot pushed a commit that referenced this pull request Oct 24, 2026
…exist (#246) (#252)

19 of the 81 rows of scripts/governance-claims.tsv still named
layer-charly-internals/charly.yml and layer-charly-internals-extra/charly.yml.
Those two files no longer hold the skill prose - they are candy manifests now,
and the prose moved to the authored .agents/skills/... trees (AGENTS.md Part II
#5). 12 of the 19 read as a false red; the other 7 are `forbid` rows and passed
VACUOUSLY, the retired phrase being absent from a file that no longer holds the
rule at all. 23% of the manifest protected nothing.

The 19 rows are repointed at the authored homes, the one anchor that exists
nowhere in the org is re-anchored to the wording the source actually uses
(`HOLDING. on BOTH threads`), and the umbrella's own AGENTS.md gets a row for
the same rule with its own anchor (`HOLDING. if you are the blocking side`).

The second half is the control that stops it recurring. Nothing asserted the
manifest's own PATHS, so a surface that moved was indistinguishable from one
that was never checked: the gate silently downgraded it to "not checked". A
named surface whose OWNER REPO is materialized in this checkout but whose FILE
is absent is now a STALE POINTER and FAILS. A skip stays right for a surface
this checkout does not carry at all - an uncarried owner repo, or an
uninitialized (empty) submodule path in a light checkout, which must not become
a false red.

MEASURED on the same fixture - one surface moved:
  the old checker: checked=75 skipped=6  fail=0  (rc=0 - SILENT)
  the new checker: checked=75 skipped=0  fail=1  (rc=1 - LOUD)
and against the real umbrella checkout, every row asserted:
  governance-reconcile: checked=81 skipped=0 fail=0  (rc=0)

The gate is STRENGTHENED, not loosened: a named surface can no longer be
silently unchecked.

Assisted-by: Claude Code minimax minimax-m3.1-flash:cloud (analysed on a live system)
github-actions Bot pushed a commit that referenced this pull request Nov 3, 2026
* fix(ci): give the rootless builder a writable runc state root

The caller's image build has failed at its first RUN for every attempt, showing
only `did not complete successfully: exit code: 1`. Once the engine began
printing step output (charly v2026.307.1020 carries --progress plain from
opencharly/charly#1103), the failing step's own line appeared:

    #5 0.028 runc run failed: lstat /run/runc//4u7q9fyvlqri1tx69x2couqh7: permission denied

28 ms in, the recipe never reached.

Mechanism: runc chooses its state root from its EFFECTIVE uid. rootlesskit maps
this user to uid 0 inside its user namespace, so runc believes it is root and
takes its rootful default, /run/runc. On the runner that path exists, is
root-owned, and is not traversable by this user.

Root fix: give THIS user that one directory, exactly as /run/buildkit is
already given, and assert it in the same step so a future regression fails loud
with the cause instead of the one-line solve error. Never a blanket chown.

Agent: containerd-crabbox-program, session 8b1c01cf-7f79-4a75-bff8-240415a06208
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)

* fix(ci): fold the two host-path guards into one loop; full model name in the trailer

R2: the /run/runc guard I added was a verbatim copy of the /run/buildkit one
directly above it — the same predicate landing in a second place. Both paths
exist for ONE reason (rootlesskit maps this user to uid 0, so the daemon and
its runc address root-owned host paths), so they are now one loop over the two
paths, with each path's measured evidence kept in the comment. The two cannot
drift into divergent ownership rules.

A3: the Assisted-by trailer carried `deepseek-v4.1-flash:cloud`, a routing
slug; it now carries the full model name.

Agent: containerd-crabbox-program, session 8b1c01cf-7f79-4a75-bff8-240415a06208
Assisted-by: Claude Code DeepSeek V4.1 Flash (analysed on a live system)

---------

Co-authored-by: Andreas Trawoeger <[email protected]>
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