From 881ea440ae03c0c798acb41e99b372b153d01293 Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 24 Jun 2026 10:40:52 +0100 Subject: [PATCH] fix(validator): recognise colon/brace-block identity + AI.a2ml manifests The A2ML identity check matched only TOML (`name = ".."`) and s-expr (`(name "..")`) dialects, so it false-failed three valid dialects with 'Missing required identity field': - brace-block colon syntax `Trust { name: ".." version: ".." }` - YAML-ish `id: ".."` / `version: ".."` - free-text `AI.a2ml` manifests (same doc type as 0-AI-MANIFEST.a2ml) Adds colon/brace-block identity+version recognition (incl. `id` key) and whitelists AI.a2ml as a manifest. The identity rule is unchanged for genuinely identity-less non-manifest files (verified: still errors). Fixes estate-wide 'Validate A2ML manifests' dogfood-gate false failures. --- validate-a2ml.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/validate-a2ml.sh b/validate-a2ml.sh index f345db5..b053676 100755 --- a/validate-a2ml.sh +++ b/validate-a2ml.sh @@ -142,6 +142,14 @@ validate_a2ml() { if [[ "$line" =~ ^[[:space:]]*\([[:space:]]*(agent[-_]id|name|project)[[:space:]]+\" ]]; then has_identity=true fi + # Colon / brace-block form: `name: "..."`, `id: "..."`, `project: "..."`. + # YAML-ish and brace-block A2ML dialects (e.g. `Trust { name: "..." }`, + # `id: "tsdm-standard"`) carry the same identity semantics; only the + # delimiter (`:` vs `=`) differs. `id` is the brace-block spelling of an + # identity key. + if [[ "$line" =~ ^[[:space:]]*(agent[-_]id|name|project|id)[[:space:]]*: ]]; then + has_identity=true + fi # Check for version field — TOML form if [[ "$line" =~ ^[[:space:]]*(version|schema_version)[[:space:]]*= ]]; then has_version=true @@ -150,6 +158,10 @@ validate_a2ml() { if [[ "$line" =~ ^[[:space:]]*\([[:space:]]*(version|schema_version)[[:space:]]+\" ]]; then has_version=true fi + # Version field — colon / brace-block form + if [[ "$line" =~ ^[[:space:]]*(version|schema_version)[[:space:]]*: ]]; then + has_version=true + fi done < "$file" # AI manifest files (0-AI-MANIFEST.a2ml, 0.1-AI-MANIFEST.a2ml, etc.) @@ -165,7 +177,10 @@ validate_a2ml() { # files in the same directory (ECOSYSTEM.a2ml, STATE.a2ml) DO carry their # own $name/project and continue to be validated normally. case "$basename" in - AGENTIC.a2ml|META.a2ml|NEUROSYM.a2ml|PLAYBOOK.a2ml) + AGENTIC.a2ml|META.a2ml|NEUROSYM.a2ml|PLAYBOOK.a2ml|AI.a2ml) + # AI.a2ml = free-text "AI Assistant Instructions" manifest, the same + # doc type as 0-AI-MANIFEST.a2ml but with the bare name; identity is + # carried by the enclosing repo/plugin dir, not an in-file field. is_manifest=true ;; # Dockerfile-style top-level typed manifests (Intentfile, Trustfile, …)