Commit 5165ca6
standards: add scm→a2ml migration script for .bot_directives/
Adds tools/scm-to-a2ml-bot-directives/migrate.jl — a Julia script that
converts hyperpolymath bot-directive SCM files to A2ML (TOML-shaped).
Per user directive 2026-04-17: "absolutely eliminate and update
everywhere the scm stuff, no need for fallback". This is the reusable
migration tool; the estate-wide sweep follows in companion commits
(one per affected repo).
Conversion:
.bot_directives/<bot>.scm → .machine_readable/bot_directives/<bot>.a2ml
.machine_readable/bot_directives/<bot>.scm → .machine_readable/bot_directives/<bot>.a2ml
Handles three input shapes:
(bot-directive (bot "X") (scope "Y") (allow (...)) (deny (...)) (notes "..."))
(bot-directives (version "1.0") (notes "..." "...")) -- README-style
(<botname>-config (quality-gates (...)) (<block> (...)) ...) -- nested
Emits TOML with appropriate sections for nested configs (quality-gates,
zig-analysis, etc. become [quality-gates], [zig-analysis] tables).
Safety:
- Writes .a2ml first, verifies it parses structurally, only then
deletes the .scm.
- Parse-back failure aborts that file and leaves the .scm in place.
- Legacy .bot_directives/ directory removed when empty.
- Idempotent: second run is a no-op.
- UTF-8 safe tokeniser (em-dashes in README.scm files already encountered).
Usage:
julia migrate.jl <repo>
julia migrate.jl --all # walks the estate
julia migrate.jl --dry-run <repo>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d765345 commit 5165ca6
1 file changed
Lines changed: 579 additions & 0 deletions
0 commit comments