Repository navigation
docs(hooks): record the ceded boundary for merge-family index mutators - #45
Conversation
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)
pr-validator — APPROVEDChange class: hook source edit, comment-only → Documentation-only change class. What I independently re-derived (trusting nothing)
Substance: is the cession defensible
Tier
Checklist (docs-only class)
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 Assisted-by: Claude (documentation reviewed) |
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)
… 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)*
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-validatoron PR #44 surfaced that the merge-family verbs also mutate the index and are not matched byINDEX_MUTATING. I confirmed it by probe against the merged gate — 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-validatorre-checks against the real diff; and widening the set trades genuine over-blocking risk (git merge --ff-only origin/main && git commitis 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.git diff -U0filtered for non-#changed lines returns nothing.python3 .claude/hooks/gate_test.py— 62 cases, 0 failures, exit 0, unchanged frommain. Zero behaviour change.documentation reviewedon a staged.shdiff, andpre-commit-gate.shACCEPTED 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
gate_test.pyconfirms behaviour is untouched.documentation reviewedis legal precisely because the diff is comment-only;pre-commit-gate.shenforces that boundary itself and let this commit through.Note for the evaluator
Merge with
--squash(--rebaseis disabled repo-wide). Carry theAssisted-by: Claude (documentation reviewed)trailer. Please confirm independently that the diff really is comment-only and thatgate_test.pystill reports 62/0 — if any behaviour changed, the tier is wrong and this must FAIL.Assisted-by: Claude (documentation reviewed)