Skip to content

Commit 6c47174

Browse files
fix(validator): recognise colon/brace-block identity + AI.a2ml manifests (#41)
Repairs estate-wide 'Validate A2ML manifests' false failures. The identity check only matched TOML/s-expr dialects; this adds colon/brace-block (`name:`, `id:`) and whitelists `AI.a2ml`. Verified: thunderbird Trust.a2ml, methodologies TSDM.a2ml, asdf AI.a2ml now pass; a genuinely identity-less file still errors (rule intact). Source fix for the dogfood-gate failure class.
1 parent ea928ac commit 6c47174

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

validate-a2ml.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ validate_a2ml() {
142142
if [[ "$line" =~ ^[[:space:]]*\([[:space:]]*(agent[-_]id|name|project)[[:space:]]+\" ]]; then
143143
has_identity=true
144144
fi
145+
# Colon / brace-block form: `name: "..."`, `id: "..."`, `project: "..."`.
146+
# YAML-ish and brace-block A2ML dialects (e.g. `Trust { name: "..." }`,
147+
# `id: "tsdm-standard"`) carry the same identity semantics; only the
148+
# delimiter (`:` vs `=`) differs. `id` is the brace-block spelling of an
149+
# identity key.
150+
if [[ "$line" =~ ^[[:space:]]*(agent[-_]id|name|project|id)[[:space:]]*: ]]; then
151+
has_identity=true
152+
fi
145153
# Check for version field — TOML form
146154
if [[ "$line" =~ ^[[:space:]]*(version|schema_version)[[:space:]]*= ]]; then
147155
has_version=true
@@ -150,6 +158,10 @@ validate_a2ml() {
150158
if [[ "$line" =~ ^[[:space:]]*\([[:space:]]*(version|schema_version)[[:space:]]+\" ]]; then
151159
has_version=true
152160
fi
161+
# Version field — colon / brace-block form
162+
if [[ "$line" =~ ^[[:space:]]*(version|schema_version)[[:space:]]*: ]]; then
163+
has_version=true
164+
fi
153165
done < "$file"
154166

155167
# AI manifest files (0-AI-MANIFEST.a2ml, 0.1-AI-MANIFEST.a2ml, etc.)
@@ -165,7 +177,10 @@ validate_a2ml() {
165177
# files in the same directory (ECOSYSTEM.a2ml, STATE.a2ml) DO carry their
166178
# own $name/project and continue to be validated normally.
167179
case "$basename" in
168-
AGENTIC.a2ml|META.a2ml|NEUROSYM.a2ml|PLAYBOOK.a2ml)
180+
AGENTIC.a2ml|META.a2ml|NEUROSYM.a2ml|PLAYBOOK.a2ml|AI.a2ml)
181+
# AI.a2ml = free-text "AI Assistant Instructions" manifest, the same
182+
# doc type as 0-AI-MANIFEST.a2ml but with the bare name; identity is
183+
# carried by the enclosing repo/plugin dir, not an in-file field.
169184
is_manifest=true
170185
;;
171186
# Dockerfile-style top-level typed manifests (Intentfile, Trustfile, …)

0 commit comments

Comments
 (0)