Lanes page reads the database, and the in-memory Lane state is deleted #145
Reference in New Issue
Block a user
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?
Parent
Spec #134.
What to build
The Lanes page starts answering the question thirty seconds after a deploy, and the in-memory Lane state that could not is removed in the same change. One row per Site: what its last pass found waiting, how many it read, its pace, and, when it did no work, the reason it declined. That reason is the whole difference between a Lane resting and a Lane stuck, and it is recorded rather than guessed.
Columns: Site, Due, Checked, Gap, Last pass, the outcomes-and-state phrase, controls. The five outcome counts render named -- the page never prints the word "failures" bare -- and a zero renders as none observed, because the wording is the honesty: the failure kind that would hurt most, an adapter parsing a wrong number successfully, is not in this taxonomy and never can be. The five counts render unlinked: the pass row holds counts and never identities, so there is no list of the four refused Series to point at. A trouble state renders danger; the one true stall (due series, none checked, no skip reason) is distinguishable from every Lane that declined and said why.
Browser reachability is a status line pinned to the section heading, not a paragraph. Browser configuration becomes "is the browser websocket URL set", read in the web layer's config -- strictly more accurate than today, since it describes the deployment rather than whether one goroutine happened to construct a fetcher. Reachability is derived: any browser Site whose latest pass carries an unreachable count inside the refusal backoff of now, which needs that backoff constant exported from the poller package.
Numerics on this table are centred rather than right-flushed, because at column width a right-flushed figure loses its header. Rows are single-line. The block keeps its own 30s timer and stays the only timer on the surface -- now a six-row primary-key read rather than a map copy.
Deleted in this ticket, atomically: the poller's Lane state map, its recorder, the Lane state and status types, the status query method, the whole status file, the in-memory refusal map left behind by the recording ticket, and the web-side Lane reporter interface with its test fake. A half-deleted twin means two sources of truth in tree, so the deletion is not staged. This reduces the test seam count: a Lanes-page test inserts a pass row instead of constructing a fake reporter.
Write the ADR for persisted Lane state and the deletion of its in-memory twin with this implementation, not before.
Acceptance criteria
go test ./...greenBlocked by
Merged into
spec-134as6f9109c(branchticket/145-lanes-from-db, commitscb2b104,fc8a40c,d72c482).The Lanes page now reads
poll_passesandpoll_lanesthroughstore.LatestLanePassesandstore.LanePassOutcomes, so Lane history survives a restart and the page renders from seeded rows with no poller present. Skip reason is distinguished from a true stall,asleepnever counts toward attention, named outcome counts render zero as a digit, and browser reachability is derived from the pass log rather than asked of the poller.The deletion is atomic in the same change:
internal/latest/status.go,LaneState,Status,LaneStatus,recordLaneState,web.LaneReporter,fakeLanesand the lane-reporter parameter onnewRouterare all gone.refuseBackoffis exported aslatest.RefuseBackoff. ADR-0012 lands with it.Review: one Critical, four Important and two Minor findings fixed across two rounds; three judgement-call Minors declined with reasons in the report.
go test ./...green on the merged base.