things-api 0.15.0 → 0.17.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 (145) hide show
  1. package/README.md +4 -4
  2. package/dist/audit/schema.d.ts +8 -0
  3. package/dist/audit/schema.js.map +1 -1
  4. package/dist/cli/commands/install-skill.js +9 -2
  5. package/dist/cli/commands/install-skill.js.map +1 -1
  6. package/dist/cli/commands/repeat-flags.d.ts +14 -4
  7. package/dist/cli/commands/repeat-flags.js +113 -33
  8. package/dist/cli/commands/repeat-flags.js.map +1 -1
  9. package/dist/cli/commands/todo.js +49 -2
  10. package/dist/cli/commands/todo.js.map +1 -1
  11. package/dist/cli/commands/writes.js +241 -66
  12. package/dist/cli/commands/writes.js.map +1 -1
  13. package/dist/cli/help.js +23 -13
  14. package/dist/cli/help.js.map +1 -1
  15. package/dist/cli/interrupt.d.ts +42 -0
  16. package/dist/cli/interrupt.js +105 -0
  17. package/dist/cli/interrupt.js.map +1 -0
  18. package/dist/cli/main.js +5 -0
  19. package/dist/cli/main.js.map +1 -1
  20. package/dist/cli/read-driver.d.ts +2 -2
  21. package/dist/cli/skill.d.ts +24 -0
  22. package/dist/cli/skill.js +40 -0
  23. package/dist/cli/skill.js.map +1 -1
  24. package/dist/client.d.ts +53 -12
  25. package/dist/client.js +9 -1
  26. package/dist/client.js.map +1 -1
  27. package/dist/config.d.ts +39 -0
  28. package/dist/config.js +16 -1
  29. package/dist/config.js.map +1 -1
  30. package/dist/contracts.d.ts +9 -2
  31. package/dist/contracts.js +1 -1
  32. package/dist/contracts.js.map +1 -1
  33. package/dist/index.d.ts +5 -2
  34. package/dist/index.js +7 -0
  35. package/dist/index.js.map +1 -1
  36. package/dist/mcp/server.js +132 -31
  37. package/dist/mcp/server.js.map +1 -1
  38. package/dist/model/entities.d.ts +35 -0
  39. package/dist/model/entities.js.map +1 -1
  40. package/dist/model/occurrences.d.ts +14 -1
  41. package/dist/model/occurrences.js +20 -4
  42. package/dist/model/occurrences.js.map +1 -1
  43. package/dist/model/recurrence.d.ts +60 -9
  44. package/dist/model/recurrence.js +76 -19
  45. package/dist/model/recurrence.js.map +1 -1
  46. package/dist/paths.d.ts +8 -0
  47. package/dist/paths.js +10 -0
  48. package/dist/paths.js.map +1 -1
  49. package/dist/read/detail.js +49 -1
  50. package/dist/read/detail.js.map +1 -1
  51. package/dist/read/queries.d.ts +12 -0
  52. package/dist/read/queries.js +14 -0
  53. package/dist/read/queries.js.map +1 -1
  54. package/dist/read/shape.d.ts +25 -22
  55. package/dist/read/shape.js +81 -55
  56. package/dist/read/shape.js.map +1 -1
  57. package/dist/read/stage.d.ts +5 -5
  58. package/dist/read/stage.js +2 -2
  59. package/dist/read/views.d.ts +1 -1
  60. package/dist/read/views.js +4 -4
  61. package/dist/surface-copy.d.ts +2 -2
  62. package/dist/surface-copy.js +2 -2
  63. package/dist/sync-health.js +2 -1
  64. package/dist/sync-health.js.map +1 -1
  65. package/dist/trace/tracer.d.ts +87 -0
  66. package/dist/trace/tracer.js +167 -0
  67. package/dist/trace/tracer.js.map +1 -0
  68. package/dist/write/batch.d.ts +28 -3
  69. package/dist/write/batch.js +162 -46
  70. package/dist/write/batch.js.map +1 -1
  71. package/dist/write/clear-reminder.js +24 -21
  72. package/dist/write/clear-reminder.js.map +1 -1
  73. package/dist/write/clone.d.ts +4 -0
  74. package/dist/write/clone.js +531 -0
  75. package/dist/write/clone.js.map +1 -0
  76. package/dist/write/commands.js +140 -49
  77. package/dist/write/commands.js.map +1 -1
  78. package/dist/write/completion-context.d.ts +57 -0
  79. package/dist/write/completion-context.js +49 -0
  80. package/dist/write/completion-context.js.map +1 -0
  81. package/dist/write/failure-hints.d.ts +10 -1
  82. package/dist/write/failure-hints.js +8 -0
  83. package/dist/write/failure-hints.js.map +1 -1
  84. package/dist/write/guards.d.ts +1 -1
  85. package/dist/write/guards.js +43 -5
  86. package/dist/write/guards.js.map +1 -1
  87. package/dist/write/make-repeating-project.d.ts +2 -3
  88. package/dist/write/make-repeating-project.js +2 -73
  89. package/dist/write/make-repeating-project.js.map +1 -1
  90. package/dist/write/move.js +8 -1
  91. package/dist/write/move.js.map +1 -1
  92. package/dist/write/operations.d.ts +140 -9
  93. package/dist/write/operations.js +4 -1
  94. package/dist/write/operations.js.map +1 -1
  95. package/dist/write/pipeline.d.ts +77 -0
  96. package/dist/write/pipeline.js +298 -20
  97. package/dist/write/pipeline.js.map +1 -1
  98. package/dist/write/pre-state.d.ts +1 -1
  99. package/dist/write/pre-state.js +9 -3
  100. package/dist/write/pre-state.js.map +1 -1
  101. package/dist/write/preserve-modified.d.ts +55 -0
  102. package/dist/write/preserve-modified.js +106 -0
  103. package/dist/write/preserve-modified.js.map +1 -0
  104. package/dist/write/promote-clone.d.ts +32 -0
  105. package/dist/write/promote-clone.js +867 -0
  106. package/dist/write/promote-clone.js.map +1 -0
  107. package/dist/write/repeat-anchor.d.ts +110 -0
  108. package/dist/write/repeat-anchor.js +238 -0
  109. package/dist/write/repeat-anchor.js.map +1 -0
  110. package/dist/write/repeat-asserts.d.ts +28 -0
  111. package/dist/write/repeat-asserts.js +169 -0
  112. package/dist/write/repeat-asserts.js.map +1 -0
  113. package/dist/write/repeat-rule.js +27 -12
  114. package/dist/write/repeat-rule.js.map +1 -1
  115. package/dist/write/resolution-timestamps.js +22 -0
  116. package/dist/write/resolution-timestamps.js.map +1 -1
  117. package/dist/write/reversibility.js +27 -14
  118. package/dist/write/reversibility.js.map +1 -1
  119. package/dist/write/undo.d.ts +11 -1
  120. package/dist/write/undo.js +126 -10
  121. package/dist/write/undo.js.map +1 -1
  122. package/dist/write/vectors/session-reachability.d.ts +78 -0
  123. package/dist/write/vectors/session-reachability.js +103 -0
  124. package/dist/write/vectors/session-reachability.js.map +1 -0
  125. package/dist/write/vectors/simulator.js +100 -30
  126. package/dist/write/vectors/simulator.js.map +1 -1
  127. package/dist/write/vectors/types.d.ts +117 -10
  128. package/dist/write/vectors/ui-certification.d.ts +1 -1
  129. package/dist/write/vectors/ui-certification.js +10 -3
  130. package/dist/write/vectors/ui-certification.js.map +1 -1
  131. package/dist/write/vectors/ui-recipes.d.ts +8 -0
  132. package/dist/write/vectors/ui-recipes.js +120 -22
  133. package/dist/write/vectors/ui-recipes.js.map +1 -1
  134. package/dist/write/vectors/ui.d.ts +79 -13
  135. package/dist/write/vectors/ui.js +415 -59
  136. package/dist/write/vectors/ui.js.map +1 -1
  137. package/dist/write/verify/delta.d.ts +12 -14
  138. package/dist/write/verify/delta.js +35 -34
  139. package/dist/write/verify/delta.js.map +1 -1
  140. package/package.json +1 -1
  141. package/schema/envelope.schema.json +22 -0
  142. package/skills/things-cli/SKILL.md +7 -3
  143. package/skills/things-cli/references/banner.md +1 -1
  144. package/skills/things-cli/references/contracts.md +17 -9
  145. package/skills/things-cli/references/data-model.md +2 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The R10 lifecycle taxonomy: ONE derived per-item field, `stage`, that replaces
2
+ * The RS5 lifecycle taxonomy: ONE derived per-item field, `stage`, that replaces
3
3
  * the three former wire fields `start` / `logged` / `trashed`. It names an item's
4
4
  * primary lifecycle bucket in the same six words the sidebar and the view cards
5
5
  * use, so a consumer reads one word instead of cross-referencing three.
@@ -24,7 +24,7 @@
24
24
  * A completed/canceled row NOT yet past the boundary has `logged=false` here,
25
25
  * so it FALLS THROUGH and keeps its live stage below (Mike's explicit ruling).
26
26
  * 2½. a DEADLINE-PULLED undated row (`today` marker set ∧ `startDate IS NULL`) →
27
- * `anytime` — R13 (BANNER1 / BANNER1b, law L-A): a due-deadline pull re-files
27
+ * `anytime` — RS8 (BANNER1 / BANNER1b, law L-A): a due-deadline pull re-files
28
28
  * an undated Inbox/Someday row into ANYTIME (the GUI removes it from
29
29
  * Someday/Inbox and adds it to Anytime at pull time, even while raw `start`
30
30
  * still reads 0/2). It derives its DESTINATION, not its origin. Ordered ABOVE
@@ -62,7 +62,7 @@
62
62
  * docs/lab/upcoming-research.md, summarized in docs/things-app-oddities.md
63
63
  * §8d–8e). A SOMEDAY or INBOX item with a due/overdue UNsuppressed deadline is
64
64
  * PULLED into Today+Anytime, so it too reads `stage: "anytime"` AND `today: true`
65
- * (R13 / BANNER1b — the GUI files a pulled row under Anytime, out of its origin
65
+ * (RS8 / BANNER1b — the GUI files a pulled row under Anytime, out of its origin
66
66
  * bucket, §8s); the same item once its deadline is SUPPRESSED
67
67
  * (`deadlineSuppressionDate` stamped — a side effect of rescheduling an
68
68
  * overdue-deadline item, oddities §8e) is NOT pulled: no today marker, so it
@@ -104,7 +104,7 @@ export interface StageInput {
104
104
  */
105
105
  export declare function deriveStage(item: StageInput): Stage;
106
106
  /**
107
- * An item's TIME-AXIS POSITION (R12) — a presence-keyed value complementary to
107
+ * An item's TIME-AXIS POSITION (RS7) — a presence-keyed value complementary to
108
108
  * {@link Stage}. The doctrine line: **`stage` enumerates the sidebar BUCKETS an
109
109
  * item lives in; `when` enumerates its TIME POSITIONS (today | evening | a future
110
110
  * date).** Someday is deliberately NOT a `when` value — it is a bucket, so it
@@ -178,7 +178,7 @@ export declare function entityStage(item: EntityDerivable): Stage;
178
178
  */
179
179
  export declare function entityWhen(item: EntityDerivable): When | undefined;
180
180
  /**
181
- * The R13 provisional-marker LAW (BANNER1 L-B) — the ONE predicate the wire emit
181
+ * The RS8 provisional-marker LAW (BANNER1 L-B) — the ONE predicate the wire emit
182
182
  * boundary (`shape.ts`) and the TTY pip (`render.ts` renderToday) share, so a
183
183
  * rendered `•` can NEVER disagree with the emitted `provisional`. A Today member
184
184
  * (a today/evening `when`) the app has not yet MATERIALIZED: `start != active OR
@@ -7,7 +7,7 @@ export function deriveStage(item) {
7
7
  return "trash";
8
8
  if (item.logged)
9
9
  return "logbook";
10
- // R13 (BANNER1 / BANNER1b, law L-A): a due-deadline PULL re-files an undated
10
+ // RS8 (BANNER1 / BANNER1b, law L-A): a due-deadline PULL re-files an undated
11
11
  // row (Inbox or Someday origin) into ANYTIME — the GUI removes it from the
12
12
  // Someday/Inbox lists and adds it to the Anytime list at pull time, even while
13
13
  // its raw `start` still reads 0/2 (Anytime ⊇ Today's to-dos). The row carries
@@ -96,7 +96,7 @@ export function entityWhen(item) {
96
96
  });
97
97
  }
98
98
  /**
99
- * The R13 provisional-marker LAW (BANNER1 L-B) — the ONE predicate the wire emit
99
+ * The RS8 provisional-marker LAW (BANNER1 L-B) — the ONE predicate the wire emit
100
100
  * boundary (`shape.ts`) and the TTY pip (`render.ts` renderToday) share, so a
101
101
  * rendered `•` can NEVER disagree with the emitted `provisional`. A Today member
102
102
  * (a today/evening `when`) the app has not yet MATERIALIZED: `start != active OR
@@ -439,7 +439,7 @@ export interface DeadlinesFilter extends ViewFilter {
439
439
  * deadline is strictly future; a deadline-less template, an undecodable rule, an
440
440
  * after-completion/paused template with no set next occurrence, and any
441
441
  * non-future derived deadline are EXCLUDED (never a guessed date). A projected
442
- * row discloses its projection-ness through the R11 `repeating` presence (it IS
442
+ * row discloses its projection-ness through the RS6 `repeating` presence (it IS
443
443
  * the template row, carrying the projected value in `deadline`). No double count:
444
444
  * the already-materialized instance is a concrete row under the base query and
445
445
  * the next-instance cursor points PAST it, so the projection lands on a strictly
@@ -183,7 +183,7 @@ export function inboxView(db, now, filter, zone) {
183
183
  where.push("t.creationDate <= ?");
184
184
  binds.push(filter.until.getTime() / 1000);
185
185
  }
186
- // R13 (BANNER1 Q1b, law L-A): a due/overdue un-dismissed deadline pulls an
186
+ // RS8 (BANNER1 Q1b, law L-A): a due/overdue un-dismissed deadline pulls an
187
187
  // undated Inbox row into Today AND removes it from the GUI Inbox list — even
188
188
  // while its raw `start` still reads 0. EXCLUDE the pulled rows so the flat
189
189
  // inbox view stays GUI-faithful; reuse the Today deadline arm verbatim so the
@@ -207,7 +207,7 @@ export function anytimeView(db, now, filter, zone) {
207
207
  // cascade-excluded — the checked project row represents them. The boundary is
208
208
  // threaded into the SQL filter and materialize so presence and `logged` agree.
209
209
  //
210
- // R13 (BANNER1b, law L-A): Anytime is a SUPERSET of Today's to-dos — a
210
+ // RS8 (BANNER1b, law L-A): Anytime is a SUPERSET of Today's to-dos — a
211
211
  // due-deadline pull re-files an undated Inbox/Someday row into Anytime (out of
212
212
  // its origin bucket) even while its raw `start` still reads 0/2. So the
213
213
  // membership arm is ANYTIME_SELF *OR* the Today deadline-pull arm (reused
@@ -394,7 +394,7 @@ export function somedayView(db, now, filter, zone) {
394
394
  ? `EXISTS (SELECT 1 FROM TMTask p WHERE p.uuid = ${EFF_PROJECT}
395
395
  AND p.trashed = 0 AND p.status = 0 AND ${ANYTIME_SELF("p")})`
396
396
  : "0";
397
- // R13 (BANNER1 Q1b, law L-A): a due/overdue un-dismissed deadline pulls an
397
+ // RS8 (BANNER1 Q1b, law L-A): a due/overdue un-dismissed deadline pulls an
398
398
  // undated Someday row into Today AND removes it from the GUI Someday list —
399
399
  // even while its raw `start` still reads 2. EXCLUDE the pulled rows so the flat
400
400
  // someday view stays GUI-faithful; reuse the Today deadline arm verbatim so the
@@ -844,7 +844,7 @@ export function searchView(db, query, options, now, zone) {
844
844
  * deadline is strictly future; a deadline-less template, an undecodable rule, an
845
845
  * after-completion/paused template with no set next occurrence, and any
846
846
  * non-future derived deadline are EXCLUDED (never a guessed date). A projected
847
- * row discloses its projection-ness through the R11 `repeating` presence (it IS
847
+ * row discloses its projection-ness through the RS6 `repeating` presence (it IS
848
848
  * the template row, carrying the projected value in `deadline`). No double count:
849
849
  * the already-materialized instance is a concrete row under the base query and
850
850
  * the next-instance cursor points PAST it, so the projection lands on a strictly
@@ -33,10 +33,10 @@ export declare const LIMIT_DESC = "maximum items to show (default 50)";
33
33
  /** Shared `--all`/`all` description (lift the row limit). */
34
34
  export declare const ALL_DESC = "show every matching item, no limit";
35
35
  /**
36
- * Shared `--full`/`full` description — the R7 tier escape hatch. List views
36
+ * Shared `--full`/`full` description — the RS2 tier escape hatch. List views
37
37
  * default to a compact line-item; this forces the full per-row record
38
38
  * (`created`/`modified`, the full repeat block, full notes, default-valued
39
- * fields). The no-redundant-ancestry pruning (R6) still applies.
39
+ * fields). The no-redundant-ancestry pruning (RS1) still applies.
40
40
  */
41
41
  export declare const FULL_DESC = "full detail per row (default is a compact line-item)";
42
42
  /** Default per-project preview cap in the grouped catalogues (anytime). */
@@ -33,10 +33,10 @@ export const LIMIT_DESC = `maximum items to show (default ${DEFAULT_LIST_LIMIT})
33
33
  /** Shared `--all`/`all` description (lift the row limit). */
34
34
  export const ALL_DESC = "show every matching item, no limit";
35
35
  /**
36
- * Shared `--full`/`full` description — the R7 tier escape hatch. List views
36
+ * Shared `--full`/`full` description — the RS2 tier escape hatch. List views
37
37
  * default to a compact line-item; this forces the full per-row record
38
38
  * (`created`/`modified`, the full repeat block, full notes, default-valued
39
- * fields). The no-redundant-ancestry pruning (R6) still applies.
39
+ * fields). The no-redundant-ancestry pruning (RS1) still applies.
40
40
  */
41
41
  export const FULL_DESC = "full detail per row (default is a compact line-item)";
42
42
  /** Default per-project preview cap in the grouped catalogues (anytime). */
@@ -239,7 +239,8 @@ export function computeSyncHealth(db, dbPath, deps = {}) {
239
239
  verdict: running
240
240
  ? "the Things app is running — the database is live and receiving writes"
241
241
  : "the Things app is NOT running — the database is frozen (there is no background sync " +
242
- "daemon); launch Things to resume syncing and writes",
242
+ "daemon); launch Things to resume syncing. A write launches it automatically unless " +
243
+ "`auto-launch` is turned off",
243
244
  };
244
245
  // WAL freshness.
245
246
  const walMtimeMs = (deps.walMtimeMs ?? defaultWalMtimeMs)(`${dbPath}-wal`);
@@ -1 +1 @@
1
- {"version":3,"file":"sync-health.js","sourceRoot":"","sources":["../src/sync-health.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,eAAe,EAA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C9C,MAAM,aAAa,GAAgC;QACjD,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC;QACrB,UAAU,EAAE,OAAO;QACnB,OAAO,EACL,MAAM,KAAK,IAAI;YACb,CAAC,CAAC,mCAAmC;YACrC,CAAC,CAAC,uBAAuB,WAAW,CAAC,OAAO,CAAC,EAAE;KACpD,CAAC;IAEF,mBAAmB;IACnB,MAAM,SAAS,GAAG,IAAI,CAAC,mBAAmB,IAAI,0BAA0B,CAAC,MAAM,CAAC,CAAC;IACjF,MAAM,YAAY,GAAG,CAAC,IAAI,CAAC,gBAAgB,IAAI,uBAAuB,CAAC,CAAC,SAAS,CAAC,CAAC;IACnF,MAAM,cAAc,GAAiC;QACnD,EAAE,EAAE,SAAS,CAAC,YAAY,CAAC;QAC3B,OAAO,EACL,YAAY,KAAK,IAAI;YACnB,CAAC,CAAC,gEAAgE;YAClE,CAAC,CAAC,8BAA8B,WAAW,CAAC,cAAc,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE;KACvF,CAAC;IAEF,OAAO;QACL,UAAU;QACV,GAAG;QACH,aAAa;QACb,cAAc;QACd,KAAK,EAAE,YAAY,CAAC,EAAE,EAAE,KAAK,CAAC;KAC/B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,87 @@
1
+ /** One line in the trace: a phase tag plus arbitrary structured fields. */
2
+ export interface TraceEvent {
3
+ /**
4
+ * The kind of moment: `invocation` (start), `stage` (a pipeline milestone),
5
+ * `ui-dispatch` (one osascript hop), `verify` (poll summary), `watchdog`,
6
+ * `result`, `signal`, or `invocation-end`.
7
+ */
8
+ phase: string;
9
+ [field: string]: unknown;
10
+ }
11
+ /** A trace destination. The file sink stamps `ts`/`elapsedMs` onto each event. */
12
+ export interface TraceSink {
13
+ /** Absolute path of the trace file (embedded in uncertain-outcome results). */
14
+ readonly path: string;
15
+ /** Epoch ms when this invocation's trace opened (the `elapsedMs` origin). */
16
+ readonly startedAt: number;
17
+ write(event: TraceEvent): void;
18
+ close(): void;
19
+ }
20
+ /** Install (or clear, with null) the process trace sink. */
21
+ export declare function setTraceSink(next: TraceSink | null): void;
22
+ /** The active sink, or null when tracing is off. */
23
+ export declare function traceSink(): TraceSink | null;
24
+ /** Is tracing on right now? Cheap guard for hot call sites. */
25
+ export declare function traceActive(): boolean;
26
+ /** The active trace file path, or null — embedded in uncertain-outcome results. */
27
+ export declare function tracePath(): string | null;
28
+ /**
29
+ * Emit one event. The event is built by a THUNK so nothing is allocated when
30
+ * tracing is off (overhead ≈ 0 disabled). Never throws — a failed trace write
31
+ * must never break a mutation.
32
+ */
33
+ export declare function trace(makeEvent: () => TraceEvent): void;
34
+ export interface InflightWrite {
35
+ op: string;
36
+ /** The resolved target uuid, when the op has a single one (else null). */
37
+ uuid: string | null;
38
+ vector: string;
39
+ /** True while a GUI drive is in flight — the genuinely-uncertain case. */
40
+ uiDrive: boolean;
41
+ /** The label of the last UI-drive step dispatched (updated as it drives). */
42
+ step?: string;
43
+ startedAt: number;
44
+ }
45
+ /** Mark (or clear, with null) the write currently touching the app. */
46
+ export declare function setInflight(write: InflightWrite | null): void;
47
+ /** The write currently touching the app, or null. */
48
+ export declare function getInflight(): InflightWrite | null;
49
+ /** Record the last-dispatched UI-drive step on the in-flight write. */
50
+ export declare function noteInflightStep(step: string): void;
51
+ /**
52
+ * The effective trace decision. The tri-state config key wins when set
53
+ * (`true`/`false` force it), otherwise tracing follows `isDev` — on for a
54
+ * `-dev` source checkout, off for a published install. The env override is
55
+ * already folded into `configTrace` by {@link loadConfig}.
56
+ */
57
+ export declare function resolveTraceEnabled(configTrace: boolean | null | undefined, isDev: boolean): boolean;
58
+ /** Redact obvious secrets (URL-scheme auth tokens) from a logged argv. */
59
+ export declare function sanitizeArgv(argv: readonly string[]): string[];
60
+ /**
61
+ * Open a per-invocation JSONL trace file and return the sink (already carrying
62
+ * the leading `invocation` event). One file per process keeps concurrent
63
+ * invocations from interleaving, so the file for a given run reconstructs that
64
+ * run and nothing else.
65
+ */
66
+ export declare function createFileTraceSink(opts: {
67
+ dir: string;
68
+ argv: readonly string[];
69
+ version: string;
70
+ pid: number;
71
+ now?: () => number;
72
+ }): TraceSink;
73
+ /**
74
+ * CLI entry: decide whether to trace this invocation and, if so, install a file
75
+ * sink. Returns the sink (or null when off). Called from the write driver so
76
+ * tracing is scoped to mutations — the invocations where a step timeline earns
77
+ * its keep. Never throws: a trace-setup failure degrades to no tracing.
78
+ */
79
+ export declare function installCliTrace(opts: {
80
+ argv: readonly string[];
81
+ version: string;
82
+ isDev: boolean;
83
+ env?: NodeJS.ProcessEnv;
84
+ pid?: number;
85
+ }): TraceSink | null;
86
+ /** Tear down the process trace sink (clears the in-flight marker too). */
87
+ export declare function closeCliTrace(): void;
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Dev-mode step-timeline trace (TRACE1, #487).
3
+ *
4
+ * When tracing is on — a `-dev` build, or forced via the `traceEnabled` config
5
+ * key / `THINGS_API_TRACE` env — every write invocation appends a step-level
6
+ * timeline to ONE local JSONL file under {@link traceDir}. The file is the
7
+ * single artifact an issue report can point at to reconstruct exactly what the
8
+ * CLI did and when: the sanitized argv, each pipeline stage, every UI-drive
9
+ * osascript dispatch (with duration + outcome), the verify poll summary, the
10
+ * final result, and — critically for a hang report — an interruption marker if
11
+ * a signal killed the process mid-drive.
12
+ *
13
+ * Design goals:
14
+ * - Overhead ≈ 0 when disabled: {@link trace} is one null-check + return, and
15
+ * the emit thunk is never invoked.
16
+ * - Flush-on-write: each event is `appendFileSync`'d immediately, so even a
17
+ * SIGKILL leaves every event up to the last checkpoint on disk.
18
+ * - LOCAL-ONLY: a trace may carry real task titles/uuids from the running
19
+ * database. That is fine on the maintainer's own machine; it must NEVER be
20
+ * committed to the public repo or attached to a public issue.
21
+ *
22
+ * The sink and the in-flight-write registry are module-global by design: a CLI
23
+ * invocation is exactly one process running exactly one write, so a singleton is
24
+ * both correct and far simpler than threading a tracer through every signature.
25
+ */
26
+ import { appendFileSync, mkdirSync } from "node:fs";
27
+ import { join } from "node:path";
28
+ import { loadConfig } from "../config.js";
29
+ import { traceDir } from "../paths.js";
30
+ let sink = null;
31
+ /** Install (or clear, with null) the process trace sink. */
32
+ export function setTraceSink(next) {
33
+ sink = next;
34
+ }
35
+ /** The active sink, or null when tracing is off. */
36
+ export function traceSink() {
37
+ return sink;
38
+ }
39
+ /** Is tracing on right now? Cheap guard for hot call sites. */
40
+ export function traceActive() {
41
+ return sink !== null;
42
+ }
43
+ /** The active trace file path, or null — embedded in uncertain-outcome results. */
44
+ export function tracePath() {
45
+ return sink?.path ?? null;
46
+ }
47
+ /**
48
+ * Emit one event. The event is built by a THUNK so nothing is allocated when
49
+ * tracing is off (overhead ≈ 0 disabled). Never throws — a failed trace write
50
+ * must never break a mutation.
51
+ */
52
+ export function trace(makeEvent) {
53
+ if (sink === null)
54
+ return;
55
+ try {
56
+ sink.write(makeEvent());
57
+ }
58
+ catch {
59
+ // tracing is best-effort diagnostics; never let it affect the write
60
+ }
61
+ }
62
+ let inflight = null;
63
+ /** Mark (or clear, with null) the write currently touching the app. */
64
+ export function setInflight(write) {
65
+ inflight = write;
66
+ }
67
+ /** The write currently touching the app, or null. */
68
+ export function getInflight() {
69
+ return inflight;
70
+ }
71
+ /** Record the last-dispatched UI-drive step on the in-flight write. */
72
+ export function noteInflightStep(step) {
73
+ if (inflight !== null)
74
+ inflight.step = step;
75
+ }
76
+ // ---------------------------------------------------------------------------
77
+ // Enablement + the file sink.
78
+ // ---------------------------------------------------------------------------
79
+ /**
80
+ * The effective trace decision. The tri-state config key wins when set
81
+ * (`true`/`false` force it), otherwise tracing follows `isDev` — on for a
82
+ * `-dev` source checkout, off for a published install. The env override is
83
+ * already folded into `configTrace` by {@link loadConfig}.
84
+ */
85
+ export function resolveTraceEnabled(configTrace, isDev) {
86
+ return configTrace ?? isDev;
87
+ }
88
+ /** Redact obvious secrets (URL-scheme auth tokens) from a logged argv. */
89
+ export function sanitizeArgv(argv) {
90
+ return argv.map((arg) => arg.replace(/((?:[?&]|\b)(?:auth|token)=)[^&\s]+/gi, "$1<redacted>"));
91
+ }
92
+ function isoStamp(ms) {
93
+ return new Date(ms).toISOString();
94
+ }
95
+ /**
96
+ * Open a per-invocation JSONL trace file and return the sink (already carrying
97
+ * the leading `invocation` event). One file per process keeps concurrent
98
+ * invocations from interleaving, so the file for a given run reconstructs that
99
+ * run and nothing else.
100
+ */
101
+ export function createFileTraceSink(opts) {
102
+ const now = opts.now ?? Date.now;
103
+ const startedAt = now();
104
+ mkdirSync(opts.dir, { recursive: true });
105
+ // Filesystem-safe stamp (colons/dots → dashes) plus the pid, so two runs in
106
+ // the same second never collide.
107
+ const fileStamp = isoStamp(startedAt).replace(/[:.]/g, "-");
108
+ const path = join(opts.dir, `${fileStamp}-${opts.pid}.jsonl`);
109
+ const sinkImpl = {
110
+ path,
111
+ startedAt,
112
+ write(event) {
113
+ const line = `${JSON.stringify({ ts: isoStamp(now()), elapsedMs: now() - startedAt, ...event })}\n`;
114
+ appendFileSync(path, line);
115
+ },
116
+ close() {
117
+ // JSONL is flushed per line; nothing to finalize.
118
+ },
119
+ };
120
+ sinkImpl.write({
121
+ phase: "invocation",
122
+ argv: sanitizeArgv(opts.argv),
123
+ version: opts.version,
124
+ pid: opts.pid,
125
+ cwd: process.cwd(),
126
+ });
127
+ return sinkImpl;
128
+ }
129
+ /**
130
+ * CLI entry: decide whether to trace this invocation and, if so, install a file
131
+ * sink. Returns the sink (or null when off). Called from the write driver so
132
+ * tracing is scoped to mutations — the invocations where a step timeline earns
133
+ * its keep. Never throws: a trace-setup failure degrades to no tracing.
134
+ */
135
+ export function installCliTrace(opts) {
136
+ const env = opts.env ?? process.env;
137
+ try {
138
+ const config = loadConfig(env);
139
+ if (!resolveTraceEnabled(config.traceEnabled, opts.isDev))
140
+ return null;
141
+ const created = createFileTraceSink({
142
+ dir: traceDir(env),
143
+ argv: opts.argv,
144
+ version: opts.version,
145
+ pid: opts.pid ?? process.pid,
146
+ });
147
+ setTraceSink(created);
148
+ return created;
149
+ }
150
+ catch {
151
+ return null;
152
+ }
153
+ }
154
+ /** Tear down the process trace sink (clears the in-flight marker too). */
155
+ export function closeCliTrace() {
156
+ inflight = null;
157
+ if (sink !== null) {
158
+ try {
159
+ sink.close();
160
+ }
161
+ catch {
162
+ // best-effort
163
+ }
164
+ sink = null;
165
+ }
166
+ }
167
+ //# sourceMappingURL=tracer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracer.js","sourceRoot":"","sources":["../../src/trace/tracer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAuBvC,IAAI,IAAI,GAAqB,IAAI,CAAC;AAElC,4DAA4D;AAC5D,MAAM,UAAU,YAAY,CAAC,IAAsB;IACjD,IAAI,GAAG,IAAI,CAAC;AACd,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,SAAS;IACvB,OAAO,IAAI,CAAC;AACd,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,WAAW;IACzB,OAAO,IAAI,KAAK,IAAI,CAAC;AACvB,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,SAAS;IACvB,OAAO,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,SAA2B;IAC/C,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO;IAC1B,IAAI,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,oEAAoE;IACtE,CAAC;AACH,CAAC;AAmBD,IAAI,QAAQ,GAAyB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QACH,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,OAAO,CAAC;IACjB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,aAAa;IAC3B,QAAQ,GAAG,IAAI,CAAC;IAChB,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,IAAI,CAAC;YACH,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC;QAAC,MAAM,CAAC;YACP,cAAc;QAChB,CAAC;QACD,IAAI,GAAG,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -66,6 +66,21 @@ export interface BatchItemResult {
66
66
  /** Echoed when the op carried a client idempotency id (ADDITIVE). */
67
67
  opId?: string;
68
68
  }
69
+ /**
70
+ * Resume guidance after a stop-on-failure halt (Change 2). Present only when a
71
+ * runtime failure halted the batch with lines left not-run. Tells the caller
72
+ * whether the SAME batch can be resubmitted verbatim to resume.
73
+ */
74
+ export interface BatchResumption {
75
+ /** How many lines were reported not-run after the halt. */
76
+ notRun: number;
77
+ /** True iff every line that COMMITTED a change carried an opId (safe verbatim rerun). */
78
+ verbatimSafe: boolean;
79
+ /** Indices of committed lines that lacked an opId — a verbatim rerun would RE-RUN these. */
80
+ nonIdempotentIndices: number[];
81
+ /** Human-readable resume story (mirrored into the CLI/MCP summary). */
82
+ detail: string;
83
+ }
69
84
  /** The whole-batch result: the per-op stream plus the batch-level additions. */
70
85
  export interface BatchResult {
71
86
  results: BatchItemResult[];
@@ -77,14 +92,24 @@ export interface BatchResult {
77
92
  * all-rejected batch, or one where no leg reached the pipeline.
78
93
  */
79
94
  undoToken?: string;
95
+ /**
96
+ * Resume guidance — present only when a runtime failure HALTED the batch
97
+ * (stop-on-failure default) leaving lines not-run (ADDITIVE).
98
+ */
99
+ resumption?: BatchResumption;
80
100
  }
81
101
  export interface BatchOptions {
82
- /** Stop at the first non-ok outcome; remaining ops report kind "skipped". */
83
- failFast?: boolean;
102
+ /**
103
+ * Run PAST a runtime per-line failure instead of halting. The default is
104
+ * stop-on-failure (Change 2): a runtime failure halts the batch and every
105
+ * later line is reported not-run. Set this to restore the old proceed-past
106
+ * behavior (every line runs regardless of earlier failures).
107
+ */
108
+ continueOnError?: boolean;
84
109
  /** Plan every op without executing (each result is its dry-run plan). */
85
110
  dryRun?: boolean;
86
111
  actor?: string;
87
112
  }
88
- /** True when an outcome should be treated as a failure for --fail-fast/exit. */
113
+ /** True when an outcome should be treated as a failure (halt / exit code). */
89
114
  export declare function outcomeFailed(outcome: BatchItemOutcome): boolean;
90
115
  export declare function runBatch(deps: WriteDeps, ops: BatchOp[], options?: BatchOptions, onResult?: (result: BatchItemResult) => void): Promise<BatchResult>;