Files
zeekayandHanzo Dev a8c1616951 consent: silence is refusal — a tri-state training answer with one predicate
The training answer was a bool, so "never asked" and "asked and declined" shared
a value. Nothing could tell whether an answer had ever been given, which means no
screen could know to ask and no data path could treat silence as refusal.

Training becomes a tri-state Answer (unanswered/granted/refused) with the zero
value being unanswered, so a missing record, an unparseable blob, a wrong JSON
type and an unrecognized token all decode to silence. MayTrain admits exactly one
value — an explicit "granted" — and is the ONE predicate; pkg/model aliases the
type and re-exports the states so a consumer outside this module shares the same
definition rather than re-deriving what granted means.

The write path validates at the boundary, so an answer this version does not know
is refused rather than persisted for a later reader to interpret, and a change to
the answer writes an AuditLog row carrying the prior and new value — a grant and a
later revocation are both attributable, which overwriting a JSON field is not.

The preferences property is now defined once in schema, where the consent record
nested in the same blob reads it, so the two cannot drift apart.

scripts/mutants.py drives cloud's strict-scored mutation engine against these
properties: 8 rows, 8 KILLED.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-04 22:49:50 -07:00
..