fleetstate: a failed enroll-ledger read fabricates provisioning refusals — "needs a public address, has 0 B" for a capable gateway #279
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#279
Loading…
Add table
Add a link
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?
internal/fleetstate/projection.go:145-148— the projection's enroll-ledgerListerror pathreturn nils. A nil map meansdevice()(line ~204) merges no enrolment facts: every device gets zeroResources, andderiveNetwork(enroll.NetworkFacts{})yieldsNetwork{Public: false, Description: "home connection, not publicly reachable"}.This is not display-only — it gates provisioning at
internal/provision/assess.go:270. A transient ledger read failure makes the assessment tell the operator "needs a public address — this device has none" and "needs 4 GB — this device has 0" for a perfectly capable public gateway. The reasons are specific and plausible; nothing hints the ledger was unreadable.Acceptance
fleetstate.Readergrows an error channel the assess path propagates, or the snapshot carries an explicit degraded marker that assess turns into an honest "fleet state unreadable — try again" refusal (never per-resource reasons derived from zeros).Filed from the 2026-08-05 fail-loud audit (three-agent pre-production sweep; findings verified against code).
Fixed in commit
11487d8(on origin/main).The projection's
enrolled()(internal/fleetstate/projection.go) swallowed enroll-ledgerListerrors into a nil map, sodevice()merged no enrolment facts and every placed node read back with zeroResourcesandNetwork{Public:false}— whichassess.gothen turned into confident "needs a public address — this device has none" / "needs 4 GB — this device has 0" refusals for a capable public gateway.Fix (the acceptance's explicit-degraded-marker option):
enrolled()now returns its read error;Devices/Devicemark each derived device with a newfleetstate.Device.Degradedflag (zero resources because UNKNOWN, not small/private); andAssess/ForRolerefuse a degraded device with an honesterrFleetUnreadable("fleet state ... is unreadable — try again") instead of deriving per-resource/network reasons from the zeros.ChangeSetuproutes through both and is covered. Theomitemptyfield is ignored by existing consumers, so no regression.Tests (red-first):
internal/provision/assess_test.go— injected ledger error ⇒ assess reports the read failure, never a resource/network refusal;internal/fleetstate/projection_test.go— an unreadable ledger marks every deviceDegradedwith no fabricated resources.go build ./...,go vet,golangci-lint, and fullgo test ./...green.