Skip to content

fix(validate-a2ml): treat whole .machine_readable/ tree as structural-identity#12

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/a2ml-machine-readable-structural-identity
May 17, 2026
Merged

fix(validate-a2ml): treat whole .machine_readable/ tree as structural-identity#12
hyperpolymath merged 1 commit into
mainfrom
fix/a2ml-machine-readable-structural-identity

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Problem

The identity check exempted only .machine_readable/6a2/ typed manifests (structural identity = owning repo + path + filename, no in-file name/agent-id). That rationale applies to the entire .machine_readable/ tree.

rsr-template-repo — the canonical source every RSR repo is built from — itself ships CLADE.a2ml, ANCHOR.a2ml, STATE/ECOSYSTEM, agent_instructions/{debt,coverage,methodology}, ai/AI, policies/*, integrations/* without an in-file identity key. The old check therefore produced estate-wide false positives on every consumer.

Surfaced via idaptik#77: Dogfood Gate reported 15 A2ML errors — 10 were already-fixed false positives (stale pinned SHA), the remaining 5 were exactly these canonical .machine_readable/ docs.

Fix

Generalise the existing 6a2/ exemption to the whole .machine_readable/ tree. Purely subtractive — adds an exemption, cannot introduce new errors.

Verification

  • idaptik: 5 → 0 errors (exit 0).
  • rsr-template-repo: still flags its 3 non-tree docs (.machine_readable/-external) — exemption is correctly narrow.
  • a2ml-validate-action self-dogfood: still flags its pre-existing docs/governance/* (unrelated, not introduced here).
  • bash -n clean.

🤖 Generated with Claude Code

…-identity

The identity check exempted only `.machine_readable/6a2/` typed manifests,
on the rationale that their identity is structural (owning repo + path +
filename) rather than an in-file `name`/`agent-id` key. That rationale
applies to the entire `.machine_readable/` tree, not just `6a2/`:
CLADE.a2ml, ANCHOR.a2ml, STATE/ECOSYSTEM, agent_instructions/{debt,
coverage,methodology}, ai/AI, policies/*, integrations/* are all typed
agent-readable docs authored without an in-file identity key.

rsr-template-repo — the canonical source every RSR repo is built from —
itself ships these files without an identity key, so the old check
produced estate-wide false positives on every consumer (e.g. idaptik#77:
15 errors, of which 10 were already-fixed false positives and the
remaining 5 were these canonical .machine_readable/ docs).

Generalises the existing `6a2/` exemption to the whole tree. Files
outside `.machine_readable/` are still validated (verified: rsr-template
still flags its 3 non-tree docs; a2ml-validate-action still flags its
docs/governance/*). Purely subtractive — adds an exemption, cannot
introduce new errors.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 8 issues detected

Severity Count
🔴 Critical 1
🟠 High 1
🟡 Medium 6

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action actions/upload-artifact@v4 needs attention",
    "type": "unpinned_action",
    "file": "release.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action actions/download-artifact@v4 needs attention",
    "type": "unpinned_action",
    "file": "release.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "codeql.yml lists `language: javascript-typescript` but the repo has no source files in any CodeQL-scannable language. The analyze job will exit 'no source files' on every run. Switch the matrix to `actions` (which scans workflow files — every repo has those).",
    "type": "codeql_language_matrix_mismatch",
    "file": "codeql.yml",
    "action": "switch_codeql_matrix_to_actions",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "line": 24,
    "reason": "Secret found: Generic API key",
    "type": "secret_detected",
    "file": "/home/runner/work/a2ml-validate-action/a2ml-validate-action/.envrc",
    "action": "revoke_rotate_and_purge",
    "rule_module": "security_errors",
    "severity": "critical"
  },
  {
    "reason": "Nominal-only SAST in a2ml-validate-action: codeql.yml language matrix contains no language present in the repo and lacks `actions`, so CodeQL records zero results on every commit. Remediation: set the CodeQL matrix to `language: actions`.",
    "type": "StaticAnalysis",
    "file": "/home/runner/work/a2ml-validate-action/a2ml-validate-action",
    "action": "auto_fix",
    "rule_module": "scorecard",
    "severity": "medium",
    "remediation": "Add CodeQL or equivalent SAST workflow.",
    "scorecard_check": "SAST"
  },
  {
    "reason": "1 workflow(s) with tag-pinned (not SHA-pinned) actions in a2ml-validate-action",
    "type": "DependencyPinning",
    "file": "/home/runner/work/a2ml-validate-action/a2ml-validate-action",
    "action": "auto_fix",
    "rule_module": "scorecard",
    "severity": "medium",
    "remediation": "Pin GitHub Actions and Docker base images by SHA hash.",
    "scorecard_check": "Pinned-Dependencies"
  },
  {
    "reason": "Repository has 2 non-main remote branch(es). Policy: single main branch only.",
    "type": "GS007",
    "file": ".",
    "action": "delete_remote_branches",
    "rule_module": "git_state",
    "severity": "medium"
  },
  {
    "reason": "Source file missing SPDX-License-Identifier header",
    "type": "SD009",
    "file": "src/interface/ffi/src/main.zig",
    "action": "add_spdx_header",
    "rule_module": "structural_drift",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath merged commit 59145c7 into main May 17, 2026
17 of 18 checks passed
@hyperpolymath hyperpolymath deleted the fix/a2ml-machine-readable-structural-identity branch May 17, 2026 01:40
hyperpolymath added a commit to hyperpolymath/neurophone that referenced this pull request May 17, 2026
Resolves the last three red lanes tracked in #41. Each had moved past
its original plumbing error into a genuine, distinct root cause:

| Lane | Original (already fixed) | Actual current root cause | Fix here
|
|---|---|---|---|
| **A2ML** | `@main` not SHA-pinned | Pinned SHA `fd7b2d8` pre-dated
[a2ml-validate-action#12](hyperpolymath/a2ml-validate-action#12);
15 `.machine_readable/*` files lacked an in-file identity field | Bump
pin → `59145c7` (treats whole `.machine_readable/` tree as
structural-identity). **0 identity errors** with no repo-side `.a2ml`
edits |
| **Hypatia** | bad upload-artifact SHA | `hypatia-scan.yml` drifted:
`cd scanner` into a dir that no longer exists in the hypatia repo
(mix.exs is at root) → exit 1 | Sync workflow to canonical
`rsr-template-repo` version (builds at `$HOME/hypatia`; also brings
`\|\| true` guard, correct artifact SHA, concurrency, continue-on-error
on PR comment) |
| **fuzz** | Containerfile vs Dockerfile | Repo root is a *virtual*
workspace → `fuzz/Cargo.toml` build failed "believes it's in a workspace
when it's not"; also broken+unused `neurophone path=".."` dep and
undeclared `serde_json` | Add empty `[workspace]` to `fuzz/Cargo.toml`;
drop dead dep; declare `serde_json`; commit `fuzz/Cargo.lock`. Builds
clean locally |

### Verification
- A2ML: ran the `59145c7` validator against this repo's pristine tree →
`Errors: 0`.
- fuzz: `cargo build --manifest-path fuzz/Cargo.toml` → `Finished`
clean.
- Hypatia: canonical template is repo-agnostic and removes the failing
`cd scanner` step; will confirm green on CI.

K9 already passes on `main`. The redundant cross-repo validator PR
(a2ml-validate-action#13) was closed as superseded by #12.

Refs #41

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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