Repository navigation
feat(hooks): ZERO-ALIASES pre-commit gate + CLAUDE.md hooks-doctrine reconciliation (guidance fix) - #123
Conversation
…reconciliation (guidance fix) The superproject leg of the guidance-level fix (B2 leg 2) for the RCA finding (task #49) that a fresh pr-validator let an alias/boundary violation pass, with NO mechanical backstop. This leg adds the deterministic hook floor + reconciles the doctrine; the plugins leg (#66) strengthens the validator spec. Fix 1 — the ZERO-ALIASES hook gate (pre-commit-gate.sh + gate_test.py): alias_gate(repo) blocks a NEW charly/*_aliases.go file (status A; alias files have NO migration exception), a declaration-form kit-alias line in any staged charly/*.go (type X = kit.Y / var x = kit.Y), and a grouped alias line in a GROWN charly/*_aliases.go. A plain residual kit IMPORT/CALL is ALLOWED — only alias FORMS block (IMPORT-PURITY of a plain import/call stays validator-judged). Fail-open for non-charly repos; tier-independent. gate_test.py gains 8 ZERO-ALIASES cases + a charly_repo() helper (charly-superproject shape, no go.mod, isolating the alias gate from the lint gate): NEW alias file blocked, declaration-form var/type alias blocked, grouped alias in grown alias file blocked, plain kit CALL allowed, plain kit IMPORT allowed, alias outside charly/ not gated, clean charly change allowed. 32/32 cases PASS — the changed alias_gate code path executed LIVE against real staged charly/*_aliases.go files. Fix 2 — CLAUDE.md hooks-doctrine reconciliation: the mechanics list now names the ZERO-ALIASES gate (fail-open; plain residual kit import/call ALLOWED, only alias FORMS block — the mechanical floor under the pr-validator architecture gate, never a substitute). Attribution/CHANGELOG/architecture/R0-R10 proof remain validator-judged — the doctrine is reconciled with what the hooks ACTUALLY enforce. The plugins gitlink bump to the merged #66 commit is appended as a follow-up commit on this branch before merge (B2: the super pointer must reference a commit on plugins main, which only the merge produces). Change class: hook SCRIPT (code/config class) — not documentation-only; the CLAUDE.md docs ride along. R10 = parse + execute the changed script live: python3 -B gate_test.py -> 32/32 PASS. Tier: analysed on a live system (the changed hook code ran live with output pasted; no disposable bed applies to a pre-commit hook). Assisted-by: Claude (analysed on a live system)
…tem trace + ZERO-ALIASES hook floor) Pure submodule-pointer bump to c30881ef (the merged #66 — all-documentation pr-validator.md strengthening). B2 leg 2 follow-up: the super pointer must reference a commit on plugins main, which only the #66 merge produces. Assisted-by: Claude (documentation reviewed)
pr-validator — APPROVED ✅Change class: hook/workflow (code/config — a pre-commit hook SCRIPT change; CLAUDE.md docs + plugins gitlink ride along) Security & anti-tampering (T1–T4)The hook change STRENGTHENS a guardrail: it adds a deterministic R10 — re-derived myself (trust nothing)Hook-script class ⇒ R10 = parse + execute the changed script live. I re-ran the changed
ARCHITECTURE GATE — placementplacement: CORRECT per-item trace: This PR stages NO goal-fit: advances the plugin-host end-state — adds the mechanical backstop for the R0–R10 checklist
Decision: APPROVED. Every applicable rule is positively confirmed from the diff + my own live re-run of the changed hook script. The change strengthens a guardrail, is placed at the correct layer (a harness hook, not core/SDK/candy capability code), and the doctrine reconciliation makes the previously-over-claimed Assisted-by: Claude GLM 5.2 Cloud (analysed on a live system) |
Assisted-by: Claude (analysed on a live system)
… redesign marshal (#67) feat(deploy)!: K5-Unit-1 Option A — clean kit of R-item, shrink seam, redesign marshal (#67) The K5-Unit-1 cutover moves the deploy state-model body from `charly/` core into `sdk/deploykit` (a kind-blind mechanism kit). The original move contaminated the kind-blind kit with a deploy-kind-specific transform (`MarshalBundleNodeLegacy`) and threaded FOUR core-coupled ops through the `DeployStateHost` seam. Option A fixes that incomplete-seam violation. SDK leg (sdk PR #55, merged 9ec6940, tag v0.2026196.1147): - Removes `MarshalBundleNodeLegacy` from `sdk/deploykit` — the R-item that contaminated the kind-blind kit. - Removes `MigrateDeployEntity` + `LatestSchemaVersion` + `AcquireDeployConfigLock` from the `StateHostMechanisms` seam. - Collapses `LatestSchemaVersion` → `kit.LatestSchemaVersion()` directly; `AcquireDeployConfigLock` → `kit.AcquireFileLock(path+".lock", true)` directly. - Redesigns `SaveBundleConfig` as a kind-blind shell taking a `marshalNode` callback (version-stamp + provides-marshal + write-temp-rename + fail-safe re-check). - Shrinks the seam from 4 ops to 1 op (`LoadUnifiedBundleConfig` — K1-gated, dies when K1 relocates LoadUnified to loaderkit, task #31). Super leg (this PR): - Fuses `MarshalBundleNodeLegacy` + `migrateDeployEntity` into ONE clean canonical `marshalBundleNode` in `charly/deploy_nodeform.go`. - Adds `saveBundleConfigNodeForm(dc)` — the ONE `charly/` helper (R3) supplying `marshalDeployNode` as the callback. - Updates ~12 `charly/` `SaveBundleConfig` call sites → `saveBundleConfigNodeForm`. - Registers ONLY `LoadUnifiedBundleConfig` in `deploy_state_host.go` init (1-op seam). - Deletes `migrateDeployEntity` (dead after fusion — R5). - Bumps the `sdk` gitlink to the merged Option A sdk commit `9ec6940` + `charly/go.mod` require `v0.2026196.1147`. Net core-LOC NEGATIVE (494 insertions, 1027 deletions). IMPORT-PURITY preserved (`deploy_nodeform.go` imports spec+yaml.v3 only; `deploy_state_host.go` uses the pre-existing `deploykit` import directly — body-move exception). ZERO-ALIASES preserved (the alias file shrank; no new `charly/*_aliases.go`). The marshal + helper + ~12 deploy-lifecycle consumers live in `charly/` core until K4 moves them to their plugin homes (plugin-bundle / plugin-deploy-pod / plugin-check) — tracked K4-exit inventory (task #52), not permanent residue. R10: 5 disposable beds CONCURRENTLY (check-sidecar-pod, check-charly-vm, check-structkind, check-substrate, check-group) — all exit 0, zero warnings, fresh-rebuild (`update` step) on each. The changed deploy state-model paths executed live on every bed's deploy-add → config → update route. Delta re-gate after merging main (#123): go build/vet/gofmt/test/lint all clean, file overlap EMPTY. Assisted-by: Claude GLM 5.2 Cloud (fully tested and validated)
…e parsed node (wave: spec 533, sdk 531, plugin-loader 534) (#565) * refactor: F2 — the genericNode dual representation dies (bridge deletion) Parser consolidation F2 (plan/nested-capture-architecture.md, Cutover F2). The dual-representation member-tree IR is gone: node_parsed.go (the JSON→yaml→JSON round-trip machine parsedNodeToGeneric/genericToParsedNode + the normalizeNodeInto test bridge), node_parse.go (the genericNode type), node_candy.go (the yaml-key candyIsImage + buildCandy re-conversion) and node_build.go (decodeNodeValue's wrapper) are DELETED. Their last prod callers (foldCandyKind, validateKindValueCUE, materializeDiscoveredNode) now operate on the wire-safe spec.ParsedNode through the loader seam: - foldCandyKind: pl.CandyIsImage(pn)/pl.BuildCandy(pn) (the loaderkit parsed-node restatement) + the SHARED spec set-body folds (spec.SetBoxInto/SetCandyInto, F2.4) — no genericNode reconstruction anywhere in the dispatch. - validateKindValueCUE: the mapping-shape check reads the canonical JSON body directly; the CUE ingest is CueDocFromJSON (F2.3) — the gn→yaml.Marshal→CueDocFromYAML round trip is gone. - materializeDiscoveredNode: pl.CandyIsImage(pn) (F2.1). - materializeDocStream: the ONE loaderkit doc-stream composer (pl.ParseDocStream, F2.5) drives the embedded-vocab stream with the same per-document pipeline as the file walk; the hand-rolled classify/gate/parse loop is deleted. - The three self-labeled (R3) one-line wrappers (isStandaloneResourceKind, foldStandaloneTemplateReply, decodeNodeValue) are inlined at their call sites / die with buildCandy; node_normalize.go disappears, ensureMap moves beside its consumer. - pluginPrimaries (F2.6): the frozen 11-entry table is DELETED — the table is seeded at init from the compiled-in units' declared capability primaries (the embedded charly.yml verb_primaries: data directive, admitted by #NodeDoc), and the expectation is a parity assertion (node_desugar_test.go). - KindProvider (the last type naming genericNode) + its no-op bijection gate die with the type; the reserved-registry test iterates the live ClassKind registry instead. - R5 sweep: stale claims about the deleted bridge fixed across loader_threaded.go / plugin_prescan.go / materialize.go / materialize_seam_parity_test.go / plugin_inproc.go / the kernel manifest. - Moved tests: the bridge test files' candy/child-form coverage lives beside the loaderkit implementation in sdk (candy_node_test.go, node_childform_test.go); the charly-side plugin e2e + node-form tests were rewritten against parsed-node fixtures (parsednode_helpers_test.go). Full kernel suite green on the committed tree (with the wave's worktree replaces; the final pin commit swaps them for the released tags). * fix(deps): pin the F2 wave tags — spec v0.2026251.533, sdk v0.2026251.531, plugin-loader v0.2026251.534 The F2 bridge-deletion wave's seam surface + implementations are released (spec #123/#124, sdk #240, plugin-loader #8). The dev worktree replaces are dropped; the full kernel suite is green on the final committed real-pinned tree. * chore: re-trigger validator with the A2/A3 bed evidence (pod 2026.251.0621 + VM 2026.251.0627, both PASS)
* fix(pin): advance box/cachyos to the merged distro-cachyos main box/cachyos 88ca1d57e6 -> a9afa6b19a (distro-cachyos main HEAD, the post-tag CHANGELOG commit for PR #123). This is the charly-side leg of the runner-image chain: the fix merged in distro-cachyos#123 advances the pod-github-runner pin that the runner image composes. Policy B mirrors charly's box/* gitlinks into the umbrella's distro-* pins, so this leg is what lets the umbrella's distro-cachyos view advance to the same commit. Pins only a MERGED ref: a9afa6b1 is distro-cachyos's main HEAD. Closes #810. * fix(pin): advance the five remaining lagging box/* to their distro mains box/{arch,debian,fedora,omarchy,ubuntu} advance to each distro repo's merged origin/main HEAD, so charly's box/* view carries no pin that lags its distro. box/cachyos was advanced in the preceding commit (the runner-image chain leg). Merged refs only; no hand-pins. --------- Co-authored-by: atrawog <[email protected]>
Summary
The superproject leg (B2 leg 2) of the guidance-level fix for the RCA finding (task #49): a fresh
pr-validatorlet an alias/boundary violation pass, with NO mechanical backstop — a prior feat-branch CLAUDE.md hooks doctrine claimed a "v2 ZERO-ALIASES gate" that DID NOT EXIST in the actualpre-commit-gate.sh. This leg adds the deterministic hook floor + reconciles the doctrine. The plugins leg (#66) strengthens the validator spec.Fix 1 — the ZERO-ALIASES hook gate (
pre-commit-gate.sh+gate_test.py)alias_gate(repo)blocks:charly/*_aliases.gofile (git statusA) — alias files have NO migration exception;charly/*.go(type X = kit.Y/var x = kit.Y);Name = kit.Y) in a GROWNcharly/*_aliases.go.A plain residual kit IMPORT or CALL is ALLOWED — only alias FORMS block (IMPORT-PURITY of a plain import/call stays validator-judged). Fail-open for non-charly repos (an sdk/plugins submodule leg with no
charly/dir). Tier-independent.gate_test.pygains 8 ZERO-ALIASES cases + acharly_repo()helper (a charly-superproject shape with nogo.mod, isolating the alias gate from the lint gate).Fix 2 — CLAUDE.md hooks-doctrine reconciliation
The mechanics list now names the ZERO-ALIASES gate (fail-open; plain residual kit import/call ALLOWED, only alias FORMS block — the mechanical floor under the
pr-validator's architecture gate, never a substitute). Attribution identity/confidence, change class, CHANGELOG coverage, architecture, and R0–R10 proof remain validator-judged (never reimplemented with hook regexes) — the doctrine is reconciled with what the hooks ACTUALLY enforce.Change class + tier
The super leg touches a hook SCRIPT (
.claude/hooks/pre-commit-gate.sh+gate_test.py) — a code/config class — so it is NOT documentation-only; the CLAUDE.md docs ride along. R10 (change class = hook script) = parse + execute the changed script live. Tier:analysed on a live system(the changed hook code ran live with output pasted; no disposable bed applies to a pre-commit hook).R10 evidence (pasted — the changed
alias_gatecode path executed LIVE)python3 -B gate_test.py(the changedpre-commit-gate.shexecuted against real stagedcharly/*_aliases.gofiles + realgit diff):All 24 pre-existing cases (bypass / lint / push gates) still PASS — no regression.
B2 sequencing
The
pluginsgitlink bump to the merged #66 commit is appended as a follow-up commit on this branch BEFORE merge (B2: the super pointer must reference a commit on pluginsmain, which only the #66 merge produces). The squash-merge folds the hook+CLAUDE.md commit + the gitlink-bump commit into the one main commit.R0–R10 checklist
pre-commit-gate.sh; the doctrine points at the gate, never restates its logicgate_test.py's deliberate "attribution is validator-owned/ALLOW" assertions)gate_test.pyparses + executes the changed script live (pasted above); the newalias_gatepath executed against real staged charly/*_aliases.go filesAssisted-by: Claude GLM 5.2 Cloud (analysed on a live system)Assisted-by: Claude GLM 5.2 Cloud (analysed on a live system)