feat(agent-spec): land v1 as canonical, with a version shim in the CLI - #13
Merged
Conversation
Fixes the contradiction #10 opened on: the canonical input format now assigns authority action by action, each non-autonomous row requiring an `enforced_by` mechanism, instead of one per-agent autonomy label the canon tells readers to avoid. schemas/agent-spec.schema.yaml v1.0, real JSON Schema draft 2020-12 schemas/agent-spec.v0.yaml frozen; what aux-audit 0.1.x reads schemas/MIGRATION.md why, the field mapping, the timeline schemas/migrate-v0-to-v1.py converter The shim is the point. Before it, a v1 document handed to the shipped CLI came back with four field errors, including "`autonomy` is required" — demanding the exact field v1 removes on purpose. That reads as a broken tool, which is worse than the inconsistent document it replaced: a reader can reason around a document. Now: aux-audit: this is an agent-spec v1.0 document; aux-audit 0.1.x reads v0.1.0. Nothing was graded. v1 scoring lands in aux-audit 0.2.0. Migrating a v0 spec: python3 schemas/migrate-v0-to-v1.py your-spec.yaml Background: schemas/MIGRATION.md, trustkit#10 Detection is two markers, `mandate` or `spec_version`, checked before validation so no field error is ever produced for a version mismatch. An invalid *v0* spec still gets its field errors — the shim swallows nothing it should not. Four tests cover it, including a CLI-level one asserting the old misleading line is gone. Not in this commit, still #10: scoring v1. aux.H01 and aux.H03 read spec.autonomy today; under v1 they become "does every non-autonomous action name an enforcing mechanism", which is a better question and a different computation. That is aux-audit 0.2.0. Also: yamllint's `colons` rule is disabled. v1 aligns its `$ref` columns deliberately and it reads better that way; leaving warnings on every run would cost more than the rule is worth. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MhpqWEvwKp7NrmJfdXYq4M
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Fixes the contradiction #10 was opened on. The canonical input format now assigns authority action by action, each non-autonomous row requiring an
enforced_bymechanism, instead of the single per-agentautonomylabel the canon tells readers to avoid.schemas/agent-spec.schema.yamlschemas/agent-spec.v0.yamlaux-audit0.1.x readsschemas/MIGRATION.mdschemas/migrate-v0-to-v1.pyThe shim is the point
Landing v1 under the canonical filename while the CLI still reads v0 would normally trade an inconsistent document for a broken tool, which is worse — a reader can reason around a document. Measured on a scratch copy before building anything, a v1 spec handed to the shipped CLI came back with:
Now:
Detection is two markers —
mandateorspec_version— checked before validation, so a version mismatch can never produce a field error. An invalid v0 spec still gets its field errors; the shim swallows nothing it should not, and there is a test asserting exactly that.Cost, measured rather than estimated
#10 called the swap "aux-audit v0.2, not a patch". For the file swap that was wrong, and the correction is recorded on the Issue:
spec.tsrepointed atagent-spec.v0.yamlThis PR adds four more tests for the shim: 38/38.
Linked Issue
Advances #10; does not close it. Scoring v1 is still open —
aux.H01andaux.H03readspec.autonomytoday, and under v1 they become "does every non-autonomous action name an enforcing mechanism". Better question, different computation,aux-audit0.2.0.Type
Migration note: v0.1.0 is not deleted, not renamed in place, and not stopped from working. It moves to
agent-spec.v0.yaml, keeps its own header explaining what replaced it, and remains what the shipped CLI validates against. Anything written against v0 keeps scoring identically.schemas/MIGRATION.mdcarries the field-by-field mapping.Contribution bar — checklist
debateIssue first. — [debate] agent-spec v1: per-action mandate with enforced_by, replacing the autonomy label #10, opened, argued and decided before any of this was written.yamllintclean with zero warnings,check:schemasclean,check-coverage.py12/12, links resolve, and v1 verified as a valid draft 2020-12 schema byDraft202012Validator.check_schema.One config change worth flagging
yamllint'scolonsrule is disabled. v1 aligns its$refcolumns deliberately:That reads better than the unaligned form, and leaving thirteen warnings on every CI run would cost more than the rule is worth. Everything else stays strict.
Out of scope
validate.py— in fix(schemas): brain-spec used the wrong ID namespace; add a cross-schema check #12, which also fixes abrain-specID mismatch it caught. The two PRs touch different files and compose; fix(schemas): brain-spec used the wrong ID namespace; add a cross-schema check #12 first is the tidier order, since its validator recognisesagent-spec.v0.yamlas the frozen format and checks v1 as real JSON Schema.🤖 Generated with Claude Code
https://claude.ai/code/session_01MhpqWEvwKp7NrmJfdXYq4M
Generated by Claude Code