Skip to content

pm-stack send ledger: stamp sent_at on write and repair legacy rows (slice of #14061) #14419

Backlog

Description

@dezren39

Refs #14061
Parent tracking: #14158

Scope

Legacy send-ledger repair for pm-stack notifications: all 269 rows in the AlertsStore ledger are excluded by sendTimestamp (pm-stack/aggregator/src/notifications.ts), so the measurement page reports no sends.

Root cause (verified on main)

AlertsStore.logSend (pm-stack/aggregator/src/alerts.ts) inserts (class, object_ref, incident_id, outcome) with no timestamp; the send time falls back to the created_at column default, which does not parse.

Work

  1. Stamp sent_at explicitly in the writer (ISO-8601 UTC).
  2. Make the reader accept the format the live rows actually carry, or backfill sent_at for recoverable legacy rows.
  3. Alarm when excluded rows equal total rows.

Done check

A test that writes a send through logSend and reads it back through sendTimestamp, plus a test that an undated row triggers the alarm.

Owned paths: pm-stack/aggregator/src/alerts.ts, pm-stack/aggregator/src/notifications.ts, and their tests.
Coordinate with #14084 (PM push unification), which owns the unified ledger.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T14:32:00Z",
    "session_id": "ses_e5df224b130ffeIqO7mTfWJNik",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/code",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/code",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "6fd30c93b62a4b6fba19e6444c7d69f343fb93a1"
    },
    "auth_subject": "oc-code-08",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Acceptance criteria

  • AlertsStore.logSend stamps sent_at explicitly in ISO-8601 UTC on every new ledger row.
  • The reader accepts the stamped format, and the measurement page reports sends for rows written after the change.
  • Legacy rows (the 269 rows named in the scope) are repaired or explicitly excluded with the reason recorded.
  • Tests cover the writer stamping and the reader parsing, and the pm-stack suite stays green.

Activity

  1. developing-today commented on Nov 24, 2026

    @developing-today
    Contributor
  2. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    Contributor

    Intake review

    Fleet monitor intake pass (protocol section 5), 2026-11-24.

  3. added
    app/pm-stack
    priority/normal
    effort/s
    status/needs-triage
    meta/enriched
    on Nov 24, 2026
  4. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Progress (xaltha lane, 2026-11-24): PR #14574 open — #14574

    Slice landed: logSend stamps sent_at (ISO-8601 UTC) on every row; reader normalizes the legacy column-default timestamp format and repairLegacySendRow backfills sent_at for recoverable legacy rows (unrecoverable rows stay excluded, counted as undated, reason shown on the notifications page); roll-up gains total + alarm (excluded == total) and the page renders an ALARM banner in that case. Tests cover the logSend→sendTimestamp round-trip, legacy normalization/backfill, and the all-undated alarm.

    Verification: remote only — fleet queue dispatch is blocked by TLS defect #13185, so the fleet-command workflow fallback is running bun test test/notifications.test.ts on branch xaltha/14419-send-ledger-sent-at: https://github.com/developing-today/fleet/actions/runs/45474489791 (in progress at note time; result will be followed up here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackeffort/skind/enhancementmeta/enrichedpriority/normalstatus/needs-triagestatus:in-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions