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>
hyperpolymath added a commit to hyperpolymath/idaptik that referenced this pull request May 17, 2026
Triage of the three workflows in #77.

## Tests — fixed (988/988)

Root cause of the red was a single **uncaught** exception
(`PhoenixSocket.nextRef is not a function`) that aborted the run
mid-suite. The runner only `console.log`'d failures and never exited
nonzero, so that crash was the *only* thing failing CI — and it **masked
18 pre-existing real failures**.

- `PhoenixSocket`: `allocRef` → `nextRef` (API drift; both test suites
expect `nextRef`).
- `applyFriction`: float-safe assertion (`100.0*0.55 !== 55.0` in
IEEE-754).
- **Gated the runner** (`Deno.exit(1)` on failure) — this un-masks the
18; all fixed, choosing the canonical side per the source's *documented
intent*:
- Multiplayer ×3 — `Hacker`→`Q` was a deliberate rename across 5 source
files; tests were stale.
- LevelConfig ×10 + Functional F06/F15 + Regression R09 — a dated,
commented gameplay rebalance ("Counts updated 2026-03-16", "Win rate was
0%"); tests encoded the old numbers.
- CompanionMole `getCarryCapacity` — mock used the old multi-slot
equipment model; source refactored to single `equipped`.
- DLC bundle round-trip — wire form is lowercase `"expert"`; test
wrongly expected `"Expert"`.

The gating is the important durable fix: silent test rot is no longer
possible.

## Dogfood Gate — A2ML fixed at source; K9 tracked

Both sub-jobs were pinned to stale (2026-04-11) action SHAs.

- **A2ML**: 15 errors. 10 were already-fixed false positives (stale
pin); the remaining 5 were the canonical `.machine_readable/` tree — an
over-strict identity check that **rsr-template-repo itself fails**.
Fixed at source in **hyperpolymath/a2ml-validate-action#12** (merged);
this PR adopts the new pin `59145c7`. idaptik A2ML: **0 errors**.
- **K9**: pin un-drifted to `2d96f43`. The 6 remaining errors are real
but rooted in the **`k9iser` generator** emitting contracts without the
`K9!` magic line + pedigree block — tracked as
**hyperpolymath/k9iser#8**. The K9 sub-job stays red until that lands
(not masked).

## RSR Anti-Pattern Check

Already returned to green via #82 — no action needed.

## Status vs #77

- Tests: ✅ green + gated
- Dogfood Gate: ✅ A2ML half green at source; ⏳ K9 half blocked on
k9iser#8
- RSR Anti-Pattern: ✅ already green

Not using `Closes #77` — Dogfood Gate is only fully green once k9iser#8
lands.

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

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