Skip to content

Commit fd7b2d8

Browse files
fix(validate-a2ml): recognise contractile-shape A2ML files (#9)
The script's identity / version check assumed every `.a2ml` file uses TOML `key = value` form. Contractile-shape files (Trustfile.a2ml, Intentfile.a2ml, Mustfile.a2ml, Adjustfile.a2ml, …) use `@directive:` syntax instead — their identity lives in `@trust-level`, `@intent`, `@abstract` etc., not in `name = "..."` / `version = "..."`. As a result every contractile file in a consumer repo failed validation ("Missing required identity field"), blocking Dependabot PRs across the fleet. Detect contractile shape by the presence of any of: @abstract, @trust-level, @trust-boundary, @trust-actions, @trust-deny, @intent, @must, @adjust, @EnD in the file body, then skip the manifest-style identity / version checks (parallel to the existing `*AI-MANIFEST*` special-case for markdown-style manifests). Attestation-block and section-heading checks (Checks 3 and 4) remain applied — they're shape-agnostic. Closes the validate-A2ML-manifest failures observed on every Dependabot PR across chimichanga, gitbot-fleet, idaptik, ambientops, and more (reported by hyperpolymath/hypatia#23 audit as `Validate A2ML manifests` class — 10 PRs blocked at audit time). Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 5483b67 commit fd7b2d8

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

validate-a2ml.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,25 @@ validate_a2ml() {
146146
is_manifest=true
147147
fi
148148

149-
if [[ "$has_identity" == "false" && "$is_manifest" == "false" ]]; then
149+
# Contractile-shape A2ML files use `@directive:` syntax instead of
150+
# TOML `key = value`. Trustfile.a2ml, Intentfile.a2ml, Mustfile.a2ml,
151+
# Adjustfile.a2ml etc. are policy / trust / intent / abstract files
152+
# whose identity is implicit in their @-prefixed directives
153+
# (`@trust-level`, `@intent`, ...) rather than a TOML name/version
154+
# pair. Treating them as manifest-shape produces 100% false positives —
155+
# they're a different A2ML doc type. Detected by the presence of any
156+
# contractile directive in the file body.
157+
local is_contractile_shape=false
158+
if grep -qE '^@(abstract|trust-level|trust-boundary|trust-actions|trust-deny|intent|must|adjust|end)([[:space:]]*:|$)' "$file"; then
159+
is_contractile_shape=true
160+
fi
161+
162+
if [[ "$has_identity" == "false" && "$is_manifest" == "false" && "$is_contractile_shape" == "false" ]]; then
150163
report_issue "error" "$file" 1 \
151164
"Missing required identity field (agent-id, name, or project)"
152165
fi
153166

154-
if [[ "$has_version" == "false" && "$is_manifest" == "false" ]]; then
167+
if [[ "$has_version" == "false" && "$is_manifest" == "false" && "$is_contractile_shape" == "false" ]]; then
155168
report_issue "warning" "$file" 1 \
156169
"Missing version or schema_version field"
157170
fi

0 commit comments

Comments
 (0)