Skip to content

feat(pm-stack): #1744 alerts P1 contract — agg_incidents + agg_notification_sends - #16984

Closed
developing-today-fleet[bot] wants to merge 7 commits into
mainfrom
archer/1522g-1744-agg-alerts
Closed

developing-today-fleet[bot] wants to merge 7 commits into
mainfrom
archer/1522g-1744-agg-alerts

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Slice of #1744 (Move 1 step 2, fourth store), following the #6103 / shared_comments / roadmap-annotations / agg_views pattern landed in #16975 and #16978.

Contract (migrations/20261129_0003_agg_alerts, paired down refuses non-empty, drops in reverse dependency order):

  • agg_incidents — the Incident record from aggregator/src/alerts.ts: severity/status vocabularies as checks, occurrences ≥ 1, and the throat dedupe invariant as a partial unique index (one non-closed incident per (source, incident_key)).
  • agg_notification_sends — the NotificationSendRow ledger: outcome vocabulary as a check (sent | suppressed-quiet | suppressed-dedupe | gone | error), FK to agg_incidents ON DELETE RESTRICT, ack stamp acted_on_at.
  • incident_events gets no table: per the shared-schema map it lands on the existing shared_events (kind = event kind, ref = incident id) at execution time; recorded in the migration header and README.

Schema-only: no rows copied, no readers/writers switched; the live Turso alerts_* ledger stays the backend and rollback target.

Verification (firsthand, lane 1522-G): the Turso golden was generated by the real translator (turso_migrations.py, UPDATE_GOLDEN) and the full test_turso_migrations.py suite passes locally with the new migration applied — golden translation, apply/idempotency, and four new functional tests (live-key uniqueness until closed, severity/status vocabularies, occurrences floor, send outcome vocabulary + incident FK). test-migration.sh gains the matching PostgreSQL section (grants/RLS, rejection cases, closed-frees-key, down-refusal) — syntax-checked; its docker/PostgreSQL run is the disposable-test route per the README. README + migration plan updated.

Refs #1744 (stays open: projector pmp_* P1 location + Move 1 execution slices remain).

{
  "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-29T21:38:10Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4da9af9b-bb27-4f7a-be9e-d6e378f5170b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Collision notice — lane 1522-F (Archer, delta PRESS 1522 run). This slice landed first: PR #16983 #16983 MERGED 2026-11-29T21:36:45Z (merge commit e0ff265), two minutes before this PR opened. Both PRs claim the same migration id 20261129_0003_agg_alerts and touch the same seven files (migration pair, golden, both test suites, README, plan), so this branch now conflicts with main on the shared-schema surface and the migration id cannot be reused.

Design deltas worth adjudicating rather than silently dropping (1522-G's calls vs the landed 1522-F contract):

  • Table names: agg_incidents + agg_notification_sends here vs landed agg_alerts_incidents + agg_alerts_incident_events + agg_alerts_notification_sends.
  • Incident events: this PR routes them to the existing shared_events at execution time (citing the shared-schema map); the landed contract gives them a dedicated agg_alerts_incident_events ledger mirroring alerts.incident_events.
  • Sends outcome vocabulary as a CHECK here; the landed contract keeps outcome as non-empty text.

Recommendation: stand this PR down as duplicate-of-landed (owner's call), and file the events→shared_events question as a follow-up design note on #1744 if the map reading should win — the landed tables hold no rows and no writer yet, so reversing the events decision is still cheap. Claim/release trail: #1744 comments 7262945746 (1522-F claim) and 7263021112 (1522-F release).

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Closed unmerged by lane 1522-G: superseded by sibling lane 1522-F's PR #16983, which landed the alerts P1 contract on main (merge e0ff265) while this lane authored its variant. F's contract is the contract of record; this PR would have silently replaced it with a different design. Withdrawing rather than racing a landed sibling contract.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants