Contract — R93 B4 Consensus Schema Regex Messages
Round: R93 debug-sweep · XS scope (compact contract)
Audit: docs/audits/r93-b4-consensus-regex-msgs-audit.md
β task: 3cfa2d18-6820-4cd7-be77-7e85c1143279
§1. Invariants
| ID | Invariant |
|---|---|
| I-1 | Every .regex(RE) call site in src/domains/consensus/tools.ts carries a descriptive second-arg message string. |
| I-2 | The message describes what shape the value must take (e.g. "round_id must be a positive decimal integer (allocated by consensus_propose)"), not the regex itself. |
| I-3 | Regex constants HEX_64_RE, HEX_EVEN_NONEMPTY_RE, HEX_EVEN_OR_EMPTY_RE, DECIMAL_POSITIVE_RE are unchanged. |
| I-4 | All 79 test suites pass. No test asserts on the generic "Invalid" string (verified). |
§2. Acceptance criteria
- AC-1.
git diff origin/main..HEAD -- src/domains/consensus/tools.tsshows only.regex(RE, "...")second-arg additions at every call site. - AC-2.
npm run build && npm run lint && npm testexit 0. - AC-3. Live
consensus_finality {round_id:"bad"}now returnsINVALID_PARAMSwith the descriptive message insidedetails.issues[*].message.
Proceeding to packet.