@catalyst-cloud/schema 0.1.21 → 0.1.22

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.21",
3
+ "version": "0.1.22",
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",
@@ -162,6 +162,28 @@ export function mayPruneHotEvent(check: HotEventPruneCheck): boolean {
162
162
  return check.archivedAt !== null && check.ageMs > EVENT_HOT_WINDOW_MS;
163
163
  }
164
164
 
165
+ // ── Session transcripts — the artifact plane's first lifecycle class (CTC-963 / ADR-0041) ─────────
166
+ //
167
+ // Transcripts are NOT events and get their OWN retention class: short default, longer
168
+ // keep-on-failure, neither inherited from event retention above nor from ADR-0036's original
169
+ // no-lifecycle default. Enforced by two operator-applied R2 lifecycle delete-age rules keyed on the
170
+ // name markers below (docs/event-backbone/retention-and-deletion.md's transcript section;
171
+ // docs/devops.md carries the exact provisioning calls). The name prefixes are imported by
172
+ // apps/mirror's transcript name grammar so route grammar and lifecycle rules share one definition.
173
+
174
+ /** A transcript whose worker reported a clean outcome is kept 30 days. */
175
+ export const TRANSCRIPT_RETENTION_OK_MS = 30 * 24 * 60 * 60 * 1000; // 30 days
176
+
177
+ /** A transcript whose worker failed/died mid-phase is kept 180 days — keep-on-failure, so a
178
+ * post-mortem is possible long after the ok-class copies have expired. */
179
+ export const TRANSCRIPT_RETENTION_FAIL_MS = 180 * 24 * 60 * 60 * 1000; // 180 days
180
+
181
+ /** The name marker a clean-outcome transcript carries in its final key segment. */
182
+ export const TRANSCRIPT_OK_NAME_PREFIX = "transcript-ok-";
183
+
184
+ /** The name marker a failed/crashed-outcome transcript carries in its final key segment. */
185
+ export const TRANSCRIPT_FAIL_NAME_PREFIX = "transcript-fail-";
186
+
165
187
  /** Bump when the projection's slot ASSIGNMENT changes (a field moves position, or the slot count
166
188
  * changes); additive-at-the-end changes to a slot's semantic meaning still bump, because AE has no
167
189
  * schema to enforce it and a silent reinterpretation of an existing blob/double is the failure mode