observability: backup-recent-events — backups' RecentEvents(window) — a projection over records the seam already exposes #828

Closed
opened 2026-08-25 10:59:56 +00:00 by matou-build-agent · 2 comments

Parent

Feature spec: #796 — control-panel observability child spec: activity feed (P12) (DDR 0206).
Design ticket #763; slice-map fan-in #770; wayfinder map #7.
Slice backup-recent-events of docs/slices/observability.yaml; covers spec #796 stories 54–61 (backups face).

What to build

The backups face: run outcome per target (verified / target failed / failed), a dataset going
stale
, restore started / verified / failed partway, and export taken — from the run
ledger, the restore records and the export log (DDR 0083).

A projection over records the seam already exposes, not new bookkeeping. No new table, file,
stream or collector.

The owner's own words ride each event verbatim (e.g. "Nightly run verified — 2 of 2 targets"),
the owner's own problem flag marks the failures and the staleness, the operation-log handle is
carried only where backups genuinely has one, and the drill-in is backups' own (Runs &
verification for that dataset).

Acceptance criteria

  • (story 56) Given the run ledger, restore records and export log (DDR 0083), when RecentEvents(window) is called, then it derives per-target run outcomes (verified / target failed / failed), datasets going stale, restore started / verified / failed partway, and exports taken — and no new table, file, stream or collector is created.
  • (story 8) Given a run event whose ledger recorded "Nightly run verified — 2 of 2 targets", then the event carries that text verbatim — no sentence is composed and no outcome re-derived.
  • (story 19) Given a failed run, a failed target or a dataset going stale, then the owner's problem flag is set on the event — the surface applies no classification of its own.
  • (stories 29–30) Given an event whose owner genuinely has an operation-log handle, then it is carried; and given one whose owner has none, then no handle is fabricated.
  • (story 32) Given a backups-run event, then its drill-in intent is backups' own (Runs & verification for that dataset).
  • (story 56) Given the window bound, then only events inside it are returned.
  • (stories 45, 47) Given any operator-triggered retry or export, then the event carries no actor and no person subject.

Blocked by

  • #824 — observability:activity-ops-event-contract
  • backups:scheduled-runs-and-verification (#88 — done, satisfied)
  • backups:restore-in-place-replaces (#91 — done, satisfied)
  • backups:export-sovereignty-valve (#93 — done, satisfied)

Task manifest

task: observability:backup-recent-events
interface: backups gain an additive `RecentEvents(window)` face returning typed ops events for per-target
  run outcomes, dataset staleness, restore started/verified/failed-partway and exports taken — a projection
  over the run ledger, restore records and export log the seam already exposes
seam: 'the backups package''s own tests (prior art `run_test.go`, `pertarget_test.go`): each event kind
  derived for a window; the ledger''s words carried verbatim; the problem flag set on failures and staleness;
  log handles carried only where held; the window bound honoured; no actor emitted'
acceptance:
- given: a nightly run that verified 2 of 2 targets
  when: '`RecentEvents(window)` is called'
  then: the event returns carrying the ledger's words verbatim
- given: a run in which one target failed
  when: '`RecentEvents(window)` is called'
  then: a per-target failure event returns with the owner's problem flag set
- given: a dataset that went stale
  when: '`RecentEvents(window)` is called'
  then: the staleness event returns flagged as a problem by the owner
- given: a restore that failed partway and an export taken
  when: '`RecentEvents(window)` is called'
  then: both return with backups' own words and drill-in intents
- given: an event whose owner holds no operation-log handle
  when: the event is derived
  then: no handle is fabricated
depends_on:
- activity-ops-event-contract
- backups:scheduled-runs-and-verification
- backups:restore-in-place-replaces
- backups:export-sovereignty-valve
out_of_scope:
- new bookkeeping of any kind — this is a projection over existing records
- the read-composition and route (`transport-activity-read`)
- any lever — no retry-the-run from the feed
- durable history beyond what the run ledger, restore records and export log already keep
needs_human_decision: []

Emitted by /to-tickets over docs/slices/observability.yaml in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #797.

## Parent Feature spec: **#796** — control-panel observability child spec: activity feed (P12) (DDR 0206). Design ticket #763; slice-map fan-in **#770**; wayfinder map #7. Slice `backup-recent-events` of `docs/slices/observability.yaml`; covers spec #796 stories 54–61 (backups face). ## What to build The backups face: run outcome **per target** (verified / target failed / failed), a dataset **going stale**, restore **started / verified / failed partway**, and **export taken** — from the run ledger, the restore records and the export log (DDR 0083). **A projection over records the seam already exposes, not new bookkeeping.** No new table, file, stream or collector. The owner's own words ride each event verbatim (e.g. *"Nightly run verified — 2 of 2 targets"*), the owner's own problem flag marks the failures and the staleness, the operation-log handle is carried only where backups genuinely has one, and the drill-in is backups' own (Runs & verification for that dataset). ## Acceptance criteria - [ ] (story 56) Given the run ledger, restore records and export log (DDR 0083), when `RecentEvents(window)` is called, then it derives per-target run outcomes (verified / target failed / failed), datasets going stale, restore started / verified / failed partway, and exports taken — and **no new table, file, stream or collector is created**. - [ ] (story 8) Given a run event whose ledger recorded *"Nightly run verified — 2 of 2 targets"*, then the event carries that text **verbatim** — no sentence is composed and no outcome re-derived. - [ ] (story 19) Given a failed run, a failed target or a dataset going stale, then the owner's **problem flag** is set on the event — the surface applies no classification of its own. - [ ] (stories 29–30) Given an event whose owner genuinely has an operation-log handle, then it is carried; and given one whose owner has none, then **no handle is fabricated**. - [ ] (story 32) Given a backups-run event, then its drill-in intent is backups' own (Runs & verification for that dataset). - [ ] (story 56) Given the window bound, then only events inside it are returned. - [ ] (stories 45, 47) Given any operator-triggered retry or export, then the event carries **no actor** and no person subject. ## Blocked by - #824 — `observability:activity-ops-event-contract` - `backups:scheduled-runs-and-verification` (#88 — done, satisfied) - `backups:restore-in-place-replaces` (#91 — done, satisfied) - `backups:export-sovereignty-valve` (#93 — done, satisfied) ## Task manifest ```yaml task: observability:backup-recent-events interface: backups gain an additive `RecentEvents(window)` face returning typed ops events for per-target run outcomes, dataset staleness, restore started/verified/failed-partway and exports taken — a projection over the run ledger, restore records and export log the seam already exposes seam: 'the backups package''s own tests (prior art `run_test.go`, `pertarget_test.go`): each event kind derived for a window; the ledger''s words carried verbatim; the problem flag set on failures and staleness; log handles carried only where held; the window bound honoured; no actor emitted' acceptance: - given: a nightly run that verified 2 of 2 targets when: '`RecentEvents(window)` is called' then: the event returns carrying the ledger's words verbatim - given: a run in which one target failed when: '`RecentEvents(window)` is called' then: a per-target failure event returns with the owner's problem flag set - given: a dataset that went stale when: '`RecentEvents(window)` is called' then: the staleness event returns flagged as a problem by the owner - given: a restore that failed partway and an export taken when: '`RecentEvents(window)` is called' then: both return with backups' own words and drill-in intents - given: an event whose owner holds no operation-log handle when: the event is derived then: no handle is fabricated depends_on: - activity-ops-event-contract - backups:scheduled-runs-and-verification - backups:restore-in-place-replaces - backups:export-sovereignty-valve out_of_scope: - new bookkeeping of any kind — this is a projection over existing records - the read-composition and route (`transport-activity-read`) - any lever — no retry-the-run from the feed - durable history beyond what the run ledger, restore records and export log already keep needs_human_decision: [] ``` --- *Emitted by `/to-tickets` over `docs/slices/observability.yaml` in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #797.*
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=10071
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=10071 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #828 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 828,
  "status": "success",
  "commits": [
    "77a9910"
  ],
  "changed_files": [
    "internal/backup/recentevents.go",
    "internal/backup/recentevents_test.go",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/backup/ ./internal/opsevent/",
      "exit_code": 0
    },
    {
      "command": "go test ./...",
      "exit_code": 0
    },
    {
      "command": "gofmt -l internal/backup/recentevents.go internal/backup/recentevents_test.go",
      "exit_code": 0
    }
  ],
  "criteria": {
    "story 56 — RecentEvents derives per-target run outcomes, staleness, restore started/verified/failed-partway, exports taken; no new store": "internal/backup/recentevents.go RecentEvents(ctx,win) fans over run ledger (runEvents), staleFault (staleEvent) and the audit operation log (operationEvents) — no new table/file/stream/collector; TestRecentEvents_* seam cases",
    "story 8 — a run ledger recorded verbatim carried, no sentence composed, no outcome re-derived": "verifiedRunWords composes backups' own headline owner-side; TestRecentEvents_VerifiedRunCarriesLedgerWordsVerbatim asserts Words == 'Nightly run verified — 2 of 2 targets'",
    "story 19 — failed run / failed target / stale dataset set the owner's problem flag": "runEvents sets Problem on RunPartial per-target failures and verification/snapshot failures; staleEvent sets Problem; TestRecentEvents_PerTargetFailureCarriesProblemFlag + TestRecentEvents_StalenessIsAProblemWithNoHandle",
    "stories 29-30 — operation-log handle carried where held, not fabricated": "operationEvents carries LogRef=e.ID from the audit entry; run/stale events carry none; TestRecentEvents_RestoreAndExportFromTheOperationLog + TestRecentEvents_NoAuditSinkStillDerivesLedgerEvents",
    "story 32 — a backups-run event's drill-in is backups' own (Runs & verification for that dataset)": "runsDrillIn{Label:'Runs & verification', Target:'backups', Ref:datasetID}; TestRecentEvents_VerifiedRunCarriesLedgerWordsVerbatim asserts DrillIn",
    "story 56 — window bound honoured": "every derivation guards win.Contains(...); TestRecentEvents_WindowBoundHonoured",
    "stories 45,47 — operator-triggered retry or export carries no actor and no person subject": "OpsEvent has no actor field; operationEvents never reads e.Actor; subject is always opsevent.Dataset; TestRecentEvents_RestoreAndExportFromTheOperationLog asserts no operator name in words and a dataset subject"
  },
  "summary": "Backups gains an additive RecentEvents(window) face deriving typed ops events from the run ledger, the audit operation log and the standing staleness fault — a projection with no new bookkeeping.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #828 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 828, "status": "success", "commits": [ "77a9910" ], "changed_files": [ "internal/backup/recentevents.go", "internal/backup/recentevents_test.go", "STATUS.md" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/backup/ ./internal/opsevent/", "exit_code": 0 }, { "command": "go test ./...", "exit_code": 0 }, { "command": "gofmt -l internal/backup/recentevents.go internal/backup/recentevents_test.go", "exit_code": 0 } ], "criteria": { "story 56 — RecentEvents derives per-target run outcomes, staleness, restore started/verified/failed-partway, exports taken; no new store": "internal/backup/recentevents.go RecentEvents(ctx,win) fans over run ledger (runEvents), staleFault (staleEvent) and the audit operation log (operationEvents) — no new table/file/stream/collector; TestRecentEvents_* seam cases", "story 8 — a run ledger recorded verbatim carried, no sentence composed, no outcome re-derived": "verifiedRunWords composes backups' own headline owner-side; TestRecentEvents_VerifiedRunCarriesLedgerWordsVerbatim asserts Words == 'Nightly run verified — 2 of 2 targets'", "story 19 — failed run / failed target / stale dataset set the owner's problem flag": "runEvents sets Problem on RunPartial per-target failures and verification/snapshot failures; staleEvent sets Problem; TestRecentEvents_PerTargetFailureCarriesProblemFlag + TestRecentEvents_StalenessIsAProblemWithNoHandle", "stories 29-30 — operation-log handle carried where held, not fabricated": "operationEvents carries LogRef=e.ID from the audit entry; run/stale events carry none; TestRecentEvents_RestoreAndExportFromTheOperationLog + TestRecentEvents_NoAuditSinkStillDerivesLedgerEvents", "story 32 — a backups-run event's drill-in is backups' own (Runs & verification for that dataset)": "runsDrillIn{Label:'Runs & verification', Target:'backups', Ref:datasetID}; TestRecentEvents_VerifiedRunCarriesLedgerWordsVerbatim asserts DrillIn", "story 56 — window bound honoured": "every derivation guards win.Contains(...); TestRecentEvents_WindowBoundHonoured", "stories 45,47 — operator-triggered retry or export carries no actor and no person subject": "OpsEvent has no actor field; operationEvents never reads e.Actor; subject is always opsevent.Dataset; TestRecentEvents_RestoreAndExportFromTheOperationLog asserts no operator name in words and a dataset subject" }, "summary": "Backups gains an additive RecentEvents(window) face deriving typed ops events from the run ledger, the audit operation log and the standing staleness fault — a projection with no new bookkeeping.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#828
No description provided.