@catalyst-cloud/schema 0.1.19 → 0.1.20
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 +1 -1
- package/src/events/registry.ts +7 -12
- package/src/events/retention.ts +13 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@catalyst-cloud/schema",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
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",
|
package/src/events/registry.ts
CHANGED
|
@@ -1600,6 +1600,13 @@ export const durableEventTypes = {
|
|
|
1600
1600
|
wakes: false,
|
|
1601
1601
|
entity: "ticket",
|
|
1602
1602
|
},
|
|
1603
|
+
"relay.phase.completed": {
|
|
1604
|
+
rationale:
|
|
1605
|
+
"CTC-985 — a relay-done.json receipt materialized a phase completion in the tenant DO's own relay_phase_state. ADR-0039 durable-fact example ('a phase started, completed, failed, or was preempted'), and the one fact that can create NEW eligible work for a ticket, so the dispatcher cohort must wake on it the same way fence.claimed and phase.dispatch.requested already do.",
|
|
1606
|
+
ingestVerb: "artifacts.event",
|
|
1607
|
+
wakes: { consumerClass: "dispatcher" },
|
|
1608
|
+
entity: "ticket",
|
|
1609
|
+
},
|
|
1603
1610
|
"session.ended": {
|
|
1604
1611
|
rationale: "An agent session ended — a real lifecycle boundary fact.",
|
|
1605
1612
|
ingestVerb: "coordination.publish",
|
|
@@ -1937,10 +1944,6 @@ export const telemetryEventTypes = {
|
|
|
1937
1944
|
reason:
|
|
1938
1945
|
"Part of the recovery.skipped.* family: The bare fallback skip marker with no reason suffix (1 line) — same family.",
|
|
1939
1946
|
},
|
|
1940
|
-
"recovery.skipped.already-shipped-pr-3750-merged-head-matches-origin-main": {
|
|
1941
|
-
reason:
|
|
1942
|
-
"Part of the recovery.skipped.* family: Same free-text-reason-in-type defect as the pr-1071 sibling, for a different PR — flagged for phase-3.",
|
|
1943
|
-
},
|
|
1944
1947
|
"recovery.skipped.artifact-not-gate-visible": {
|
|
1945
1948
|
reason:
|
|
1946
1949
|
"Part of the recovery.skipped.* family: A recurring pre-condition check ('is the artifact visible to the gate yet') re-logged on every sweep pass until it resolves — 14,710 lines/mo.",
|
|
@@ -1965,10 +1968,6 @@ export const telemetryEventTypes = {
|
|
|
1965
1968
|
reason:
|
|
1966
1969
|
"Part of the recovery.skipped.* family: A recurring pre-condition check re-logged every sweep pass — 14,699 lines/mo.",
|
|
1967
1970
|
},
|
|
1968
|
-
"recovery.skipped.pr-1071-blocked-by-a-pre-existing-repo-wide-ci-failure-on-main-n": {
|
|
1969
|
-
reason:
|
|
1970
|
-
"Part of the recovery.skipped.* family: ⚠️ The clearest evidence of the family's defect: a full free-text incident explanation baked directly into the event NAME (confirmed against the raw log line) and re-logged 3,960 times for one PR. This is a producer bug flagged for the phase-3 inventory — the reason belongs in payload, never in `type`.",
|
|
1971
|
-
},
|
|
1972
1971
|
"recovery.skipped.prior-artifact-missing": {
|
|
1973
1972
|
reason:
|
|
1974
1973
|
"Part of the recovery.skipped.* family: A recurring pre-condition check re-logged every sweep pass — 35,141 lines/mo, the largest of the skip-reason family.",
|
|
@@ -1977,10 +1976,6 @@ export const telemetryEventTypes = {
|
|
|
1977
1976
|
reason:
|
|
1978
1977
|
"Part of the recovery.skipped.* family: A recurring pre-condition check re-logged every sweep pass — 28,906 lines/mo.",
|
|
1979
1978
|
},
|
|
1980
|
-
"recovery.skipped.source-conflict-ctl708-unavailable": {
|
|
1981
|
-
reason:
|
|
1982
|
-
"Part of the recovery.skipped.* family: Same free-text-reason-in-type defect, embedding a specific ticket's conflict detail in the type — flagged for phase-3.",
|
|
1983
|
-
},
|
|
1984
1979
|
"recovery.skipped.ticket-already-merged-pipeline-regressed": {
|
|
1985
1980
|
reason:
|
|
1986
1981
|
"Part of the recovery.skipped.* family: A recurring pre-condition check re-logged every sweep pass — 14,868 lines/mo.",
|
package/src/events/retention.ts
CHANGED
|
@@ -76,7 +76,19 @@ export function eventArchiveKey(coords: EventArchiveCoords): string {
|
|
|
76
76
|
// is well-formed. Re-deriving the yyyy-mm-dd prefix from the parsed Date and requiring it to match
|
|
77
77
|
// the input's own date prefix rejects that rollover instead of misfiling into a wrong partition.
|
|
78
78
|
const roundTripDatePrefix = occurredAt.slice(0, 10);
|
|
79
|
-
|
|
79
|
+
// Codex P2 (PR #1250): derive the parsed prefix in the TIMESTAMP'S OWN offset, not UTC — a
|
|
80
|
+
// valid instant like 2026-08-24T23:30:00-02:00 is already Aug 25 in UTC, so a UTC comparison
|
|
81
|
+
// rejects a well-formed date the regex deliberately accepts. The rollover check still fires:
|
|
82
|
+
// an out-of-range date (2026-02-30) rolls forward and lands on a different calendar date in
|
|
83
|
+
// ANY fixed offset.
|
|
84
|
+
const offsetMatch = /(?:Z|([+-])(\d{2}):(\d{2}))$/.exec(occurredAt);
|
|
85
|
+
const offsetMs =
|
|
86
|
+
offsetMatch && offsetMatch[1]
|
|
87
|
+
? (offsetMatch[1] === "-" ? -1 : 1) *
|
|
88
|
+
(Number(offsetMatch[2]) * 3600 + Number(offsetMatch[3]) * 60) *
|
|
89
|
+
1000
|
|
90
|
+
: 0;
|
|
91
|
+
const parsedDatePrefix = new Date(occurredAtMs + offsetMs).toISOString().slice(0, 10);
|
|
80
92
|
if (roundTripDatePrefix !== parsedDatePrefix) {
|
|
81
93
|
throw new Error(
|
|
82
94
|
`eventArchiveKey: occurredAt ${JSON.stringify(occurredAt)} is not a valid date`,
|