docs: reserved-namespaces forecast + 3+ char-first convention for new builtins#343
Merged
Merged
Conversation
Three consecutive releases (v0.11.3 avg, v0.11.4 +=, v0.11.6 ct) have broken carry-forward scripts by adding short-name builtins that collided with existing user bindings. ILO-P011 catches each at parse time with a clean rename hint, but the agent has no forward-looking signal: nothing in the spec told them ct was about to be reserved. Adds a Reserved namespaces subsection enumerating every 2-char and 3-char builtin currently reserved, plus the forward-compat rule that new builtins land under names of 4 characters or longer. That gives agents a deterministic safe-name strategy: any 2-char name not on the list is permanently safe, and the 3-char list is publicly stable. ai.txt and skills/ilo/SKILL.md regenerate through build.rs so the agent-facing surfaces stay in sync.
Pairs with the SPEC Reserved namespaces forecast: SPEC tells agents which short names are taken; AGENTS tells contributors why we don't take any more. New builtins land under names of 4 characters or longer, and a 2- or 3-char alias is only added later when the long form is unambiguous and the short doesn't shadow a plausible user binding. Existing short builtins (avg, ct, sin, flat, frq, ...) are grandfathered; the rule applies to new entries only. The drift-guard test ties this back to the SPEC enumeration so the published forecast cannot silently fall out of sync with the registry.
Asserts every <=3-char entry in Builtin::ALL appears in the SPEC
Reserved namespaces enumeration, and that the SPEC doesn't list names
that aren't builtins. Without this, the forecast we publish to agents
("2-char names not on this list are user-safe forever") can drift
silently the next time a builtin is added without updating the doc —
which is exactly the failure mode that broke marketing-analyst rerun7
when ct landed in v0.11.6 with no spec entry.
Two tests: one for drift in either direction with a precise error
message naming the offending builtin and pointing at AGENTS.md > Adding
builtins, and a structural test asserting the SPEC section and the
forward-compat rule string both still exist.
Demonstrates the safe-name strategy in context: shows the would-error forms (ct=..., avg=...) as commented-out reference, then a working 4-char binding (mycnt) that's guaranteed forward-compatible because new builtins land under 4+ char names. Doubles as engine-harness regression via the example test runner.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced May 17, 2026
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.
Summary
Three consecutive releases broke carry-forward scripts via short-name builtin collisions: v0.11.3 reserved
avg, v0.11.4 tightened+=, v0.11.6 reservedct. Each timeILO-P011fired cleanly at parse time with a good rename hint, but the persona had no way to see it coming. Marketing-analyst rerun7 (originating P2 in the assessment doc) called this the predictable-cadence tax: not the rename itself, but the ~6-turn investigation cycle of parse-error → read message → check ai.txt for new builtin → confirm version → apply rename.This PR closes the forecast gap with combined option (a) + (c) from the originating entry:
Builtin::ALLat test time so the published forecast cannot silently fall out of sync with the registry.Manifesto framing: every name-collision incident now turns into a single-character rename (the existing
ILO-P011hint already nails that), and every release ships with a forecast that lets agents avoid the collision in the first place. The published 2-char namespace becomes a forever-safe binding surface for user code.Rejected option (b) loud→warn: demoting
ILO-P011to a warning would re-introduce the silent-mis-dispatch in call position that the existing error message specifically guards against — exactly the manifesto-violation we're guarding against.What's in the diff (per commit)
docs: add reserved-namespaces section to SPEC— new### Reserved namespacessubsection after the existing reserved-words section. Enumerates every 2-char (at hd tl rd wr ct) and 3-char short-name builtin, plus the longer ones in prose. Publishes the safe-name strategy (2-char names not on the list are permanently safe, new builtins land 4+ chars).ai.txtandskills/ilo/SKILL.mdregenerate through the existingbuild.rsmirror.docs: record 3+ char-first convention for new builtins in AGENTS.md— new## Adding builtinssection spelling out the rule for contributors, including the alias-only-when-safe guard for short aliases.tests: drift-guard SPEC reserved-names enumeration vs Builtin::ALL—tests/regression_reserved_names_doc.rswith two tests: one that parses the SPEC enumeration and diffs it against the registry, one that asserts the section + forecast string still exist. Failure messages point the maintainer at AGENTS.md.examples: reserved-names learning artefact—examples/reserved-names.iloshowing the would-error forms as commented reference + a working 4-char binding. Doubles as engine-harness regression coverage.Repro before/after
Before: marketing-analyst rerun7, carry-forward script with
ct=r.10, hitsILO-P011: 'ct' is a builtin and cannot be used as a binding name. Persona has to grep ai.txt for new builtin entries to figure out what changed. ~6 turn investigation overhead.After: persona reads SPEC
### Reserved namespacesonce, pickscty(unreserved 2-char name, permanently safe) and never collides again. New builtins land under 4+ chars per AGENTS.md so the 2-char surface stops accumulating reservations.Test plan
cargo test --release --features cranelift— full suite greencargo clippy --release --features cranelift --all-targets -- -D warnings— cleancargo fmt --check— cleanBuiltin::ALL— the message names the offending builtin and points at the AGENTS ruleexamples/reserved-names.iloruns across every engine via the existingtests/examples_engines.rsharness, returns3as expectedFollow-ups