Skip to content

fix(hooks): the pin contract's commit-carried inputs have ONE definition (opencharly/opencharly#661) - #664

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/pin-check-class-inputs
Oct 24, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/pin-check-class-inputs

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

What this closes. #661 — the umbrella's own commit gate decides
whether to run the pin check by change class, and the shipped class covered only the
gitlinks. It also carries the disposition of the charly/pr-validator's non-blocking
observation on #660: that observation is CONFIRMED, and it is a
defect in the class, not a wording slip. The RCA is posted on #660's thread.

This is the follow-up to #660 (merged, squash 02177e7, validator
verdict PASS), which shipped the change class this change corrects. #660's two non-blocking
observations are dispositioned on its thread; the first is the defect fixed here, the second
is a deliberate trade-off that this change does not alter.

The defect. charly task pin-check composes verb:git-submodules in mode: verify,
and that verb reads three commit-carried inputs:

  1. the index's gitlinks — the edge's got side, and every submodule's recorded
    gitlink (the checkout audit's expectation);
  2. the manifest that declares the pin contract — charly.yml's pins: block, with
    its pin_map and pinned_from;
  3. the declared path set — .gitmodules, which the checkout audit walks.

The shipped class was "the staged diff moves a gitlink", and the shipped comment called
it EXACT: "every value it compares is an INDEX entry … so a commit that moves no gitlink
cannot violate it"
. That claim was false. The declaration and the path set are FILES,
and the edge's want side is read from the pinned_from checkout's HEAD tree — so a
commit that edits the manifest or the declared path set violates the pin check without
moving a gitlink
, and the gate skipped the check that would have caught it.

The fix: ONE definition, TWO readers. The rule now lives once, in
scripts/pin-contract-inputs.sh, and the two places that ask the question ask it of that
one definition:

  • the commit gate's change class (hooks/pre-commit-gate.sh) now only MEASURES —
    which staged paths are gitlinks, and which are declaration files. The rule is not
    restated in the gate, so the two cannot drift;
  • the wave body's coverage decision (scripts/sync-pin-evidence.sh) reads the same
    definition, because it asks the same question — can this diff violate the pin check?
    Its own copy of that question was narrower than the truth: it decided coverage by
    "a distro-* pin moved", so a diff that moved charly's own gitlink (which moves the
    edge's want side) or edited the manifest was described in a PR body as a diff the pin
    check "cannot fail on". That was false, and it under-claimed what the gate proves.

The prose surfaces that carried the old model are corrected in the same change: the
verify step's description in charly.yml, and the README's row for
charly task pin-check, which described the command as asserting the pin contract's edge
alone while the verb runs the edge and the checkout audit.

The class is a deliberate SUPERSET of the violation set. A charly.yml edit that
touches no pin block still fires the check, because the check reads the whole manifest, so
a change to it can change what the check compares — and R3 forbids cleverness in place of
a rule. The checkout drift the same verb also sees (a checkout dirty, or at another
commit, caused by no commit) stays where the rulebook puts it: charly task verify
(AGENTS.md Part II #1), which composes the same verb.

The coverage now has one fired assertion and one mutation arm per input, so a dropped
leg goes red: 11 arms in the gate's fixture (each mutation turns it red, the unmutated
copy green) and 7 arms in the wave body's self-test, which judge the coverage decision
itself.

file what it carries
README.md the charly task pin-check row: the verb runs the edge and the checkout audit
charly.yml the verify step's description: the change class is the pin contract's commit-carried inputs
hooks/pre-commit the driver: the gate is called once, and the gate decides by class
hooks/pre-commit-gate.sh the change-class decision — it MEASURES the staged paths and asks the shared rule
scripts/check-pre-commit-gate.mjs the gate's own assertion: a fired assertion per input, a mutation arm per input
scripts/pin-contract-inputs.sh the ONE definition of the pin contract's commit-carried inputs
scripts/sync-pin-evidence.sh the wave body's coverage decision — it reads the same definition
scripts/sync-pr-body.sh the generated body's rule-10 line names the same inputs

Head 3835e254485395089ff8da28fce5c2ec0bb049e9; base origin/main
1e809762d028328b72083f72981c6c72312d1527; the diff is 8 files changed, 409 insertions(+), 62 deletions(-).

How tested

The head and the base — the committed tree this body describes:

$ git rev-parse HEAD
3835e254485395089ff8da28fce5c2ec0bb049e9
$ git rev-parse origin/main
1e809762d028328b72083f72981c6c72312d1527

The worktree-local binary (R9 — binary equals source), never a shared install:

$ ./charly/bin/charly version
2026.297.0121

The class, measured live on THIS diff — the gate's own question, asked of the shared
definition over the diff this commit carries (it edits charly.yml, the manifest that
declares the pin contract, so the check fires), and over a prose-only diff (it does not):

$ git diff --name-only HEAD~1 HEAD
README.md
charly.yml
hooks/pre-commit
hooks/pre-commit-gate.sh
scripts/check-pre-commit-gate.mjs
scripts/pin-contract-inputs.sh
scripts/sync-pin-evidence.sh
scripts/sync-pr-body.sh
$ git diff --raw HEAD~1 HEAD | awk 'BEGIN{FS="\t"} {split($1,m," "); if (m[1] ~ /160000/ || m[2] ~ /160000/) print $2}'
$ pin_contract_touches_input "$CHANGED" "$GL" && echo FIRES
FIRES
$ pin_contract_touches_input "README.md" "" || echo SKIPS
SKIPS

(The git diff --raw line printed nothing: this diff moves no gitlink, and the class
fires anyway, because the manifest it edits is one of the inputs.)

The gate's own fixture — the fired assertions, each one an input of the check, and
then the mutation arms, each of which turns the fixture red while the unmutated copy
stays green:

$ node scripts/check-pre-commit-gate.mjs
  PASS  hooks/pre-commit-gate.sh + hooks/pre-commit: one owner for the legs, each run once, the skip visible, the missing binary loud, no main-clone fallback, and the index the commit carries read
  PASS  the gate FIRED: a commit that changes the index's gitlinks runs the pin check EXACTLY once and the self-test EXACTLY once
  PASS  the gate FIRED: a commit that changes none of the pin contract's inputs SKIPS the pin check visibly (0 invocations) and still runs the self-test once
  PASS  the gate FIRED: a docs-only commit in a tree with NO charly binary PASSES (exit 0) — the fresh-worktree path
  PASS  the gate FIRED: a commit that changes the index's gitlinks with NO charly binary FAILS LOUD (exit 1) and names the fix
  PASS  the gate FIRED: a commit that changes the manifest with NO charly binary FAILS LOUD (exit 1) and names the fix
  PASS  the gate FIRED: a FAILING pin check fails the gate (exit 1) — the verdict is not swallowed
  PASS  the gate FIRED: a commit that changes the manifest runs the pin check EXACTLY once
  PASS  the gate FIRED: a commit that changes the declared path set runs the pin check EXACTLY once
  PASS  the gate FIRED: a path-limited commit is judged on the index IT carries, not on the repository's own index
  PASS  the gate FIRED: with no index given, the repository's own index is judged (the staged gitlink fires the check)
check-pre-commit-gate: OK

$ node scripts/check-pre-commit-gate.mjs --self-test
  PASS  mutation 'the change class is ignored' is caught (gate red)
  PASS  mutation 'the manifest leg is dropped' is caught (gate red)
  PASS  mutation 'the declared path set leg is dropped' is caught (gate red)
  PASS  mutation 'the declaration files are never watched' is caught (gate red)
  PASS  mutation 'the shared definition is not the one the gate reads' is caught (gate red)
  PASS  mutation 'the pin check runs twice' is caught (gate red)
  PASS  mutation 'the missing binary does not fail loud' is caught (gate red)
  PASS  mutation 'the self-test leg is skipped' is caught (gate red)
  PASS  mutation 'the main-clone binary comes back' is caught (gate red)
  PASS  mutation 'the hook calls the gate twice' is caught (gate red)
  PASS  mutation 'the hook takes the pin check back' is caught (gate red)
  PASS  the unmutated copy is GREEN
check-pre-commit-gate --self-test: OK (11 arms)

The wave body's coverage decision — the shared rule, judged by the second reader's
own self-test, which asks the same question of the same definition:

$ bash scripts/sync-pin-evidence.sh --self-test
sync-pin-evidence: self-test OK (compact <path> <staged> <remote> <flag> rows both ways; coverage both directions; bounded_rows emits all under budget and >=1 + elision notice over budget; staged-gitlink reads the index + falls back to HEAD; evidence_legend states BOTH readings of a non-distro-* ! and the check that tells them apart)

This change's coverage FAILS without the change — the old decision, taken from
origin/main (DISTRO_MOVED — coverage only when a distro-* pin moved), judged
against the same inputs, and the new shared rule judged against them:

$ . ./scripts/pin-contract-inputs.sh
$ for c in "charly.yml:" ".gitmodules:" "charly:charly" "plugin-vm:plugin-vm" "distro-arch:distro-arch" "README.md:"; do
    changed="${c%%:*}"; links="${c##*:}"
    if [ -n "$links" ] && printf '%s\n' "$links" | grep -q '^distro-'; then old=COVERED; else old=NOT_COVERED; fi
    if pin_contract_touches_input "$changed" "$links"; then new=COVERED; else new=NOT_COVERED; fi
    printf '%-44s old=%-12s new=%s\n' "$changed" "$old" "$new"
  done
charly.yml                                   old=NOT_COVERED  new=COVERED
.gitmodules                                  old=NOT_COVERED  new=COVERED
charly                                       old=NOT_COVERED  new=COVERED
plugin-vm                                    old=NOT_COVERED  new=COVERED
distro-arch                                  old=COVERED      new=COVERED
README.md                                    old=NOT_COVERED  new=NOT_COVERED

Four real inputs the old rule missed, and one it did not (a plain file) that the new rule
still does not fire on. The fixture is red on the two trees that do not carry the change:

$ git archive origin/main | tar -x -C /tmp/r1-repro/oldroot2
$ node scripts/check-pre-commit-gate.mjs --root /tmp/r1-repro/oldroot2
  FAIL  scripts/pin-contract-inputs.sh exists — the one definition of the pin contract's commit-carried inputs
  FAIL  firing hooks/pre-commit-gate.sh (ENOENT: no such file or directory, lstat '/tmp/r1-repro/oldroot2/scripts/pin-contract-inputs.sh')
check-pre-commit-gate: 2 finding(s)
$ git archive HEAD | tar -x -C /tmp/r1-repro/hybridroot2
$ # the OLD decision transplanted into the new tree, in place of the shared definition
$ node scripts/check-pre-commit-gate.mjs --root /tmp/r1-repro/hybridroot2
  PASS  hooks/pre-commit-gate.sh + hooks/pre-commit: one owner for the legs, each run once, the skip visible, the missing binary loud, no main-clone fallback, and the index the commit carries read
  PASS  the gate FIRED: a commit that changes the index's gitlinks runs the pin check EXACTLY once and the self-test EXACTLY once
  PASS  the gate FIRED: a commit that changes none of the pin contract's inputs SKIPS the pin check visibly (0 invocations) and still runs the self-test once
  PASS  the gate FIRED: a docs-only commit in a tree with NO charly binary PASSES (exit 0) — the fresh-worktree path
  PASS  the gate FIRED: a commit that changes the index's gitlinks with NO charly binary FAILS LOUD (exit 1) and names the fix
  FAIL  the gate FIRED: a commit that changes the manifest with NO charly binary FAILS LOUD (exit 1) and names the fix
  FAIL  the gate FIRED: a FAILING pin check fails the gate (exit 0) — the verdict is not swallowed
  FAIL  the gate FIRED: a commit that changes the manifest runs the pin check EXACTLY once
  FAIL  the gate FIRED: a commit that changes the declared path set runs the pin check EXACTLY once
  PASS  the gate FIRED: a path-limited commit is judged on the index IT carries, not on the repository's own index
  PASS  the gate FIRED: with no index given, the repository's own index is judged (the staged gitlink fires the check)
check-pre-commit-gate: 4 finding(s)

The hybrid is the sharper of the two: the old rule inside the new tree keeps the
gitlink legs green and turns the manifest and path-set legs red, and it turns a FAILING
pin check into a green gate — the swallowed verdict, which is the exact failure the
change exists to remove.

The umbrella's own gate, on the committed tree — the whole plan, every step:

plugin github.com/opencharly/plugin-example-kind/candy/plugin-example-kind: served from /home/atrawog/.cache/charly/plugin-build/views/plugin-example-kind-660763c18b405ea9 (build sha256:643e81502274cd1f42bcf3ba7f05a981effba9654ec6eb219e85dbdfa156bb65); source /home/atrawog/.cache/charly/repos/github.com/opencharly/[email protected]/candy/plugin-example-kind
plugin plugin-example-structkind: served from /home/atrawog/.cache/charly/plugin-build/views/plugin-example-structkind-f39364ecc01e5411 (build sha256:e2c98e2435e2e0110c2fc29f08a76ccf6464efaecb40a95190752286d1f16a35); source /home/atrawog/.cache/charly/repos/github.com/opencharly/[email protected]/candy/plugin-example-structkind
plugin plugin-jetkvm: served from /home/atrawog/.cache/charly/plugin-build/views/plugin-jetkvm-2728452fcfb25529 (build sha256:9bdf8390f86de24e7ee3030e2dfdb5140aab232d5df4b40bd1510c18d64f0658); source /home/atrawog/.cache/charly/repos/github.com/opencharly/[email protected]/candy/plugin-jetkvm
task verify: 33 step(s), 0 failed
[pass] check — the pin contract holds — every distro-* gitlink equals charly's own box/* gitlink (the EDGE), and every submodule is clean and checked out at its recorded gitlink (the CHECKOUT AUDIT), composed ONCE through pins
verify: 6 policy pin(s) hold across 412 submodule(s); 13 checkout(s) clean at their gitlink; 399 uninitialized (pin audited, no checkout): charly-alpine, charly-arch, charly-debian, charly-fedora, charly-jetkvm, charly-lib, charly-openwrt, charly-registry, charly-streamer, charly-ubuntu, clawsweeper, crabbox, crabhelm, docs, dotgithub, eval-omarchy, gst-wayland-display, layer-a11y-tools, layer-agent-forwarding, layer-agentteams, layer-agentteams-cli, layer-agentteams-openclaw, layer-agentteams-snapshot, layer-android-apidemos, layer-android-sdk, layer-android-test-apps, layer-asciinema, layer-blogwatcher, layer-build-toolchain, layer-cachyos-extras, layer-camsnap, layer-charly, layer-charly-check, layer-charly-internals-extra, layer-charly-tools, layer-check-base-layer, layer-check-builder-npm, layer-check-composition-layer, layer-check-cross-local-driver-layer, layer-check-group-layer, layer-check-local-layer, layer-check-retention-fixture, layer-check-stack-layer, layer-check-structkind-layer, layer-check-substrate-layer, layer-check-tier1-layer, layer-chrome, layer-chrome-sway, layer-claude-code, layer-clawhub, layer-codex, layer-container-nesting, layer-crabbox, layer-cstream-desktop, layer-cua, layer-cuda, layer-cue, layer-debootstrap-builder, layer-debug-tools, layer-desktop-fonts, layer-desktop-media, layer-dev-tools, layer-devops-tools, layer-direnv, layer-docker-ce, layer-docs-site, layer-examplebuilder-consumer, layer-examplestep-consumer, layer-examplestep-deploy-consumer, layer-fastfetch, layer-ffmpeg, layer-fonts-extended, layer-forgecode, layer-gemini, layer-gh, layer-gifgrep, layer-github-actions, layer-gnupg, layer-gocryptfs, layer-gogcli, layer-golang, layer-google-cloud, layer-google-cloud-npm, layer-goplaces, layer-grafana-tools, layer-gst-wayland-display, layer-helm-chart, layer-hermes-playwright, layer-heroic, layer-himalaya, layer-java-openjdk, layer-jupyter-mcp, layer-k3s, layer-k3s-kernel, layer-kde-shell, layer-keepassxc, layer-kimi, layer-kind, layer-kubernetes, layer-kubevirt, layer-kubevirt-operator, layer-language-runtimes, layer-libnotify, layer-llama-cpp, layer-maplibre-versatiles-styler, layer-mcporter, layer-nano-pdf, layer-nerdctl, layer-nodejs, layer-notebook-finetuning, layer-notebook-graph, layer-notebook-llm-on-supercomputers, layer-notebook-ollama, layer-notebook-openrouter, layer-notebook-osm, layer-notebook-templates, layer-nvenc-headers, layer-nvidia, layer-ollama-cuda, layer-ollama-rocm, layer-omarchy-base, layer-omarchy-boot, layer-omarchy-desktop-apps, layer-omarchy-dev, layer-omarchy-fonts, layer-omarchy-gpu-nvidia, layer-omarchy-hardware, layer-omarchy-hyprland, layer-omarchy-media, layer-omarchy-network, layer-omarchy-shell, layer-omarchy-terminal, layer-omarchy-themes, layer-oracle, layer-ordercli, layer-pacstrap-builder, layer-pavucontrol, layer-pi-agent, layer-pixi, layer-playwright, layer-pod-addcandy-marker, layer-pre-commit, layer-punktfunk, layer-punktfunk-client, layer-python, layer-python-ml, layer-qdrant, layer-ripgrep, layer-rocm, layer-rpmfusion, layer-rust, layer-sag, layer-selkies-kde-desktop, layer-sherpa-onnx, layer-shortbread, layer-socat, layer-songsee, layer-sqlite, layer-ssh-client, layer-steam, layer-stepkind-build-consumer, layer-summarize, layer-supervisord, layer-sway-desktop, layer-sway-desktop-vnc, layer-tailscale, layer-tailscale-up, layer-thunar, layer-tmux, layer-typst, layer-unsloth, layer-uv, layer-vectorchord, layer-versatiles-fonts, layer-versatiles-style, layer-vscode, layer-wacli, layer-wf-recorder, layer-whisper, layer-wl-overlay, layer-wl-record-pixelflux, layer-wl-screenshot-grim, layer-wl-screenshot-pixelflux, layer-wl-tools, layer-workspace-mount, layer-xdg-portal, layer-xfce4-terminal, layer-xterm, layer-xurl, layer-yay, lobster, omarchy-eval-artifacts, openclaw, openclaw-enterprise, pi-asciinema, pi-fabric, pi-lsp, pi-review-action, pixelflux, pkg-arch, pkg-debian, pkg-fedora, plugin-adb, plugin-addr, plugin-agent, plugin-agent-pi, plugin-agentteams, plugin-alias, plugin-appium, plugin-authoring, plugin-boot-kind, plugin-box, plugin-bpf, plugin-build, plugin-builder, plugin-builder-aur, plugin-builder-cargo, plugin-builder-npm, plugin-builder-pixi, plugin-cache, plugin-candy, plugin-candy-kind, plugin-cardwire, plugin-cdp, plugin-check, plugin-clean, plugin-cmd, plugin-command, plugin-crabbox, plugin-cstream, plugin-cua, plugin-dbus, plugin-deploy-local, plugin-deploy-pod, plugin-deploy-vm, plugin-desktop-kind, plugin-distro, plugin-dns, plugin-docs, plugin-doctor, plugin-dsh, plugin-egress, plugin-enc, plugin-example, plugin-example-bootstrap, plugin-example-builder, plugin-example-command, plugin-example-deploy, plugin-example-dispatch, plugin-example-external, plugin-example-kind, plugin-example-lifecycle, plugin-example-require, plugin-example-step, plugin-example-stepkind, plugin-example-structkind, plugin-examplerunverb, plugin-feature, plugin-file, plugin-fleet, plugin-generate-packages, plugin-gh, plugin-gpu, plugin-harness-kind, plugin-helm, plugin-herdr, plugin-http, plugin-init, plugin-installstep, plugin-interface, plugin-jetkvm, plugin-k8sgen, plugin-kernel-param, plugin-kube, plugin-kubevirt, plugin-loader, plugin-lobster, plugin-marketplace, plugin-matching, plugin-mcp, plugin-media, plugin-migrate, plugin-mise, plugin-mount, plugin-nerdctl, plugin-oci, plugin-ollama, plugin-omarchy, plugin-openclaw, plugin-package, plugin-pipeline, plugin-pod, plugin-port, plugin-preempt, plugin-process, plugin-punktfunk, plugin-qdrant, plugin-quickshell, plugin-record, plugin-refs, plugin-resource, plugin-review, plugin-secrets, plugin-service, plugin-settings, plugin-sidecar, plugin-spice, plugin-ssh, plugin-status, plugin-substrate, plugin-task, plugin-tmux, plugin-tunnel, plugin-udev, plugin-unit, plugin-unix-group, plugin-user, plugin-vision, plugin-vm, plugin-vnc, plugin-wl, pod-agentteams-controller, pod-agentteams-element, pod-agentteams-higress, pod-agentteams-manager, pod-agentteams-matrix, pod-agentteams-minio, pod-agentteams-worker, pod-airflow, pod-android-emulator-layer, pod-appium-server, pod-charly-automation, pod-charly-hooks, pod-charly-mcp, pod-charly-versa, pod-check-keepalive, pod-check-redis-init-layer, pod-check-tier23-layer, pod-chrome-cdp, pod-chrome-devtools-mcp, pod-chrome-headless, pod-cloud-init, pod-comfyui, pod-crabbox, pod-cstream, pod-dbus, pod-dsh, pod-filebrowser, pod-github-runner, pod-herdr, pod-hermes, pod-hermes-full, pod-hyprland, pod-immich, pod-immich-ml, pod-jupyter, pod-jupyter-ml, pod-k8s-layer, pod-kde-desktop, pod-kde-selkies, pod-labwc, pod-maputnik, pod-marimo, pod-mcp-layer, pod-nested-podman-socket, pod-ollama, pod-openwebui, pod-os-layer, pod-osm-tools, pod-pipewire, pod-pmtiles-viewer, pod-postgresql, pod-qdrant, pod-qemu-guest-agent, pod-redis, pod-redis-client-layer, pod-redis-server-layer, pod-selkies, pod-selkies-core, pod-selkies-desktop, pod-sshd, pod-sway, pod-swaync, pod-testapi, pod-traefik, pod-unsloth-studio, pod-valkey, pod-versatiles, pod-versatiles-frontend, pod-virtualization, pod-waybar, pod-waybar-labwc, pod-wayvnc, pod-web-layer, rpiv-todo, sdk, spec, vm-k3s-agent, vm-k3s-server
[pass] check — each pin's CURRENCY — the pin is at the ref its intent names (the question the consistency half above does not answer)
currency: 8 of 412 pin(s) NOT current [1 behind, 1 blocked-by charly:box/cachyos (behind), 404 cur, 6 differs (no checkout to judge ancestry)]; intents: 406 upstream leaf/leaves (406 implicit), 6 derived-from edge(s); NOT CURRENT: distro-cachyos: blocked-by charly:box/cachyos (behind); intent derived-from:charly; recorded 1893455d3a; served 6abe895225 (charly:box/cachyos branch); docs: differs (no checkout to judge ancestry); intent upstream:main (implicit: .gitmodules branch=); recorded a5bd2445dd; served 9540ca5371 (branch); marketplace: behind; intent upstream:main (implicit: .gitmodules branch=); recorded 42b8789543; served d0d55ccc77 (branch); plugin-crabbox: differs (no checkout to judge ancestry); intent upstream:main (implicit: .gitmodules branch=); recorded d5eea8fd15; served 72a7abe4a3 (branch); plugin-nerdctl: differs (no checkout to judge ancestry); intent upstream:main (implicit: .gitmodules branch=); recorded a0051aec96; served 4f0f29da3b (branch); pod-charly-automation: differs (no checkout to judge ancestry); intent upstream:main (implicit: .gitmodules branch=); recorded ca58c6f843; served e4f278f19e (branch); pod-charly-hooks: differs (no checkout to judge ancestry); intent upstream:main (implicit: .gitmodules branch=); recorded fb0dd7c4c6; served a7b5a24c38 (branch); pod-crabbox: differs (no checkout to judge ancestry); intent upstream:main (implicit: .gitmodules branch=); recorded 64852170aa; served c7a7297d82 (branch); producer-first legs: marketplace (42b8789543 -> d0d55ccc77) -> distro-cachyos (blocked-by charly:box/cachyos (behind))
[pass] check — every submodule's branch equals its remote default — KEPT INLINE, deliberately, because no verb owns this clause, and it is the expensive half (one git ls-remote per submodule, hence the timeout below)
exit=0
[pass] check — charly's own nested submodules are at their gitlinks — KEPT INLINE, because the verb has no recursive-nested clause
exit=0
[pass] check — the nested-submodule step above — an uninitialized nested path is a NOTICE, a +/U drift still FAILS (fixtures)
exit=0
[pass] check — the branch-audit step above — every branch= is compared against the remote default, and EVERY mismatch is named (fixtures)
exit=0
[pass] check — the branch-audit gate discriminates — each mutation turns it RED (fixtures)
exit=0
[pass] check — no command: step in this file carries a braced reference in its text — the plan runner CLAIMS one, and an unresolvable one SKIPS the step instead of failing it, so the gate would read green over a check that never ran (fixtures)
exit=0
[pass] check — the command-text gate discriminates — each mutation turns it RED (fixtures)
exit=0
[pass] check — the README's MEASURED figures agree with each other — the table, the prose that quotes it, and the date every dated figure carries — and every count of a collection that GROWS is derived from that collection or dated (fixtures)
exit=0
[pass] check — the measurement gate discriminates — each mutation turns it RED, the figures and the shape counts alike (fixtures)
exit=0
[pass] check — the body/diff reconciliation gate discriminates — a file table that omits a changed file, one that lists an unchanged file, and a pasted git rev-parse HEAD that is not the head, each turn it RED (fixtures)
exit=0
[pass] check — the umbrella's own committed builders pass their self-tests — the set the commit gate runs, owned by scripts/self-test.sh
exit=0
[pass] check — the commit gate decides by CHANGE CLASS and runs each leg EXACTLY ONCE — the pin check only when the diff touches one of the pin contract's commit-carried inputs (a gitlink, the manifest charly.yml, the declared path set .gitmodules), the skip visible, the missing binary loud, and the index the commit carries read (fixtures)
exit=0
[pass] check — the commit-gate gate discriminates — each mutation turns it RED (fixtures)
exit=0
[pass] check — every step of every task in this file declares a context: the plan runner activates — a set disjoint from [build, runtime] (the [deploy] this file used to carry) is a no-op in EVERY mode (fixtures)
exit=0
[pass] check — the opencode gate plugin contract (the check-opencode-plugin gate the former verify-pins.sh ran)
exit=0
[pass] check — the PR-watch plugin's pure logic + its shipped (uncommented) SDK delivery primitives
exit=0
[pass] check — the agent-progress monitor+control plugin — static (no .sh), the classifier (RCA regression), and a read-only store
exit=0
[pass] check — the session tracker plugin — the durable ledger (rule 9 invariant), the three tools, and the real-binary load
exit=0
[pass] check — every harness-config surface parses and is wired (rule 5)
exit=0
[pass] check — the harness-config gate discriminates — each mutation turns it RED (fixtures)
exit=0
[pass] check — the pi gate extension fails CLOSED, uses the rule-2 worktree path, and wires both gate scripts
exit=0
[pass] check — the validator enforces only what the rulebook states — rulebook check ids == the AGENTS.md "What the validator checks" table, every cited skill resolves, and the committed rulebook == the live AI_REVIEW_PROMPT (#446)
exit=0
[pass] check — the validator rule-map gate discriminates — each mismatch fixture turns it RED
exit=0
[pass] check — the coordination closed set is the SAME nine labels on every surface that enumerates it (#567)
exit=0
[pass] check — the coordination closed-set gate discriminates — each mutation turns it RED (fixtures)
exit=0
[pass] check — the pi wake binding delegates to the neutral watchers, wakes, re-arms, cleans up, and ships inert + wired
exit=0
[pass] check — the pi PR-status tool parses, normalises the state, finds the run by head SHA, reads jobs via REST, and classifies INCONCLUSIVE
exit=0
[pass] check — the pi question tool is dependency-free, headless-safe, serialized, and wired into .pi/settings.json
exit=0
[pass] check — the harness-neutral R10 bed watcher classifies exit codes and parses summary.yml (self-test)
exit=0
[pass] check — every canonical root narrative exists and every root-file reference in the agent surfaces resolves (the #356 content-loss gate)
exit=0
[pass] check — the root-ref gate discriminates — each mutation turns it RED (fixtures)
exit=0
VERIFY_EXIT=0

The legacy is gone — the three claim-keyed sweeps find no matches in the umbrella's
own tree (the CHANGELOG is history, and is excluded by design):

$ git grep -n "DISTRO_MOVED" -- . ":!CHANGELOG"
exit=1
$ git grep -n "PIN_CONTRACT_FILES=(" -- . ":!CHANGELOG"
exit=1
$ git grep -n "grep -c .160000." -- hooks scripts
exit=1

The old model's phrase survives only where it names the case the fixture fires, or the
model it replaced
— every surviving hit, classified:

$ git grep -n "moves no gitlink" -- . ":!CHANGELOG"
scripts/check-pre-commit-gate.mjs:22:// first version of this fixture asserted that "a commit that moves no gitlink skips
$ git grep -n "moves a gitlink" -- . ":!CHANGELOG"
scripts/pin-contract-inputs.sh:23:# was derived by judgement ("a diff that moves a gitlink") instead of from what the

The first hit is the fixture's own note about the class it replaced; the second is the
shared definition's note about the model it replaced. Neither is a live rule.

The body's own gates — the diff reconciliation and the org's linter, on this body:

$ node scripts/check-pr-body-diff.mjs --body PR_BODY.md --base origin/main
PASS every pasted git rev-parse HEAD names the head being pushed (3835e25)
NOTE the body states no count of the diff's new files — the count rule is inapplicable
PASS the file table lists exactly the 8 file(s) the diff changes (against origin/main)
check-pr-body-diff: OK

$ python3 marketplace/scripts/pr_body_lint.py PR_BODY.md --head 3835e25 --rules R0,R1,R2,R3,R4,R5,R6,R7,R8,R9,R10
pr_body_lint: 0 finding(s)

Rulebook compliance

  • R0 — the skills the dispatcher selects for this change (/charly-internals:git-workflow,
    /charly-internals:strict-policy, /charly-internals:root-cause-analyzer) were loaded
    before the first edit.
  • R1 — the validator's non-blocking observation on fix(hooks): the commit gate decides by change class, and each leg runs once (opencharly/opencharly#602, #645, #498) #660 is a real defect, and the RCA
    (mechanism, missed control, blast radius, root fix) is posted on fix(hooks): the commit gate decides by change class, and each leg runs once (opencharly/opencharly#602, #645, #498) #660's thread. The
    class was derived by judgement instead of from the verb's read-set; the fixture
    asserted the class as written, so it could not falsify it — that is the missed control,
    and the fix is one fired assertion and one mutation arm per input. The corpus copy of
    the same false description is filed as the charly task pin-check row under-describes the verb's read-set, and scopes commit-violability to a gitlink-moving commit layer-charly-internals#146 and listed
    under ## Filed issues. Zero warnings in the gate above.
  • R2 — the rule has ONE owner: scripts/pin-contract-inputs.sh. The commit gate and
    the wave body's coverage decision are two READERS of it, not two copies; the wave
    body's narrower copy of the question is deleted in the same cutover.
  • R3 — no workaround: the class is a rule, not a heuristic that guesses; no sleep, no
    retry, no suppression, no fallback branch.
  • R4 — the product is fixed before the prose: the gate and the shared definition come
    first, and the two prose surfaces that carried the old model (charly.yml, README.md)
    are corrected in the same change.
  • R5 — the legacy is gone, with the claim-keyed sweeps pasted above; the surviving
    hits are classified in the same section.
  • R6 — git status was stated before the amend; no force-push, no amend after the
    push, no direct push to main, no hook bypass, and no other session's branch,
    worktree or file touched. No submodule was edited: the umbrella records gitlinks only,
    and this diff moves no gitlink.
  • R7 — the changed path executed live (the class measured on this diff, the gate's
    fixture, the wave body's self-test and the umbrella's whole plan, all pasted above), and
    this change's own coverage fails without the change: each of the fixture's 11 mutation
    arms is red on the mutated copy while the unmutated copy is green, the wave body's
    7 arms judge the coverage decision itself, and the fixture is red on the OLD tree
    (2 findings) and on the hybrid that carries the old rule (4 findings) — all pasted
    above.
  • R8 — the pin check ran LIVE against the real index, in the umbrella's plan above;
    nothing was mocked. The fixture's fired assertions use a RECORDING charly, and what
    they judge is the gate's DECISION — how many times it invokes a leg, whether the skip
    is visible, whether the missing binary is loud — not the verb's verdict, which the live
    run exercises.
  • R9 — the worktree-local, CalVer-stamped build is used (printed above), never a
    shared install.
  • R10 — the change-class gate ran on the committed tree being pushed, with zero
    failed steps and no warning: charly task verify (33 steps, 0 failed) plus the
    changed gate's own --self-test (11 arms, each red on its mutation) and the wave
    body's self-test. No disposable: true target is affected: this change touches no
    build, no deploy and no bed, and the umbrella declares no candy or box.
  • Part II ci: adopt org-wide validation chain — pr-validator + tag-on-merge, drop custom auto-merge #2 — the edit happens in the session worktree, on a branch off fresh
    origin/main; every tracked submodule checkout stays at its gitlink.
  • Part II chore: sync all submodule pins; spec no longer charly-pinned #6/fix: escape backticks in umbrella-gates rules template (pi extension parse error) #7/chore: sync gitlinks to the landed sdk de-submodule cutover #11 — the work is claimed on the issue it resolves, the coordination
    records are posted on the threads it touches, and the resolved issue is closed with an
    explicit RESOLVED record when this PR lands — a Closes keyword does not close an
    issue by itself.

Change classification

One gate's own decision. The diff carries the umbrella's own commit gate: the hook,
the gate it delegates to, the gate's own assertion, the shared definition the gate reads,
the wave body that reads it too, and the manifest's and README's references to them. No
submodule content, no Go source, no schema, no gitlink, no pin, no deploy and no bed.

The gates that own this class are the changed gate's own --self-test (the coverage this
change adds), the wave body's --self-test (the coverage of the second reader), and the
umbrella's charly task verify (the aggregate gate, which runs both among its 33
steps) — all run on the committed tree above, and the changed path itself ran live.

On the attribution tier. The tier is fully tested and validated: the change-class
gate passed on the final tree with zero warnings, the changed path ran live, and the
measurements above are retained in this body.

Filed issues

Two further findings were filed while the issues that #660 discharged
were closed, so that neither dies with the issue it was recorded on. They are not this
diff's scope — this diff neither causes them nor fixes them:

No other issue was filed: every other finding this change's scope touched is fixed in it.

Agent: charly

Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

…ion (#661)

The commit gate's change class was "the staged diff moves a gitlink", and it
was derived by judgement instead of from what the verb reads. `charly task
pin-check` composes `verb:git-submodules` in mode: verify, and that verb reads
three commit-carried inputs:

  1. the INDEX's gitlinks — the edge's `got` side, and every submodule's
     recorded gitlink (the checkout audit's expectation);
  2. the MANIFEST that DECLARES the pin contract — charly.yml's `pins:`
     block, with its `pin_map` and `pinned_from`;
  3. the DECLARED PATH SET — .gitmodules, which the checkout audit walks.

A commit that edits (2) or (3) moves no gitlink, so the gate SKIPPED the
check that would have caught it — and the shipped comment claimed the class
was exact ("every value it compares is an INDEX entry, and ... a commit that
moves no gitlink cannot violate it"). The claim was false: the edge's `want`
side is read from the `pinned_from` CHECKOUT's HEAD, and the declaration and
the path set are files.

The rule now lives ONCE — scripts/pin-contract-inputs.sh — and both readers
ask the same question of it ("can this diff violate the pin check?"):

  - the commit gate's CHANGE CLASS (hooks/pre-commit-gate.sh), which now only
    MEASURES: which staged paths are gitlinks, and which are declaration
    files. The rule is not restated in the gate, so the two cannot drift;
  - the wave body's COVERAGE DECISION (scripts/sync-pin-evidence.sh), whose
    rule was NARROWER than the truth: it decided coverage by "a `distro-*`
    pin moved", so a diff that moved charly's own gitlink (which moves the
    edge's `want` side) or edited the manifest was described in a PR body as
    a diff the pin check "cannot fail on". That was false, and the body
    under-claimed what the gate proves.

The class is a deliberate SUPERSET of the violation set — a charly.yml edit
that touches no pin block still fires the check — because the check reads the
whole manifest, so a change to it can change what the check compares. The
checkout drift is caused by NO commit, so it stays where the rulebook puts it:
`charly task verify` (AGENTS.md Part II #1), which composes the SAME verb.

The two prose surfaces that carried the old model are corrected in the same
change: the verify step's description in charly.yml, and the README's row
for `charly task pin-check`, which described the command as asserting "the
pin contract's cheap half" — the edge alone — while the verb runs the edge
AND the checkout audit.

The coverage now has ONE fired assertion per input and ONE mutation arm per
input, so a dropped leg goes red: 11 arms in the gate's fixture (each
mutation turns it RED, the unmutated copy GREEN) and 7 arms in the wave
body's self-test, which prove the coverage decision itself.

Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)
@aitrawog

Copy link
Copy Markdown
Contributor Author

STATUS

The follow-up to #660 is open: #664, head
3835e254485395089ff8da28fce5c2ec0bb049e9 on feat/pin-check-class-inputs, branched off
fresh origin/main 1e809762d028328b72083f72981c6c72312d1527 (which carries #660's
squash 02177e7). The branch is pushed and nothing is amended after this push.

What is done. The pin check's change class is derived from what the verb actually reads
instead of from judgement, the rule lives ONCE, and both places that ask the question ask it
of that one definition: the commit gate's class (hooks/pre-commit-gate.sh) and the wave
body's coverage decision (scripts/sync-pin-evidence.sh). The two prose surfaces that
carried the old model (charly.yml's verify step, the README's pin-check row) are
corrected in the same change. The coverage is one fired assertion and one mutation arm per
input — 11 arms in the gate's fixture, 7 in the wave body's self-test.

The proof, on the committed tree. charly task verify — 33 steps, 0 failed,
VERIFY_EXIT=0, no warning. The gate's own fixture — 11 fired assertions, all PASS. The
fixture's --self-test — 11 mutation arms, each RED on its mutation, the unmutated copy
GREEN. The wave body's --self-test — OK. The coverage that fails without the change: the
fixture is RED on the OLD tree (2 findings — the shared definition is absent and the gate
cannot fire) and RED on the hybrid that carries the old rule inside the new tree
(4 findings — the manifest and path-set legs, and the swallowed verdict). The class was
measured live on this diff (it FIRES, because the diff edits the manifest) and on a
prose-only diff (it SKIPS). The pre-push body lint and the body/diff reconciliation both
pass on the body this PR carries.

What is next. The fresh charly/pr-validator's verdict. Every finding it raises is
fixed or rebutted on this thread BEFORE any next push, and every new comment here is read
in full.

Filed, and claimed: opencharly/layer-charly-internals#146 (the corpus copy of the same
false description, in the repo that authors it — producer-first: layer-charly-internals →
marketplace → docs → the umbrella's gitlinks), plus #662 and
#663, filed while the issues #660 discharged were closed, so that neither finding dies with
the issue it was recorded on.

Next update due: on the validator's verdict, or when the next round's commit is pushed —
whichever comes first.

Agent: charly

Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

I re-derived every claim in the body and the single comment against the current diff and found them consistent. Summary of what I checked and where I landed:

Correctness of the fix.

  • scripts/pin-contract-inputs.sh defines the rule once: PIN_CONTRACT_DECLARATION_FILES=(charly.yml .gitmodules), pin_contract_is_declaration_input, and pin_contract_touches_input <changed> <gitlinks>. The function fires on a declaration file in the changed set, or on a gitlink path that is also in the changed set. Both readers (hooks/pre-commit-gate.sh, scripts/sync-pin-evidence.sh) source the same file — no restated copy.
  • hooks/pre-commit-gate.sh now measures only: STAGED_NAMES from git diff --cached --name-only (respecting GIT_INDEX_FILE) and STAGED_GITLINK_PATHS from --raw with awk 'FS="\t"' + split($1,m," "), matching 160000 in either mode field (covers moved/added/removed gitlinks). It fails loud if the shared file is absent. The old mode_count/grep -c logic is gone.
  • scripts/sync-pin-evidence.sh sources the same definition, builds GITLINK_PATHS, computes COVERED via the shared rule, and names the touched inputs. The old DISTRO_MOVED prefix-count is removed. The broadening (any gitlink, plus manifest/path-set) is correct and matches the verb's read-set as described.
  • Prose surfaces (README.md, charly.yml verify step, hooks/pre-commit header, sync-pr-body.sh rule-10 line) are corrected in the same change.

Tests.

  • The fixture adds one fired assertion per input: F7 (manifest), F8 (declared path set), F9 (manifest + no binary fails loud), plus the reworded F1/F2/F4/F5/F6 arms. Each mutation arm drops exactly one leg (charly.yml, .gitmodules, both, the shared-source wiring, the class itself, the binary-fail-loud path) and the fixture goes red; the unmutated copy stays green. The wave body's self-test adds seven direct assertions of the shared rule, including the "gitlink not in changed set must not fire" negative. The body's pasted check-pre-commit-gate.mjs output (11 PASS), --self-test output (11 arms + green), and sync-pin-evidence.sh --self-test output are internally consistent with the code.

Honesty of the body.

  • File counts: 8 files, 409 insertions / 62 deletions — matches the per-file ± counts exactly (1+7+9+79+160+70+81+2 = 409; 1+3+5+15+17+0+20+1 = 62).
  • Head SHA 3835e25…, base 1e8097…, "no gitlink moved on this diff but the class still fires because charly.yml is edited" — all consistent with the diff. The legacy sweeps (DISTRO_MOVED, PIN_CONTRACT_FILES=(, grep -c .160000.) are genuinely absent from the new content. The surviving "moves no gitlink"/"moves a gitlink" hits are the classified historical notes, as stated.
  • The old-vs-new coverage table and the old-tree / hybrid reproduction (2 and 4 findings) match the described failure modes.

Security / scope.

  • No secrets, no eval, no unquoted expansion; grep -qxF -- and awk handle paths safely; git failures in the gate are loud under the script's set -euo pipefail. Change is coherent, no leftover legacy path, no dead code.

Comment disposition.

  • The single comment (@aitrawog, a STATUS update) is not a maintainer sign-off, and none is claimed. Its stated head SHA, branch, base, and counts match the current state, so it is consistent — it asserts nothing that contradicts the diff. The change therefore stands on its own evidence, which it does.

Non-blocking observations (do not gate this PR):

  • In scripts/sync-pin-evidence.sh, set -euo pipefail is placed after sourcing pin-contract-inputs.sh; unlike the gate, a missing shared file there would not fail loud (the later if pin_contract_touches_input … would read as NOT_COVERAGE). The file is committed alongside, so this cannot bite in the shipped tree, but the gate's explicit existence guard is the stronger pattern.
  • The wave body detects gitlinks via is_gitlink_path, which may not classify a removed gitlink as a gitlink; the commit gate's --raw mode check does. For sync PRs (gitlinks moved, not removed) this does not affect the decision, and the shared-rule design explicitly leaves the gitlink measure to the caller.

No finding rises to a block: the change does what the body claims, ships coverage that fails without it, is honest about its evidence, and is clean.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@aitrawog

Copy link
Copy Markdown
Contributor Author

STATUS

The validator's two observations on this PR are dispositioned — one fixed, one rebutted
with the measurement that settles it. Neither is filed away.

Observation 1 — the wave body sourced the shared definition before set -e was in
force, so a missing file failed OPEN.
FIXED, in #667 (head
e8cb45a), which is the follow-up this PR's RESOLVED record pointed at.

The RCA, on the merged tree of this PR (squash c717835), measured in a scratch copy
with scripts/pin-contract-inputs.sh absent:

$ bash sync-pin-evidence.sh "$PWD" "$PWD/pin-check.log" < /dev/null
sync-pin-evidence.sh: line 54: /tmp/obs1-measure/pin-contract-inputs.sh: No such file or directory
sync-pin-evidence.sh: line 419: pin_contract_touches_input: command not found

and the body then published, as a FACT, "The pin check is NOT offered as this diff's
coverage: this diff changes NONE of the pin contract's commit-carried inputs"
— and
exited 0. The source failed silently because no set -e was in force yet; the
undefined function answered "no" inside an if condition, where a non-zero status is a
false test rather than an error; and the body published a coverage decision it never made.

Mechanism. set -euo pipefail sat AFTER the source, and the body carried no existence
guard — while the commit gate, which reads the SAME shared file, had guarded it all along
at hooks/pre-commit-gate.sh:77. The body was the one reader of the shared definition
without the guard, so it was the one reader that could fail open.

Missed control. The commit gate's guard was not a shared rule; it was a line inside one
reader. Nothing made the second reader carry it, and nothing made a missing file loud in
the body.

Blast radius. The body is the sync PR's own builder: it decides what the pin check
covers for a diff. A missing shared file made it declare, with the same authority as a
real decision, that a diff touching the manifest or the declared path set was NOT covered —
the exact opposite of the truth, and the direction that hides a violation.

Root fix. The body now carries the commit gate's own guard, in the commit gate's own
shape: set -euo pipefail first, then an explicit existence check that NAMES the missing
file, before the source. A new self-test arm proves the fail-open cannot come back: it
runs a COPY of the body in a directory with no shared file, in body mode with empty stdin
(never --self-test — a self-referential arm is a hang, not a test), and asserts the
fail-open SIGNATURE is absent (command not found, and the NOT offered as this diff
claim), and that the loud failure says the body cannot decide. A positive control re-runs
the same copy WITH the shared file and requires it to reach a coverage decision, so the arm
cannot pass by failing everything. The arm is RED on the old shape and GREEN on the new one.

Observation 2 — is_gitlink_path "may not classify a removed gitlink as a gitlink".
REBUTTED, by measurement. is_gitlink_path reads the INDEX first and falls back to
git ls-tree HEAD, so a path that is in HEAD but no longer in the index resolves to mode
160000 and IS classified as a gitlink. Measured on a scratch repo with a gitlink
committed and then removed from the index:

$ git update-index --add --cacheinfo 160000,0000…0001,sub && git commit -qm "add gitlink"
$ git update-index --force-remove sub

$ git ls-files -s -- sub            # the index: the path is gone
$ git ls-tree HEAD -- sub
160000 commit 0000000000000000000000000000000000000001	sub   # HEAD still has it

and the body, run with sub on stdin in that repo, renders a GITLINK row — sub 000000000000 ! — not a (file) row. The classification the observation doubted is
correct.

What is a real defect, and it is not this one. The row's VALUE is wrong: for a REMOVED
gitlink the body compares the removed pin against the remote's default-branch HEAD and can
flag !, so a removal and a divergence look the same in a table whose reading is "this pin
is not the remote's HEAD". That is a separate mechanism from this PR's change — a body
making a WRONG decision, where this PR's fail-open was a body making NO decision — so it
is filed as #666 with its measurement, and it lands in its own PR.
The classification is not in question; the value is.

Agent: charly

Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

github-actions Bot pushed a commit that referenced this pull request Oct 24, 2026
…— nine gitlinks to their producers' served mains (#671)

The rule landed as #670 and the arm as
opencharly/layer-charly-internals#148 (tag v2026.297.0850); the corpus
regenerated and merged as opencharly/marketplace#575 (tag v2026.297.0931).
This advances the umbrella's own pins through the pin contract's verb, so the
umbrella's tree carries the arm that reads the pushed range's trailers, and it
aligns the umbrella's two `charly task pin-check` rows with the contract
#664 implemented — the read-set the corpus's canonical
text names, and the umbrella's own rows did not.

Refs #613

Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)
@aitrawog
aitrawog deleted the feat/pin-check-class-inputs branch November 1, 2026 19:10
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