Skip to content

fix(hooks): make the canonical hookset validator .deed-aware - #802

Merged
hyperpolymath merged 4 commits into
mainfrom
secqual/deed-aware-hookset-validator
Sep 15, 2026
Merged

hyperpolymath merged 4 commits into
mainfrom
secqual/deed-aware-hookset-validator

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Why

standards/.githooks/validate-a2ml.sh is the file that
.github/workflows/propagate-hooks.yml copies into every repo in both
estates
. It was a 1,399-byte script that knew only the dead A2ML manifest
dialect — it required ^(agent-id|pedigree): and ^version:, and had zero
references to .deed.

This replaces it with the dual-accept validator already merged on
deed-ecosystem/validate-action main (f9d999b6).

The ordering this fixes

propagate-hooks.yml is currently inert. Its last five runs all failed at
"Identify repositories with .githooks" with:

##[error]Unable to process file command 'output' successfully.
##[error]Invalid format '  ""'

— a multi-line value written to $GITHUB_OUTPUT with no heredoc delimiter. The
Propagate Hook Updates job is skipped every time.

That makes this PR a prerequisite, not a companion, to any repair of that
workflow. It does cp -v ./.githooks/* target-repo/.githooks/, so repairing it
first would have copied this dead-dialect script over the 79 repos that
already carry a better (if also .deed-blind) 13,737-byte one.

Measured, one denominator

245 local repos with a resolvable origin; 150 carry a remote dogfood-gate.yml.
118 of those 150 enforce the dead dialect.

remote class repos .deed-aware
vendored bash .githooks/validate-a2ml.sh (13,737 b, frozen 2026-07-27) 79 no
pinned a2ml-ecosystem/validate-action@aa4b836b (2026-07-25) 39 no
pinned …@main (a2ml 20 + deed 5) 25 yes
pinned phantom a2ml-validate-action@ 2 no

Verification

  • bash -n clean
  • 4/4 deed-ecosystem/conformance/valid fixtures accepted, 0 false rejects
  • 3/5 conformance/invalid rejected. The 2 misses are both version cases and
    are warnings by design — the ecosystem's own run-deed-tests.sh test 4
    asserts "strict promotes the version warning to an error"
  • 14/14 sampled vendored repos (725 .a2ml files) return identical exit
    codes
    under the old and new script — no regression
  • Planted positive: a valid .deed passes under the new script; the old one
    has 0 .deed references and cannot see it at all
  • Planted negative: a .deed with no :schema-version is reported (as a
    warning, per the design above)

Not changed here

strict stays false. Measured: flipping it turns 8 of 10 sampled repos
red, so it is a separate decision, not a free win.

Stacked on #798, which removes this validator's invocation from pre-commit
and pre-push. Without that, a commit to this repo cannot pass its own hooks.

🤖 Generated with Claude Code

https://claude.ai/code/session_0168Bgpez8mFBcAqYAj8VgEx

hyperpolymath and others added 3 commits September 15, 2026 03:20
standards could not accept ANY commit through its own pre-commit hook. Two
gates blocked each other, and both validate a format that no longer exists.

The registry drift guard demanded every commit stage
.machine_readable/REGISTRY.a2ml -- a generated, TOML-shaped artefact, i.e. a
specimen of the record dialect the owner ruled SUPERSEDED on 2026-09-08.
Staging it then tripped the "A2ML manifests" gate, because validate-a2ml.sh
greps manifest syntax (^version:, ^(agent-id|pedigree):) that the live
s-expression .deed grammar does not have.

Measured: validate-a2ml.sh passes 0 of 222 tracked .a2ml files in this repo.
Every commit in this repo's history must therefore have bypassed the hook.

Repairing the regex is not the cure. It would turn all 222 files red at once,
and it would be repairing a validator for a format the owner has ruled dead:
A2ML was abandoned after the ML community objected to the name. .deed and .k9
are the live formats.

Note the dates. REGISTRY.a2ml and scripts/build-registry.sh were created
2026-06-03 (#356, #357) -- legitimate work, three months before the DEED
rename, simply never migrated. But .githooks/validate-a2ml.sh was created
2026-09-12, NINE DAYS AFTER the rename ruling and four days after the record
dialect was killed: a new gate written for a format already declared dead.
No hook in this repo knows .deed exists (pre-commit a2ml=4 / deed=0).

Removed, per owner ruling R-H3 (2026-09-15):
  - run_validator "A2ML manifests" "validate-a2ml.sh" "staged"
  - the registry drift guard block

Kept deliberately:
  - the K9 contracts gate. K9 is live.
  - registry drift coverage, which CI still enforces at
    .github/workflows/registry-verify.yml:56 (build-registry.sh --check).
  - REGISTRY.a2ml itself, byte-for-byte (owner ruling R-H4). It is a GENERATED
    artefact, so reshaping scripts/build-registry.sh is a separate, deliberate
    job and is not coupled to unblocking commits.

A .deed validator returns to this hook once the dual-accept validate-action
lands (owner ruling R-H2).

Verification: bash -n clean; the hook now exits 0 against a staged set it
previously rejected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0168Bgpez8mFBcAqYAj8VgEx
The deadlock had a second limb. Removing the A2ML gate from pre-commit was not
enough: pre-push line 44 runs the identical dead validator, so a push whose tip
commit touched a .a2ml file was still rejected.

Found the hard way -- a push whose only change was regenerating
.machine_readable/REGISTRY.a2ml with the repo's own generator was refused with
"missing agent-id or pedigree" and "missing version", manifest-dialect keys the
live s-expression .deed grammar does not have.

Same ruling (R-H3), same reasoning as the pre-commit removal in the previous
commit. The K9 gate stays: K9 is live.

Separately noted, NOT changed here: pre-push computes its file set from
HEAD~1..HEAD, so a multi-commit push validates only the TIP commit. That is a
latent fake-gate and deserves its own fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0168Bgpez8mFBcAqYAj8VgEx
standards/.githooks/validate-a2ml.sh was a 1,399-byte script that knew only
the dead A2ML manifest dialect: it required ^(agent-id|pedigree): and
^version: and had no concept of .deed at all. It is the file that
propagate-hooks.yml copies into every repo in both estates.

Replace it with the dual-accept validator already merged on
deed-ecosystem/validate-action main (f9d999b6): DEED s-expression heads
(estate-deed, repo-deed, estate-atlas-deed, praxis-deed) dispatched on the
first form per DEED-GRAMMAR-SPEC, :canonical-name and :schema-version, with
.a2ml retained as legacy so nothing currently passing starts failing.

This makes the PROPAGATION SOURCE safe before the vehicle is repaired.
propagate-hooks.yml is currently inert -- its last five runs all failed at
"Identify repositories with .githooks" with `Invalid format '  ""'`, a
multi-line value written to $GITHUB_OUTPUT with no heredoc delimiter, so the
propagate job is skipped every time. Repairing that workflow before this
commit would have copied the dead-dialect script over 79 repos that already
carry a better one.

Verified:
- bash -n clean
- 4/4 deed-ecosystem conformance/valid fixtures accepted, 0 false rejects
- 3/5 conformance/invalid rejected; the 2 version cases are warnings by
  design and the suite's own test 4 asserts strict promotes them
- 14/14 sampled vendored repos (725 .a2ml files) give identical exit codes
  under the old and new script -- no regression
- planted positive: a valid .deed passes under the new script; the old one
  has zero .deed references and cannot see it at all

Refs #798

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0168Bgpez8mFBcAqYAj8VgEx
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d0a10bce-639e-4bbb-8a2f-c0992fcfc44a

📥 Commits

Reviewing files that changed from the base of the PR and between 1fbeb72 and 8664de2.

📒 Files selected for processing (1)
  • .githooks/validate-a2ml.sh

📝 Summary

Summary by CodeRabbit

  • New Features
    • Validation now supports both .a2ml and .deed files, including multiple identity and schema formats.
    • Added attestation and section-heading checks.
    • Added GitHub annotations, scan summaries, path filtering, and strict mode.
    • Recognises supported manifest and machine-readable paths with appropriate validation exemptions.
  • Behaviour Changes
    • Missing identity is reported as an error; missing version or schema information is reported as a warning.
    • SPDX checks now cover the first 10 lines and produce warnings.
    • Validation exits successfully with a notice when no matching files are found.

Walkthrough

The validator now scans .a2ml and .deed files, supports more identity and version forms, adds attestation and heading checks, applies path and file exemptions, and reports counters through GITHUB_OUTPUT.

Changes

Validator expansion

Layer / File(s) Summary
Runtime filtering and reporting
.githooks/validate-a2ml.sh
The script parses INPUT_PATHS_IGNORE, emits GitHub annotations, tracks error and warning counts, and promotes warnings when INPUT_STRICT=true.
Content validation rules
.githooks/validate-a2ml.sh
The script recognises additional identity and version syntax, exempts selected manifest and structural files, checks attestation content, and warns about unclosed section headings.
File discovery and scan lifecycle
.githooks/validate-a2ml.sh
The script discovers .a2ml and .deed files, handles empty scans, writes counters to GITHUB_OUTPUT, and removes staged-only validation.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Suggested reviewers: joshuajewell

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks each deed and file
Identity forms now pass in style
Warnings hop to errors when strict
Attestations get a careful tick
Counters bloom where outputs glow
The validator is ready to go

Comment @coderabbitai help to get the list of available commands.

Base automatically changed from secqual/remove-dead-a2ml-gates to main September 15, 2026 18:30
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
@hyperpolymath
hyperpolymath merged commit 1723e19 into main Sep 15, 2026
16 of 21 checks passed
@hyperpolymath
hyperpolymath deleted the secqual/deed-aware-hookset-validator branch September 15, 2026 21:00
@sonarqubecloud

Copy link
Copy Markdown

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