Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 2.34 KB

File metadata and controls

9 lines (7 loc) · 2.34 KB

assertions — notes

Hand-written. ../harvested/assertions.md is what the documents say; this file is what the implementation found, and it wins. Each entry names the harvested entry it answers by that entry's stable key.

Conflicts

  • The production assertion primitive is the domain model's own shared validation helper, not a general-purpose Assert.that. Resolves assertions/df75bd2e. The styleguide's rule presumes a project-wide assertion facade over Sorbet's runtime sig checks; this port has no Sorbet (see ../notes/type-system.md), and it has something narrower that the rule's purpose is better served by. docs/sdk-design-ruby/04-domain-model-construction.md fixes one shared helper that raises one error type with the one message form "<name> is required", because SEAM-29 requires required-field validation to be uniform across every model and HTTP-4 requires the failure to name the field — a generic Assert.that(cond, "message") would let each model phrase that message differently, which is the drift SEAM-29 exists to prevent. A second, unrelated primitive would give two ways to raise the same class of failure and no rule about which. What the SDK does instead: field validation lives in each Data type's initialize override and routes through that one helper; cross-field validation lives in the Builder's build; and the wire boundary re-validates header names and outbound values (HTTP-17, HTTP-18, XCUT-18) inside every transport adapter, which is where the styleguide's "check arguments at entry" density rule is actually paid in this codebase. The helper lands in phase 1 with the domain model it belongs to; phase 0 ships no production assertions at all, because it ships no production code beyond each gem's namespace and VERSION, so there is nothing for this rule to bite on until phase 1. Nothing in test/ is affected: Minitest's own assert_* family is the test-side assertion vocabulary and the styleguide's chapter 11 rules govern it unchanged. The styleguide-amendment alternative (scoping rule 5's Assert.that clause to projects without a domain-model validation contract of their own) was considered and not taken; this is recorded as an SDK deviation instead. review · docs/work/mvp/phase0/2026-09-05-phase0-scaffold-and-quality-gates-design.md · high · sha:manual-phase0-assert