DIALECT-09: Require an anchor with a contract
What it demonstrates
Section titled “What it demonstrates”A declared section anchor emits structure/anchor-missing when no matching ^id resolves.
Builds on: DIALECT-02: Anchor a section, read it from .anchors
How it’s done
Section titled “How it’s done”Commands, code, and output together; comments mark which is which.
mcVersion: 1kind: contractbody: sections: - section: Summary anchor: summary # a ^summary must resolve in this section
$ markdown-contract validate --contract summary.contract.yaml --path notes# error structure/anchor-missing section 'Summary' is missing required block-id ^summarySurfaces exercised
Section titled “Surfaces exercised”declarative contract section.anchorstructure/anchor-missing rulevalidate CLI --contract/--path