Parent
Sub-issue of #204 (Phase 4: Hardening)
Summary
The reconciler invariant checker is logging violations every 5 seconds for every active town, generating massive log noise. Two distinct violations:
Invariant 7: "Working agent has no hook"
Affected towns: 8a6f9375 (your town), 505b54c4
For your town, the working agent is 9640a1a6 — the mayor. The mayor is always working with no hook (it doesn't work on beads). Invariant 7 should exclude mayors from the "working agent must have a hook" check.
For town 505b54c4, agent c07585bd is a non-mayor working agent with no hook. This is the #1358 bug — dispatch timeout race leaves the agent in an inconsistent state.
Invariant 5: "Convoy bead is in_progress (should only be open or closed)"
Affected towns: 505b54c4 (5 convoy beads), be20bf4b (3 convoy beads)
The invariant expects convoy parent beads to only be open or closed. But in_progress is a legitimate transient state — it means agents are actively working on the convoy's child beads. The invariant is too strict.
Either:
- Allow
in_progress and in_review as valid convoy bead states in the invariant check
- Or the convoy bead status should not change from
open until all children are closed (then it goes straight to closed). If convoy beads are being set to in_progress by dispatchAgent or hookBead, that's the bug.
Impact
- Log spam: ~12 error log lines per 5-second alarm tick per affected town
- No direct functional impact (invariants are detection-only, don't block reconciler actions)
- Masks real errors in the Workers observability dashboard
Fix
- Invariant 7:
AND agent_metadata.role != 'mayor'
- Invariant 5: Either allow
in_progress/in_review for convoy beads, or fix the code path that sets convoy beads to in_progress
Parent
Sub-issue of #204 (Phase 4: Hardening)
Summary
The reconciler invariant checker is logging violations every 5 seconds for every active town, generating massive log noise. Two distinct violations:
Invariant 7: "Working agent has no hook"
Affected towns:
8a6f9375(your town),505b54c4For your town, the working agent is
9640a1a6— the mayor. The mayor is alwaysworkingwith no hook (it doesn't work on beads). Invariant 7 should exclude mayors from the "working agent must have a hook" check.For town
505b54c4, agentc07585bdis a non-mayor working agent with no hook. This is the #1358 bug — dispatch timeout race leaves the agent in an inconsistent state.Invariant 5: "Convoy bead is in_progress (should only be open or closed)"
Affected towns:
505b54c4(5 convoy beads),be20bf4b(3 convoy beads)The invariant expects convoy parent beads to only be
openorclosed. Butin_progressis a legitimate transient state — it means agents are actively working on the convoy's child beads. The invariant is too strict.Either:
in_progressandin_reviewas valid convoy bead states in the invariant checkopenuntil all children are closed (then it goes straight toclosed). If convoy beads are being set toin_progressbydispatchAgentorhookBead, that's the bug.Impact
Fix
AND agent_metadata.role != 'mayor'in_progress/in_reviewfor convoy beads, or fix the code path that sets convoy beads toin_progress