@catalyst-cloud/schema 0.1.27 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@catalyst-cloud/schema",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "type": "module",
5
5
  "description": "Typed Drizzle schema = single source of truth for the per-tenant Mirror DO SQLite store (CTC-13 / ADR-0002). Shared by the mirror Worker, the host-sync replica, and the browser OPFS replica.",
6
6
  "license": "MIT",
@@ -235,6 +235,13 @@ export const MIRROR_MIGRATIONS = {
235
235
  tag: "0031_ctc851_comment_parent_backfill",
236
236
  breakpoints: true,
237
237
  },
238
+ {
239
+ idx: 32,
240
+ version: "6",
241
+ when: 1788057508383,
242
+ tag: "0032_elite_donald_blake",
243
+ breakpoints: true,
244
+ },
238
245
  ],
239
246
  },
240
247
  migrations: {
@@ -299,5 +306,7 @@ export const MIRROR_MIGRATIONS = {
299
306
  "ALTER TABLE `comments` ADD `parent_type` text;--> statement-breakpoint\nALTER TABLE `comments` ADD `parent_entity_id` text;--> statement-breakpoint\nCREATE INDEX `idx_comments_parent` ON `comments` (`parent_type`,`parent_entity_id`,`removed_at`);",
300
307
  "0031_ctc851_comment_parent_backfill":
301
308
  "-- CTC-851 — backfill comment parents + quarantine the pre-fix empty-issue_id orphans.\n--\n-- 0030 adds the parent_type/parent_entity_id columns and fixes both WRITE legs (webhook normalizer +\n-- reconcile) so new/re-swept comments carry a real parent, but that alone converges only rows the\n-- reconcile re-sweeps — and it walks OPEN issues, so a non-issue comment (or a comment on a closed\n-- issue) keeps its corrupt shape forever. This backfill is what makes the CORPUS canonical rather\n-- than just the new writes.\n--\n-- ⭐ Deliberately a DATA migration in the SHARED bundle (the 0014 pattern): the DO and every host /\n-- OPFS replica apply the same MIRROR_MIGRATIONS through the same runner, so each side repairs its OWN\n-- rows locally. That converges every replica WITHOUT emitting a change_log delta per row (migrations\n-- bypass appendChange), so no ring-buffer flood (the CTC-279 concern).\n--\n-- (a) Healthy rows (a real issue_id) → parent_type='issue', parent_entity_id=issue_id.\n-- (b) Orphans (issue_id empty-string — the measured shape — or NULL, defensively) cannot be repaired\n-- from row data: the replica comments table has no `raw` column and no parent signal beyond the\n-- comment-reply parent_id. A pure in-bundle DML migration cannot call Linear, so it QUARANTINES\n-- them: parent_type='unresolved', issue_id nulled — MARKED with a stated reason, never deleted\n-- (the AC explicitly permits quarantine-with-reason). CTC-851 measured 54 such rows live.\n--\n-- Idempotent by the `parent_type IS NULL` guard: once a row is stamped it is skipped on replay, so a\n-- crash between a statement succeeding and its tag being recorded (execReplaySafe) is safe.\nUPDATE `comments`\n SET `parent_type` = 'issue', `parent_entity_id` = `issue_id`\n WHERE `parent_type` IS NULL AND `issue_id` IS NOT NULL AND `issue_id` <> '';\n--> statement-breakpoint\nUPDATE `comments`\n SET `parent_type` = 'unresolved', `issue_id` = NULL\n WHERE `parent_type` IS NULL AND (`issue_id` = '' OR `issue_id` IS NULL);\n",
309
+ "0032_elite_donald_blake":
310
+ "ALTER TABLE `issues` ADD `creator_id` text;--> statement-breakpoint\nALTER TABLE `issues` ADD `creator_name` text;--> statement-breakpoint\nALTER TABLE `issues` ADD `creator_avatar_url` text;",
302
311
  },
303
312
  } as const;
package/src/mirror.ts CHANGED
@@ -62,6 +62,10 @@ export const issues = sqliteTable(
62
62
  bot_actor_name: text("bot_actor_name"),
63
63
  bot_actor_type: text("bot_actor_type"),
64
64
  bot_actor_sub_type: text("bot_actor_sub_type"),
65
+ // CTC-867: the raiser — the Linear issue creator, inline triplet copying comments.author_*.
66
+ creator_id: text("creator_id"),
67
+ creator_name: text("creator_name"),
68
+ creator_avatar_url: text("creator_avatar_url"),
65
69
  parent_id: text("parent_id"),
66
70
  parent_identifier: text("parent_identifier"),
67
71
  // Ticket field enrichment (CTC-TICKET-FIELDS): lifecycle timestamps + due date + snooze + url +