Protocols
The repeatable shape of every module delivery. Invariant-first, protocol-driven. Case reviews, completion reports, status snapshots, review gates — the same flow every time, regardless of module.
One direction, six artifacts
Each artifact derives from the one to its left. Reversing the flow ("the code says so, update the spec") is a drift signal — fix the spec before the code lands.
Every module ships these ten files
A module is not handoff-ready until all ten exist. Missing any one of them blocks the release gate.
README.mdSTATUS.md{module}-execution-spec.mdhandover/ui/*.tsxhandover/preview/{module}-preview.htmlhandover/preview/screenshots/*.pngtests/{module}.test.tstests/smoke-*.mjshandover/docs/{module}-module-completion-report.mdhandover/docs/{module}-integration-notes.mdImplementation follows invariants, not the reverse
Read the invariants
- Global wallet invariants (this library)
- Module execution spec
- Authority chain at the top of each binding doc
Express them in code
- TSX matches the spec, not the other way around
- Closed enums declared once, mirrored everywhere
- Forbidden patterns explicitly absent
Assert them in tests
- One assertion per invariant
- Source-scans for forbidden tokens
- Disjointness between validation and terminal sets
Demonstrate them in preview
- Every reviewable state navigable from sidebar
- Edge cases (no-match, insufficient, expired) visible
- Deterministic mocks; no live data
When a decision needs a record
For non-trivial product decisions (e.g., amount-uniqueness vs tx-hash, memo/tag vs amount matching), produce a visual case-review HTML alongside the standard markdown.
Two surfaces, one history
Snapshot of the latest pass
- Author history table at top
- Validation matrix per pass
- Versioned (v1.0, v1.1, …) — never overwritten
- Append a row every time STATUS changes
Detail behind the status
- Files modified / files NOT touched
- Per-section invariant table
- Backend/API assumptions called out
- Known gaps + integration concerns
What gets verified before a module ships
The repeatable shape
Every Unit module — wallet, vault, identity, future — follows the same shape. New modules inherit this without re-derivation.
Spec → Build → Preview → Test → Report → Handoff
One direction. Spec leads. Reports follow. Standards are how the system is built — not documentation after the fact.