pipework 0.7.25 → 0.8.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 (139) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +18 -8
  3. package/dist/cli/commands/check.d.ts +2 -0
  4. package/dist/cli/commands/check.d.ts.map +1 -1
  5. package/dist/cli/commands/check.js +54 -11
  6. package/dist/cli/commands/check.js.map +1 -1
  7. package/dist/cli/commands/test.d.ts +1 -0
  8. package/dist/cli/commands/test.d.ts.map +1 -1
  9. package/dist/cli/commands/test.js +20 -6
  10. package/dist/cli/commands/test.js.map +1 -1
  11. package/dist/core/config/load.d.ts +6 -0
  12. package/dist/core/config/load.d.ts.map +1 -1
  13. package/dist/core/config/load.js +5 -0
  14. package/dist/core/config/load.js.map +1 -1
  15. package/dist/core/config/namespace.d.ts +5 -0
  16. package/dist/core/config/namespace.d.ts.map +1 -1
  17. package/dist/core/config/schema.d.ts +11 -0
  18. package/dist/core/config/schema.d.ts.map +1 -1
  19. package/dist/core/config/schema.js +6 -0
  20. package/dist/core/config/schema.js.map +1 -1
  21. package/dist/core/logging/redact-match.d.ts +4 -0
  22. package/dist/core/logging/redact-match.d.ts.map +1 -0
  23. package/dist/core/logging/redact-match.js +23 -0
  24. package/dist/core/logging/redact-match.js.map +1 -0
  25. package/dist/data/db/namespace.d.ts +1 -0
  26. package/dist/data/db/namespace.d.ts.map +1 -1
  27. package/dist/data/domain/build-factory.js +2 -0
  28. package/dist/data/domain/build-factory.js.map +1 -1
  29. package/dist/data/domain/build-schema.js +2 -0
  30. package/dist/data/domain/build-schema.js.map +1 -1
  31. package/dist/data/domain/build-table.d.ts.map +1 -1
  32. package/dist/data/domain/build-table.js +86 -12
  33. package/dist/data/domain/build-table.js.map +1 -1
  34. package/dist/data/domain/field.d.ts +2 -0
  35. package/dist/data/domain/field.d.ts.map +1 -1
  36. package/dist/data/domain/field.js +7 -0
  37. package/dist/data/domain/field.js.map +1 -1
  38. package/dist/data/domain/trace-safe-projection.d.ts +12 -0
  39. package/dist/data/domain/trace-safe-projection.d.ts.map +1 -0
  40. package/dist/data/domain/trace-safe-projection.js +25 -0
  41. package/dist/data/domain/trace-safe-projection.js.map +1 -0
  42. package/dist/data/domain/types.d.ts +34 -2
  43. package/dist/data/domain/types.d.ts.map +1 -1
  44. package/dist/data/migrate/diff.d.ts.map +1 -1
  45. package/dist/data/migrate/diff.js +19 -0
  46. package/dist/data/migrate/diff.js.map +1 -1
  47. package/dist/data/migrate/snapshot.d.ts +6 -0
  48. package/dist/data/migrate/snapshot.d.ts.map +1 -1
  49. package/dist/data/migrate/snapshot.js +16 -0
  50. package/dist/data/migrate/snapshot.js.map +1 -1
  51. package/dist/data/migrate/sql-emit.js +4 -1
  52. package/dist/data/migrate/sql-emit.js.map +1 -1
  53. package/dist/test/index.d.ts +1 -1
  54. package/dist/test/index.d.ts.map +1 -1
  55. package/dist/test/index.js +1 -1
  56. package/dist/test/index.js.map +1 -1
  57. package/dist/test/vitest-workspace.d.ts.map +1 -1
  58. package/dist/test/vitest-workspace.js +15 -3
  59. package/dist/test/vitest-workspace.js.map +1 -1
  60. package/dist/trace/annotation/flow-step-annotation.d.ts +51 -0
  61. package/dist/trace/annotation/flow-step-annotation.d.ts.map +1 -0
  62. package/dist/trace/annotation/flow-step-annotation.js +6 -0
  63. package/dist/trace/annotation/flow-step-annotation.js.map +1 -0
  64. package/dist/trace/annotation/parse-error.d.ts +16 -0
  65. package/dist/trace/annotation/parse-error.d.ts.map +1 -0
  66. package/dist/trace/annotation/parse-error.js +5 -0
  67. package/dist/trace/annotation/parse-error.js.map +1 -0
  68. package/dist/trace/annotation/parse.d.ts +21 -0
  69. package/dist/trace/annotation/parse.d.ts.map +1 -0
  70. package/dist/trace/annotation/parse.js +201 -0
  71. package/dist/trace/annotation/parse.js.map +1 -0
  72. package/dist/trace/capture/bounded-serializer.d.ts +21 -0
  73. package/dist/trace/capture/bounded-serializer.d.ts.map +1 -0
  74. package/dist/trace/capture/bounded-serializer.js +107 -0
  75. package/dist/trace/capture/bounded-serializer.js.map +1 -0
  76. package/dist/trace/partition/day.d.ts +7 -0
  77. package/dist/trace/partition/day.d.ts.map +1 -0
  78. package/dist/trace/partition/day.js +39 -0
  79. package/dist/trace/partition/day.js.map +1 -0
  80. package/dist/trace/partition/index.d.ts +11 -0
  81. package/dist/trace/partition/index.d.ts.map +1 -0
  82. package/dist/trace/partition/index.js +8 -0
  83. package/dist/trace/partition/index.js.map +1 -0
  84. package/dist/trace/partition/partition-name.d.ts +8 -0
  85. package/dist/trace/partition/partition-name.d.ts.map +1 -0
  86. package/dist/trace/partition/partition-name.js +23 -0
  87. package/dist/trace/partition/partition-name.js.map +1 -0
  88. package/dist/trace/partition/plan.d.ts +35 -0
  89. package/dist/trace/partition/plan.d.ts.map +1 -0
  90. package/dist/trace/partition/plan.js +39 -0
  91. package/dist/trace/partition/plan.js.map +1 -0
  92. package/dist/trace/partition/schedule.d.ts +14 -0
  93. package/dist/trace/partition/schedule.d.ts.map +1 -0
  94. package/dist/trace/partition/schedule.js +11 -0
  95. package/dist/trace/partition/schedule.js.map +1 -0
  96. package/dist/trace/partition/startup-hook.d.ts +6 -0
  97. package/dist/trace/partition/startup-hook.d.ts.map +1 -0
  98. package/dist/trace/partition/startup-hook.js +15 -0
  99. package/dist/trace/partition/startup-hook.js.map +1 -0
  100. package/dist/trace/partition/sync.d.ts +14 -0
  101. package/dist/trace/partition/sync.d.ts.map +1 -0
  102. package/dist/trace/partition/sync.js +62 -0
  103. package/dist/trace/partition/sync.js.map +1 -0
  104. package/dist/trace/partition/tables.d.ts +8 -0
  105. package/dist/trace/partition/tables.d.ts.map +1 -0
  106. package/dist/trace/partition/tables.js +16 -0
  107. package/dist/trace/partition/tables.js.map +1 -0
  108. package/dist/trace/retain/copy-on-error.d.ts +18 -0
  109. package/dist/trace/retain/copy-on-error.d.ts.map +1 -0
  110. package/dist/trace/retain/copy-on-error.js +62 -0
  111. package/dist/trace/retain/copy-on-error.js.map +1 -0
  112. package/dist/trace/schema/trace-fields.d.ts +18 -0
  113. package/dist/trace/schema/trace-fields.d.ts.map +1 -0
  114. package/dist/trace/schema/trace-fields.js +34 -0
  115. package/dist/trace/schema/trace-fields.js.map +1 -0
  116. package/dist/trace/schema/trace-retained.d.ts +18 -0
  117. package/dist/trace/schema/trace-retained.d.ts.map +1 -0
  118. package/dist/trace/schema/trace-retained.js +11 -0
  119. package/dist/trace/schema/trace-retained.js.map +1 -0
  120. package/dist/trace/schema/trace-step-fields.d.ts +15 -0
  121. package/dist/trace/schema/trace-step-fields.d.ts.map +1 -0
  122. package/dist/trace/schema/trace-step-fields.js +31 -0
  123. package/dist/trace/schema/trace-step-fields.js.map +1 -0
  124. package/dist/trace/schema/trace-step-retained.d.ts +15 -0
  125. package/dist/trace/schema/trace-step-retained.d.ts.map +1 -0
  126. package/dist/trace/schema/trace-step-retained.js +18 -0
  127. package/dist/trace/schema/trace-step-retained.js.map +1 -0
  128. package/dist/trace/schema/trace-step.d.ts +15 -0
  129. package/dist/trace/schema/trace-step.d.ts.map +1 -0
  130. package/dist/trace/schema/trace-step.js +17 -0
  131. package/dist/trace/schema/trace-step.js.map +1 -0
  132. package/dist/trace/schema/trace.d.ts +18 -0
  133. package/dist/trace/schema/trace.d.ts.map +1 -0
  134. package/dist/trace/schema/trace.js +11 -0
  135. package/dist/trace/schema/trace.js.map +1 -0
  136. package/dist/workspace/changed-files.d.ts.map +1 -1
  137. package/dist/workspace/changed-files.js +5 -1
  138. package/dist/workspace/changed-files.js.map +1 -1
  139. package/package.json +3 -3
@@ -0,0 +1,62 @@
1
+ // Copy-on-error: when a trace ends badly (error / truncated / expired), the hot
2
+ // `trace` / `trace_step` partitions it lives in will be dropped on the normal
3
+ // `hotRetentionDays` schedule. Before that happens the errored trace — and its
4
+ // ancestry spine up to the root — is copied into the cold `trace_retained` /
5
+ // `trace_step_retained` tables, which keep the longer `errorRetentionDays`
6
+ // window.
7
+ //
8
+ // Only the parent chain is followed (`parent_id`): not siblings, not the step
9
+ // tree (`parent_step_id`). The spine is what you need to read an errored trace
10
+ // in context. Each copied trace brings all of its own steps.
11
+ //
12
+ // The copy is idempotent — `ON CONFLICT DO NOTHING` against each cold table's
13
+ // composite primary key — so re-running after a crash, or copying a trace whose
14
+ // ancestor was already retained by an earlier error, is a no-op.
15
+ import { sql } from '../../data/db/sql.js';
16
+ import { quoteIdentifier } from '../../data/db/identifiers.js';
17
+ import { camelToSnake } from '../../data/domain/naming.js';
18
+ import { traceFields } from '../schema/trace-fields.js';
19
+ import { traceStepFields } from '../schema/trace-step-fields.js';
20
+ function columnList(keys, label, prefix = '') {
21
+ return keys.map(k => `${prefix}${quoteIdentifier(camelToSnake(k), label)}`).join(', ');
22
+ }
23
+ const TRACE_COLUMNS = columnList(Object.keys(traceFields), 'trace column');
24
+ const TRACE_STEP_COLUMNS = columnList(Object.keys(traceStepFields), 'trace step column');
25
+ const TRACE_STEP_COLUMNS_FROM_STEP = columnList(Object.keys(traceStepFields), 'trace step column', 's.');
26
+ /**
27
+ * Copy an errored trace and its parent spine into the cold retained tables.
28
+ *
29
+ * `traceId` is the trace that ended badly. Its ancestry is walked through
30
+ * `parent_id` to the root; every trace on that spine, plus all of their steps,
31
+ * is inserted into `trace_retained` / `trace_step_retained`. Returns the count
32
+ * of rows actually inserted — zero for both when everything was already
33
+ * retained, or when `traceId` does not exist.
34
+ */
35
+ export async function copyTraceOnError(db, traceId) {
36
+ const rows = await db.execute(sql `
37
+ WITH RECURSIVE spine AS (
38
+ SELECT * FROM "trace" WHERE "id" = ${traceId}
39
+ UNION
40
+ SELECT t.* FROM "trace" t JOIN spine ON t."id" = spine."parent_id"
41
+ ),
42
+ copied_traces AS (
43
+ INSERT INTO "trace_retained" (${sql.raw(TRACE_COLUMNS)})
44
+ SELECT ${sql.raw(TRACE_COLUMNS)} FROM spine
45
+ ON CONFLICT ("id", "opened_day") DO NOTHING
46
+ RETURNING "id"
47
+ ),
48
+ copied_steps AS (
49
+ INSERT INTO "trace_step_retained" (${sql.raw(TRACE_STEP_COLUMNS)})
50
+ SELECT ${sql.raw(TRACE_STEP_COLUMNS_FROM_STEP)}
51
+ FROM "trace_step" s JOIN spine ON s."trace_id" = spine."id"
52
+ ON CONFLICT ("id", "trace_day") DO NOTHING
53
+ RETURNING "id"
54
+ )
55
+ SELECT
56
+ (SELECT count(*) FROM copied_traces)::int AS traces,
57
+ (SELECT count(*) FROM copied_steps)::int AS steps
58
+ `);
59
+ const row = rows[0];
60
+ return { traces: row['traces'], steps: row['steps'] };
61
+ }
62
+ //# sourceMappingURL=copy-on-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-on-error.js","sourceRoot":"","sources":["../../../src/trace/retain/copy-on-error.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,2EAA2E;AAC3E,UAAU;AACV,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,6DAA6D;AAC7D,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,iEAAiE;AAEjE,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAShE,SAAS,UAAU,CAAC,IAAc,EAAE,KAAa,EAAE,MAAM,GAAG,EAAE;IAC5D,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACxF,CAAC;AAED,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,cAAc,CAAC,CAAA;AAC1E,MAAM,kBAAkB,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,mBAAmB,CAAC,CAAA;AACxF,MAAM,4BAA4B,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAA;AAExG;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EAAM,EAAE,OAAe;IAC5D,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CAAA;;2CAEQ,OAAO;;;;;sCAKZ,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC;eAC7C,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC;;;;;2CAKM,GAAG,CAAC,GAAG,CAAC,kBAAkB,CAAC;eACvD,GAAG,CAAC,GAAG,CAAC,4BAA4B,CAAC;;;;;;;;GAQjD,CAAC,CAAA;IAEF,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAE,CAAA;IACpB,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAW,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,CAAW,EAAE,CAAA;AAC3E,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const traceFields: {
2
+ id: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceId">> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceId">>;
3
+ openedDay: import("../../data/domain/types.js").FieldDescriptor<string> & import("../../data/domain/field.js").FieldModifiers<string>;
4
+ rootId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceId">> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceId">>;
5
+ parentId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceId"> | null> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceId"> | null>;
6
+ parentStepId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceStepId"> | null> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceStepId"> | null>;
7
+ entryKind: import("../../data/domain/types.js").FieldDescriptor<"test" | "http" | "job" | "cron"> & import("../../data/domain/field.js").FieldModifiers<"test" | "http" | "job" | "cron">;
8
+ status: import("../../data/domain/types.js").FieldDescriptor<"error" | "open" | "closed" | "truncated" | "expired"> & import("../../data/domain/field.js").FieldModifiers<"error" | "open" | "closed" | "truncated" | "expired">;
9
+ tenantId: import("../../data/domain/types.js").FieldDescriptor<string | null> & import("../../data/domain/field.js").FieldModifiers<string | null>;
10
+ requestId: import("../../data/domain/types.js").FieldDescriptor<string | null> & import("../../data/domain/field.js").FieldModifiers<string | null>;
11
+ sessionId: import("../../data/domain/types.js").FieldDescriptor<string | null> & import("../../data/domain/field.js").FieldModifiers<string | null>;
12
+ userId: import("../../data/domain/types.js").FieldDescriptor<string | null> & import("../../data/domain/field.js").FieldModifiers<string | null>;
13
+ openedAt: import("../../data/domain/types.js").FieldDescriptor<Date> & import("../../data/domain/field.js").FieldModifiers<Date>;
14
+ closedAt: import("../../data/domain/types.js").FieldDescriptor<Date | null> & import("../../data/domain/field.js").FieldModifiers<Date | null>;
15
+ expiresAt: import("../../data/domain/types.js").FieldDescriptor<Date> & import("../../data/domain/field.js").FieldModifiers<Date>;
16
+ truncatedAtSeq: import("../../data/domain/types.js").FieldDescriptor<number | null> & import("../../data/domain/field.js").FieldModifiers<number | null>;
17
+ };
18
+ //# sourceMappingURL=trace-fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-fields.d.ts","sourceRoot":"","sources":["../../../src/trace/schema/trace-fields.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;CAwBvB,CAAA"}
@@ -0,0 +1,34 @@
1
+ // The column shape shared by the hot `trace` table and the cold
2
+ // `trace_retained` table. A trace is one execution rooted at an entry point
3
+ // (HTTP request, job, cron tick, test); its steps live in `trace_step`.
4
+ //
5
+ // Field descriptors are immutable, so the same record is handed to both
6
+ // `define()` calls — the hot and retained tables are structurally identical
7
+ // and differ only in retention policy.
8
+ import { field } from '../../data/domain/index.js';
9
+ export const traceFields = {
10
+ id: field.uuid().brand('TraceId').defaultRandom(),
11
+ // Partition key — the calendar day the trace opened. Retention drops whole
12
+ // day-partitions, so every row carries the day it belongs to.
13
+ openedDay: field.date(),
14
+ // The root of the trace tree. Equals `id` for a root trace. No DB foreign
15
+ // key: retention must be free to drop ancestor partitions out from under it.
16
+ rootId: field.uuid().brand('TraceId'),
17
+ parentId: field.uuid().brand('TraceId').nullable(),
18
+ parentStepId: field.uuid().brand('TraceStepId').nullable(),
19
+ entryKind: field.enum(['http', 'job', 'cron', 'test']),
20
+ status: field.enum(['open', 'closed', 'error', 'truncated', 'expired']),
21
+ tenantId: field.uuid().tenant().nullable(),
22
+ requestId: field.text().nullable(),
23
+ sessionId: field.text().nullable(),
24
+ userId: field.text().nullable(),
25
+ openedAt: field.timestamp(),
26
+ closedAt: field.timestamp().nullable(),
27
+ // Force-close deadline: openedAt + hotRetentionDays. A trace must not outlive
28
+ // its own oldest day-partition.
29
+ expiresAt: field.timestamp(),
30
+ // Set when the step cap is hit and the trace is truncated — the seq at which
31
+ // capture stopped.
32
+ truncatedAtSeq: field.integer().nullable(),
33
+ };
34
+ //# sourceMappingURL=trace-fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-fields.js","sourceRoot":"","sources":["../../../src/trace/schema/trace-fields.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,4EAA4E;AAC5E,wEAAwE;AACxE,EAAE;AACF,wEAAwE;AACxE,4EAA4E;AAC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IAC7E,mBAAmB;IACnB,cAAc,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAA"}
@@ -0,0 +1,18 @@
1
+ export declare const traceRetained: import("../../data/domain/types.js").DefinedTable<{
2
+ id: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceId">> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceId">>;
3
+ openedDay: import("../../data/domain/types.js").FieldDescriptor<string> & import("../../data/domain/field.js").FieldModifiers<string>;
4
+ rootId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceId">> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceId">>;
5
+ parentId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceId"> | null> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceId"> | null>;
6
+ parentStepId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceStepId"> | null> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceStepId"> | null>;
7
+ entryKind: import("../../data/domain/types.js").FieldDescriptor<"test" | "http" | "job" | "cron"> & import("../../data/domain/field.js").FieldModifiers<"test" | "http" | "job" | "cron">;
8
+ status: import("../../data/domain/types.js").FieldDescriptor<"error" | "open" | "closed" | "truncated" | "expired"> & import("../../data/domain/field.js").FieldModifiers<"error" | "open" | "closed" | "truncated" | "expired">;
9
+ tenantId: import("../../data/domain/types.js").FieldDescriptor<string | null> & import("../../data/domain/field.js").FieldModifiers<string | null>;
10
+ requestId: import("../../data/domain/types.js").FieldDescriptor<string | null> & import("../../data/domain/field.js").FieldModifiers<string | null>;
11
+ sessionId: import("../../data/domain/types.js").FieldDescriptor<string | null> & import("../../data/domain/field.js").FieldModifiers<string | null>;
12
+ userId: import("../../data/domain/types.js").FieldDescriptor<string | null> & import("../../data/domain/field.js").FieldModifiers<string | null>;
13
+ openedAt: import("../../data/domain/types.js").FieldDescriptor<Date> & import("../../data/domain/field.js").FieldModifiers<Date>;
14
+ closedAt: import("../../data/domain/types.js").FieldDescriptor<Date | null> & import("../../data/domain/field.js").FieldModifiers<Date | null>;
15
+ expiresAt: import("../../data/domain/types.js").FieldDescriptor<Date> & import("../../data/domain/field.js").FieldModifiers<Date>;
16
+ truncatedAtSeq: import("../../data/domain/types.js").FieldDescriptor<number | null> & import("../../data/domain/field.js").FieldModifiers<number | null>;
17
+ }>;
18
+ //# sourceMappingURL=trace-retained.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-retained.d.ts","sourceRoot":"","sources":["../../../src/trace/schema/trace-retained.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;EAGxB,CAAA"}
@@ -0,0 +1,11 @@
1
+ // The cold `trace_retained` table — structurally identical to `trace`, but
2
+ // holds traces copied out on error so they survive past `hotRetentionDays`.
3
+ // RANGE-partitioned the same way; retention drops day-partitions older than
4
+ // `errorRetentionDays`.
5
+ import { define } from '../../data/domain/index.js';
6
+ import { traceFields } from './trace-fields.js';
7
+ export const traceRetained = define('trace_retained', traceFields, {
8
+ primaryKey: ['id', 'openedDay'],
9
+ partitionBy: { strategy: 'range', column: 'openedDay' },
10
+ });
11
+ //# sourceMappingURL=trace-retained.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-retained.js","sourceRoot":"","sources":["../../../src/trace/schema/trace-retained.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,4EAA4E;AAC5E,4EAA4E;AAC5E,wBAAwB;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,EAAE,WAAW,EAAE;IACjE,UAAU,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC;IAC/B,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE;CACxD,CAAC,CAAA"}
@@ -0,0 +1,15 @@
1
+ export declare const traceStepFields: {
2
+ id: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceStepId">> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceStepId">>;
3
+ traceDay: import("../../data/domain/types.js").FieldDescriptor<string> & import("../../data/domain/field.js").FieldModifiers<string>;
4
+ traceId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceId">> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceId">>;
5
+ seq: import("../../data/domain/types.js").FieldDescriptor<number> & import("../../data/domain/field.js").FieldModifiers<number>;
6
+ parentStepId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceStepId"> | null> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceStepId"> | null>;
7
+ flowStepRef: import("../../data/domain/types.js").FieldDescriptor<string> & import("../../data/domain/field.js").FieldModifiers<string>;
8
+ status: import("../../data/domain/types.js").FieldDescriptor<"error" | "ok"> & import("../../data/domain/field.js").FieldModifiers<"error" | "ok">;
9
+ startedAt: import("../../data/domain/types.js").FieldDescriptor<Date> & import("../../data/domain/field.js").FieldModifiers<Date>;
10
+ completedAt: import("../../data/domain/types.js").FieldDescriptor<Date | null> & import("../../data/domain/field.js").FieldModifiers<Date | null>;
11
+ durationMicros: import("../../data/domain/types.js").FieldDescriptor<bigint | null> & import("../../data/domain/field.js").FieldModifiers<bigint | null>;
12
+ capturedInputs: import("../../data/domain/types.js").FieldDescriptor<import("zod/v4").JSONType> & import("../../data/domain/field.js").FieldModifiers<import("zod/v4").JSONType>;
13
+ error: import("../../data/domain/types.js").FieldDescriptor<import("zod/v4").JSONType> & import("../../data/domain/field.js").FieldModifiers<import("zod/v4").JSONType>;
14
+ };
15
+ //# sourceMappingURL=trace-step-fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-step-fields.d.ts","sourceRoot":"","sources":["../../../src/trace/schema/trace-step-fields.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAqB3B,CAAA"}
@@ -0,0 +1,31 @@
1
+ // The column shape shared by the hot `trace_step` table and the cold
2
+ // `trace_step_retained` table. One row per flow step that executed under an
3
+ // active Flow.
4
+ //
5
+ // Field descriptors are immutable, so the same record is handed to both
6
+ // `define()` calls.
7
+ import { field } from '../../data/domain/index.js';
8
+ import { schema } from '../../data/schema/namespace.js';
9
+ export const traceStepFields = {
10
+ id: field.uuid().brand('TraceStepId').defaultRandom(),
11
+ // Partition key — the parent trace's `openedDay`, NOT the step's own
12
+ // timestamp. This keeps the foreign key into `trace` partition-local: a
13
+ // step and its trace always sit in the same day-partition, so the two
14
+ // tables' partitions retire together.
15
+ traceDay: field.date(),
16
+ traceId: field.uuid().brand('TraceId'),
17
+ // Spawn order within the trace. Branch vs step is an edge property, not a
18
+ // node property — `seq` only records sequencing.
19
+ seq: field.integer(),
20
+ parentStepId: field.uuid().brand('TraceStepId').nullable(),
21
+ // The `path:symbol` identity of the flow step, matching the annotation's
22
+ // upstream/downstream targets.
23
+ flowStepRef: field.text(),
24
+ status: field.enum(['ok', 'error']),
25
+ startedAt: field.timestamp(),
26
+ completedAt: field.timestamp().nullable(),
27
+ durationMicros: field.bigint().nullable(),
28
+ capturedInputs: field.jsonb(schema.check.json()).nullable(),
29
+ error: field.jsonb(schema.check.json()).nullable(),
30
+ };
31
+ //# sourceMappingURL=trace-step-fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-step-fields.js","sourceRoot":"","sources":["../../../src/trace/schema/trace-step-fields.ts"],"names":[],"mappings":"A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/domain/types.js").DefinedTable<{
2
+ id: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceStepId">> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceStepId">>;
3
+ traceDay: import("../../data/domain/types.js").FieldDescriptor<string> & import("../../data/domain/field.js").FieldModifiers<string>;
4
+ traceId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceId">> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceId">>;
5
+ seq: import("../../data/domain/types.js").FieldDescriptor<number> & import("../../data/domain/field.js").FieldModifiers<number>;
6
+ parentStepId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceStepId"> | null> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceStepId"> | null>;
7
+ flowStepRef: import("../../data/domain/types.js").FieldDescriptor<string> & import("../../data/domain/field.js").FieldModifiers<string>;
8
+ status: import("../../data/domain/types.js").FieldDescriptor<"error" | "ok"> & import("../../data/domain/field.js").FieldModifiers<"error" | "ok">;
9
+ startedAt: import("../../data/domain/types.js").FieldDescriptor<Date> & import("../../data/domain/field.js").FieldModifiers<Date>;
10
+ completedAt: import("../../data/domain/types.js").FieldDescriptor<Date | null> & import("../../data/domain/field.js").FieldModifiers<Date | null>;
11
+ durationMicros: import("../../data/domain/types.js").FieldDescriptor<bigint | null> & import("../../data/domain/field.js").FieldModifiers<bigint | null>;
12
+ capturedInputs: import("../../data/domain/types.js").FieldDescriptor<import("zod/v4").JSONType> & import("../../data/domain/field.js").FieldModifiers<import("zod/v4").JSONType>;
13
+ error: import("../../data/domain/types.js").FieldDescriptor<import("zod/v4").JSONType> & import("../../data/domain/field.js").FieldModifiers<import("zod/v4").JSONType>;
14
+ }>;
15
+ //# sourceMappingURL=trace-step-retained.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-step-retained.d.ts","sourceRoot":"","sources":["../../../src/trace/schema/trace-step-retained.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;EAQ5B,CAAA"}
@@ -0,0 +1,18 @@
1
+ // The cold `trace_step_retained` table — structurally identical to
2
+ // `trace_step`, holding steps copied out on error. Its foreign key targets
3
+ // `trace_retained`: copy-on-error writes the trace and its steps together, so
4
+ // referential integrity holds in the cold tables exactly as it does in the hot
5
+ // ones.
6
+ import { define } from '../../data/domain/index.js';
7
+ import { traceStepFields } from './trace-step-fields.js';
8
+ import { traceRetained } from './trace-retained.js';
9
+ export const traceStepRetained = define('trace_step_retained', traceStepFields, {
10
+ primaryKey: ['id', 'traceDay'],
11
+ partitionBy: { strategy: 'range', column: 'traceDay' },
12
+ foreignKeys: [{
13
+ columns: ['traceId', 'traceDay'],
14
+ references: { definition: traceRetained, columns: ['id', 'openedDay'] },
15
+ onDelete: 'cascade',
16
+ }],
17
+ });
18
+ //# sourceMappingURL=trace-step-retained.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-step-retained.js","sourceRoot":"","sources":["../../../src/trace/schema/trace-step-retained.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,2EAA2E;AAC3E,8EAA8E;AAC9E,+EAA+E;AAC/E,QAAQ;AAER,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,qBAAqB,EAAE,eAAe,EAAE;IAC9E,UAAU,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC;IAC9B,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE;IACtD,WAAW,EAAE,CAAC;YACZ,OAAO,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;YAChC,UAAU,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE;YACvE,QAAQ,EAAE,SAAS;SACpB,CAAC;CACH,CAAC,CAAA"}
@@ -0,0 +1,15 @@
1
+ export declare const traceStep: import("../../data/domain/types.js").DefinedTable<{
2
+ id: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceStepId">> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceStepId">>;
3
+ traceDay: import("../../data/domain/types.js").FieldDescriptor<string> & import("../../data/domain/field.js").FieldModifiers<string>;
4
+ traceId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceId">> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceId">>;
5
+ seq: import("../../data/domain/types.js").FieldDescriptor<number> & import("../../data/domain/field.js").FieldModifiers<number>;
6
+ parentStepId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceStepId"> | null> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceStepId"> | null>;
7
+ flowStepRef: import("../../data/domain/types.js").FieldDescriptor<string> & import("../../data/domain/field.js").FieldModifiers<string>;
8
+ status: import("../../data/domain/types.js").FieldDescriptor<"error" | "ok"> & import("../../data/domain/field.js").FieldModifiers<"error" | "ok">;
9
+ startedAt: import("../../data/domain/types.js").FieldDescriptor<Date> & import("../../data/domain/field.js").FieldModifiers<Date>;
10
+ completedAt: import("../../data/domain/types.js").FieldDescriptor<Date | null> & import("../../data/domain/field.js").FieldModifiers<Date | null>;
11
+ durationMicros: import("../../data/domain/types.js").FieldDescriptor<bigint | null> & import("../../data/domain/field.js").FieldModifiers<bigint | null>;
12
+ capturedInputs: import("../../data/domain/types.js").FieldDescriptor<import("zod/v4").JSONType> & import("../../data/domain/field.js").FieldModifiers<import("zod/v4").JSONType>;
13
+ error: import("../../data/domain/types.js").FieldDescriptor<import("zod/v4").JSONType> & import("../../data/domain/field.js").FieldModifiers<import("zod/v4").JSONType>;
14
+ }>;
15
+ //# sourceMappingURL=trace-step.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-step.d.ts","sourceRoot":"","sources":["../../../src/trace/schema/trace-step.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;;;;;;EAQpB,CAAA"}
@@ -0,0 +1,17 @@
1
+ // The hot `trace_step` table — one row per flow step executed under a Flow.
2
+ // Partitioned by `traceDay` (the parent trace's `openedDay`), so the foreign
3
+ // key into `trace` is partition-local and both tables' partitions retire
4
+ // together.
5
+ import { define } from '../../data/domain/index.js';
6
+ import { traceStepFields } from './trace-step-fields.js';
7
+ import { trace } from './trace.js';
8
+ export const traceStep = define('trace_step', traceStepFields, {
9
+ primaryKey: ['id', 'traceDay'],
10
+ partitionBy: { strategy: 'range', column: 'traceDay' },
11
+ foreignKeys: [{
12
+ columns: ['traceId', 'traceDay'],
13
+ references: { definition: trace, columns: ['id', 'openedDay'] },
14
+ onDelete: 'cascade',
15
+ }],
16
+ });
17
+ //# sourceMappingURL=trace-step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-step.js","sourceRoot":"","sources":["../../../src/trace/schema/trace-step.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,YAAY;AAEZ,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,eAAe,EAAE;IAC7D,UAAU,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC;IAC9B,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE;IACtD,WAAW,EAAE,CAAC;YACZ,OAAO,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;YAChC,UAAU,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE;YAC/D,QAAQ,EAAE,SAAS;SACpB,CAAC;CACH,CAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ export declare const trace: import("../../data/domain/types.js").DefinedTable<{
2
+ id: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceId">> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceId">>;
3
+ openedDay: import("../../data/domain/types.js").FieldDescriptor<string> & import("../../data/domain/field.js").FieldModifiers<string>;
4
+ rootId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceId">> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceId">>;
5
+ parentId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceId"> | null> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceId"> | null>;
6
+ parentStepId: import("../../data/domain/types.js").FieldDescriptor<import("../../data/domain/brand.js").Branded<string, "TraceStepId"> | null> & import("../../data/domain/field.js").FieldModifiers<import("../../data/domain/brand.js").Branded<string, "TraceStepId"> | null>;
7
+ entryKind: import("../../data/domain/types.js").FieldDescriptor<"test" | "http" | "job" | "cron"> & import("../../data/domain/field.js").FieldModifiers<"test" | "http" | "job" | "cron">;
8
+ status: import("../../data/domain/types.js").FieldDescriptor<"error" | "open" | "closed" | "truncated" | "expired"> & import("../../data/domain/field.js").FieldModifiers<"error" | "open" | "closed" | "truncated" | "expired">;
9
+ tenantId: import("../../data/domain/types.js").FieldDescriptor<string | null> & import("../../data/domain/field.js").FieldModifiers<string | null>;
10
+ requestId: import("../../data/domain/types.js").FieldDescriptor<string | null> & import("../../data/domain/field.js").FieldModifiers<string | null>;
11
+ sessionId: import("../../data/domain/types.js").FieldDescriptor<string | null> & import("../../data/domain/field.js").FieldModifiers<string | null>;
12
+ userId: import("../../data/domain/types.js").FieldDescriptor<string | null> & import("../../data/domain/field.js").FieldModifiers<string | null>;
13
+ openedAt: import("../../data/domain/types.js").FieldDescriptor<Date> & import("../../data/domain/field.js").FieldModifiers<Date>;
14
+ closedAt: import("../../data/domain/types.js").FieldDescriptor<Date | null> & import("../../data/domain/field.js").FieldModifiers<Date | null>;
15
+ expiresAt: import("../../data/domain/types.js").FieldDescriptor<Date> & import("../../data/domain/field.js").FieldModifiers<Date>;
16
+ truncatedAtSeq: import("../../data/domain/types.js").FieldDescriptor<number | null> & import("../../data/domain/field.js").FieldModifiers<number | null>;
17
+ }>;
18
+ //# sourceMappingURL=trace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/trace/schema/trace.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;EAGhB,CAAA"}
@@ -0,0 +1,11 @@
1
+ // The hot `trace` table — one row per execution, rooted at an entry point.
2
+ // RANGE-partitioned by `openedDay`; retention drops day-partitions older than
3
+ // `hotRetentionDays`. Errored traces are copied to `trace_retained` before
4
+ // their partition is dropped.
5
+ import { define } from '../../data/domain/index.js';
6
+ import { traceFields } from './trace-fields.js';
7
+ export const trace = define('trace', traceFields, {
8
+ primaryKey: ['id', 'openedDay'],
9
+ partitionBy: { strategy: 'range', column: 'openedDay' },
10
+ });
11
+ //# sourceMappingURL=trace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/trace/schema/trace.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,8EAA8E;AAC9E,2EAA2E;AAC3E,8BAA8B;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE;IAChD,UAAU,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC;IAC/B,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE;CACxD,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"changed-files.d.ts","sourceRoot":"","sources":["../../src/workspace/changed-files.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,QAAQ,CAAA;AAE/C,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,CAalE;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B;IAAE,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAoBhD"}
1
+ {"version":3,"file":"changed-files.d.ts","sourceRoot":"","sources":["../../src/workspace/changed-files.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,QAAQ,CAAA;AAE/C,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,CAalE;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B;IAAE,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAwBhD"}
@@ -20,7 +20,11 @@ export function filesToModules(files, modulePaths) {
20
20
  for (const file of files) {
21
21
  let matched = false;
22
22
  for (const modPath of sorted) {
23
- if (file === modPath || file.startsWith(modPath + '/')) {
23
+ // '.' is the synthesized implicit module for a single-package repo — it
24
+ // is the repo root, so it contains every file. git diff paths are
25
+ // repo-relative without a leading './', so the prefix check below can
26
+ // never match '.' on its own.
27
+ if (modPath === '.' || file === modPath || file.startsWith(modPath + '/')) {
24
28
  modules.add(modPath);
25
29
  matched = true;
26
30
  break;
@@ -1 +1 @@
1
- {"version":3,"file":"changed-files.js","sourceRoot":"","sources":["../../src/workspace/changed-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAI7C,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,IAAc;IACtD,IAAI,CAAC;QACH,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtB,MAAM,GAAG,GAAG,QAAQ,CAAC,+BAA+B,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;YAClH,OAAO,UAAU,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;QAED,MAAM,OAAO,GAAG,QAAQ,CAAC,2BAA2B,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;QAClH,MAAM,YAAY,GAAG,QAAQ,CAAC,0CAA0C,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;QACtI,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,EAAE,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5E,CAAC;IAAC,MAAM,CAAC;QACP,O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EAAkE;YAClE,sEAAsE;YACtE,8BAA8B;YAC9B,IAAI,OAAO,KAAK,GAAG,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC,EAAE,CAAC;gBAC1E,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;gBACpB,OAAO,GAAG,IAAI,CAAA;gBACd,MAAK;YACP,CAAC;QACH,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,WAAW,GAAG,IAAI,CAAA;QACpB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAA;AACjC,CAAC;AAED,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AACxD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pipework",
3
- "version": "0.7.25",
3
+ "version": "0.8.0",
4
4
  "description": "TypeScript framework for multi-tenant SaaS applications. PostgreSQL-only.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -41,8 +41,8 @@
41
41
  "types": "./dist/test/vitest-plugin.d.ts"
42
42
  },
43
43
  "./vitest": {
44
- "import": "./dist/test/vitest-config.js",
45
- "types": "./dist/test/vitest-config.d.ts"
44
+ "import": "./dist/test/vitest-workspace.js",
45
+ "types": "./dist/test/vitest-workspace.d.ts"
46
46
  },
47
47
  "./globals": {
48
48
  "types": "./dist/test/globals.d.ts"