Skip to content

feat(pm-stack): agg_views shared-schema contract (#1744 Move 1 step 2) - #16978

Merged
developing-today-fleet[bot] merged 7 commits into
mainfrom
archer/1452e-1744-agg-views-schema
Nov 29, 2026
Merged

developing-today-fleet[bot] merged 7 commits into
mainfrom
archer/1452e-1744-agg-views-schema

Conversation

@developing-today-fleet

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

Copy link
Copy Markdown
Contributor

What

The third bounded slice of #1744 (Move 1, step 2, third store), following the #6103 / shared_comments / roadmap-annotations pattern (PR #16975): the P1 schema contract for the views store — views.json → public.agg_views.

  • migrations/20261129_0002_agg_views.up.sql — typed columns for every SavedView field (mirroring aggregator/src/views.ts): name (trimmed, ≤120), owner key, filters as a non-empty jsonb object (known-key/value-shape validation stays at the application boundary, per the agg_actions payload precedent), is_default, both timestamps. The store's two cross-row invariants become database indexes: unique name per owner in trimmed case-insensitive form (lower(name), the store's normalizedViewName form) and at most one default per owner (partial unique index). RLS enabled; mutable-store grants (SELECT, INSERT, UPDATE, DELETE — views are renamed, re-defaulted and deleted, unlike append-only annotations).
  • Paired .down.sql refuses to drop a non-empty table.
  • golden/20261129_0002_agg_views.sqlite.sql — Turso translation hand-derived by the translator's documented rules from constructs already pinned by earlier goldens; exercised against a disposable SQLite store (duplicate case-variant name, second default, and empty filters all refused).
  • test-migration.sh + test_turso_migrations.py — apply order, grants, constraint probes, down-refusal and rollback for the new table.
  • README + migration plan updated; P1's remaining contract scope no longer names views.

Scope guard

Schema-only: no rows copied, no reader/writer cutover, views.json remains the only live backend and the rollback target. #1744 acceptance criterion 3 is untouched.

Refs #1744. Lane 1452-E (bravo SUSTAIN).

{
  "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:17:47Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch/hatch-personal",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch/hatch-personal",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "ae82d850793a5b05b88f64050ab030b49349f8d9"
    },
    "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.

…ep 2)

pm-stack/shared-schema/migrations/20261129_0002_agg_views.up.sql
…ep 2)

pm-stack/shared-schema/migrations/20261129_0002_agg_views.down.sql
…ep 2)

pm-stack/shared-schema/golden/20261129_0002_agg_views.sqlite.sql
…ep 2)

pm-stack/SHARED-SCHEMA-MIGRATION-PLAN.md
…ep 2)

pm-stack/shared-schema/test-migration.sh
…ep 2)

pm-stack/shared-schema/test_turso_migrations.py
@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: 10d607f4-1db0-4dad-9118-a54670fec688

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

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