Report control-plane watch outages for every kind #69

Closed
opened 2026-10-27 13:34:49 +00:00 by sam · 1 comment
Owner

Goal

Losing the State Store stream shows an outage error on every watched kind's apply-status record for archied and archie-gateway, cleared on reconnect.

Evidence

internal/app/archied/control_plane.go:283 calls KeepWatch with no end callback; archiegateway/server.go:290 only logs (including refused documents).

Rules

Read CLAUDE.md. Do only what the Goal and Stop when need. File anything else you notice as a bead; do not fix it. Run task check once at the end; if it fails twice on the same problem, comment on this bead and stop.

Stop when

  • Both processes report and clear outages per kind.
    Then commit (Conventional Commits, scoped by package), bd close this bead and stop.

Close reason

Closed


Imported from beads archie-core-4q28.17 · GitHub #1245 · type bug · priority P1 · created 2026-10-05 · closed 2026-10-05

## Goal Losing the State Store stream shows an outage error on every watched kind's apply-status record for archied and archie-gateway, cleared on reconnect. ## Evidence internal/app/archied/control_plane.go:283 calls KeepWatch with no end callback; archiegateway/server.go:290 only logs (including refused documents). ## Rules Read CLAUDE.md. Do only what the Goal and Stop when need. File anything else you notice as a bead; do not fix it. Run `task check` once at the end; if it fails twice on the same problem, comment on this bead and stop. ## Stop when - [ ] Both processes report and clear outages per kind. Then commit (Conventional Commits, scoped by package), `bd close` this bead and stop. ### Close reason Closed --- _Imported from beads `archie-core-4q28.17` · GitHub #1245 · type bug · priority P1 · created 2026-10-05 · closed 2026-10-05_
sam added the highbug labels 2026-10-27 13:34:49 +00:00
sam self-assigned this 2026-10-27 13:34:49 +00:00
sam closed this issue 2026-10-27 13:34:49 +00:00
Author
Owner

sam wrote (originally 2026-10-05):

Implementation done in the working tree; gate blocked by a concurrent writer in this checkout, so per the rules (second failure on the same problem) I am commenting and stopping without committing.
Implemented, mirroring the workflow-execution-settings pattern at control_plane.go:87-140 exactly:

  • archied startRuntimeResourceWatches: per-kind lastApplyErr/streamErr; an open callback re-reporting on re-established watches (clears the outage, keeps an outstanding refusal); the refusal path reporting through the record; the end callback reporting 'runtime settings watch unavailable: ' at version 0 (Reporter keeps the last applied version) unless a refusal outranks it; applyRuntimeResourceUpdate now returns the refusal/rejection for the watch to keep.
  • archie-gateway startRuntimeWatches: same pattern; relayer returns the refusal instead of only logging.
  • archie-gateway persona and soul watches: moved onto a shared watchStatus helper (watchPersonas/watchSoul, gateway_runtime.go) that reports applied versions, records the outage on stream end and clears it on re-establishment. Boot now seeds the persona/soul records with their versions. This also fixes their misplaced doc comment sitting above setupChatTasks.
    Verified before the tree was broken by the foreign change: go build ./internal/... clean, golangci-lint on internal/app/archied and internal/app/archiegateway '0 issues' (one dupl hit on the personas/soul pair fixed by the shared helper). task check run 1 failed at proto:check: the checkout carries another session's uncommitted dispatch-reason work (proto/state, internal/daemon, internal/infrastructure/postgres, migration 0032, binding_dispatch_test) and its latest edastore.go edit does not compile (undefined pgtype at 514/517), which fails the build for every package that imports postgres. That failure is not from this bead's files and was still present minutes later with edits continuing. Files changed for this bead, uncommitted in the tree: internal/app/archied/control_plane.go, internal/app/archiegateway/server.go, internal/app/archiegateway/gateway_runtime.go (plus .16's internal/app/controlplane/operational_settings.go and two ui files).
_sam wrote (originally 2026-10-05):_ Implementation done in the working tree; gate blocked by a concurrent writer in this checkout, so per the rules (second failure on the same problem) I am commenting and stopping without committing. Implemented, mirroring the workflow-execution-settings pattern at control_plane.go:87-140 exactly: - archied startRuntimeResourceWatches: per-kind lastApplyErr/streamErr; an open callback re-reporting on re-established watches (clears the outage, keeps an outstanding refusal); the refusal path reporting through the record; the end callback reporting 'runtime settings watch unavailable: <stream error>' at version 0 (Reporter keeps the last applied version) unless a refusal outranks it; applyRuntimeResourceUpdate now returns the refusal/rejection for the watch to keep. - archie-gateway startRuntimeWatches: same pattern; relayer returns the refusal instead of only logging. - archie-gateway persona and soul watches: moved onto a shared watchStatus helper (watchPersonas/watchSoul, gateway_runtime.go) that reports applied versions, records the outage on stream end and clears it on re-establishment. Boot now seeds the persona/soul records with their versions. This also fixes their misplaced doc comment sitting above setupChatTasks. Verified before the tree was broken by the foreign change: go build ./internal/... clean, golangci-lint on internal/app/archied and internal/app/archiegateway '0 issues' (one dupl hit on the personas/soul pair fixed by the shared helper). task check run 1 failed at proto:check: the checkout carries another session's uncommitted dispatch-reason work (proto/state, internal/daemon, internal/infrastructure/postgres, migration 0032, binding_dispatch_test) and its latest edastore.go edit does not compile (undefined pgtype at 514/517), which fails the build for every package that imports postgres. That failure is not from this bead's files and was still present minutes later with edits continuing. Files changed for this bead, uncommitted in the tree: internal/app/archied/control_plane.go, internal/app/archiegateway/server.go, internal/app/archiegateway/gateway_runtime.go (plus .16's internal/app/controlplane/operational_settings.go and two ui files).
sam added a new dependency 2026-11-14 14:45:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#69