@substrat-run/kernel 0.116.0 → 0.118.0

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.
Files changed (64) hide show
  1. package/dist/capability.d.ts +220 -0
  2. package/dist/capability.d.ts.map +1 -0
  3. package/dist/capability.js +537 -0
  4. package/dist/capability.js.map +1 -0
  5. package/dist/check-key.d.ts +30 -0
  6. package/dist/check-key.d.ts.map +1 -0
  7. package/dist/check-key.js +37 -0
  8. package/dist/check-key.js.map +1 -0
  9. package/dist/denial-query.d.ts +32 -1
  10. package/dist/denial-query.d.ts.map +1 -1
  11. package/dist/denial-query.js +66 -28
  12. package/dist/denial-query.js.map +1 -1
  13. package/dist/index.d.ts +20 -5
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +15 -4
  16. package/dist/index.js.map +1 -1
  17. package/dist/job-run.d.ts +28 -0
  18. package/dist/job-run.d.ts.map +1 -1
  19. package/dist/job-run.js +37 -0
  20. package/dist/job-run.js.map +1 -1
  21. package/dist/outbox-event.d.ts +131 -0
  22. package/dist/outbox-event.d.ts.map +1 -0
  23. package/dist/outbox-event.js +185 -0
  24. package/dist/outbox-event.js.map +1 -0
  25. package/dist/permission-checker.d.ts +8 -1
  26. package/dist/permission-checker.d.ts.map +1 -1
  27. package/dist/permission-checker.js +18 -0
  28. package/dist/permission-checker.js.map +1 -1
  29. package/dist/permission-eval.d.ts +8 -0
  30. package/dist/permission-eval.d.ts.map +1 -1
  31. package/dist/permission-eval.js +164 -91
  32. package/dist/permission-eval.js.map +1 -1
  33. package/dist/platform-request-query.d.ts +58 -1
  34. package/dist/platform-request-query.d.ts.map +1 -1
  35. package/dist/platform-request-query.js +61 -1
  36. package/dist/platform-request-query.js.map +1 -1
  37. package/dist/platform-sweep.d.ts +123 -8
  38. package/dist/platform-sweep.d.ts.map +1 -1
  39. package/dist/platform-sweep.js +158 -34
  40. package/dist/platform-sweep.js.map +1 -1
  41. package/dist/row-decode.d.ts +107 -0
  42. package/dist/row-decode.d.ts.map +1 -0
  43. package/dist/row-decode.js +93 -0
  44. package/dist/row-decode.js.map +1 -0
  45. package/dist/scope-host.d.ts +211 -9
  46. package/dist/scope-host.d.ts.map +1 -1
  47. package/dist/scope-host.js +33 -0
  48. package/dist/scope-host.js.map +1 -1
  49. package/dist/scope-tuple-seat.d.ts +72 -0
  50. package/dist/scope-tuple-seat.d.ts.map +1 -0
  51. package/dist/scope-tuple-seat.js +93 -0
  52. package/dist/scope-tuple-seat.js.map +1 -0
  53. package/dist/subject-redaction.d.ts +273 -0
  54. package/dist/subject-redaction.d.ts.map +1 -0
  55. package/dist/subject-redaction.js +362 -0
  56. package/dist/subject-redaction.js.map +1 -0
  57. package/dist/system-switch.d.ts +108 -0
  58. package/dist/system-switch.d.ts.map +1 -0
  59. package/dist/system-switch.js +145 -0
  60. package/dist/system-switch.js.map +1 -0
  61. package/dist/timeline.d.ts.map +1 -1
  62. package/dist/timeline.js +109 -57
  63. package/dist/timeline.js.map +1 -1
  64. package/package.json +2 -2
@@ -0,0 +1,108 @@
1
+ /**
2
+ * The schedule kill switch (#1666), shared by both adapters so the gate that decides
3
+ * whether a module's schedules run and the lever that moves it cannot disagree.
4
+ *
5
+ * A scope runs a module's schedules only while it holds a live `system:<module>` grant
6
+ * (#383) — "the grant IS the switch". That sentence was true of the gate and had no
7
+ * lever: nothing could revoke the grant. This file is the lever, and it has to be more
8
+ * than a revoke, for two reasons found while building it:
9
+ *
10
+ * 1. **A reconcile seats grants.** Since #1659 a reconcile leaves a revoked grant revoked,
11
+ * but it still CREATES a missing one. A vertical whose next version declares a schedule
12
+ * with a new permission gets that grant seated live on every install — and a gate that
13
+ * reads "any live grant" is open again, on a scope an operator switched off.
14
+ * 2. **An explicit grant clears a tombstone.** `grantToSystem` is `INSERT OR REPLACE` by
15
+ * design (#1659's re-grant guarantee), so a stray grant of one permission would bring
16
+ * that tuple back — and with it, under the old gate, the whole module.
17
+ *
18
+ * So the OFF position is a tuple of its own: a live `system:<module>` / `switch:off` /
19
+ * `scope:<id>` marker. The gate is OFF while that marker is live, whatever grants are
20
+ * live beside it. **Restore is the lever; a grant is not.** The marker is an ordinary
21
+ * K-21 tuple: switching back on tombstones it, so the row stays as evidence of when the
22
+ * switch was last pulled. The permission walk reads only `role:` and `granted:` relations
23
+ * (`permission-eval.ts`), so the marker authorizes nothing and denies nothing by itself.
24
+ *
25
+ * Switching off ALSO tombstones every live `granted:` tuple the module holds on the scope.
26
+ * That is what makes it a kill switch rather than a schedule pause: anything that acts
27
+ * with the module's system authority — a resumable job run (#1577), a `getSystemScope`
28
+ * invoke — is denied by its own `ctx.check` while the switch is off.
29
+ *
30
+ * **And nothing may write a new one while it is off**, which is what makes that denial
31
+ * hold. The checker is deliberately NOT marker-aware; the switch is closed on the WRITE
32
+ * side instead, at the only two writers of a scope-level `system:` grant:
33
+ * - `grantToSystem` refuses while the module is switched off on that scope (the adapters
34
+ * ask `systemSwitchedOff` in the same unit as the write);
35
+ * - provisioning's seat (`seatScopeTuple`) seats nothing for a subject whose marker is
36
+ * live, so a reconcile cannot create a grant a newer version declares.
37
+ *
38
+ * **Restore returns exactly what OFF took, never more.** Each grant OFF tombstones gets a
39
+ * `switched:<permission>` record, live for as long as the switch holds it. ON restores
40
+ * only grants with a live record, then tombstones the records — so a grant that was
41
+ * revoked independently BEFORE the switch was pulled stays revoked through OFF and ON.
42
+ *
43
+ * Params and results are plain SQL over `_substrat_tuples`, run through `SwitchSql`,
44
+ * which each adapter implements over its own handle inside one transaction.
45
+ */
46
+ /** The relation of the OFF marker. Not `granted:` and not `role:`, so no check reads it. */
47
+ export declare const SYSTEM_SWITCH_OFF_RELATION = "switch:off";
48
+ /** The two statement shapes the switch needs, over either adapter's SQLite handle. */
49
+ export interface SwitchSql {
50
+ all(sql: string, ...params: (string | null)[]): Record<string, unknown>[];
51
+ run(sql: string, ...params: (string | null)[]): void;
52
+ }
53
+ /**
54
+ * Where one module's schedules stand on one scope.
55
+ *
56
+ * - `on`: a live grant and no live OFF marker — due schedules fire.
57
+ * - `off`: a live OFF marker. The schedules do not fire, and each is reported `skipped`
58
+ * with `switchedOff: true` — the sweep reached the scope and chose not to run, which
59
+ * is not the same fact as a sweep that never reached it.
60
+ * - `ungranted`: no live grant and no marker. A foreign vertical's scope on a CP-full host
61
+ * (the module is registered and this scope never ran it), or a grant removed by a raw
62
+ * write. Quiet, exactly as before the switch existed: no run, no skip, no error.
63
+ */
64
+ export type SystemScheduleState = 'on' | 'off' | 'ungranted';
65
+ /**
66
+ * "Is this subject's OFF marker live?", as a SQL predicate over ONE bound parameter (the
67
+ * subject). The one spelling the gate, the grant refusal and the provisioning seat share,
68
+ * so the three cannot disagree about what "switched off" means.
69
+ */
70
+ export declare const SYSTEM_SWITCH_OFF_PREDICATE = "EXISTS (SELECT 1 FROM _substrat_tuples\n WHERE subject = ? AND relation = 'switch:off' AND revoked_at IS NULL)";
71
+ /**
72
+ * The gate, one statement: is the OFF marker live, and is any `granted:` tuple live?
73
+ * `substr` rather than `LIKE`: `LIKE` is case-insensitive in SQLite and a Durable
74
+ * Object caps its patterns (#1655); an exact prefix compare is neither.
75
+ */
76
+ export declare function systemScheduleState(db: SwitchSql, moduleId: string, now: string): SystemScheduleState;
77
+ /** Is this module switched off on the scope `db` is? What `grantToSystem` refuses on. */
78
+ export declare function systemSwitchedOff(db: SwitchSql, moduleId: string): boolean;
79
+ /** The refusal `grantToSystem` throws while the switch is off — one wording, both adapters. */
80
+ export declare function systemSwitchedOffMessage(moduleId: string, scopeId: string): string;
81
+ /** What one switch call did in the scope's own storage — `SystemSwitchOutcome`'s shape. */
82
+ export interface SwitchOutcome {
83
+ held: boolean;
84
+ changed: boolean;
85
+ permissions: string[];
86
+ }
87
+ /**
88
+ * Move one module's switch on one scope. Idempotent: a repeat changes nothing and says so.
89
+ *
90
+ * OFF tombstones every live `granted:` tuple the module holds at `scope:<id>`, records each
91
+ * as `switched:<permission>`, and makes the marker live. ON un-tombstones exactly the
92
+ * grants with a live `switched:` record, tombstones those records, and tombstones the
93
+ * marker. A repeated OFF re-asserts the whole position: a grant that became live meanwhile
94
+ * (only a raw write can do that now) is tombstoned and recorded too.
95
+ *
96
+ * `held: false`, with nothing written, when the scope holds neither a grant nor a marker
97
+ * for the module: the caller named something this scope never ran, and turning "nothing"
98
+ * off must not write a marker that silently disables a module the day it is installed.
99
+ *
100
+ * Run it inside one transaction; the reads and writes here are meant to be one unit.
101
+ */
102
+ export declare function switchSystemSchedules(db: SwitchSql, input: {
103
+ moduleId: string;
104
+ scopeId: string;
105
+ to: 'on' | 'off';
106
+ at: string;
107
+ }): SwitchOutcome;
108
+ //# sourceMappingURL=system-switch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-switch.d.ts","sourceRoot":"","sources":["../src/system-switch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,4FAA4F;AAC5F,eAAO,MAAM,0BAA0B,eAAe,CAAC;AAKvD,sFAAsF;AACtF,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAC1E,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC;CACtD;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,KAAK,GAAG,WAAW,CAAC;AAI7D;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,oHACmD,CAAC;AAE5F;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAcrG;AAED,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK1E;AAED,+FAA+F;AAC/F,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAMlF;AAED,2FAA2F;AAC3F,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,SAAS,EACb,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,IAAI,GAAG,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACzE,aAAa,CA4Ff"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * The schedule kill switch (#1666), shared by both adapters so the gate that decides
3
+ * whether a module's schedules run and the lever that moves it cannot disagree.
4
+ *
5
+ * A scope runs a module's schedules only while it holds a live `system:<module>` grant
6
+ * (#383) — "the grant IS the switch". That sentence was true of the gate and had no
7
+ * lever: nothing could revoke the grant. This file is the lever, and it has to be more
8
+ * than a revoke, for two reasons found while building it:
9
+ *
10
+ * 1. **A reconcile seats grants.** Since #1659 a reconcile leaves a revoked grant revoked,
11
+ * but it still CREATES a missing one. A vertical whose next version declares a schedule
12
+ * with a new permission gets that grant seated live on every install — and a gate that
13
+ * reads "any live grant" is open again, on a scope an operator switched off.
14
+ * 2. **An explicit grant clears a tombstone.** `grantToSystem` is `INSERT OR REPLACE` by
15
+ * design (#1659's re-grant guarantee), so a stray grant of one permission would bring
16
+ * that tuple back — and with it, under the old gate, the whole module.
17
+ *
18
+ * So the OFF position is a tuple of its own: a live `system:<module>` / `switch:off` /
19
+ * `scope:<id>` marker. The gate is OFF while that marker is live, whatever grants are
20
+ * live beside it. **Restore is the lever; a grant is not.** The marker is an ordinary
21
+ * K-21 tuple: switching back on tombstones it, so the row stays as evidence of when the
22
+ * switch was last pulled. The permission walk reads only `role:` and `granted:` relations
23
+ * (`permission-eval.ts`), so the marker authorizes nothing and denies nothing by itself.
24
+ *
25
+ * Switching off ALSO tombstones every live `granted:` tuple the module holds on the scope.
26
+ * That is what makes it a kill switch rather than a schedule pause: anything that acts
27
+ * with the module's system authority — a resumable job run (#1577), a `getSystemScope`
28
+ * invoke — is denied by its own `ctx.check` while the switch is off.
29
+ *
30
+ * **And nothing may write a new one while it is off**, which is what makes that denial
31
+ * hold. The checker is deliberately NOT marker-aware; the switch is closed on the WRITE
32
+ * side instead, at the only two writers of a scope-level `system:` grant:
33
+ * - `grantToSystem` refuses while the module is switched off on that scope (the adapters
34
+ * ask `systemSwitchedOff` in the same unit as the write);
35
+ * - provisioning's seat (`seatScopeTuple`) seats nothing for a subject whose marker is
36
+ * live, so a reconcile cannot create a grant a newer version declares.
37
+ *
38
+ * **Restore returns exactly what OFF took, never more.** Each grant OFF tombstones gets a
39
+ * `switched:<permission>` record, live for as long as the switch holds it. ON restores
40
+ * only grants with a live record, then tombstones the records — so a grant that was
41
+ * revoked independently BEFORE the switch was pulled stays revoked through OFF and ON.
42
+ *
43
+ * Params and results are plain SQL over `_substrat_tuples`, run through `SwitchSql`,
44
+ * which each adapter implements over its own handle inside one transaction.
45
+ */
46
+ /** The relation of the OFF marker. Not `granted:` and not `role:`, so no check reads it. */
47
+ export const SYSTEM_SWITCH_OFF_RELATION = 'switch:off';
48
+ /** `switched:<permission>` — "the switch revoked this grant, and ON gives it back". */
49
+ const SWITCHED_PREFIX = 'switched:';
50
+ const subjectOf = (moduleId) => `system:${moduleId}`;
51
+ /**
52
+ * "Is this subject's OFF marker live?", as a SQL predicate over ONE bound parameter (the
53
+ * subject). The one spelling the gate, the grant refusal and the provisioning seat share,
54
+ * so the three cannot disagree about what "switched off" means.
55
+ */
56
+ export const SYSTEM_SWITCH_OFF_PREDICATE = `EXISTS (SELECT 1 FROM _substrat_tuples
57
+ WHERE subject = ? AND relation = '${SYSTEM_SWITCH_OFF_RELATION}' AND revoked_at IS NULL)`;
58
+ /**
59
+ * The gate, one statement: is the OFF marker live, and is any `granted:` tuple live?
60
+ * `substr` rather than `LIKE`: `LIKE` is case-insensitive in SQLite and a Durable
61
+ * Object caps its patterns (#1655); an exact prefix compare is neither.
62
+ */
63
+ export function systemScheduleState(db, moduleId, now) {
64
+ const subject = subjectOf(moduleId);
65
+ const row = db.all(`SELECT
66
+ ${SYSTEM_SWITCH_OFF_PREDICATE} AS off,
67
+ EXISTS (SELECT 1 FROM _substrat_tuples
68
+ WHERE subject = ? AND substr(relation, 1, 8) = 'granted:'
69
+ AND revoked_at IS NULL AND (expires_at IS NULL OR expires_at > ?)) AS granted`, subject, subject, now)[0];
70
+ if (Number(row?.off) === 1)
71
+ return 'off';
72
+ return Number(row?.granted) === 1 ? 'on' : 'ungranted';
73
+ }
74
+ /** Is this module switched off on the scope `db` is? What `grantToSystem` refuses on. */
75
+ export function systemSwitchedOff(db, moduleId) {
76
+ const row = db.all(`SELECT ${SYSTEM_SWITCH_OFF_PREDICATE} AS off`, subjectOf(moduleId))[0];
77
+ return Number(row?.off) === 1;
78
+ }
79
+ /** The refusal `grantToSystem` throws while the switch is off — one wording, both adapters. */
80
+ export function systemSwitchedOffMessage(moduleId, scopeId) {
81
+ return (`module '${moduleId}' is switched off on scope ${scopeId} (#1666) — restore it first ` +
82
+ `(restoreToSystem). A grant is not the lever: granting while it is off would hand the ` +
83
+ `module's system authority back to anything but its schedules.`);
84
+ }
85
+ /**
86
+ * Move one module's switch on one scope. Idempotent: a repeat changes nothing and says so.
87
+ *
88
+ * OFF tombstones every live `granted:` tuple the module holds at `scope:<id>`, records each
89
+ * as `switched:<permission>`, and makes the marker live. ON un-tombstones exactly the
90
+ * grants with a live `switched:` record, tombstones those records, and tombstones the
91
+ * marker. A repeated OFF re-asserts the whole position: a grant that became live meanwhile
92
+ * (only a raw write can do that now) is tombstoned and recorded too.
93
+ *
94
+ * `held: false`, with nothing written, when the scope holds neither a grant nor a marker
95
+ * for the module: the caller named something this scope never ran, and turning "nothing"
96
+ * off must not write a marker that silently disables a module the day it is installed.
97
+ *
98
+ * Run it inside one transaction; the reads and writes here are meant to be one unit.
99
+ */
100
+ export function switchSystemSchedules(db, input) {
101
+ const subject = subjectOf(input.moduleId);
102
+ const object = `scope:${input.scopeId}`;
103
+ const grants = db.all(`SELECT relation, revoked_at FROM _substrat_tuples
104
+ WHERE subject = ? AND object = ? AND substr(relation, 1, 8) = 'granted:'
105
+ ORDER BY relation`, subject, object);
106
+ const marker = db.all(`SELECT revoked_at FROM _substrat_tuples WHERE subject = ? AND relation = ? AND object = ?`, subject, SYSTEM_SWITCH_OFF_RELATION, object)[0];
107
+ if (grants.length === 0 && !marker)
108
+ return { held: false, changed: false, permissions: [] };
109
+ const permissionOf = (relation) => relation.slice('granted:'.length);
110
+ if (input.to === 'off') {
111
+ const live = grants.filter((g) => g.revoked_at === null).map((g) => permissionOf(g.relation));
112
+ for (const permission of live) {
113
+ db.run(`UPDATE _substrat_tuples SET revoked_at = ? WHERE subject = ? AND relation = ? AND object = ?`, input.at, subject, `granted:${permission}`, object);
114
+ // What ON may give back — and nothing else. INSERT OR REPLACE, so a record a past
115
+ // OFF/ON cycle left tombstoned is live again for this one.
116
+ db.run(`INSERT OR REPLACE INTO _substrat_tuples (subject, relation, object, expires_at, revoked_at)
117
+ VALUES (?, ?, ?, NULL, NULL)`, subject, `${SWITCHED_PREFIX}${permission}`, object);
118
+ }
119
+ const markerMoved = !marker || marker.revoked_at !== null;
120
+ if (markerMoved) {
121
+ db.run(`INSERT OR REPLACE INTO _substrat_tuples (subject, relation, object, expires_at, revoked_at)
122
+ VALUES (?, ?, ?, NULL, NULL)`, subject, SYSTEM_SWITCH_OFF_RELATION, object);
123
+ }
124
+ return { held: true, changed: markerMoved || live.length > 0, permissions: live };
125
+ }
126
+ const records = db.all(`SELECT relation FROM _substrat_tuples
127
+ WHERE subject = ? AND object = ? AND substr(relation, 1, 9) = ? AND revoked_at IS NULL
128
+ ORDER BY relation`, subject, object, SWITCHED_PREFIX);
129
+ const restored = [];
130
+ for (const { relation } of records) {
131
+ const permission = relation.slice(SWITCHED_PREFIX.length);
132
+ const revoked = grants.find((g) => g.relation === `granted:${permission}` && g.revoked_at !== null);
133
+ if (revoked) {
134
+ db.run(`UPDATE _substrat_tuples SET revoked_at = NULL WHERE subject = ? AND relation = ? AND object = ?`, subject, `granted:${permission}`, object);
135
+ restored.push(permission);
136
+ }
137
+ db.run(`UPDATE _substrat_tuples SET revoked_at = ? WHERE subject = ? AND relation = ? AND object = ?`, input.at, subject, relation, object);
138
+ }
139
+ const markerMoved = marker !== undefined && marker.revoked_at === null;
140
+ if (markerMoved) {
141
+ db.run(`UPDATE _substrat_tuples SET revoked_at = ? WHERE subject = ? AND relation = ? AND object = ?`, input.at, subject, SYSTEM_SWITCH_OFF_RELATION, object);
142
+ }
143
+ return { held: true, changed: markerMoved || restored.length > 0, permissions: restored };
144
+ }
145
+ //# sourceMappingURL=system-switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-switch.js","sourceRoot":"","sources":["../src/system-switch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,0BAA0B,GAAG,YAAY,CAAC;AAEvD,uFAAuF;AACvF,MAAM,eAAe,GAAG,WAAW,CAAC;AAqBpC,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,UAAU,QAAQ,EAAE,CAAC;AAErE;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG;sCACL,0BAA0B,2BAA2B,CAAC;AAE5F;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAa,EAAE,Q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ACnB,MAAM,EAAE,SAAS,EACjB,IAAI,CAAC,EAAE,QAAQ,GACd,IAAI,CAAC,YAAY,CAAC,CAKpB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,cAAc,EACnB,OAAO,EAAE,OAAO,EAChB,QAAQ,SAAK,GACZ,UAAU,CA+CZ;AAkDD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,cAAc,EACnB,OAAO,EAAE,OAAO,EAChB,QAAQ,SAAK,GACZ,WAAW,CAoFb;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,cAAc,EACnB,YAAY,EAAE,MAAM,EACpB,KAAK,SAAM,GACV,gBAAgB,CAOlB;AA+DD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CA4BhH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAqEzF"}
package/dist/timeline.js CHANGED
@@ -1,4 +1,5 @@
1
- import { listLimitOf, pageOf, } from '@substrat-run/contracts';
1
+ import { deadLetter, eventDelivery, historyEntry, listLimitOf, pageOf, timelineEntry, } from '@substrat-run/contracts';
2
+ import { rowDecoder, UNDECODED_ACTOR } from './row-decode.js';
2
3
  /** The envelope columns, in the order `mapTimelineRow` expects. */
3
4
  const TIMELINE_COLUMNS = 'id, type, occurred_at, actor';
4
5
  /** …plus what a history VIEW needs. See `historyEntry` for why two are nullable. */
@@ -26,58 +27,75 @@ function timelineQuery(columns, entity, page, limit) {
26
27
  };
27
28
  }
28
29
  /**
29
- * Decode the stored actor.
30
+ * The envelope fields, decoded — the part a timeline and a history entry share.
30
31
  *
31
- * Both adapters write `JSON.stringify(actor)` over a union whose first member is
32
- * a bare `PrincipalId` STRING, so a principal is stored as `"01J…"` — quotes
33
- * included — while a system or connector actor is stored as an object. That is the trap this whole helper exists to close: the
34
- * column reads as usable and is not, and a caller resolving a name against the
35
- * raw text misses every time.
32
+ * `actor` is the reason this layer exists at all (#800). Both adapters write
33
+ * `JSON.stringify(actor)` over a union whose first member is a bare `PrincipalId`
34
+ * STRING, so a principal is stored as `"01J…"` — quotes included — while a system or
35
+ * connector actor is stored as an object. The column reads as usable and is not, and a
36
+ * caller resolving a name against the raw text misses every time.
36
37
  *
37
- * Cast rather than re-parsed, the way `mapDenialRow` treats the same encoding:
38
- * the kernel is the only writer of this column, so a Zod pass per row would buy
39
- * nothing but cost the walk.
38
+ * Decoded against the contract rather than cast (#1636): a cast of text that would not
39
+ * parse threw out of the whole page, and a cast of text that parsed into something that
40
+ * is not an actor handed the caller a value typed as one. See `rowDecoder` for what
41
+ * comes back instead, and why a required scalar still throws.
40
42
  */
41
- function actorOf(stored) {
42
- return JSON.parse(stored);
43
- }
44
- function mapTimelineRow(row) {
43
+ function envelopeOf(d, row) {
44
+ const shape = timelineEntry.shape;
45
45
  return {
46
- id: row.id,
47
- type: row.type,
48
- occurredAt: row.occurred_at,
49
- actor: actorOf(row.actor),
46
+ id: d.required('id', shape.id, row.id),
47
+ type: d.required('type', shape.type, row.type),
48
+ occurredAt: d.required('occurred_at', shape.occurredAt, row.occurred_at),
49
+ actor: d.json('actor', shape.actor, row.actor, UNDECODED_ACTOR),
50
50
  };
51
51
  }
52
- function mapHistoryRow(row) {
53
- return {
54
- ...mapTimelineRow(row),
52
+ function mapTimelineRow(row) {
53
+ const d = rowDecoder(`outbox row ${JSON.stringify(row.id)}`, 'TimelineEntry');
54
+ return d.finish(envelopeOf(d, row));
55
+ }
56
+ /**
57
+ * A history row, decoded — and which of its columns did not decode, for the one caller
58
+ * whose logic reads a column rather than rendering it (`walkEventCause`, where an
59
+ * undecodable cause must not read as a null one).
60
+ */
61
+ function decodeHistoryRow(row) {
62
+ const shape = historyEntry.shape;
63
+ const d = rowDecoder(`outbox row ${JSON.stringify(row.id)}`, 'HistoryEntry');
64
+ const entry = d.finish({
65
+ ...envelopeOf(d, row),
55
66
  // Null is a FACT here, twice over, and the two are different facts: a null
56
67
  // payload is an erasure (§5.3 kept the envelope and destroyed what was
57
- // said), a null authorization is a row written before K-34 recorded it.
58
- payload: row.payload === null ? null : JSON.parse(row.payload),
59
- authorization: row.authorization === null ? null : JSON.parse(row.authorization),
68
+ // said), a null authorization is a row written before K-34 recorded it. A
69
+ // column that did not DECODE also reads null — and `decodeError` names it,
70
+ // which is the only thing that keeps an unreadable payload from reading as an
71
+ // erased one (#1636).
72
+ payload: d.json('payload', shape.payload, row.payload, null),
73
+ authorization: d.json('authorization', shape.authorization, row.authorization, null),
60
74
  // K-42, and its null is a THIRD kind of fact: nobody was impersonating. The
61
75
  // ordinary case, not an absence of recording — the kernel stamps this on
62
76
  // every event raised under a session and on no other.
63
- impersonation: row.impersonation === null ? null : JSON.parse(row.impersonation),
64
- piiClass: row.pii_class,
65
- subjectId: row.subject_id,
77
+ impersonation: d.json('impersonation', shape.impersonation, row.impersonation, null),
78
+ piiClass: d.required('pii_class', shape.piiClass, row.pii_class),
79
+ subjectId: d.nullable('subject_id', shape.subjectId, row.subject_id ?? null),
66
80
  // #1231, and the one null that is honestly TWO facts at once: a consumer
67
81
  // emit ran on behalf of no operation, and a pre-column row is unrecorded.
68
82
  // historyEntry's doc owns that ambiguity; this mapper just carries it.
69
- operation: row.operation,
83
+ operation: d.nullable('operation', shape.operation, row.operation ?? null),
70
84
  // #1242: from the column, never the envelope — historyEntry's doc owns why.
71
- version: row.version,
85
+ version: d.nullable('version', shape.version, row.version ?? null),
72
86
  // #1237: the event this one reacted to. Null means nothing was being
73
87
  // delivered, or the row predates the column — historyEntry's doc owns the
74
88
  // distinction, and the pair (operation null + this set) is what finally
75
89
  // identifies a consumer emit, which neither field could do alone.
76
- causedBy: row.caused_by,
90
+ causedBy: d.nullable('caused_by', shape.causedBy, row.caused_by ?? null),
77
91
  // #1237: which CALL this event belongs to — what groups an invocation's events,
78
92
  // and joins them to the log line that knows its duration.
79
- invocationId: row.invocation_id,
80
- };
93
+ invocationId: d.nullable('invocation_id', shape.invocationId, row.invocation_id ?? null),
94
+ });
95
+ return { entry, failed: d.failed };
96
+ }
97
+ function mapHistoryRow(row) {
98
+ return decodeHistoryRow(row).entry;
81
99
  }
82
100
  /**
83
101
  * An entity's timeline — WHAT happened to it, WHEN, and BY WHOM.
@@ -172,8 +190,16 @@ export function walkEventCause(ctx, eventId, maxDepth = 25) {
172
190
  // pass either off as a complete chain.
173
191
  return { chain, terminal: 'missing' };
174
192
  }
175
- const entry = mapHistoryRow(row);
193
+ const { entry, failed } = decodeHistoryRow(row);
176
194
  chain.push(entry);
195
+ // #1636: a cause that did not DECODE is not a null cause. Read as one, a row with an
196
+ // operation would end the walk as 'operation' — a complete chain — when the trail
197
+ // above it was simply unreadable. The same goes for an unreadable operation beside a
198
+ // null cause, which is exactly the column that decides between the two endings.
199
+ // Either way the honest ending is the one that says the trail cannot be followed.
200
+ if (failed.has('caused_by') || (entry.causedBy === null && failed.has('operation'))) {
201
+ return { chain, terminal: 'missing' };
202
+ }
177
203
  if (entry.causedBy === null) {
178
204
  // THE distinction. An operation emitted this: the chain is whole. Neither an
179
205
  // operation nor a cause: something emitted it before causes were recorded, and
@@ -199,19 +225,26 @@ export function walkEventCause(ctx, eventId, maxDepth = 25) {
199
225
  * So: pending → retrying, else an error → dead, else delivered.
200
226
  */
201
227
  function deliveryOf(row) {
202
- const state = row.next_attempt_at !== null ? 'retrying' : row.error !== null ? 'dead' : 'delivered';
203
- return {
204
- consumer: row.consumer_module,
228
+ const shape = eventDelivery.shape;
229
+ const d = rowDecoder(`delivery row ${JSON.stringify(row.consumer_module)}`, 'valid EventDelivery');
230
+ // From the STORED columns, and `!= null` rather than a truthiness test: an empty `error`
231
+ // is a delivery that gave up with no message, not one that did not give up (#1643).
232
+ const state = row.next_attempt_at != null ? 'retrying' : row.error != null ? 'dead' : 'delivered';
233
+ return d.finish({
234
+ consumer: d.required('consumer_module', shape.consumer, row.consumer_module),
205
235
  state,
206
- at: row.delivered_at,
207
- error: row.error,
208
- attempts: row.attempts,
236
+ at: d.required('delivered_at', shape.at, row.delivered_at),
237
+ error: d.nullable('error', shape.error, row.error ?? null),
238
+ // The one this fix is for (#1643): `attempts` was cast, so a stored `-1`, `1.5` or `'many'`
239
+ // (INTEGER affinity keeps text it cannot convert) reached a caller typed as a
240
+ // non-negative integer. A required scalar with no honest empty value, so it throws.
241
+ attempts: d.required('attempts', shape.attempts, row.attempts),
209
242
  // #1525: which CALL made the attempt `at` dates — the join the event's own
210
243
  // invocation cannot make, because a retry runs in a later call or in none.
211
244
  // `?? null` rather than a bare read, for the row a legacy store hands back
212
245
  // with the column absent.
213
- invocationId: row.invocation_id ?? null,
214
- };
246
+ invocationId: d.nullable('invocation_id', shape.invocationId, row.invocation_id ?? null),
247
+ });
215
248
  }
216
249
  /**
217
250
  * Walk forward from one event: what it set off (#1237).
@@ -325,6 +358,40 @@ export function readInvocation(ctx, invocationId, limit = 200) {
325
358
  }
326
359
  /** What joins the two halves of a dead-letter cursor. The first half is a ULID, so it never holds one. */
327
360
  const DEAD_LETTER_CURSOR_SEPARATOR = '|';
361
+ /**
362
+ * One dead-letter row, decoded against the published `deadLetter` schema (#1643).
363
+ *
364
+ * The four casts this replaces (`eventId`, `occurredAt`, `consumer`, `at`) plus the
365
+ * unchecked `attempts` typed the row as a `DeadLetter` without asking it. Now every field
366
+ * is parsed by its own contract field, on `rowDecoder`'s rules: the two invocation ids are
367
+ * nullable columns and read `null` beside a `decodeError`; every other column is a required
368
+ * scalar with no honest empty value, so a row that breaks one throws, naming them — rather
369
+ * than being returned typed as valid. The cursor is built from the decoded values, so a
370
+ * page can never hand out a cursor its own schema would refuse.
371
+ */
372
+ function deadLetterOf(r) {
373
+ const shape = deadLetter.shape;
374
+ const d = rowDecoder(`dead-letter row ${JSON.stringify(r.event_id)}/${JSON.stringify(r.consumer_module)}`, 'DeadLetter');
375
+ return d.finish({
376
+ eventId: d.required('event_id', shape.eventId, r.event_id),
377
+ eventType: d.required('type', shape.eventType, r.type),
378
+ occurredAt: d.required('occurred_at', shape.occurredAt, r.occurred_at),
379
+ entity: d.required('entity_type/entity_id', shape.entity, {
380
+ entityType: r.entity_type,
381
+ entityId: r.entity_id,
382
+ }),
383
+ invocationId: d.nullable('invocation_id', shape.invocationId, r.invocation_id ?? null),
384
+ // #1525: the call the LAST attempt ran in, which for these rows is the one that
385
+ // gave up. Usually not the event's: an executor's first attempt runs in the emitting
386
+ // call's tail and every retry after it in a drain, so a delivery that exhausted its
387
+ // attempts most often names a later call or none at all.
388
+ attemptInvocationId: d.nullable('attempt_invocation_id', shape.attemptInvocationId, r.attempt_invocation_id ?? null),
389
+ consumer: d.required('consumer_module', shape.consumer, r.consumer_module),
390
+ at: d.required('delivered_at', shape.at, r.delivered_at),
391
+ error: d.required('error', shape.error, r.error),
392
+ attempts: d.required('attempts', shape.attempts, r.attempts),
393
+ });
394
+ }
328
395
  /**
329
396
  * Every delivery in the scope that gave up (#1525), newest event first.
330
397
  *
@@ -368,22 +435,7 @@ export function readDeadLetters(ctx, page) {
368
435
  WHERE d.error IS NOT NULL AND d.next_attempt_at IS NULL${after}
369
436
  ORDER BY d.event_id DESC, d.consumer_module DESC
370
437
  LIMIT ?`, params);
371
- const entries = rows.map((r) => ({
372
- eventId: r.event_id,
373
- eventType: r.type,
374
- occurredAt: r.occurred_at,
375
- entity: { entityType: r.entity_type, entityId: r.entity_id },
376
- invocationId: r.invocation_id,
377
- // #1525: the call the LAST attempt ran in, which for these rows is the one that
378
- // gave up. Usually not the event's: an executor's first attempt runs in the
379
- // emitting call's tail and every retry after it in a drain, so a delivery that
380
- // exhausted its attempts most often names a later call or none at all.
381
- attemptInvocationId: r.attempt_invocation_id ?? null,
382
- consumer: r.consumer_module,
383
- at: r.delivered_at,
384
- error: r.error,
385
- attempts: r.attempts,
386
- }));
438
+ const entries = rows.map(deadLetterOf);
387
439
  return pageOf(entries, limit, (e) => `${e.eventId}${DEAD_LETTER_CURSOR_SEPARATOR}${e.consumer}`);
388
440
  }
389
441
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"timeline.js","sourceRoot":"","sources":["../src/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,MAAM,GAwBP,MAAM,yBAAyB,CAAC;AAiEjC,mEAAmE;AACnE,MAAM,gBAAgB,GAAG,8BAA8B,CAAC;AACxD,oFAAoF;AACpF,MAAM,eAAe,GAAG,GAAG,gBAAgB,8GAA8G,CAAC;AAqB1J;;;;;;;;;GASG;AACH,SAAS,aAAa,CACpB,OAAe,EACf,MAAiB,EACjB,IAA0B,EAC1B,KAAa;IAEb,MAAM,IAAI,GAAG,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC;IACpC,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC;IAC5B,OAAO;QACL,GAAG,EACD,UAAU,OAAO,gEAAgE;YACjF,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;YAClE,gBAAgB,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,UAAU;QACjD,MAAM,EACJ,MAAM,KAAK,SAAS;YAClB,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC;YAC7C,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC;KAC1D,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG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,KAAK,GAAG,CAAC,CAAC,CACnD,CAAC;IACF,oFAAoF;IACpF,oFAAoF;IACpF,oFAAoF;IACpF,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAC5F,MAAM;QACN,KAAK;QACL,SAAS,EAAE,IAAI,CAAC,MAAM,GAAG,KAAK;KAC/B,CAAC;AACJ,CAAC;AAED,wFAAwF;AACxF,MAAM,eAAe,GAA2B;IAC9C,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,WAAW;IACrB,+EAA+E;IAC/E,kFAAkF;IAClF,UAAU,EAAE,eAAe;CAC5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@substrat-run/kernel",
3
- "version": "0.116.0",
3
+ "version": "0.118.0",
4
4
  "description": "Substrat kernel contracts and services — pure TypeScript, no platform imports (D-14)",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@substrat-run/contracts": "^0.116.0"
25
+ "@substrat-run/contracts": "^0.118.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.0.0",