Tags & rules

Open a tag, attach rules as flags or options, close it. A small, composable grammar — not regex.

On the assembly deck, a droid is built from a small set of standard parts — chassis, sensor, manipulator — and each part gets QA stamps before it leaves the line. mediva works the same way: tags are the parts, rules are the stamps.

Tags are the constructs; rules are the checks you attach.

Tags

TagKind
sectionowns a heading; the only tag that nests
list table code line medialeaves: one headingless construct inside a section
document frontmarkers, no end tag

list covers bullets, checklists, choices and evidence lists; its props pick which (items.all=checked, checked.eq=1).

<!-- mdv: section required -->
## Systems

<!-- mdv: table -->
| System    | Status |
| --------- | ------ |
| Hyperdrive| ?      |

Every tag has a page under section; every rule is on All rules.

Rules

A flag (required) or an option (content.words.min=20, columns.has=[Area, Owner]). Stack as many as needed:

<!-- mdv: section required content.words.min=20 content.none=@placeholders -->
## Summary

Counts take ranges: content.words.range=20..180, items.range=1... A rule on the wrong tag is a compile error.

Content rules

content.blocks.has demands something present, content.none demands it absent. Values are a construct name, a /regex/, or a "literal".

<!-- mdv: section required content.blocks.has=[table, /because/] content.none=/tbd|tba/i -->
## Decision

State the call, justify it with the word "because", and back it with a table.
## Decision

Ship it. Rollout date TBD.
## Decision

Ship it, because the table shows no regressions.

| Option | Cost |
| --- | --- |
| Ship | low |

Strictness

Closure rules (strict, labels.eq=@template) turn "must contain" into "exactly this": Strictness. Retune severity with Overrides.

Plugins add rules and tags

A plugin adds namespaced rules (compliance/noWeasel) and tags, never a heading owner.

Why not regex?

/## Checklist\s+[-*] \[x\] Tests added or updated\s+[-*] \[x\] Docs updated(?!\s+[-*] \[[ x]\])/m
<!-- mdv: section required -->
## Checklist

<!-- mdv: list required items.all=checked labels.eq=@template -->
- [ ] Tests added or updated
- [ ] Docs updated
## Checklist

- [x] Tests added or updated
- [ ] Docs updated
- [x] Shipped it

Rules read structure, so failures point at a line, not a byte offset.

Next: Strictness, Overrides, Frontmatter, Evidence lists, Glossary.

On this page