[v0.1.x/Proto] Bind the gated-field list to the Requires call sites it claims #175
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis#175
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What was found
crates/felis-protocol/src/minor.rsrecords every gated field twice: once in the hand-writtenGATED_FIELDSlist, and once at theRequires::when(...)call site inside the owningMinorGated::requiresimpl. Nothing binds the two together.
The ledger-coverage test (
the_ledger_covers_every_executable_addition) walksGATED_FIELDS, so deleting aRequires::whencall from arequires()arm while leaving itsGATED_FIELDSentry in place still passes:the send gate silently stops authorizing that field while the prose ledger and the test both keep claiming it
does. The reverse — an entry added to
GATED_FIELDSwith no call site — is equally invisible.Why it is out of scope for #50
#50's acceptance criterion is that the prose ledger and the executable metadata cover the same additions;
both directions of that check now run. Closing this gap instead means changing how a field declares its
requirement — colocating the
Requiresconstant with the field it gates and enumerating them through a macroor trait, so the list and the call sites cannot be written separately. That is a design of its own, and #50 is
already at its size budget.
What the follow-up should do
Derive the gated-field set structurally from the call sites
requires()reads, so a field's authorization hasexactly one home, then point the ledger-coverage test at that derived set. Per-field coverage of the current
call sites (a message built with each field present, asserting
requires().minor) is the cheaper fallback ifthe structural version proves too invasive before the freeze.
Split from #50.