M-AILANG-FMT-ADOPTION: ailang fmt discoverability + opt-in harness hooks#415
Merged
Conversation
Adds prompts/v0.16.3.md = byte-identical prefix of v0.16.2 plus a ~6-line Formatting section (command usage only, no AILANG code snippet so no ailang check surface). Registers it append-only in versions.json with its sha256 and flips "active" to v0.16.3; existing entries are byte-preserved. Gate sanity tripwires (Phase-2 landed): fmt --help documents lossless comment preservation (not the Phase-1 blanket refusal); a non-parsing temp file exits 3; a commented-but-parseable file exits 0. Verified after rebuild: `ailang prompt | grep -i fmt` returns the teaching line; `ailang prompt --version v0.16.2 | grep -i fmt` is still empty (append-only proof — old prompt served byte-identical). Refs #399 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CLI audit: `ailang --help` and `ailang fmt --help` are already Phase-2-current (exit-code table 0/1/2/3, lossless-comment text) — no Phase-1 limitation drift. Adds an Adoption section to docs/docs/reference/formatter.md: the exit-code contract table with hook interpretation, the five contract clauses (idempotence, meaning-preservation, atomicity, non-blocking+non-silent, never-format-non-parsing), the `make fmt-check` description, a copy-paste Claude Code PostToolUse hook config, and the Motoko per-edit cross-repo contract (text only — no cross-repo commit). Cross-links from the development-workflow guide to /docs/reference/formatter#adoption. Note: a full Docusaurus build currently fails on a PRE-EXISTING base-tree sidebar error (missing doc ids reference/errors/* + reference/formatter), reproduced identically with these edits stashed — not caused by this sprint. These edits are additive content to an existing page with a valid anchor link. Refs #399 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds a standalone `make fmt-check-ail` target reporting `ailang fmt --check` drift over examples/**/*.ail + stdlib/**/*.ail (exit 1 + drifted paths on drift, 0 when canonical). It is NOT wired into `make ci` — the `make ci` recipe is byte-identical before/after (verified). Note: `fmt-check` was already taken by the Go gofmt CI gate, so the AILANG target uses a non-colliding name. Informational drift baseline over 393 .ail files: 31 canonical, 268 drift, 87 exit-2 comment-refusals, 7 parse errors (no mass reformat — out of scope). Adds scripts/hooks/format_ail.sh: a non-blocking (always exit 0), non-silent (surfaces every non-exit-3 failure via hookSpecificOutput.additionalContext), bounded PostToolUse hook. The bounded-timeout guard escalates SIGTERM->grace->SIGKILL before wait (kill; sleep 1; kill -9; wait) so a SIGTERM-ignoring fmt cannot wedge the turn (the design doc's shipped kill-then-unbounded-wait snippet was the pre-fix version). The `ailang fmt` invocation never discards stderr (2>&1 into the capture file, never 2>/dev/null); jq presence is probed up front and the first jq call is unsuppressed; the silent branch is pinned to exactly exit 3. Registers the hook opt-in in .claude/settings.json under PostToolUse matcher Edit|Write, after the existing (unchanged) Go hook. Manual tests all pass (turn never blocked): (a) valid .ail formatted; (b) non-parsing .ail -> exit 3 silent defer, file untouched; (c) chmod-000 file -> exit 2 advisory surfaced; (d) SIGTERM-ignoring stub ailang -> reaped by SIGKILL after grace (~4s, not 300s), file byte-identical, timeout advisory surfaced, no orphan. Idempotence spot-check: second run is a no-op. make test green. Refs #399 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
M3 discovered `fmt-check` is already the Go gofmt CI gate, so the AILANG drift target ships as `fmt-check-ail`. Update the formatter Adoption section and the development-workflow cross-links to match, and note why the name differs. Refs #399 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The build's embed step copies prompts/ into cmd/ailang/prompts/ (the tree embedded into the binary); commit the v0.16.3 file + versions.json active flip so the shipped binary serves the fmt teaching prompt. Also updates the auto-generated docs/docs/prompts/current.md to reflect the active v0.16.3. Refs #399 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…mented Controller finalization for mission iteration 65 (evaluator D1/D2): - CHANGELOG: add v0.30.0 entry for the fmt-adoption sprint (prompt v0.16.3, fmt-check-ail, format_ail.sh hook, formatter.md Adoption section) - Move design doc + sprint plan planned/ -> implemented/v0_30_0/, status ✅ IMPLEMENTED Sprint: executor (opus) M1-M3, evaluator (sonnet, generator≠judge) PASS 89/100 r1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sunholo-voight-kampff
enabled auto-merge (squash)
July 19, 2026 22:45
|
This was referenced Jul 19, 2026
sunholo-voight-kampff
added a commit
that referenced
this pull request
Jul 19, 2026
… LANDED (#416) PR #415 squash b787bb9; executor (opus, worktree) M1-M3, evaluator (sonnet, generator≠judge) PASS 89/100 r1. ailang fmt now discoverable (teaching prompt v0.16.3) + opt-in auto-format PostToolUse hook w/ Mark-approved SIGKILL escalation. Controller disproved a false "docs build failure" (skipped CI-only sync-registry.sh gen step). Post-merge dev CI CI/Build/Deploy-Docs all green @ b787bb9. metered=$0.00. - Log entry 70; STATUS stamp iter-65 added, iter-62 rotated to archive. - Queue: m-ailang-fmt-adoption → [LANDED]. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.



Mission iteration 65. Closes the
ailang fmtadoption gap now that Phase 2 (PR #414) made it lossless. No parser/type/codegen/runtime change — prompts, docs, build-glue, and opt-in hooks only.Milestones (executor: opus · evaluator: sonnet, generator≠judge — PASS 89/100 round 1)
prompts/versions.json,activeflipped; old versions serve byte-identical). Prompt now tells the modelailang fmtexists.docs/docs/reference/formatter.mdAdoption section (exit-code contract table 0/1/2/3, five contract clauses,make fmt-check-ail, copy-paste Claude Code PostToolUse hook config, Motoko cross-repo contract text); cross-linked from the development-workflow guide.make fmt-check-ail(standalone AILANG drift check; not inmake ci, which is byte-identical) + opt-inscripts/hooks/format_ail.shwith the Mark-approved SIGTERM→grace→SIGKILL escalation and noailang fmtstderr suppression.Notable deviation
fmt-checkcollided with the pre-existing Go gofmt CI gate → AILANG target shipped asfmt-check-ailto keepmake cibyte-identical. Docs reflect the shipped name.Verification
make testgreen;make cibyte-identical.sync-registry.shstep (the executor's flagged "docs build failure" was that skipped generation step + stale cache, not a sprint defect).ailang prompt --version v0.16.2 | grep -i fmtempty; current prompt teaches fmt.Design doc:
design_docs/implemented/v0_30_0/m-ailang-fmt-adoption.md. Bookkeeping: #399.🤖 Generated with Claude Code