Commit c181fec
committed
fix(mailbox): pub(crate) phase so the owner-trait invariant is compiler-enforced (#507 review)
Codex P2: MailboxSoA.phase was `pub`, so a downstream crate could assign an
arbitrary KanbanColumn directly, bypassing MailboxSoaOwner::try_advance_phase
(the lifecycle-DAG check) and the KanbanMove emission this change centralizes.
The field doc already claims "mutated only via the owner trait" — but `pub`
left that as documentation, not enforcement.
Change `pub phase` -> `pub(crate) phase`. Verified safe across the whole
workspace (cargo check --workspace --all-targets exits 0):
- the only writer is the in-crate impl MailboxSoaOwner for MailboxSoA<N>
(advance_phase, mailbox_soa.rs); pub(crate) keeps that working.
- the soa_view.rs write is on the FakeSoa test double, not MailboxSoA.
- no external crate reads the field directly; reads go through the
MailboxSoaView::phase() getter, which is unchanged.
mailbox_soa lib tests (12) + soa_view tests (3) green.
https://claude.ai/code/session_01VysoWJ6vsyg3wEGc5v7T5v1 parent 08b6417 commit c181fec
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
| |||
0 commit comments