Repository navigation
fix(sync): the generated body proves each moved pin's default-branch HEAD - #230
Conversation
…HEAD Two validator findings on the last sync PR (#229): - the body offered check-policy-b.sh as the diff's coverage, but that gate asserts only distro-* gitlinks and the diff moved zero distro-* pins, so it could not fail on the change; - the default-branch claim was asserted with no per-pin evidence. The body now pastes, per moved path, the staged submodule SHA beside the owning repo's remote default-branch HEAD (git ls-remote <url> HEAD), marks distro-* as charly-pinned, and states truthfully whether policy B is this diff's coverage or not (offered as coverage ONLY when a distro-* pin moved).
[step: review]Review — BLOCKHead SHA: Change class: hook/workflow — Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…ted body Addresses all three validator findings on #230: - B12: extract the per-pin evidence logic into a committed, SELF-TESTING script (scripts/sync-pin-evidence.sh --self-test), wired into the pre-commit gate; its three arms (classification, equality, coverage branch) each make the self-test FAIL when broken (proven). - T3: read the STAGED GITLINK (git ls-tree HEAD -- <path>), never the submodule working-tree HEAD, so an uninitialised/other-commit submodule cannot turn a correct pin into a false not-equal. - A1: the body now calls that script, so the evidence is real command output. The generated body states truthfully whether policy B can fail on THIS diff.
[step: review]Review — BLOCKHead SHA: Change class: hook/workflow — umbrella Blocks
Comment intake: comment Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…g the caller Two defects in the pin-evidence self-test and live path: 1. The live path read the staged pin with `git ls-tree HEAD`, but the body is generated AFTER `git add -A` and BEFORE the commit, so HEAD still names the OLD snapshot. Read the INDEX (`git rev-parse :<path>`) via `staged_gitlink`. 2. R1 CORRUPTION: git exports GIT_DIR/GIT_INDEX_FILE to hook processes, and `git -C <dir>` does NOT override them — so the self-test's fixture `git` calls wrote into the CALLING repo (measured: the umbrella's config gained `bare=true`, `user.name=t`, and a stray `sub` gitlink). Both the fixture ops and `staged_gitlink` now scrub those vars first; verified inert under a simulated hook env. A fixture-repo self-test arm pins the staged-gitlink read: reverting to HEAD or the submodule working-tree HEAD FAILS the self-test.
[step: review]Review — BLOCKHead SHA: Change class: hook/workflow — umbrella Blocks
Comment intake
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Body-only correction (validator re-trigger): the head is unchanged in content; this empty commit exists solely so the org validator re-reviews the PR against the corrected body. Tree is identical to 20e8c51.
[step: review]Review — BLOCKHead SHA: Change class: hook/workflow — umbrella Blocks
Comment intake
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…es the token RCA of the validator block on c670023: `staged_gitlink` read the index with a bare `git rev-parse ":$p"`. On a failure it ECHOES the literal `:path` token and exits non-zero, so the `[ -n "$sha" ]` guard passed and the `git ls-tree HEAD` fallback never ran — dead code. Switch to `rev-parse --verify --quiet` (prints nothing, exits 1) with `|| true`, and add two self-test arms (an absent path; a path present in HEAD but removed from the index) so a regression fails the gate.
[step: review]Review — PASSHead SHA: Change class: hook/workflow — umbrella Comment intake: all four prior Note (non-blocking): the body's commit-set line lists Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Fixes the validator findings on the generated sync PR
opencharly/opencharly#229by correcting the body generator in.github/workflows/sync.yml(the sync PR is bot-authored; its body is emitted by this committed block and cannot be hand-edited into truthfulness without fixing the generator).Findings fixed:
scripts/check-policy-b.shas "the one pinning assertion this PR's diff can violate", but it asserts onlydistro-*gitlinks, while chore: sync gitlinks #229 moveddotgithub/eval-omarchy/marketplace/sdk(zerodistro-*).HEAD:<path>), not the staged index gitlink.GIT_DIR/GIT_INDEX_FILEto hook processes, andgit -C <dir>does not override them, so the fixture'sgit config/update-indexwrote into the umbrella (measured:core.bare=true,user.name=t, a straysubgitlink).Fix. The pin-evidence logic is extracted into a committed, self-testing script,
scripts/sync-pin-evidence.sh:staged_gitlinkreads the STAGED INDEX gitlink withgit rev-parse --verify --quiet :<path>(the index entry), falling back togit ls-tree HEAD -- <path>only when the path is not in the index (already committed, so HEAD is the recorded pin). It never reads the submodule working tree (finding 3) — and it scrubsGIT_DIR/GIT_INDEX_FILE/GIT_WORK_TREE/… so it always targets the repo it names (finding 4).--verify --quiet+|| trueare the load-bearing fix for the fallback: baregit rev-parse ":$p"echoes the literal:<path>token on failure and exits non-zero, so the old[ -n "$sha" ]guard passed and thels-tree HEADfallback was dead code (the validator's block on the previous head).--verify --quietprints nothing and exits 1;|| truekeeps that from aborting underset -e.staged-gitlink=<sha> remote-HEAD=<sha> [kind, EQUAL|not-equal](finding 2).distro-*pin moved; otherwise the body says so plainly and names the per-pin evidence as the real coverage (finding 1).--self-testcovers the classification (both ways), the equality, the coverage branch (both directions), a real fixture repo where the staged pin differs from HEAD, and the unstaged-path fallback (an absent path → empty; a path in HEAD but removed from the index → HEAD's pin) — each arm fails without its logic. It is wired into the pre-commit gate.Commit set (this branch is append-only;
mainreceives a squash):fa9ba3f,af69343,20e8c51, the content fix9669767, and the empty re-freeze commitc670023.Files:
.github/workflows/sync.yml(+20/−17),hooks/pre-commit(+3),scripts/sync-pin-evidence.sh(new, +190; executable). 3 files, +213/−17.Closes / relates to: supersedes the body of
opencharly/opencharly#229.Breaking change + rollback: none — body-emission only.
How tested — the real command outputs
All of the following were run on the frozen head
9669767; pasted verbatim.1. The committed self-test (B12 coverage) and the umbrella pre-commit gate:
2. B12 — each new-logic arm, reverted, FAILS the self-test (full output):
3. The GIT_DIR-corruption fix, proven inert under the exact hook environment:
4. The generated
run:block is valid bash:5. The generated per-pin table, produced by the real script (moved set = the four #229 paths;
not-equalis expected because this branch is based on the OLDorigin/mainpins — the sync run re-runs it against its own staged pins, where each is the merged default-branch HEAD):(The
policy-b placeholderline is this local run's injected stand-in for the policy-B log; in the generator the realcheck-policy-b.shoutput is appended there.)Harness rulebook compliance
/charly-internals:git-workflowloaded.GIT_DIRbeing exported to hooks and-Cnot overriding it. The previous head's block (the deadls-tree HEADfallback) was root-caused to baregit rev-parse :<path>echoing the literal token on failure — fixed with--verify --quietand proven by new arms 5/6. Zero warnings.scripts/sync-pin-evidence.sh; policy B remains the onedistro-*gate.N/A — no artifact/binary.N/A by construction — written at merge from this body.Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)