Skip to content

docs/llms.txt: single-file language reference for LLMs (#403)#432

Merged
InauguralPhysicist merged 1 commit into
mainfrom
feat/ai-legibility-403
Jul 5, 2026
Merged

docs/llms.txt: single-file language reference for LLMs (#403)#432
InauguralPhysicist merged 1 commit into
mainfrom
feat/ai-legibility-403

Conversation

@InauguralPhysicist

Copy link
Copy Markdown
Collaborator

What

LLMs generate Python/TS fluently and EigenScript badly — they fall into exactly the spread/scope traps the write-eigenscript skill exists to prevent. For a low-training-data language, the artifact that makes it AI-legible may shape a stranger's first hour more than the REPL.

docs/llms.txt distills the whole surface a model needs into one file:

  • the of / one-element-spread rule (f of [x] does not spread — the Initialize EigenScript repository with official README and project structure #1 silent-wrong trap),
  • the outward-mutating scope model (is mutates the caller's binding; local in helpers),
  • reserved/soft keywords, the observer idioms (loop while not converged, report_value), values/strings,
  • and an explicit generate-then-validate ladder: eigenscript --lint --json (parse/lint) → run → --test — the parse→compile→sandbox grading iLambdaAi already uses.

Kept honest

  • Linked from the README; a doc-drift check stamps llms.txt to the current version so it can't silently fall behind SPEC.
  • Every snippet was run before shipping — which caught a wrong idiom in the draft: 1/0 warns and saturates rather than throwing, so the try/catch example now raises with throw of explicitly (and says so). An LLM reference that teaches a wrong idiom is worse than none.

Scope note

Per-file eigs.json lint allow-lists (the other half of #399) and this single-file reference both serve the "mechanically validate generated code" goal. Suite 2508/2508.

Closes #403

🤖 Generated with Claude Code

LLMs generate Python/TS fluently and EigenScript badly — they fall into exactly
the spread/scope traps the write-eigenscript skill exists to prevent. For a
low-training-data language, the artifact that makes it AI-legible may shape a
stranger's first hour more than the REPL: the whole language in one file, plus a
mechanical validate-what-you-generated loop.

docs/llms.txt distills the surface a model actually needs — the `of`/one-element
spread rule (`f of [x]` does not spread), the outward-mutating scope model
(`local` in helpers), reserved/soft keywords, the observer idioms, values/strings
— and documents the generation-validation ladder explicitly: `--lint --json`
(parse/lint) → run → `--test` (the parse→compile→sandbox grading iLambdaAi
already uses). Linked from the README; a doc-drift check stamps it to the current
version so it can't silently fall behind SPEC.

Every code snippet was run before shipping — which caught a wrong idiom in the
draft: `1/0` warns and saturates rather than throwing, so the try/catch example
raises with `throw of` explicitly (and now says so).

Suite 2508/2508.

Closes #403

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@InauguralPhysicist InauguralPhysicist merged commit b50461b into main Jul 5, 2026
16 checks passed
@InauguralPhysicist InauguralPhysicist deleted the feat/ai-legibility-403 branch July 5, 2026 03:00
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.

AI-legibility: single-file language reference + document the generation-validation ladder

1 participant