Commit 6bff6ec
feat(validator): recognise s-expression identity/version fields (#26)
## Summary
Extend the identity-field and version-field regexes so they recognise
s-expression form (\`(name \"...\")\`) alongside the existing TOML form
(\`name = \"...\"\`). Same semantics, only syntax differs.
## Why
The current regex only matches TOML kv pairs:
\`\`\`bash
[[ \"\$line\" =~ ^[[:space:]]*(agent[-_]id|name|project)[[:space:]]*= ]]
\`\`\`
Some valid A2ML dialects in the hyperpolymath estate use Lisp-style
s-expressions for the metadata block — e.g. classification registries:
\`\`\`a2ml
(assail-classifications
(metadata
(version \"1.1.0\")
(project \"boj-server\")))
\`\`\`
These flag as \"Missing required identity field\" today even though
\`project\` is structurally present. \`boj-server\`'s
\`audits/assail-classifications.a2ml\` is the case that surfaced this —
its Dogfood Gate has been red on main for 5+ consecutive runs purely on
this false-positive.
## Patch
Adds two parallel s-expression branches with explanatory comments. Match
\`(field \"...\"\` at any indent so the metadata-block-nested form is
recognised.
## Test plan
- [x] \`bash -n validate-a2ml.sh\` — syntax check passes
- [x] Synthetic fixture with \`(metadata (project \"boj-server\"))\` → 0
errors
- [x] Actual boj-server \`audits/assail-classifications.a2ml\` → 0
errors (was 1)
- [x] Negative control with neither kv nor s-expression identity → still
errors as expected
- [ ] CI on this PR (action self-test, if present)
## Downstream
Once this lands and gets tagged, repos that pin a SHA can bump:
- \`hyperpolymath/boj-server/.github/workflows/dogfood-gate.yml\` —
pinned to \`59145c7d1039fa3059b3ecacdb50ee23d7505898\`. After this
merges, bump to the new SHA to clear the recurring Dogfood Gate failure
on main.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d6ab0cb commit 6bff6ec
1 file changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
136 | 146 | | |
137 | 147 | | |
138 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
139 | 153 | | |
140 | 154 | | |
141 | 155 | | |
| |||
0 commit comments