Skip to content

feat(hooks): ZERO-ALIASES pre-commit gate + CLAUDE.md hooks-doctrine reconciliation (guidance fix) - #123

Merged
atrawog merged 3 commits into
mainfrom
feat/guidance-zero-aliases-teeth
Jul 15, 2026
Merged

atrawog merged 3 commits into
mainfrom
feat/guidance-zero-aliases-teeth

Conversation

@atrawog

@atrawog atrawog commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The superproject leg (B2 leg 2) of the guidance-level fix for the RCA finding (task #49): a fresh pr-validator let 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 actual pre-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:

  • a NEW charly/*_aliases.go file (git 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);
  • a grouped-block alias line ( Name = kit.Y) in a GROWN charly/*_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.py gains 8 ZERO-ALIASES cases + a charly_repo() helper (a charly-superproject shape with no go.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_gate code path executed LIVE)

python3 -B gate_test.py (the changed pre-commit-gate.sh executed against real staged charly/*_aliases.go files + real git diff):

[PASS] want=BLOCK got=BLOCK commit: NEW charly/*_aliases.go file blocked (#86 class)
[PASS] want=BLOCK got=BLOCK commit: declaration-form var alias blocked
[PASS] want=BLOCK got=BLOCK commit: declaration-form type alias blocked
[PASS] want=BLOCK got=BLOCK commit: grouped alias in grown alias file blocked (#87 class)
[PASS] want=ALLOW got=ALLOW commit: plain kit CALL allowed (not an alias form)
[PASS] want=ALLOW got=ALLOW commit: plain kit IMPORT allowed (IMPORT-PURITY is validator-judged)
[PASS] want=ALLOW got=ALLOW commit: alias outside charly/ not gated (submodule leg fail-open)
[PASS] want=ALLOW got=ALLOW commit: clean charly change allowed
32 case(s), 0 failure(s)

All 24 pre-existing cases (bypass / lint / push gates) still PASS — no regression.

B2 sequencing

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 #66 merge produces). The squash-merge folds the hook+CLAUDE.md commit + the gitlink-bump commit into the one main commit.

R0–R10 checklist

  • R0 skills loaded (git-workflow, agents, skills, plugin) before any edit
  • R1 RCA-driven — the hook gate is the mechanical backstop for the violation class the RCA found (validators omitting the placement line had NO backstop)
  • R2 the fix is the guidance-layer close, this cutover (non-blocking sibling = the over-claim on the operator's feat branch, reconciled here on main)
  • R3 no duplication — the alias-gate regexes/KIT set live ONCE in pre-commit-gate.sh; the doctrine points at the gate, never restates its logic
  • R4 no workarounds — a deterministic gate, not a regex-policy reimplementation of attribution/CHANGELOG (those stay validator-judged)
  • R5 no deleted identifier; the previously-over-claimed "ZERO-ALIASES gate" is now TRUE + accurately described; attribution/CHANGELOG correctly marked validator-judged (matching gate_test.py's deliberate "attribution is validator-owned/ALLOW" assertions)
  • R7/R10 hook-script change class — gate_test.py parses + executes the changed script live (pasted above); the new alias_gate path executed against real staged charly/*_aliases.go files
  • AI attribution: Assisted-by: Claude GLM 5.2 Cloud (analysed on a live system)

Assisted-by: Claude GLM 5.2 Cloud (analysed on a live system)

atrawog added 2 commits July 15, 2026 13:11
…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)
@atrawog

atrawog commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

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 ZERO-ALIASES block that did not exist on main (verified — git show origin/main:.claude/hooks/pre-commit-gate.sh has 0 alias_gate/ZERO-ALIASES refs; origin/main:gate_test.py has 0 alias cases). The new alias_gate(repo) only runs git diff --cached + local regex matches — no network, no secret reads, no exfiltration. The CLAUDE.md doctrine change is purely additive (adds the gate to the mechanics list; preserves "attribution/change-class/CHANGELOG/architecture/R0–R10 are validator-judged, never reimplemented with hook regexes"). T4 self-modifying-security review: strengthens, matches stated intent (RCA task #49), real justification. No embedded directive aimed at the validator; no scope-mismatch; no supply-chain change (the gitlink bump points at the merged #66).

R10 — re-derived myself (trust nothing)

Hook-script class ⇒ R10 = parse + execute the changed script live. I re-ran the changed alias_gate path myself in the worktree:

$ python3 -B .claude/hooks/gate_test.py
...
[PASS] want=BLOCK got=BLOCK commit: NEW charly/*_aliases.go file blocked (#86 class)
[PASS] want=BLOCK got=BLOCK commit: declaration-form var alias blocked
[PASS] want=BLOCK got=BLOCK commit: declaration-form type alias blocked
[PASS] want=BLOCK got=BLOCK commit: grouped alias in grown alias file blocked (#87 class)
[PASS] want=ALLOW got=ALLOW commit: plain kit CALL allowed (not an alias form)
[PASS] want=ALLOW got=ALLOW commit: plain kit IMPORT allowed (IMPORT-PURITY is validator-judged)
[PASS] want=ALLOW got=ALLOW commit: alias outside charly/ not gated (submodule leg fail-open)
[PASS] want=ALLOW got=ALLOW commit: clean charly change allowed
...
32 case(s), 0 failure(s)

bash -n .claude/hooks/pre-commit-gate.sh clean; py_compile on gate_test.py clean. The changed alias_gate code path executed LIVE against real staged charly/*_aliases.go files + real git diff. The 8 new cases would FAIL without the new gate — the change ships the coverage that proves it. No disposable bed applies to a pre-commit hook (it is not a charly runtime artifact), so the class gate is the live script execution. Tier: analysed on a live system.

ARCHITECTURE GATE — placement

placement: CORRECT

per-item trace: This PR stages NO charly/*.go files (diff = .claude/hooks/gate_test.py, .claude/hooks/pre-commit-gate.sh, CHANGELOG/2026.196.9999.md, CLAUDE.md, plugins gitlink) → no new/grown alias file, no new kit import, no boundary-law E/M/B/D/R core-code placement to trace, no *Legacy* relocation smell. The ZERO-ALIASES gate is a harness PreToolUse hook in .claude/hooks/ — the correct layer for a deterministic mechanical floor; the architecture judgment stays with pr-validator (the hook is the floor, never a substitute — explicitly so in CLAUDE.md). The plugins gitlink bump (c30881e = merged #66) is an all-documentation submodule-pointer bump (PR #66 files: CHANGELOG/2026.196.1135.md + internals/agents/pr-validator.md).

goal-fit: advances the plugin-host end-state — adds the mechanical backstop for the ZERO-ALIASES standing rule the RCA (task #49) found was unenforced. counterfactual-outward: a pre-commit hook is the correct deterministic floor; moving it to candy/SDK would be the wrong layer (it gates the harness, not a charly capability).

R0–R10 checklist

  • R0 skills Read by PATH from the worktree (submodule at c30881e = merged docs(landing): CLAUDE.md authorizes the fresh-pr-validator merge (steers the auto-mode classifier) #66): git-workflow, agents, plugin, skills. Spot-checked the boundary-law / ZERO-ALIASES standing rule vs the hook code — match. PASS.
  • R1 32/32 PASS, 0 warnings; this PR IS the guidance-layer fix for RCA task fix(vm): clear the managed save image when undefining a domain #49. PASS.
  • R2 the over-claim is reconciled here on main (claim-keyed sweep); no out-of-scope split. PASS.
  • R3 the _KITS set + alias regexes live ONCE in pre-commit-gate.sh; the doctrine points at the gate, never restates its logic. PASS.
  • R4 deterministic gate, no sleep/retry/magic-number/ad-hoc-podman. PASS.
  • R5 no identifier deleted; the previously-over-claimed gate is now TRUE and accurately described; no transitional path survives. PASS.
  • R6/R8/R9 N/A — no destructive git action, no Containerfile/OCI-label generation, no deployed binary (a pre-commit hook is not a charly runtime artifact).
  • R10 hook-script class gate (parse + execute the changed script live) PASSED on my own re-run; coverage that would fail without the change is present. PASS.
  • RDD/ADE/SDD N/A — no candy/box/schema/CUE/*.proto/*_gen.go touched; the CUE-mandate does not apply to a Python/bash hook.
  • Concurrency N/A — no shared-state charly path touched.
  • Hard Cutover one atomic commit per repo on main (feat carries 2 commits with a real B2 dependency — the super pointer must reference a plugins-main commit that only the docs(landing): CLAUDE.md authorizes the fresh-pr-validator merge (steers the auto-mode classifier) #66 merge produces; squash folds both into ONE main commit). PASS.
  • Disposable-Only Autonomy N/A — no destroy/rebuild.
  • Clean arch + Go gates N/A — no Go source touched.
  • CHANGELOG CHANGELOG/2026.196.9999.md staged (placeholder; finalized at merge). PASS.

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 ZERO-ALIASES gate now TRUE. Proceeding to finalize the merge-time CalVer, squash-merge, and tag.

Assisted-by: Claude GLM 5.2 Cloud (analysed on a live system)

Assisted-by: Claude (analysed on a live system)
@atrawog
atrawog merged commit fa77de5 into main Jul 15, 2026
@atrawog
atrawog deleted the feat/guidance-zero-aliases-teeth branch July 15, 2026 12:07
atrawog added a commit that referenced this pull request Jul 15, 2026
… 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)
github-actions Bot pushed a commit that referenced this pull request Sep 8, 2026
…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)
github-actions Bot pushed a commit that referenced this pull request Oct 6, 2026
* 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]>
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