Skip to content

docs(hooks): record the ceded boundary for merge-family index mutators - #45

Merged
atrawog merged 1 commit into
mainfrom
feat/gate-ceded-boundary
Jul 9, 2026
Merged

atrawog merged 1 commit into
mainfrom
feat/gate-ceded-boundary

Conversation

@atrawog

@atrawog atrawog commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Records, as a comment beside the predicate, the boundary this gate deliberately cedes to the pr-validator.

Change class: Documentation-only (a comment-only edit to .claude/hooks/pre-commit-gate.sh; zero behaviour change). Tier: documentation reviewed. Gate: the non-runtime standards.

Why

The pr-validator on PR #44 surfaced that the merge-family verbs also mutate the index and are not matched by INDEX_MUTATING. I confirmed it by probe against the merged gate — all ALLOW today:

git cherry-pick -n + commit      -> ALLOW
git revert -n + commit           -> ALLOW
git merge --no-commit + commit   -> ALLOW
git stash pop + commit           -> ALLOW
git am + commit                  -> ALLOW
-- control: git add              -> BLOCK

Operator decision: leave them ceded, and say so where the next reader will look. They are rare in the honest workflow this gate serves; they fail OPEN into a stale-diff commit that the fresh pr-validator re-checks against the real diff; and widening the set trades genuine over-blocking risk (git merge --ff-only origin/main && git commit is a legitimate sequence) for a backstop the agent layer already provides.

This is CLAUDE.md's stated division of labour: hooks gate mechanical invariants; agents judge proof. The gate's own header already declares it "a DISCIPLINE BACKSTOP, not a security boundary".

Recording it prevents two failure modes: rediscovering it as a surprise, and "fixing" it without a workflow that actually hits it.

Verification

  • bash -n .claude/hooks/pre-commit-gate.sh — exit 0.
  • Every added line is a comment. git diff -U0 filtered for non-# changed lines returns nothing.
  • python3 .claude/hooks/gate_test.py — 62 cases, 0 failures, exit 0, unchanged from main. Zero behaviour change.
  • Live self-test of the gate's comment-only detection: this PR's own commit declares documentation reviewed on a staged .sh diff, and pre-commit-gate.sh ACCEPTED it — which is exactly what the tier-vs-diff coherence check is supposed to do for a comment-only code edit (CLAUDE.md, "Documentation-only change class").

R0–R10

  • R2 — the residual is neither deferred nor silently dropped: it is an explicit, reasoned, recorded cession, taken as an operator decision.
  • R10 — Documentation-only change class: no bed, no build (beds cannot fail on prose). The non-runtime standards pass; gate_test.py confirms behaviour is untouched.
  • Tier — documentation reviewed is legal precisely because the diff is comment-only; pre-commit-gate.sh enforces that boundary itself and let this commit through.

Note for the evaluator

Merge with --squash (--rebase is disabled repo-wide). Carry the Assisted-by: Claude (documentation reviewed) trailer. Please confirm independently that the diff really is comment-only and that gate_test.py still reports 62/0 — if any behaviour changed, the tier is wrong and this must FAIL.

Assisted-by: Claude (documentation reviewed)

The pr-validator on PR #44 surfaced that the merge-family verbs (cherry-pick -n,
revert -n, merge --no-commit, stash pop, am, rebase, pull) also mutate the index and
are not matched by INDEX_MUTATING. Confirmed by probe: all ALLOW today.

Operator decision: leave them ceded, and say so where the next reader will look.
They are rare in the honest workflow this gate serves; they fail OPEN into a
stale-diff commit that the fresh pr-validator re-checks against the real diff; and
widening the set trades genuine over-blocking risk (`git merge --ff-only origin/main
&& git commit` is legitimate) for a backstop the agent layer already provides.
Hooks gate mechanical invariants; agents judge proof.

Recorded as a CEDED BOUNDARY comment beside the set, so it is not rediscovered as a
surprise and not 'fixed' without a workflow that actually hits it.

Comment-only edit to a .sh file: zero behaviour change (gate_test.py 62/62 unchanged),
so this is the Documentation-only change class and takes the documentation reviewed
tier -- which the gate's own comment-only detection must accept.

Assisted-by: Claude (documentation reviewed)
@atrawog

atrawog commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED

Change class: hook source edit, comment-only → Documentation-only change class.
Head: 29527b0 · Merge method: squash (repo allows squash only).

What I independently re-derived (trusting nothing)

  • Diff is genuinely comment-only. The 10 added lines are all hash-comments inside the Python heredoc block in pre-commit-gate.sh, inserted at lines 96-105 immediately above the unchanged INDEX_MUTATING tuple. gitcmd.py and gate_test.py are untouched; only .claude/hooks/pre-commit-gate.sh changed (+10 / -0).
  • Behaviour is byte-identical to origin/main. I extracted both gate versions and drove them over a 37-case matrix in identical repo states — every INDEX_MUTATING verb, no-verify / -n / core.hooksPath, missing trailer, illegal tiers, docs-tier on code vs comment, runtime tier with and without a staged CHANGELOG, -a / -am / -o, switch -c / checkout -b, attached -m, clean heredoc, apostrophe heredoc (fail-closed), quoted-spaced -C, compound and-echo, and all seven ceded verbs. Result: 37 of 37 identical verdicts (exit code + stderr), zero divergences.
  • gate_test.py: 62 cases, 0 failures, exit 0 against BOTH the PR gate and the main gate, with byte-identical output. bash -n clean on both. No pycache left behind.

Substance: is the cession defensible

  • The comment is accurate. INDEX_MUTATING = add/stage/rm/mv/reset/restore/apply/update-index — it omits exactly the seven merge-family verbs the comment names, and I confirmed all seven (cherry-pick -n, revert -n, merge --no-commit, stash pop, am, rebase, pull) fail OPEN (ALLOW) today.
  • The over-block risk is real. The sequence git merge --ff-only origin/main then commit ALLOWs today; adding merge to the set would make it a false-positive BLOCK (a certain code consequence at the late-staging guard, lines 326-332). Ceding avoids over-blocking a legitimate sequence.
  • Consistent with doctrine. The gate header already declares itself a discipline backstop, not a security boundary; CLAUDE.md states hooks gate mechanical invariants while agents judge proof. The ceded verbs fail open into a stale-diff commit that the fresh pr-validator re-checks against the real diff, with branch protection requiring that status.
  • R2 is satisfied, not dodged. This is not a deferred fix parked as a follow-up; it is a deliberate, reasoned, operator-approved design cession recorded where the next reader will look, taken because the operator directed the gate not be over-engineered. Recording a decision is not the banned pre-existing / out-of-scope framing. The PR author is the operator/repo owner.

Tier

documentation reviewed is correct and NOT inflated: the whole diff is a comment-only code edit (legal for this tier), zero behaviour changed, so no runtime tier applies. The gate own comment-only detection (diff_all_comments for .sh) classifies this change as documentation — which is exactly why its own commit was accepted by the live gate.

Checklist (docs-only class)

  • 0 security T1-T4: PASS (comment-only; no exfiltration / scope-mismatch / supply-chain; touches gate source but zero executable change; explicit operator decision)
  • 1 description complete: PASS
  • 2 change-class gate matches evidence: PASS (docs-only; non-runtime standards; no dry-run / rebuild-alone fraud)
  • 3 attribution tier justified: PASS (documentation reviewed; ceiling set independently)
  • 4 R0 skills honored: PASS (hooks doctrine)
  • 5 R1 RCA / zero warnings: PASS (62/0; no warnings)
  • 6 R2 no out-of-scope split: PASS (reasoned operator cession, not deferral)
  • 7 R3 no duplication: N/A
  • 8 R4 no ad-hoc workaround: N/A
  • 9 R5 hard cutover + grep: PASS (no identifier removed; no transitional path)
  • 10 R6/R8/R9 artifact integrity: N/A
  • 11 R10 disposable / fresh-rebuild: N/A (docs-only; non-runtime standards)
  • 12 RDD / ADE / SDD: N/A
  • 13 concurrency mandate: N/A
  • 14 hard cutover one atomic commit: PASS (one commit, 29527b0)
  • 15 kernel/plugin boundary: N/A
  • 16 disposable-only autonomy: N/A
  • 17 clean architecture + go gates: N/A (bash -n clean)
  • 18 CHANGELOG present: N/A (docs tier does not require one; the gate does not gate it)

Decision: APPROVED. The comment-only edit changes no gate behaviour (proven 37/37 + 62/0 byte-identical), accurately records a deliberate, operator-approved cession consistent with the gate own stated philosophy and CLAUDE.md hooks doctrine, and carries the correct documentation reviewed tier. Merging via squash and tagging the resulting main commit.

Assisted-by: Claude (documentation reviewed)

@atrawog
atrawog merged commit 7d34ab7 into main Jul 9, 2026
@atrawog
atrawog deleted the feat/gate-ceded-boundary branch July 9, 2026 19:37
atrawog added a commit that referenced this pull request Aug 13, 2026
docs(internals): codify the per-session worktree/branch lifecycle

Codify the per-session worktree/branch lifecycle: every session works in its OWN worktree under .claude/worktrees/<slug>/, branched off fresh origin/main, with the main tree staying on main — created at session start, removed (worktree + branch) after the PR lands, so parallel sessions never collide on one checkout. The git-workflow skill's B1 branch-per-change loop gains a Step 0, B4 "Worktree hygiene" becomes the full create → work → land → remove lifecycle, and B7 states the one-worktree-per-session rule. The agents skill's worktree-lifecycle ownership is clarified (orchestrator-owned for spawned teammates; independent parallel sessions own their own). The rulebooks (CLAUDE.md Key Rules + AGENTS.md "Hard Cutover by Default") carry the equivalent mandate with a /charly-internals:git-workflow detail pointer. Housekeeping: the untracked .claude/hooks/__pycache__/ Python bytecode is now gitignored.

Cross-repo (producer→consumer): plugins PR #155 + docs PR #45 (both regenerated from the candy/charly-internals manifest edits) + docs follow-up PR #46 (adds the docs per-repo CHANGELOG entry), then this superproject commit carries both gitlink bumps. Documentation-only change class → documentation reviewed tier, no beds.

Assisted-by: Claude Code deepseek-v4-flash:cloud (documentation reviewed)
github-actions Bot pushed a commit that referenced this pull request Oct 24, 2026
… provider path over to the renamed plugin repo (#1059)

* chore(deps): adopt plugin-task v0.2026297.1542 (the task runner counts a step that ran nothing)

`plugin-task` is compiled into the charly binary, so the pinned module version IS
the behaviour of `charly task` — and of the `git-submodules` verb that `charly task
sync` runs.

At v0.2026296.2153 the task runner counts STEPS and FAILURES only. A step that ran
nothing is neither: it is not a failure, so it is counted among the N steps, and it
is not disclosed. A green task line can read "26 step(s), 0 failed" over a run in
which six comparisons never happened. The org already owns the vocabulary for
exactly this state — `sdk.CheckSkippedExitCode = 3` ("the phase RAN NOTHING —
neither a pass nor a failure") — and the check runner honours it. The task runner
had no equivalent.

Two merged releases carry it: opencharly/plugin-task#45 (squash 7e26679, root tag
v2026.297.1509, module tag candy/plugin-task/v0.2026297.1509) adds the third
bucket, and opencharly/plugin-task#46 (squash c24c743d, root tag v2026.297.1542,
module tag candy/plugin-task/v0.2026297.1542) carries the stderr-capture fix that
#45's PASS asked for. This adopts the second.

`charly/go.mod:141` moves `github.com/opencharly/plugin-task/candy/plugin-task`
from `v0.2026296.2153` to `v0.2026297.1542`. `charly/go.sum` moves with it,
derived by `go mod tidy`: the two superseded pairs (`v0.2026296.1911`,
`v0.2026296.2153`) go and the one live pair (`v0.2026297.1542`) arrives. The
`v0.2026296.1911` pair was already stale on this tree — #1050 added the `2153` pair
without tidying — so the tidy also restores the invariant this repo's own precedent
(#1045) holds: exactly ONE plugin-task version in `charly/go.sum`.

The two versions' own `candy/plugin-task/go.mod` are byte-identical in their
requirements (`sdk v0.2026276.1822`, `spec v0.2026276.1636`), so no `sdk`/`spec`
move is behind this bump. The pin is stated once: `charly/charly.yml` names the
compiled-in plugin WORD (`plugin-task`), never a version.

Closes #1057

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

* chore(pins): cut the containerd provider path over to the renamed plugin repo

The out-of-tree engine plugin was RENAMED `plugin-nerdctl` ->
`plugin-containerd` (the engine word changed first; the repo name followed),
and its module path moved with it: `candy/plugin-nerdctl` ->
`candy/plugin-containerd`, module
`github.com/opencharly/plugin-containerd/candy/plugin-containerd`.

Three surfaces in this repo still named the pre-rename path:

- `charly/plugin_corpus.txt:79` — the corpus entry for the plugin repo;
- `charly/plugins_refs_generated.go` — the generated word->provider index,
  whose three containerd words still pointed at the old module path;
- `charly/engine_word_cutover_test.go:106` — the guardrail's canonical ref.

`charly/plugins_refs_generated.go` is a PROJECTION of the corpus's
word->provider map: pluginsgen fetches each corpus repo at its default branch
— deliberately, because the word->ref FACT lives in the plugin repos — and
records where each word is served (internal/pluginsgen/main.go,
collectWordRefs). A projection does not follow its source by itself, so the
index was re-projected with the SAME pluginsgen invocation the build uses
(scripts/bootstrap-charly.sh). The corpus entry and the guardrail's constant
follow the rename; regenerating the index is the replacement for the three
generated keys.

This is what the repo's own gate demands: `TestPluginsRefsIndexSound` compares
the committed index against what the corpus serves RIGHT NOW, and its own
failure message says "the index is FALSE; regenerate and commit it". The gate
had gone red for every checkout of this repo — including a fresh clone of
main — because the corpus moved after the index was last committed.

The build's `scripts/check-generated-clean.sh` deliberately classifies this
file as `upstream` and RESTORES the tracked copy, so a build never leaves the
tree carrying a fresh projection: the remedy is a commit here.

The retired words (`engine:nerdctl`, `verb:nerdctl`, `command:nerdctl`) stay
retired: the guardrail's negative arms still reject them.

Refs: opencharly/opencharly#589 (the containerd programme's consumer legs).

Agent: charly

*Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)*
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