The reference implementation of WikiScript lives in the `wikiscript` code repo — a small Node project, one dependency, twelve tests. It exists to make the language real: every construct on these pages parses there, and every permission table is its output. The repo stays private until the publish gate; its plan.md is the buildable spec, snapshotted on WikiScript Plan.
# The shape
wikiscript/ ├── plan.md # the buildable spec ├── package.json # node >= 24, ohm-js, node --test ├── bin/wikiscript.js # the CLI ├── src/grammar/wikiscript.ohm # the grammar — single source of truth ├── src/parse.js # grammar + semantics -> AST ├── src/ast.js # walkers over the AST ├── src/summary.js # deontic lines -> permission table ├── src/constraints.js # the determinism linter ├── corpus/ # three agreements, all parsing └── test/ # parse + summary + refusals
# The pipeline `parse.js` loads the Ohm grammar and attaches one semantic attribute, `ast`, mapping every rule to plain JSON — no classes, no hidden state. `summary.js` projects the Deontic nodes into permission rows. `constraints.js` checks what the grammar alone cannot: every capitalised term defined, every handler closed by its own name, obligations without handlers surfaced as warnings.
# The commands
wikiscript parse corpus/fork-consent.wikiscript # AST as JSON wikiscript who corpus/fork-consent.wikiscript # PARTY | MODAL | ACTION | WHEN wikiscript check corpus/fork-consent.wikiscript # determinism and definitions
# Corpus first The grammar grows only when an agreement in the Agreement Corpus needs it to. The working loop: write the agreement, watch it fail to parse, extend the grammar, make the tests green, publish the page. The corpus files ship in each agreement page's assets, so the wiki and the repo hold the same text.
# Tests as conformance `node --test` runs twelve tests: the three agreements parse to their expected shapes, the permission tables match, and the refusals refuse — `repeat forever` fails at the grammar, an undefined term fails the check. When the core is ported to Rust for the wasm targets, this corpus and these tables are the conformance suite the port must match. See WikiScript Architecture.
# See - WikiScript Grammar and Ohm - Agreement Corpus and WikiScript Plan - WikiScript and WikiScript Architecture