Skip to content

INFERENCE-INIT-01: Scaffold a contract from a folder of notes

init reads existing markdown and writes a tight-but-accepting contract plus a discoverable router, zero TypeScript.

Builds on: nothing — this is the first rung of Scaffold and Guard: init, Inference, and Drift Checks.

A terminal session: the command as you’d run it, followed by the output it prints; trailing comments note the exit status.

Terminal window
# infer the tightest contract that still accepts every *.md under ./notes
markdown-contract init ./notes
# writes notes.contract.yaml + markdown-contract.yaml (the router) in the cwd
# prints:
# init: inferred 1 contract(s); wrote 2 file(s):
# markdown-contract.yaml
# notes.contract.yaml
# self-check: clean (the scaffold accepts its own corpus)
  • init verb (src/cli/run.ts runInit)
  • inferConfig single-contract mode
  • mergeFiles router synthesis
  • post-write self-check