Treat an ACTIVE partnership as phase 2 regardless of the flags

HOST<n>_PHASE*_DONE only ever describe the mirror, so on the mirror the owner's card computed phase 0 and offered to onboard the host that had just onboarded it.
This commit is contained in:
Gmer4Lfe
2026-08-17 11:36:00 -04:00
parent 587440b6bc
commit 5fc53948c6
+11
View File
@@ -371,6 +371,17 @@ function vv_pt_nodes(): array {
$nodeIdUpper = strtoupper($slot); $nodeIdUpper = strtoupper($slot);
$onboardPhase = ($setupDb[$nodeIdUpper . '_PHASE2_DONE'] ?? '') === 'true' ? 2 $onboardPhase = ($setupDb[$nodeIdUpper . '_PHASE2_DONE'] ?? '') === 'true' ? 2
: (($setupDb[$nodeIdUpper . '_PHASE1_DONE'] ?? '') === 'true' ? 1 : 0); : (($setupDb[$nodeIdUpper . '_PHASE1_DONE'] ?? '') === 'true' ? 1 : 0);
// An ACTIVE partnership means phase 2, whatever the flags say. HOST<n>_PHASE*_DONE always
// describe the MIRROR — they are the owner's record of how far it got provisioning the
// other side — so the owner's own slot has no such flag and never will. On the mirror
// that left the owner's card computing phase 0 and rendering "Not provisioned · SSH keys
// not installed", complete with an ▶ Onboard button, on the very host that had just
// finished onboarding it. The state file is the authority on whether a partnership
// exists; the flags only say who did what to whom.
if ($onboardPhase < 2 && ($ptDb['state'] ?? '') === 'ACTIVE') {
$onboardPhase = 2;
}
// key_ready: local key generated but not yet installed on HOST2 (SSH pending manual step) // key_ready: local key generated but not yet installed on HOST2 (SSH pending manual step)
$keyReady = !$isMe && ($setupDb[$nodeIdUpper . '_KEY_READY'] ?? '') === 'true'; $keyReady = !$isMe && ($setupDb[$nodeIdUpper . '_KEY_READY'] ?? '') === 'true';
// For self: local setup complete flag (set by partnership_manager --onboard --local-only) // For self: local setup complete flag (set by partnership_manager --onboard --local-only)