Commit 67ddedb
fix(home): a stored canonical pointer to a retired Home must stop governing (#449)
Independent review r3 of 413028e: the remaining P2 was only half-fixed.
Filtering withdrawn groups in `DaemonView::home_pointer` stops FUTURE
publication, but the prior `(HomePointer, "home")` record stays in
`OwnerSyncStore`. Reconciliation does nothing when the view returns `None`,
tombstone retention never clears owner-sync state, and `canonical_home`
returns the stored value without consulting the locally known tombstone.
So the real lifecycle — advertise, withdraw, then reconcile/restart — left the
device yielding to a dead pointer forever: `provision_home` hit the suppression
branch and returned instead of creating a usable replacement, and `GET /home`
reported `elsewhere` for a group that no longer exists. Permanently, across
restarts. The previous test could not detect this: it inserted an
already-withdrawn group into an EMPTY store, so no stored pointer ever governed.
Fixed on BOTH sides, keyed on the same proof.
Proof of retirement is LOCAL: the group is in our own roster AND carries the
terminal `withdrawn` flag. Inability to see the group is deliberately NOT
proof — a canonical Home on an unreachable device is unknown, not retired, and
treating unknown as retired would let any partitioned device mint over the
owner's real Home and refork the space this issue exists to unify.
- Consumer: new `effective_canonical_home()` backs BOTH `resolve_home` and
`provision_home`, so a provably retired pointer stops governing.
- Producer: `home_pointer_mint_decision` gained a `stored_is_retired`
override, fed by the new `SyncDaemonView::canonical_pointer_is_retired`.
Without this the fix is still broken: the ordering rule refuses EVERY
replacement, because a replacement Home is always NEWER than the dead one
it replaces, so the register would keep naming a tombstone forever.
`canonical_pointer_is_retired` fails safe on a contended roster lock (answers
`false`), so a busy daemon never mints over a live canonical Home.
Regressions:
- `a_retired_advertised_home_does_not_suppress_its_replacement` — the real
lifecycle: advertise, withdraw, reconcile/restart, assert a NEW usable Home
is provisioned. Verified to FAIL against pre-fix behaviour before being kept
("a pointer to a Home we hold and know to be retired must stop governing").
- `an_unreachable_remote_home_is_never_treated_as_retired` — a Home we merely
cannot see keeps governing, and we still yield rather than fork.
- `a_provably_retired_pointer_can_be_replaced_by_a_newer_home` — and, without
proof, the ordering rule still stands.
Gates on this exact tree, separate commands, actual exits:
cargo fmt --all -> 0
cargo clippy --all-features --all-targets -- -D warnings -> 0
cargo clippy --all-features --lib --bins -- -D warnings
-D clippy::panic -D clippy::unwrap_used -D clippy::expect_used -> 0
cargo check --workspace --all-targets -> 0
RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps -> 0
cargo nextest run --workspace --all-features --no-fail-fast -> 0
(3322 passed, 0 failed, 295 skipped)
One earlier run of the same tree failed
`inbound_redial_of_suppressed_peer_emits_no_peer_connected` at
`.expect("alice connects bob")` — a QUIC dial under full-suite load, the #316
family. Neither agent in that test is built `with_user_key`, so `owner_sync` is
never constructed and every line changed here sits behind an owner-keypair
guard; it also passes in isolation (2.3s) and the re-run above is green. Not
attributed to this diff and not claimed resolved.
#449 remains partial and open: no adoption, no retirement, enrolled devices
only.
Refs #449
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ovKUXBeg5GZ51YECS9p511 parent 413028e commit 67ddedb
3 files changed
Lines changed: 212 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1899 | 1899 | | |
1900 | 1900 | | |
1901 | 1901 | | |
| 1902 | + | |
1902 | 1903 | | |
1903 | 1904 | | |
1904 | 1905 | | |
| |||
1922 | 1923 | | |
1923 | 1924 | | |
1924 | 1925 | | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
1925 | 1934 | | |
1926 | 1935 | | |
1927 | 1936 | | |
| |||
1977 | 1986 | | |
1978 | 1987 | | |
1979 | 1988 | | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
1980 | 1997 | | |
1981 | 1998 | | |
1982 | 1999 | | |
| |||
2399 | 2416 | | |
2400 | 2417 | | |
2401 | 2418 | | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
2402 | 2429 | | |
2403 | 2430 | | |
2404 | 2431 | | |
2405 | 2432 | | |
| 2433 | + | |
2406 | 2434 | | |
2407 | 2435 | | |
2408 | 2436 | | |
| |||
3908 | 3936 | | |
3909 | 3937 | | |
3910 | 3938 | | |
3911 | | - | |
| 3939 | + | |
3912 | 3940 | | |
3913 | 3941 | | |
3914 | 3942 | | |
| |||
3940 | 3968 | | |
3941 | 3969 | | |
3942 | 3970 | | |
3943 | | - | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
3944 | 3977 | | |
3945 | | - | |
| 3978 | + | |
| 3979 | + | |
| 3980 | + | |
| 3981 | + | |
| 3982 | + | |
| 3983 | + | |
3946 | 3984 | | |
3947 | 3985 | | |
3948 | 3986 | | |
| |||
3952 | 3990 | | |
3953 | 3991 | | |
3954 | 3992 | | |
3955 | | - | |
3956 | | - | |
| 3993 | + | |
| 3994 | + | |
| 3995 | + | |
| 3996 | + | |
| 3997 | + | |
| 3998 | + | |
| 3999 | + | |
| 4000 | + | |
| 4001 | + | |
| 4002 | + | |
| 4003 | + | |
| 4004 | + | |
| 4005 | + | |
| 4006 | + | |
| 4007 | + | |
| 4008 | + | |
| 4009 | + | |
| 4010 | + | |
| 4011 | + | |
| 4012 | + | |
| 4013 | + | |
| 4014 | + | |
| 4015 | + | |
| 4016 | + | |
| 4017 | + | |
3957 | 4018 | | |
3958 | 4019 | | |
3959 | 4020 | | |
| |||
3963 | 4024 | | |
3964 | 4025 | | |
3965 | 4026 | | |
3966 | | - | |
| 4027 | + | |
| 4028 | + | |
3967 | 4029 | | |
3968 | 4030 | | |
3969 | 4031 | | |
| |||
3985 | 4047 | | |
3986 | 4048 | | |
3987 | 4049 | | |
3988 | | - | |
| 4050 | + | |
3989 | 4051 | | |
3990 | 4052 | | |
3991 | 4053 | | |
3992 | | - | |
| 4054 | + | |
3993 | 4055 | | |
3994 | 4056 | | |
3995 | 4057 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
104 | 141 | | |
105 | 142 | | |
106 | 143 | | |
107 | 144 | | |
108 | 145 | | |
109 | 146 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 147 | + | |
114 | 148 | | |
115 | 149 | | |
116 | 150 | | |
| |||
625 | 659 | | |
626 | 660 | | |
627 | 661 | | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
636 | 671 | | |
637 | 672 | | |
638 | 673 | | |
| |||
1211 | 1246 | | |
1212 | 1247 | | |
1213 | 1248 | | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
1214 | 1333 | | |
1215 | 1334 | | |
1216 | 1335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
139 | 150 | | |
140 | 151 | | |
141 | 152 | | |
| |||
0 commit comments