Repository navigation
fix(hooks): key late staging on ANY index-mutating verb, not just add/stage - #44
Merged
Merged
Conversation
…/stage The immediate-next cutover for the residual the pr-validator surfaced while reviewing PR #43 (CHANGELOG/2026.190.1903.md). That cutover sealed `git add`/`git stage` and the commit -a/-i/-o flags; six other index-mutating subcommands stayed open. Measured on the merged gate BEFORE this change -- every one ALLOWED: git rm + commit (docs tier) -> ALLOW git mv + commit (docs tier) -> ALLOW git reset CHANGELOG + runtime tier -> ALLOW git restore --staged + runtime tier -> ALLOW git apply --cached + docs tier -> ALLOW git update-index + docs tier -> ALLOW -- control: git add (already sealed) -> BLOCK All six BLOCK on this branch. These are not adversarial shapes. `git rm old.go && git commit -m ...` and `git mv a.go b.go && git commit -m ...` are everyday commands, which puts them inside the gate's honest-mistake mandate, not the obfuscation case it cedes to the pr-validator. The hole runs BOTH ways. add/stage/rm/mv/apply --cached/update-index stage MORE than the gate saw; reset and restore --staged stage LESS -- unstaging a CHANGELOG/ entry AFTER the gate approved the runtime tier defeats the same requirement from the other side. The fix is a SIMPLIFICATION, not more machinery. The two-verb special case if git_invocations(cmd, "add") or git_invocations(cmd, "stage"): becomes one named set over the same shared parser (R3 -- no second parser): INDEX_MUTATING = ("add","stage","rm","mv","reset","restore","apply","update-index") if any(git_invocations(cmd, verb) for verb in INDEX_MUTATING): Matched by VERB, not by flag: `git apply` without --cached touches no index, but distinguishing that would mean per-verb flag parsing for no benefit -- the remedy (run it as its own Bash call) is cheap and always available, and a gate that fails closed on a harmless shape costs one split command, while one that fails open costs a bad commit. checkout/switch are excluded on purpose: they carry the index across unchanged, and `git switch -c feat/x && git commit` is a legitimate, common sequence. Scope unchanged: the block fires only when a tier that READS the diff is declared. In-tree coverage: gate_test.py, 62 cases, all pass. Nine new -- the six verbs above (each ALLOW on the merged gate, BLOCK here), plus three false-positive guards: `git switch -c` and `git checkout -b` before a commit stay ALLOWED, and a verb name inside a quoted message is one token, never an invocation. Assisted-by: Claude (fully tested and validated)
Contributor
Author
pr-validator — APPROVED ✅Change class: hook scripts ( Fresh, independent re-derivation — I trusted none of the author's numbers; every verdict below is from my own re-run against the real scripts. Checklist
Independent evidence I ran
Decision: PASS. The change closes six concrete everyday late-staging holes both ways (staging MORE and staging LESS), as a strict simplification over the shared parser, with block-order precedence and the four bypass gates all intact and no common workflow over-blocked. Finalizing the merge-time CalVer, squash-merging, and tagging. Assisted-by: Claude (analysed on a live system) |
Assisted-by: Claude (fully tested and validated)
This was referenced Jul 9, 2026
atrawog
added a commit
that referenced
this pull request
Jul 14, 2026
…on (R44 super leg) Superproject (consumer) leg of the R44 exit-127 check-box store-contention fix (task #44). Consumes the breaking sdk R44 leg (ImageChain / disposable-box executor DELETED) and moves box-mode to ONE persistent container, plus the INFRA exit classification. - charly/check_box_container.go (NEW) checkBoxContainerChain: ONE `podman run -d --pull=never --entrypoint= <img> sleep infinity` + per-step `podman exec` + a single `rm -f` teardown; the container-CREATE failure is classified (kit.ClassifyContainerInfraFailure → kit.ContainerInfraError) into the INFRA exit class. O(N)→O(1) container setups (the passwd-race surface), unifying box-mode with `charly check live`'s exec model. - charly/host_build_check_run.go: hostCheckRunBox + hostFeatureBox switched off the deleted ImageChain. - candy/plugin-check/{check,live,feature}_cmd.go: ONE shared failErrorFor (R3) — infra-only exits 1 (INFRA class), a genuine check failure exits 2, mixed exits 2. Never a pass-by-exhaustion. - BREAKING (R5): the charly ImageChain alias + TestImageChain + JumpPodmanRun/JumpDockerRun aliases removed (sdk defs deleted in the R44 sdk leg); grep clean. - Coordinates: sdk gitlink → 28e56e0 (v0.2026194.2258), plugins gitlink → 7baffce (v2026.194.2306), charly/go.mod sdk require → v0.2026194.2258. Reconciled onto #102 (took #102's plugin-check .golangci.yml). Validated by a fresh pr-validator (independent context): full go gates re-run on the assembled head (gofmt/build/vet/golangci-lint 0 issues charly+plugin-check/go test PASS incl TestFailErrorFor), R5 grep clean, and an OWN live spot-verify — stamped binary built from the head, `check box check-sidecar-pod` through the persistent container → 12 steps 10-pass/0-fail exit 0, clean teardown. FLUSH2 78/80 (the 2 fails = task-#66 pre-existings) cross-checked. Assisted-by: Claude (fully tested and validated)
6 tasks done
atrawog
added a commit
that referenced
this pull request
Jul 14, 2026
… live-stdio reverse channel (#106) The superproject leg of the F12 interactive/streaming reverse-channel (#62) — pairs with the merged sdk PR #44 (executor legs + carrier). charly shell / charly cmd / charly logs --follow move off their inline syscall.Exec / os/exec bodies onto the F12 executor reverse channel: the host RESOLVES the venue command (the #59 resolution inventory stays core), the owning deploy plugin runs it over the served venue executor via RunInteractive/RunStream, and the operator's terminal (inherited host-side by the reverse-channel server) drives it — stdio never crosses the wire. - Dispatch: LifecycleTarget.Attach + substrateLifecycle.Attach + externalDeployTarget.Attach + grpcSubstrateLifecycle.Attach; the venue executor is resolved GENERICALLY via VenueExecutor (vm → guest SSHExecutor ssh -t, pod → nil → host ShellExecutor podman exec/run -it; NO arbiter bracket). grpcSubstrateLifecycle.Logs threads a resolved plan for a substrate with a logs resolver. - Resolvers (pod_lifecycle_resolve.go): resolvePodShellPlan/CmdPlan/LogsPlan RELOCATE shell.go/cmd.go/commands.go verbatim; R3 resolvePodRuntimeImage is the shared image-context head with resolvePodStartDirect. Plugin bodies: pod OpAttach→podAttach (RunInteractive), OpLogs→RunStream (the podCli("logs") reentry DELETED); vm OpAttach→vmAttach over the guest SSHExecutor. OpShell stays the #57 charly service capture leg. - Verb rewires: shell→lt.Attach(tty=true), cmd→lt.Attach(tty=false)+notify wrapper, logs→lt.Logs. R5: shell.go −264 (buildShellArgs/buildExecArgs/shellQuoteArgs relocated; execCommand/findExecutable deleted). Closes the #57 M-core register IOU rows for cmd/shell/logs-follow. - Deliberate rename (orchestrator-approved): substrateLifecycle.TeardownExecutor → VenueExecutor (two consumers now: bundle-del teardown + the F12 Attach leg); the wire Op sdk.OpTeardownExecutor keeps its name for wire stability. - R2 fix: dispatchLifecycleTarget connectPluginByWord(ClassDeployTarget, node.Target) so shell/cmd/logs work on an UNCONFIGURED image. - Bumps the sdk submodule to the merged e2cc807 (tag v0.2026195.501) + charly/go.mod require. Validated by a fresh pr-validator against sdk@e2cc807: coordinates verified exactly; workspace go build/test/vet clean, golangci-lint 0, gofmt clean, both touched candies standalone green, cue:gen + pluginsgen reproducible; R5 rename/deletion sweep clean; F12 consumers live-proven on the stamped binary 2026.195.0216 with both acceptance lanes green. Completes the #62 cutover. Assisted-by: Claude (fully tested and validated)
atrawog
added a commit
that referenced
this pull request
Aug 13, 2026
plugins origin/main is now at 44b0759 (opencharly/marketplace#153, v2026.225.0029) — the R3 skill pages. The docs generator reads the plugins submodule's SKILL.md files, so the superproject pin must ride the R3 head for the docs #44 regeneration determinism check to pass at the pinned state. The docs gitlink bump to the docs#44 merged head lands in a follow-up commit once docs #44 merges. Assisted-by: Claude Code deepseek-v4-flash:cloud (documentation reviewed)
atrawog
added a commit
that referenced
this pull request
Aug 13, 2026
…arrative The docs #44 cold-reader surfaced two further findings, fixed at the source skill: entities: - Human defined on first use: a real person — a human-in-the-loop participant with an identity and permission tier — who can observe and intervene in the Rooms their permissions allow. - Worker-image narrative corrected: a Worker container runs the openclaw gateway plus the agt and mc tools and the shared protocol libs (not "the openclaw worker runtime"). The marketplace and docs projections regenerate from these entities; the producer heads ride via gitlink bumps after opencharly/marketplace#154 and opencharly/docs#44 merge. Assisted-by: Claude Code deepseek-v4-flash:cloud (documentation reviewed)
atrawog
added a commit
that referenced
this pull request
Aug 13, 2026
…law/Team/Room The R3 follow-on batch from the PR #255 cold-reader (opencharly/charly PR #255 Phase 1b): the agentteams and agentteams-cli skill pages now state the product's use case ("run a team of AI agents that collaborate on a task") and define the remaining terms a cold reader flagged as undefined on first use — kine (a lightweight storage shim that backs the API server with SQLite), reconciler (a loop that watches declared resources and drives the running system toward them), openclaw (an AI agent gateway runtime), Team (a group of Workers that share a Room), and Room (a chat space on the Matrix homeserver). Fixed at the source skill: entities, then the marketplace and docs projections regenerated. R3b follow-on (docs #44 cold-reader): Human is now defined on first use in both skill entities (a real person — a human-in-the-loop participant with an identity and permission tier — who can observe and intervene in the Rooms their permissions allow), and the worker-image narrative is corrected (a Worker container runs the openclaw gateway plus the agt and mc tools and the shared protocol libs, not "the openclaw worker runtime"). The regenerated producer heads ride via gitlink bumps after both producers merged: plugins -> 07cfa8a (opencharly/marketplace#154, v2026.225.0112), docs -> 2d0840e3 (opencharly/docs#44, v2026.225.0144). Documentation-only change class — the non-runtime standards ran: charly box validate clean, both regenerations deterministic no-ops, the whole-site link gate passed. Assisted-by: Claude Code deepseek-v4-flash:cloud (documentation reviewed)
This was referenced Sep 11, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The immediate-next cutover for the non-blocking residual the
pr-validatorsurfaced while reviewing #43 — opened the moment #43 landed, per R2.#43 sealed
git add/git stageand thecommit -a/-i/-oflags. Six other index-mutating subcommands stayed open.Change class: hook scripts + CHANGELOG. Gate: execute the changed scripts live. Tier:
fully tested and validated.The residual, measured on the merged gate (
68c1dc5) before this changeAll six BLOCK on this branch.
These are not adversarial shapes.
git rm old.go && git commit -m …andgit mv a.go b.go && git commit -m …are everyday commands, which puts them squarely inside the gate's honest-mistake mandate rather than the obfuscation case it explicitly cedes to thepr-validator.The hole runs both ways.
add/stage/rm/mv/apply --cached/update-indexstage MORE than the gate saw.resetandrestore --stagedstage LESS — unstaging aCHANGELOG/entry after the gate approved the runtime tier defeats the same requirement from the other side.The fix is a simplification, not more machinery
The two-verb special case
becomes one named set over the same shared parser (R3 — no second parser, no new predicate):
Matched by verb, not by flag.
git applywithout--cachedtouches no index, but distinguishing that would mean per-verb flag parsing for no benefit: the remedy (run it as its own Bash call) is cheap and always available, and a gate that fails closed on a harmless shape costs one split command, while one that fails open costs a bad commit.checkoutandswitchare excluded on purpose — they carry the index across unchanged, andgit switch -c feat/x && git commitis a legitimate, common sequence. There are explicit tests for both.Scope is unchanged: the block fires only when a tier that READS the diff is declared.
R10 evidence — verbatim
python3 .claude/hooks/gate_test.pyR0–R10
gitcmd.git_invocations; net simplification.bash -nclean, changed scripts executed live, 62 cases, 0 failures, exit 0, pasted above. Tree clean.Note for the evaluator
Merge with
--squash(--rebaseis disabled repo-wide). Compose the squash message and carry theAssisted-by: Claude (fully tested and validated)trailer.Please probe for false positives of your own — over-blocking is the real risk of this change. In particular, confirm your own CalVer version-stamp commit still passes (stage in one Bash call, commit in the next).
Assisted-by: Claude (fully tested and validated)