@substrat-run/kernel 0.122.1 → 0.125.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 (45) hide show
  1. package/dist/capability.d.ts +9 -0
  2. package/dist/capability.d.ts.map +1 -1
  3. package/dist/capability.js +19 -2
  4. package/dist/capability.js.map +1 -1
  5. package/dist/index.d.ts +13 -10
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +8 -6
  8. package/dist/index.js.map +1 -1
  9. package/dist/invocation-log.d.ts +75 -1
  10. package/dist/invocation-log.d.ts.map +1 -1
  11. package/dist/invocation-log.js +56 -1
  12. package/dist/invocation-log.js.map +1 -1
  13. package/dist/module-log.d.ts +116 -0
  14. package/dist/module-log.d.ts.map +1 -0
  15. package/dist/module-log.js +147 -0
  16. package/dist/module-log.js.map +1 -0
  17. package/dist/platform-sweep.d.ts +13 -1
  18. package/dist/platform-sweep.d.ts.map +1 -1
  19. package/dist/platform-sweep.js +17 -2
  20. package/dist/platform-sweep.js.map +1 -1
  21. package/dist/scope-host.d.ts +112 -8
  22. package/dist/scope-host.d.ts.map +1 -1
  23. package/dist/scope-host.js +30 -0
  24. package/dist/scope-host.js.map +1 -1
  25. package/dist/sql-limits.d.ts +23 -1
  26. package/dist/sql-limits.d.ts.map +1 -1
  27. package/dist/sql-limits.js +50 -1
  28. package/dist/sql-limits.js.map +1 -1
  29. package/dist/system-switch-record.d.ts +57 -1
  30. package/dist/system-switch-record.d.ts.map +1 -1
  31. package/dist/system-switch-record.js +63 -0
  32. package/dist/system-switch-record.js.map +1 -1
  33. package/dist/system-switch.d.ts +27 -0
  34. package/dist/system-switch.d.ts.map +1 -1
  35. package/dist/system-switch.js +35 -3
  36. package/dist/system-switch.js.map +1 -1
  37. package/dist/timeline.d.ts +11 -0
  38. package/dist/timeline.d.ts.map +1 -1
  39. package/dist/timeline.js +27 -10
  40. package/dist/timeline.js.map +1 -1
  41. package/dist/vertical-events.d.ts +21 -0
  42. package/dist/vertical-events.d.ts.map +1 -1
  43. package/dist/vertical-events.js +35 -8
  44. package/dist/vertical-events.js.map +1 -1
  45. package/package.json +2 -2
@@ -0,0 +1,116 @@
1
+ /**
2
+ * `ctx.log` — the structured logger module code writes through (#1746, #1747).
3
+ *
4
+ * ## Why module code needs one
5
+ *
6
+ * The invocation line (`invocation-log.ts`) is the per-request record: which operation ran,
7
+ * who ran it, how it ended. A vertical's own `console.log` inside a handler carries none of
8
+ * that. It is reachable only by correlating out from the stamped line, it cannot be filtered
9
+ * by operation, and it is free text, so similar lines can only be grouped by guessing.
10
+ *
11
+ * `ctx.log` writes the line with the fields already on it — tenant, scope, operation,
12
+ * invocation, who it ran as — and with the TEMPLATE it was written from:
13
+ *
14
+ * ```ts
15
+ * ctx.log.warn('reply to {ticketId} bounced: {reason}', { ticketId, reason });
16
+ * ```
17
+ *
18
+ * The template is what makes log patterns exact (#1747). Every line written from that call
19
+ * site shares `reply to {ticketId} bounced: {reason}`, whatever the values were, so the
20
+ * Patterns view groups by an equality rather than by mining free text for similar shapes.
21
+ * That only holds while the template is a constant. A template built from values
22
+ * (`` ctx.log.info(`reply to ${id}`) ``) still logs, but every line is its own pattern.
23
+ *
24
+ * ## The fields are the host's, not the caller's
25
+ *
26
+ * Tenant, scope, operation and invocation come from the context the host built, never from
27
+ * `fields`. A caller cannot file a line under another operation, and a field named `tenantId`
28
+ * stays a field. That is the same posture as the event envelope, which the kernel stamps.
29
+ *
30
+ * ## Logging never fails the operation
31
+ *
32
+ * A log call is not part of the transaction and has no result. Anything it cannot write
33
+ * as given — an oversized value, a key it will not index, a value that is not a primitive —
34
+ * is trimmed or stringified rather than thrown, because an operation that failed over its
35
+ * own diagnostics is a worse outcome than a shortened line. For the same reason a line is
36
+ * written even when the operation later rolls back: it happened, and a failure's logs are
37
+ * the ones a reader opens the page for.
38
+ */
39
+ /** A log level. `debug` is kept, and a reader may hide it. */
40
+ export type ModuleLogLevel = 'debug' | 'info' | 'warn' | 'error';
41
+ /** A field value. Anything else is stringified on the way out. */
42
+ export type ModuleLogFieldValue = string | number | boolean | null;
43
+ /** The fields a line carries, by name. */
44
+ export type ModuleLogFields = Readonly<Record<string, ModuleLogFieldValue>>;
45
+ /** What `ctx.log` is. Each method writes one line and returns nothing. */
46
+ export interface ModuleLog {
47
+ debug(template: string, fields?: ModuleLogFields): void;
48
+ info(template: string, fields?: ModuleLogFields): void;
49
+ warn(template: string, fields?: ModuleLogFields): void;
50
+ error(template: string, fields?: ModuleLogFields): void;
51
+ }
52
+ /**
53
+ * The line `ctx.log` writes. A published contract, like `InvocationLogLine`: readers filter
54
+ * on these key names, and the log platform indexes a JSON line's top-level keys. Add
55
+ * fields; never rename one.
56
+ */
57
+ export interface ModuleLogLine {
58
+ /** Discriminator — tells this line from the invocation line and from a bare `console.log`. */
59
+ substrat: 'log';
60
+ level: ModuleLogLevel;
61
+ /** The call site's template, verbatim (bounded). Lines from one call site share it. */
62
+ template: string;
63
+ /** The template with `{name}` placeholders filled from `fields`. */
64
+ message: string;
65
+ fields: Record<string, ModuleLogFieldValue>;
66
+ tenantId: string;
67
+ scopeId: string;
68
+ /** The operation the line was written under. `null` inside a consumer, which runs on behalf of none. */
69
+ operation: string | null;
70
+ /** The invocation id (#1237) — the join to the invocation line and to the events. */
71
+ invocationId: string | null;
72
+ /** Who the code ran as: `principal`, `connection`, `system`, `capability` or `vertical`. */
73
+ principalKind: string | null;
74
+ }
75
+ /** Where a host sends a line. The default writes it to the runtime's console. */
76
+ export type ModuleLogSink = (line: ModuleLogLine) => void;
77
+ /** Bounds, so one careless call cannot write a line the log platform truncates or refuses. */
78
+ export declare const MODULE_LOG_LIMITS: {
79
+ readonly template: 500;
80
+ readonly message: 4000;
81
+ readonly fields: 32;
82
+ readonly value: 1000;
83
+ };
84
+ /**
85
+ * The default sink: one JSON line on the console method matching the level, so a platform
86
+ * that reads the level off the method agrees with the `level` field.
87
+ */
88
+ export declare const consoleLogSink: ModuleLogSink;
89
+ /**
90
+ * `{name}` placeholders filled from `fields`. A placeholder with no field is left as it
91
+ * is, so a missing value reads as missing rather than as an empty gap in the sentence.
92
+ */
93
+ export declare function renderTemplate(template: string, fields: Readonly<Record<string, ModuleLogFieldValue>>): string;
94
+ /** What the host knows about the code a logger is handed to. */
95
+ export interface ModuleLogContext {
96
+ tenantId: string;
97
+ scopeId: string;
98
+ operation: string | null;
99
+ /** Read at each call: the invocation id is set on the host for the duration of a call. */
100
+ invocationId: () => string | null;
101
+ principalKind: string | null;
102
+ /**
103
+ * #1672: redact a capability secret this invocation minted before it reaches the line.
104
+ * A log is a store read by a wider audience than the caller, so the secret is withheld
105
+ * rather than refused: refusing would fail the operation over a diagnostic.
106
+ */
107
+ redact?: (text: string) => string;
108
+ }
109
+ /** The line one call writes. Exported for the adapters' tests and for a sink that wants it. */
110
+ export declare function moduleLogLine(ctx: ModuleLogContext, level: ModuleLogLevel, template: unknown, given: unknown): ModuleLogLine;
111
+ /**
112
+ * Build `ctx.log`. Each call writes one line to `sink`; a sink that throws is swallowed,
113
+ * for the same reason nothing else here throws.
114
+ */
115
+ export declare function moduleLog(ctx: ModuleLogContext, sink?: ModuleLogSink): ModuleLog;
116
+ //# sourceMappingURL=module-log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-log.d.ts","sourceRoot":"","sources":["../src/module-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,8DAA8D;AAC9D,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjE,kEAAkE;AAClE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEnE,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAE5E,0EAA0E;AAC1E,MAAM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M,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,GAAG,MAAM,CAI9G;AAED,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0FAA0F;IAC1F,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACnC;AAED,+FAA+F;AAC/F,wBAAgB,aAAa,CAC3B,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,OAAO,GACb,aAAa,CAmCf;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,GAAE,aAA8B,GAAG,SAAS,CAShG"}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * `ctx.log` — the structured logger module code writes through (#1746, #1747).
3
+ *
4
+ * ## Why module code needs one
5
+ *
6
+ * The invocation line (`invocation-log.ts`) is the per-request record: which operation ran,
7
+ * who ran it, how it ended. A vertical's own `console.log` inside a handler carries none of
8
+ * that. It is reachable only by correlating out from the stamped line, it cannot be filtered
9
+ * by operation, and it is free text, so similar lines can only be grouped by guessing.
10
+ *
11
+ * `ctx.log` writes the line with the fields already on it — tenant, scope, operation,
12
+ * invocation, who it ran as — and with the TEMPLATE it was written from:
13
+ *
14
+ * ```ts
15
+ * ctx.log.warn('reply to {ticketId} bounced: {reason}', { ticketId, reason });
16
+ * ```
17
+ *
18
+ * The template is what makes log patterns exact (#1747). Every line written from that call
19
+ * site shares `reply to {ticketId} bounced: {reason}`, whatever the values were, so the
20
+ * Patterns view groups by an equality rather than by mining free text for similar shapes.
21
+ * That only holds while the template is a constant. A template built from values
22
+ * (`` ctx.log.info(`reply to ${id}`) ``) still logs, but every line is its own pattern.
23
+ *
24
+ * ## The fields are the host's, not the caller's
25
+ *
26
+ * Tenant, scope, operation and invocation come from the context the host built, never from
27
+ * `fields`. A caller cannot file a line under another operation, and a field named `tenantId`
28
+ * stays a field. That is the same posture as the event envelope, which the kernel stamps.
29
+ *
30
+ * ## Logging never fails the operation
31
+ *
32
+ * A log call is not part of the transaction and has no result. Anything it cannot write
33
+ * as given — an oversized value, a key it will not index, a value that is not a primitive —
34
+ * is trimmed or stringified rather than thrown, because an operation that failed over its
35
+ * own diagnostics is a worse outcome than a shortened line. For the same reason a line is
36
+ * written even when the operation later rolls back: it happened, and a failure's logs are
37
+ * the ones a reader opens the page for.
38
+ */
39
+ /** Bounds, so one careless call cannot write a line the log platform truncates or refuses. */
40
+ export const MODULE_LOG_LIMITS = {
41
+ template: 500,
42
+ message: 4000,
43
+ fields: 32,
44
+ value: 1000,
45
+ };
46
+ /** A field name the log platform indexes as it is — no dots, which would read as a path. */
47
+ const FIELD_NAME = /^[A-Za-z_][A-Za-z0-9_]{0,63}$/;
48
+ /**
49
+ * The default sink: one JSON line on the console method matching the level, so a platform
50
+ * that reads the level off the method agrees with the `level` field.
51
+ */
52
+ export const consoleLogSink = (line) => {
53
+ const text = JSON.stringify(line);
54
+ if (line.level === 'error')
55
+ console.error(text);
56
+ else if (line.level === 'warn')
57
+ console.warn(text);
58
+ else if (line.level === 'debug')
59
+ console.debug(text);
60
+ else
61
+ console.log(text);
62
+ };
63
+ function clip(text, max) {
64
+ return text.length > max ? `${text.slice(0, max - 1)}…` : text;
65
+ }
66
+ /**
67
+ * A field value as the line carries it: primitives as they are, anything else as text.
68
+ * UNBOUNDED — the caller redacts before it clips (see `moduleLogLine`).
69
+ */
70
+ function fieldValue(v) {
71
+ if (v === null || typeof v === 'boolean')
72
+ return v;
73
+ if (typeof v === 'number')
74
+ return Number.isFinite(v) ? v : String(v);
75
+ if (typeof v === 'string')
76
+ return v;
77
+ if (v === undefined)
78
+ return null;
79
+ try {
80
+ return JSON.stringify(v) ?? String(v);
81
+ }
82
+ catch {
83
+ return String(v);
84
+ }
85
+ }
86
+ /**
87
+ * `{name}` placeholders filled from `fields`. A placeholder with no field is left as it
88
+ * is, so a missing value reads as missing rather than as an empty gap in the sentence.
89
+ */
90
+ export function renderTemplate(template, fields) {
91
+ return template.replace(/\{([A-Za-z_][A-Za-z0-9_]{0,63})\}/g, (whole, name) => Object.prototype.hasOwnProperty.call(fields, name) ? String(fields[name]) : whole);
92
+ }
93
+ /** The line one call writes. Exported for the adapters' tests and for a sink that wants it. */
94
+ export function moduleLogLine(ctx, level, template, given) {
95
+ const redact = ctx.redact ?? ((t) => t);
96
+ // REDACT FIRST, THEN CLIP — every string, every time. Redaction is an exact match on the
97
+ // whole secret, so clipping first can cut a secret that straddles a limit down to all but
98
+ // its last characters, which then no longer matches and is written out. A capability
99
+ // secret missing one character is a few dozen guesses from the whole one.
100
+ const full = {};
101
+ const fields = {};
102
+ if (given !== null && typeof given === 'object') {
103
+ let n = 0;
104
+ for (const [k, v] of Object.entries(given)) {
105
+ if (n >= MODULE_LOG_LIMITS.fields)
106
+ break;
107
+ if (!FIELD_NAME.test(k))
108
+ continue;
109
+ const value = fieldValue(v);
110
+ full[k] = typeof value === 'string' ? redact(value) : value;
111
+ fields[k] = typeof full[k] === 'string' ? clip(full[k], MODULE_LOG_LIMITS.value) : full[k];
112
+ n += 1;
113
+ }
114
+ }
115
+ const fullTemplate = redact(typeof template === 'string' ? template : String(template));
116
+ // Rendered from the redacted, unclipped parts, redacted once more (a secret could be
117
+ // assembled across a placeholder), and only then bounded.
118
+ const message = clip(redact(renderTemplate(fullTemplate, full)), MODULE_LOG_LIMITS.message);
119
+ return {
120
+ substrat: 'log',
121
+ level,
122
+ template: clip(fullTemplate, MODULE_LOG_LIMITS.template),
123
+ message,
124
+ fields,
125
+ tenantId: ctx.tenantId,
126
+ scopeId: ctx.scopeId,
127
+ operation: ctx.operation,
128
+ invocationId: ctx.invocationId(),
129
+ principalKind: ctx.principalKind,
130
+ };
131
+ }
132
+ /**
133
+ * Build `ctx.log`. Each call writes one line to `sink`; a sink that throws is swallowed,
134
+ * for the same reason nothing else here throws.
135
+ */
136
+ export function moduleLog(ctx, sink = consoleLogSink) {
137
+ const write = (level) => (template, fields) => {
138
+ try {
139
+ sink(moduleLogLine(ctx, level, template, fields));
140
+ }
141
+ catch {
142
+ // A log line that could not be written is not the operation's failure.
143
+ }
144
+ };
145
+ return { debug: write('debug'), info: write('info'), warn: write('warn'), error: write('error') };
146
+ }
147
+ //# sourceMappingURL=module-log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-log.js","sourceRoot":"","sources":["../src/module-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AA8CH,8FAA8F;AAC9F,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,GAAG;IACb,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,IAAI;CACH,CAAC;AAEX,4FAA4F;AAC5F,MAAM,UAAU,GAAG,+BAA+B,CAAC;AAWnD;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAkB,CAAC,IAAI,EAAE,EAAE;IACpD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO;QAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC3C,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM;QAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC9C,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO;QAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;;QAChD,OAAO,CAAC,GAAG,CAAC,IAA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ACrF,0DAA0D;IAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC5F,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,KAAK;QACL,QAAQ,EAAE,IAAI,CAAC,YAAY,EAAE,iBAAiB,CAAC,QAAQ,CAAC;QACxD,OAAO;QACP,MAAM;QACN,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,YAAY,EAAE,GAAG,CAAC,YAAY,EAAE;QAChC,aAAa,EAAE,GAAG,CAAC,aAAa;KACjC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,GAAqB,EAAE,IAAI,GAAkB,cAAc;IACnF,MAAM,KAAK,GAAG,CAAC,KAAqB,EAAE,EAAE,CAAC,CAAC,QAAgB,EAAE,MAAwB,EAAE,EAAE;QACtF,IAAI,CAAC;YACH,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;QACpD,CAAC;QAAC,MAAM,CAAC;YACP,uEAAuE;QACzE,CAAC;IACH,CAAC,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;AACpG,CAAC"}
@@ -108,6 +108,8 @@ export interface PlatformSweepOptions {
108
108
  done: number;
109
109
  failed: number;
110
110
  pending: number;
111
+ /** No deployment could be reached for this scope, so nothing was drained or counted (#1840). */
112
+ unreachable?: boolean;
111
113
  }>;
112
114
  /**
113
115
  * Re-run one scope's provision in the vertical's own deployment (#1172).
@@ -319,7 +321,7 @@ export type ScheduleStateKind = 'schedule' | 'freshness';
319
321
  * definition is what keeps the rebuilt shape and the created shape the same shape;
320
322
  * the gate then holds each adapter to including it.
321
323
  */
322
- export declare const SCHEDULE_STATE_DDL = "\n CREATE TABLE IF NOT EXISTS _substrat_schedule_state (\n -- #1288: WHICH of the two families this row belongs to, named with the same two\n -- words _substrat_sweep_runs already records its entries under:\n -- * 'schedule' -- keyed by the operation (module/verb). last_run_at and\n -- last_status are when that operation RAN here and how it ended.\n -- * 'freshness' -- keyed freshness:<eventType> (#1232). last_run_at and\n -- last_status are when the evaluator last RECORDED a verdict for that event\n -- type and what it was. Nothing ran; the row gates what the sweep records.\n kind TEXT NOT NULL,\n schedule_op TEXT NOT NULL,\n last_run_at TEXT,\n last_status TEXT,\n -- The key LEADS with kind, and that is the point of #1288 rather than a tidy-up.\n -- Until it did, the two families were told apart by the spelling of one column:\n -- a freshness key could never LOOK like an operation (an event type has passed\n -- contracts' eventType regex -- lowercase ns.verb, no colon, no slash), but the\n -- other direction was convention only, because scheduleSpec.operation is\n -- z.string().min(1). A module declaring a schedule literally named\n -- \"freshness:orders.placed\" shared the evaluator's row and nothing refused it:\n -- each write clobbered the other's verdict, and the sweep read back whichever\n -- ran last. With kind in the key those are two rows that cannot meet.\n PRIMARY KEY (kind, schedule_op)\n );\n";
324
+ export declare const SCHEDULE_STATE_DDL = "\n CREATE TABLE IF NOT EXISTS _substrat_schedule_state (\n -- #1288: WHICH of the two families this row belongs to, named with the same two\n -- words _substrat_sweep_runs already records its entries under:\n -- * 'schedule' -- keyed by the operation (module/verb). last_run_at and\n -- last_status are when that operation RAN here and how it ended.\n -- * 'freshness' -- keyed freshness:<eventType> (#1232). last_run_at and\n -- last_status are when the evaluator last RECORDED a verdict for that event\n -- type and what it was. Nothing ran; the row gates what the sweep records.\n kind TEXT NOT NULL,\n schedule_op TEXT NOT NULL,\n last_run_at TEXT,\n last_status TEXT,\n -- #1525: the invocation this row's last run happened in, or null. Null is a fact\n -- here, not a gap: a 'freshness' row never invokes anything (the evaluator only\n -- records a verdict), a 'schedule' row a pass SKIPPED carries no fresh call to\n -- attribute and keeps whatever it already held, and a row written before this\n -- column existed predates the possibility. Only a due schedule's own invoke\n -- mints one and writes it here, in the same call that stamps it onto whatever\n -- the operation emits \u2014 see runDueSchedules in each adapter.\n invocation_id TEXT,\n -- The key LEADS with kind, and that is the point of #1288 rather than a tidy-up.\n -- Until it did, the two families were told apart by the spelling of one column:\n -- a freshness key could never LOOK like an operation (an event type has passed\n -- contracts' eventType regex -- lowercase ns.verb, no colon, no slash), but the\n -- other direction was convention only, because scheduleSpec.operation is\n -- z.string().min(1). A module declaring a schedule literally named\n -- \"freshness:orders.placed\" shared the evaluator's row and nothing refused it:\n -- each write clobbered the other's verdict, and the sweep read back whichever\n -- ran last. With kind in the key those are two rows that cannot meet.\n PRIMARY KEY (kind, schedule_op)\n );\n";
323
325
  /**
324
326
  * `_substrat_schedule_state`, rebuilt with its #1288 key on a store created before
325
327
  * it. Create-copy-drop-rename, because `kind` joins the PRIMARY KEY and SQLite
@@ -683,6 +685,16 @@ export interface PlatformRequestDrainTotals {
683
685
  failed: number;
684
686
  /** Left pending for a later drain (transient failure). */
685
687
  pending: number;
688
+ /**
689
+ * Active scopes the phase stepped over because their migration failed this pass (#1840).
690
+ * Their queues are not in the counts above.
691
+ */
692
+ skipped: number;
693
+ /**
694
+ * Active scopes whose drain reported it could reach no deployment for them (#1840) — the
695
+ * drain fn returned `unreachable: true`. Their queues are not in the counts above either.
696
+ */
697
+ unreachable: number;
686
698
  }
687
699
  /**
688
700
  * One pass of the platform's scheduled work: drain every active scope's due
@@ -1 +1 @@
1
- {"version":3,"file":"platform-sweep.d.ts","sourceRoot":"","sources":["../src/platform-sweep.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,KAAK,EACL,OAAO,EACP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MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACpE,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACnD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,2BAA2B,GACnC,qBAAqB,CAuBvB"}
@@ -29,6 +29,14 @@ export const SCHEDULE_STATE_DDL = `
29
29
  schedule_op TEXT NOT NULL,
30
30
  last_run_at TEXT,
31
31
  last_status TEXT,
32
+ -- #1525: the invocation this row's last run happened in, or null. Null is a fact
33
+ -- here, not a gap: a 'freshness' row never invokes anything (the evaluator only
34
+ -- records a verdict), a 'schedule' row a pass SKIPPED carries no fresh call to
35
+ -- attribute and keeps whatever it already held, and a row written before this
36
+ -- column existed predates the possibility. Only a due schedule's own invoke
37
+ -- mints one and writes it here, in the same call that stamps it onto whatever
38
+ -- the operation emits — see runDueSchedules in each adapter.
39
+ invocation_id TEXT,
32
40
  -- The key LEADS with kind, and that is the point of #1288 rather than a tidy-up.
33
41
  -- Until it did, the two families were told apart by the spelling of one column:
34
42
  -- a freshness key could never LOOK like an operation (an event type has passed
@@ -78,6 +86,9 @@ export const SCHEDULE_STATE_DDL = `
78
86
  export const SCHEDULE_STATE_REBUILD = `
79
87
  DROP TABLE IF EXISTS _substrat_schedule_state_new;
80
88
  ${SCHEDULE_STATE_DDL.replace('CREATE TABLE IF NOT EXISTS _substrat_schedule_state', 'CREATE TABLE _substrat_schedule_state_new')}
89
+ -- #1525: invocation_id is not in this column list, deliberately — this rebuild runs
90
+ -- only on a pre-#1288 table, which predates invocation_id too, so there is nothing
91
+ -- to copy. The new table's default (NULL) is the honest answer for every such row.
81
92
  INSERT INTO _substrat_schedule_state_new (kind, schedule_op, last_run_at, last_status)
82
93
  SELECT CASE WHEN substr(schedule_op, 1, 10) = 'freshness:' THEN 'freshness' ELSE 'schedule' END,
83
94
  schedule_op, last_run_at, last_status
@@ -216,7 +227,7 @@ export async function runPlatformSweep(host, options) {
216
227
  snapshotsReaped: 0,
217
228
  archivedScopesReaped: 0,
218
229
  tenantsReaped: 0,
219
- platformRequestTotals: { scopes: 0, drained: 0, done: 0, failed: 0, pending: 0 },
230
+ platformRequestTotals: { scopes: 0, drained: 0, done: 0, failed: 0, pending: 0, skipped: 0, unreachable: 0 },
220
231
  provisionReconcile: null,
221
232
  migrations: null,
222
233
  schedules: null,
@@ -351,10 +362,14 @@ export async function runPlatformSweep(host, options) {
351
362
  const drain = options.drainPlatformRequestsFn;
352
363
  const scopes = await host.admin.listScopes(options.actor, { status: 'active' });
353
364
  await mapBounded(scopes, concurrency, async (s) => {
354
- if (failedThisPass.has(s.id))
365
+ if (failedThisPass.has(s.id)) {
366
+ report.platformRequestTotals.skipped += 1;
355
367
  return;
368
+ }
356
369
  try {
357
370
  const r = await drain(s.tenantId, s.id);
371
+ if (r.unreachable)
372
+ report.platformRequestTotals.unreachable += 1;
358
373
  if (r.drained > 0)
359
374
  report.platformRequestTotals.scopes += 1;
360
375
  report.platformRequestTotals.drained += r.drained;