Skip to content

docs: document lowercase-only identifier rule in SPEC and SKILL#271

Merged
danieljohnmorris merged 2 commits into
mainfrom
fix/spec-naming-uppercase-rule
May 14, 2026
Merged

docs: document lowercase-only identifier rule in SPEC and SKILL#271
danieljohnmorris merged 2 commits into
mainfrom
fix/spec-naming-uppercase-rule

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

PR #262 documented the post-dot field-access relaxations (camelCase, leading-uppercase, snake_case, kebab-case) so JSON keys from real APIs just work after . and .?. What it didn't document, because it was implicit, is the baseline rule the relaxations are an exception to: identifiers at binding and call sites are lowercase ASCII only, optionally with hyphenated segments.

Anyone reading the dot-access section in SPEC.md would reasonably wonder what the baseline naming rule is. This PR makes it findable on its own anchor.

Repro before/after

Before this PR, the only mention of the lowercase-only rule was an indirect note at the bottom of the dot-access section: "top-level identifiers still follow the standard naming rules". The "standard naming rules" themselves were only the 1-3 char shorten-everything heuristic, with nothing about ASCII-lowercase, hyphens, or the post-dot exception.

After this PR, a new Identifier syntax subsection under Naming gives the formal grammar ([a-z][a-z0-9]*(-[a-z0-9]+)*), a worked OK/ERROR table covering capital letters, leading capitals, underscores, and leading hyphens, the ILO-L003 surface in the CLI with the exact suggestion shape, and an explicit cross-reference to the Field names at dot-access section.

Verified against the lexer:

$ echo 'runD = 1' | ilo run -
{"code":"ILO-L003", ... "suggestion":"identifiers must be lowercase ASCII; got 'runD' (capital 'D' at offset 3). Use lowercase, e.g. `run-d` or `rund`"}

The SPEC claim matches the implementation exactly.

What's in the diff

Commit 1: SPEC.md - new Identifier syntax subsection under Naming with formal grammar, OK/ERROR table, ILO-L003 mention, and link to Field names at dot-access.

Commit 2: SKILL.md + ai.txt - mirrors the rule into SKILL.md (compressed: agents see this first when ilo loads as a Claude plugin), plus the build.rs regeneration of ai.txt.

Test plan

  • cargo build --release --features cranelift - build.rs regenerates ai.txt cleanly
  • Verified runD produces ILO-L003 with the exact suggestion the SPEC documents
  • Docs-only change, no test impact

Follow-ups

None.

PR #262 documented the post-dot dot-access relaxations (camelCase, leading-uppercase, snake_case, kebab-case) for field names, but the binding/call-site rule itself was only implicit. Anyone reading SPEC.md would see the dot-access relaxations and reasonably wonder what the baseline is.

Adds an Identifier syntax subsection under Naming with the formal grammar (`[a-z][a-z0-9]*(-[a-z0-9]+)*`), a worked OK/ERROR table, the ILO-L003 surface in the CLI, and an explicit cross-reference to the Field names at dot-access section. Makes the binding/call-site rule findable on its own anchor.
SKILL.md is what agents see first when ilo loads as a Claude plugin, so the lowercase-only rule needs to land there too, with the same OK/ERROR examples (compressed) and the post-dot exception called out.

ai.txt is the build.rs regeneration from the updated SPEC.md.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@danieljohnmorris danieljohnmorris merged commit cb80dcc into main May 14, 2026
5 checks passed
@danieljohnmorris danieljohnmorris deleted the fix/spec-naming-uppercase-rule branch May 14, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant