The contracts

What is settled before the code is.

A spec here is a contract more than one roadmap line depends on — a file format, a vocabulary, or a behaviour every tool obeys. It exists because a rationale section says why in 250 words, and a format needs to say what, at whatever length that takes.

Every spec describes code that exists, and is the contract that code is held to. Where the code and a spec disagree, that is evidence about the spec, not only about the code.

SpecWhat it fixesLines it binds
tool-surface.mdHow every call behaves: handles, post-conditions, errors, self-description, conventionsPW1–PW6
project-config.mdWhat a project declares, and how a value is resolvedPW5
measurements.mdThe closed vocabulary a comparison may returnPW8–PW11
rungs.mdThe preview ladder: what each rung is, and which question it carriesPW7, PW13–PW15
context.mdJudging an asset where it will be seen, and what survives at display sizePW10, PW15
fetching.mdBuying a mesh: the shape check, the ledger, the schema, the referencePW16–PW21
engine.mdDriving the engine: the verdict, real pixels offscreen, units, environmentPW22–PW25
motion.mdA skeleton fitted to a mesh, and a clip and its curves authored once as TOMLPW26–PW29
acceptance-spec.mdWhat “correct” means, as a file a search can aim atPW12, PW13, PW15
geometry.mdA shape as data rather than as a programPW30–PW34
provenance.mdWhat is recorded beside an artefact, and the cache keyPW6, PW14, PW17
world.mdA game's names, factions and characters declared beside its prose, and the text a player reads held to themPW196–PW200
music.mdA score written as a source in mini-notation, the note model it compiles to, and MIDIPW186–PW188
effects.mdRetro effects as sfxr parameters and a seed, and realistic ones bought under a ceiling, each at the cue a game declaresPW189, PW190
store.mdA store's capsule set cut from one key art and a logo, with the store's shapes as dataPW268
video.mdA teaser cut together from captured runs, scored, encoded as an MP4 and measuredPW429
vfx.mdA particle or ribbon effect declared as data and built into the scene the engine plays, with what it measuresPW259
driving.mdA running game held still between an agent's calls, and the commands that move and read itPW211–PW217
panel.mdA menu panel's frame declared once and built to nine-patch textures and styleboxes, by statePW316
inventory.mdEvery item a project governs, by kind, in one paged read with its record's statePW299
adoption.mdWhat one asset cost to make each way, so the claim can be falsifiedPW35
kit.mdA part every game repeats, made once in the plugin as a kit with its proof, and the five steps every kit keepsPW340–PW342

Each one lives in docs/specs/. They are ordinary documents, edited directly, unlike the roadmap, which roadkeep governs.

Two format rules, so nobody has to decide twice

TOML for documents a person authors or reads — the project config, an acceptance spec, a geometry declaration, an animation clip. JSON for records a machine writes — provenance sidecars, job state, ledgers, cache entries. The split is about who edits the file, not about what is in it. A document may also arrive as JSON where a caller emits it programmatically; a record never arrives as TOML.

An acceptance spec, in full

One file per asset, beside it or under a directory the project config names. This is the whole grammar: a list of named predicates, each naming a measure from the closed vocabulary and stating one bound, and a block per parameter the search is permitted to move.

mascot.accept.toml
asset = "mascot"
rung  = "final"          # the lowest preview rung a verdict may be taken at

[[predicate]]
id      = "face-reads-cream"
measure = "delta_e"
region  = [120, 80, 180, 140]
target  = "#E8D5C4"
max     = 2.0

[[predicate]]
id      = "silhouette-holds"
measure = "silhouette_iou"
against = "docs/design/art/ui/mascot.png"
min     = 0.97

[[predicate]]
id      = "has-a-saturated-tail"
measure = "saturation_p99"
region  = "subject"
min     = 0.85
weight  = 0.5

[search.light]
min = 0.5
max = 4.0

[search.form]
min  = 1.0
max  = 4.0
step = 0.1

What an acceptance spec deliberately cannot say

Anything no measure can compute. “Reads as cloth rather than paper” is a real criterion and not a predicate, and pretending otherwise by inventing a proxy for it is how a spec ends up satisfied by a render a person rejects. That case is expected rather than designed away — it is exactly what the contact sheet is for.

Deliberately not specced yet

  • ◆The paid-service lock and ledger (PW17, PW18). One file written by one task, and §PW17 already pins its fields. It becomes a spec here if a second consumer appears.
  • ◆The MCP tool list. It is served, and derived from the operation registry, so a document listing it would be a copy that drifts: python -m polyweave serve answers tools/list, and tool-surface.md says how each call behaves.