Agent rules for stdlib/

August 2, 2026 · View on GitHub

Folder-scoped rules for editing the forward standard library. The repo-wide guide is ../AGENTS.md; read this first when your change lands in this folder.

Read before editing

  • README.md — what the folder is, the tier partition, what future means
  • CONVENTIONS.md — what the vocabulary means (frames, winding, units)
  • STYLE_GUIDE.md — how to write declarations and bodies
  • LIBRARIES.md — how *.library.plato files relate to declaration files
  • VERIFICATION.md — which gate proves what, and the command that runs it

Regenerate types-and-concepts.txt with every change

types-and-concepts.txt is generated — one compressed declaration per line for every type and interface in the three shipping tiers, every interface first and then every type, each group sorted by name. It exists so an agent can see what the library actually contains without opening every file, and so a name it does not find there is known not to exist. That guarantee holds only while the file matches the source.

If your change adds, removes, or renames a type or an interface, or changes a member signature, regenerate the file in the same commit:

.\tools\export-types-context.bat

From this repo's root: .\tools\export-types-context.bat.

Rules:

  • Never hand-edit it. Edit the .plato source and re-run the tool.
  • Regenerating is not optional. A stale index is worse than no index: a reader cannot tell a stale line from a fresh one, so one wrong entry discredits the file.
  • The inner-loop gate enforces this. .\tools\check-stdlib-fast.ps1 runs an index freshness gate that regenerates into .temp/ and compares; it fails if the tracked file has drifted. The gate never writes the tracked file — only export-types-context.bat does.
  • future/ is excluded on purpose: it is declared, not shipped. Do not add it.