mandrel 2.111.0 → 2.113.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 (183) hide show
  1. package/.agents/agents/acceptance-critic.md +14 -0
  2. package/.agents/agents/auditor.md +14 -0
  3. package/.agents/agents/plan-critic.md +5 -0
  4. package/.agents/agents/story-worker.md +4 -1
  5. package/.agents/docs/agentrc-reference.json +22 -10
  6. package/.agents/docs/configuration.md +367 -37
  7. package/.agents/docs/execution-reference.md +11 -0
  8. package/.agents/rules/git-conventions-reference.md +7 -0
  9. package/.agents/schemas/agentrc.schema.json +174 -14
  10. package/.agents/schemas/baselines/baseline-envelope.schema.json +16 -4
  11. package/.agents/schemas/baselines/bundle-size.schema.json +1 -0
  12. package/.agents/schemas/baselines/coverage.schema.json +1 -0
  13. package/.agents/schemas/baselines/crap.schema.json +37 -10
  14. package/.agents/schemas/baselines/duplication.schema.json +1 -0
  15. package/.agents/schemas/baselines/maintainability.schema.json +1 -0
  16. package/.agents/schemas/baselines/mutation.schema.json +1 -0
  17. package/.agents/schemas/crap-report.schema.json +6 -5
  18. package/.agents/schemas/story-deliver-terminal.schema.json +41 -2
  19. package/.agents/schemas/story-progress.schema.json +1 -1
  20. package/.agents/schemas/validation-evidence.schema.json +2 -2
  21. package/.agents/scripts/boot-sweep.js +41 -3
  22. package/.agents/scripts/coverage-capture.js +37 -3
  23. package/.agents/scripts/coverage-ratchet.js +106 -0
  24. package/.agents/scripts/evidence-gate.js +84 -21
  25. package/.agents/scripts/lib/audit-baselines/read.js +8 -1
  26. package/.agents/scripts/lib/audit-baselines/trend.js +2 -1
  27. package/.agents/scripts/lib/baseline-loader.js +4 -2
  28. package/.agents/scripts/lib/baselines/codec.js +57 -0
  29. package/.agents/scripts/lib/baselines/crap-preview-incremental.js +8 -3
  30. package/.agents/scripts/lib/baselines/crap-preview-scan.js +10 -16
  31. package/.agents/scripts/lib/baselines/crap-updater-cli.js +4 -13
  32. package/.agents/scripts/lib/baselines/kernel.js +19 -1
  33. package/.agents/scripts/lib/baselines/kinds/_crap-codec.js +171 -0
  34. package/.agents/scripts/lib/baselines/kinds/_crap-read.js +56 -16
  35. package/.agents/scripts/lib/baselines/kinds/_shared-metric.js +0 -59
  36. package/.agents/scripts/lib/baselines/kinds/crap.js +283 -319
  37. package/.agents/scripts/lib/baselines/merge-envelopes.js +46 -1
  38. package/.agents/scripts/lib/baselines/preview-gates.js +29 -10
  39. package/.agents/scripts/lib/baselines/reader.js +36 -9
  40. package/.agents/scripts/lib/baselines/refresh-service.js +93 -21
  41. package/.agents/scripts/lib/baselines/seat-missing.js +173 -7
  42. package/.agents/scripts/lib/baselines/writer.js +36 -21
  43. package/.agents/scripts/lib/changed-files.js +70 -6
  44. package/.agents/scripts/lib/child-exec.js +10 -0
  45. package/.agents/scripts/lib/claude/agents-projection.js +5 -5
  46. package/.agents/scripts/lib/close-lock-events.js +8 -3
  47. package/.agents/scripts/lib/close-validation/ci-deferral.js +40 -0
  48. package/.agents/scripts/lib/close-validation/gates.js +111 -35
  49. package/.agents/scripts/lib/close-validation/process.js +16 -7
  50. package/.agents/scripts/lib/close-validation/projections/crap.js +43 -10
  51. package/.agents/scripts/lib/close-validation/runner.js +55 -23
  52. package/.agents/scripts/lib/close-validation/skip-branch-test.js +144 -0
  53. package/.agents/scripts/lib/close-validation/test-delta.js +33 -8
  54. package/.agents/scripts/lib/codex/agents-projection.js +6 -0
  55. package/.agents/scripts/lib/config/agentrc-overlay.js +9 -5
  56. package/.agents/scripts/lib/config/explain.js +5 -2
  57. package/.agents/scripts/lib/config/gates/coverage.schema.js +45 -1
  58. package/.agents/scripts/lib/config/gates/crap-incremental-coverage.schema.js +1 -1
  59. package/.agents/scripts/lib/config/git-roots.js +38 -4
  60. package/.agents/scripts/lib/config/handoff.js +24 -0
  61. package/.agents/scripts/lib/config/quality.js +26 -13
  62. package/.agents/scripts/lib/config/worktree-isolation.js +2 -5
  63. package/.agents/scripts/lib/config-resolver.js +22 -2
  64. package/.agents/scripts/lib/config-settings-schema-delivery.js +87 -4
  65. package/.agents/scripts/lib/config-settings-schema-quality.js +36 -1
  66. package/.agents/scripts/lib/config-settings-schema.js +1 -1
  67. package/.agents/scripts/lib/coverage-capture-affected.js +1 -0
  68. package/.agents/scripts/lib/coverage-capture-delta.js +164 -32
  69. package/.agents/scripts/lib/coverage-capture-own-fix.js +232 -0
  70. package/.agents/scripts/lib/coverage-capture-usage.js +2 -2
  71. package/.agents/scripts/lib/coverage-capture.js +15 -0
  72. package/.agents/scripts/lib/coverage-deferral.js +96 -0
  73. package/.agents/scripts/lib/coverage-ratchet.js +187 -0
  74. package/.agents/scripts/lib/crap-baseline-join.js +5 -5
  75. package/.agents/scripts/lib/crap-engine.js +3 -3
  76. package/.agents/scripts/lib/crap-method-identity.js +104 -48
  77. package/.agents/scripts/lib/error-redactor.js +20 -0
  78. package/.agents/scripts/lib/escomplex-anchor.js +135 -0
  79. package/.agents/scripts/lib/escomplex-kernel.js +30 -1
  80. package/.agents/scripts/lib/failure-rows.js +121 -0
  81. package/.agents/scripts/lib/full-suite-lock.js +44 -4
  82. package/.agents/scripts/lib/full-suite-queue.js +89 -13
  83. package/.agents/scripts/lib/generated/agentrc-validator.js +8 -2
  84. package/.agents/scripts/lib/gh-env.js +3 -6
  85. package/.agents/scripts/lib/gh-pr-rest.js +1 -0
  86. package/.agents/scripts/lib/git/base-sync-probe.js +182 -0
  87. package/.agents/scripts/lib/git/baseline-conflict-rows.js +60 -0
  88. package/.agents/scripts/lib/git/sync-from-base.js +18 -9
  89. package/.agents/scripts/lib/git-branch-lifecycle.js +9 -0
  90. package/.agents/scripts/lib/observability/close-telemetry.js +37 -2
  91. package/.agents/scripts/lib/observability/handoff-telemetry.js +170 -0
  92. package/.agents/scripts/lib/observability/review-dispositions.js +23 -6
  93. package/.agents/scripts/lib/observability/runtime-friction.js +17 -4
  94. package/.agents/scripts/lib/observability/source-classifier.js +3 -0
  95. package/.agents/scripts/lib/observability/story-outcome.js +393 -0
  96. package/.agents/scripts/lib/orchestration/check-baselines/phases/compare.js +2 -1
  97. package/.agents/scripts/lib/orchestration/check-baselines/phases/evaluate.js +19 -1
  98. package/.agents/scripts/lib/orchestration/check-baselines/phases/fail-detail.js +84 -0
  99. package/.agents/scripts/lib/orchestration/check-baselines/phases/pipeline.js +14 -5
  100. package/.agents/scripts/lib/orchestration/check-baselines/phases/refresh-ack.js +3 -2
  101. package/.agents/scripts/lib/orchestration/check-baselines/phases/report.js +26 -6
  102. package/.agents/scripts/lib/orchestration/code-review.js +223 -19
  103. package/.agents/scripts/lib/orchestration/handoff-gates.js +129 -62
  104. package/.agents/scripts/lib/orchestration/handoff-rescore.js +170 -0
  105. package/.agents/scripts/lib/orchestration/handoff-suite-of-record.js +45 -0
  106. package/.agents/scripts/lib/orchestration/preflight-lanes.js +208 -0
  107. package/.agents/scripts/lib/orchestration/review-base-ref.js +40 -17
  108. package/.agents/scripts/lib/orchestration/review-deposit.js +38 -12
  109. package/.agents/scripts/lib/orchestration/review-depth.js +21 -0
  110. package/.agents/scripts/lib/orchestration/review-history.js +124 -20
  111. package/.agents/scripts/lib/orchestration/review-providers/claude-verdict.js +41 -12
  112. package/.agents/scripts/lib/orchestration/review-providers/code-review.js +90 -39
  113. package/.agents/scripts/lib/orchestration/review-providers/critical-verifier.js +64 -11
  114. package/.agents/scripts/lib/orchestration/review-providers/degraded-gates.js +102 -3
  115. package/.agents/scripts/lib/orchestration/review-providers/finding-identity.js +6 -2
  116. package/.agents/scripts/lib/orchestration/review-providers/findings-renderer.js +55 -8
  117. package/.agents/scripts/lib/orchestration/review-providers/review-guidance.js +1 -0
  118. package/.agents/scripts/lib/orchestration/review-providers/review-provider-factory.js +42 -15
  119. package/.agents/scripts/lib/orchestration/review-providers/types.js +6 -0
  120. package/.agents/scripts/lib/orchestration/single-story-close/failed-terminal.js +10 -1
  121. package/.agents/scripts/lib/orchestration/single-story-close/gate-log.js +10 -0
  122. package/.agents/scripts/lib/orchestration/single-story-close/phases/base-sync.js +7 -4
  123. package/.agents/scripts/lib/orchestration/single-story-close/phases/close-validation.js +16 -3
  124. package/.agents/scripts/lib/orchestration/single-story-close/phases/code-review.js +59 -2
  125. package/.agents/scripts/lib/orchestration/single-story-close/phases/confirm-merge.js +6 -0
  126. package/.agents/scripts/lib/orchestration/single-story-close/phases/finish.js +15 -4
  127. package/.agents/scripts/lib/orchestration/single-story-close/phases/land-review-record.js +213 -0
  128. package/.agents/scripts/lib/orchestration/single-story-close/phases/normalize-pr-title.js +9 -12
  129. package/.agents/scripts/lib/orchestration/single-story-close/phases/open-pr.js +26 -12
  130. package/.agents/scripts/lib/orchestration/single-story-close/phases/post-land.js +51 -26
  131. package/.agents/scripts/lib/orchestration/single-story-close/phases/pre-gate-steps.js +2 -1
  132. package/.agents/scripts/lib/orchestration/single-story-close/phases/pre-push.js +3 -2
  133. package/.agents/scripts/lib/orchestration/single-story-close/phases/pull-request.js +50 -17
  134. package/.agents/scripts/lib/orchestration/single-story-close/phases/push.js +59 -11
  135. package/.agents/scripts/lib/orchestration/single-story-close/phases/reconcile-done.js +1 -0
  136. package/.agents/scripts/lib/orchestration/single-story-close/phases/review-block.js +31 -13
  137. package/.agents/scripts/lib/orchestration/single-story-close/phases/review-halt.js +29 -6
  138. package/.agents/scripts/lib/orchestration/single-story-close/phases/review-outcome.js +10 -12
  139. package/.agents/scripts/lib/orchestration/single-story-close/phases/review-override.js +19 -4
  140. package/.agents/scripts/lib/orchestration/single-story-close/result.js +30 -13
  141. package/.agents/scripts/lib/orchestration/single-story-close/review-overlap.js +73 -39
  142. package/.agents/scripts/lib/orchestration/single-story-close/runner.js +11 -3
  143. package/.agents/scripts/lib/orchestration/story-close/baseline-upward-writeback.js +3 -2
  144. package/.agents/scripts/lib/orchestration/story-close/duplication-close-rescore.js +77 -15
  145. package/.agents/scripts/lib/orchestration/story-deliver-terminal.js +7 -0
  146. package/.agents/scripts/lib/orchestration/story-handoff.js +796 -196
  147. package/.agents/scripts/lib/orchestration/ticketing/reads.js +2 -0
  148. package/.agents/scripts/lib/pr-body-lines.js +32 -0
  149. package/.agents/scripts/lib/single-story/ci-ratchet-gate.js +140 -0
  150. package/.agents/scripts/lib/single-story/confirm-and-land.js +17 -7
  151. package/.agents/scripts/lib/single-story/confirm-merge.js +12 -3
  152. package/.agents/scripts/lib/single-story-sweep/report-stalled-executing.js +202 -0
  153. package/.agents/scripts/lib/standalone-ratchets.js +37 -0
  154. package/.agents/scripts/lib/suite-admission.js +20 -8
  155. package/.agents/scripts/lib/suite-sizing.js +146 -0
  156. package/.agents/scripts/lib/workspace-provisioner.js +2 -2
  157. package/.agents/scripts/merge-baseline.js +14 -3
  158. package/.agents/scripts/providers/github/comments.js +19 -3
  159. package/.agents/scripts/providers/github.js +1 -0
  160. package/.agents/scripts/review-dispositions-report.js +1 -1
  161. package/.agents/scripts/role-scope-guard.js +267 -0
  162. package/.agents/scripts/single-story-close.js +4 -4
  163. package/.agents/scripts/single-story-confirm-merge.js +31 -5
  164. package/.agents/scripts/single-story-init.js +24 -4
  165. package/.agents/scripts/story-handoff.js +3 -3
  166. package/.agents/scripts/story-outcomes-report.js +231 -0
  167. package/.agents/scripts/story-review-compute.js +9 -5
  168. package/.agents/scripts/update-coverage-baseline.js +12 -2
  169. package/.agents/scripts/update-crap-baseline.js +9 -1
  170. package/.agents/workflows/helpers/code-review.md +63 -9
  171. package/.agents/workflows/helpers/deliver-digest.md +53 -54
  172. package/.agents/workflows/helpers/deliver-reference.md +233 -67
  173. package/.agents/workflows/helpers/deliver-story-reference.md +19 -8
  174. package/.agents/workflows/helpers/deliver-story.md +7 -2
  175. package/.agents/workflows/helpers/parallel-tooling.md +29 -0
  176. package/docs/CHANGELOG.md +55 -0
  177. package/lib/cli/doctor-checks/coverage-ratchet.js +54 -0
  178. package/lib/cli/doctor-checks/effective-agentrc.js +23 -0
  179. package/lib/cli/doctor-checks/llm-review.js +2 -11
  180. package/lib/cli/doctor-checks/sync-parity.js +5 -1
  181. package/lib/cli/doctor-checks/test-credit-path.js +7 -2
  182. package/lib/cli/registry.js +5 -0
  183. package/package.json +1 -1
@@ -7,6 +7,10 @@
7
7
  * adds clones to a file it changed fails the head-vs-base compare at close.
8
8
  * The scan covers the whole tree (clones are pairwise); only changed-file rows
9
9
  * and their clone partners' rows are written. Every failure is a named skip, never a failed close.
10
+ *
11
+ * A skipped base sync passes `baselineRef` (the merge-base): the change set is
12
+ * scoped on it, and no row is written for a path `origin/<base>` changed since,
13
+ * because the tree holds that file's merge-base version and main owns its row.
10
14
  */
11
15
 
12
16
  import fs from 'node:fs';
@@ -31,7 +35,7 @@ const TAG = '[duplication-rescore]';
31
35
 
32
36
  const KIND = 'duplication';
33
37
 
34
- const DEFAULT_BASELINE_REL_PATH = 'baselines/duplication.json';
38
+ export const DEFAULT_BASELINE_REL_PATH = 'baselines/duplication.json';
35
39
 
36
40
  /**
37
41
  * Untagged on purpose (see the module header): never `baseline-refresh:`.
@@ -63,9 +67,20 @@ function buildCommitBody(moved) {
63
67
  * @param {object} logger
64
68
  * @param {string} reason
65
69
  */
66
- function skip(logger, reason) {
70
+ function skip(logger, reason, extra = {}) {
67
71
  logger.info?.(`${TAG} no re-score commit (${reason}).`);
68
- return { ran: false, committed: false, reason };
72
+ return { ran: false, committed: false, reason, ...extra };
73
+ }
74
+
75
+ /** A completed scan that moved nothing still reports its clone partners. */
76
+ function unchanged(logger, partners) {
77
+ return skip(logger, 'unchanged', { moved: [], partners });
78
+ }
79
+
80
+ /** @returns {object} a committed re-score's result. */
81
+ function committedResult(sha, moved, partners) {
82
+ const movedPaths = moved.map((m) => m.path);
83
+ return { ran: true, committed: true, sha, movedPaths, moved, partners };
69
84
  }
70
85
 
71
86
  /**
@@ -87,11 +102,44 @@ function resolveScopeBase({ workTree, git, baseBranch }) {
87
102
  }
88
103
 
89
104
  /**
90
- * Guards plus the scoped file list. A dirty baseline file would otherwise be
91
- * swept into the commit.
105
+ * Paths `origin/<base>` changed since `baselineRef`; the base-sync probe's
106
+ * raw-path rule. Throws on a failed diff.
107
+ *
108
+ * @param {{ workTree: string, git: Function, scopeBase: string, baselineRef: string }} ctx
109
+ * @returns {string[]}
110
+ */
111
+ function listIncomingFiles({ workTree, git, scopeBase, baselineRef }) {
112
+ const out = git(
113
+ ['diff', '--name-only', '--no-renames', baselineRef, scopeBase],
114
+ { cwd: workTree },
115
+ );
116
+ return String(out ?? '')
117
+ .split('\n')
118
+ .map((line) => line.trim())
119
+ .filter((line) => line.length > 0);
120
+ }
121
+
122
+ /**
123
+ * The change-set base and the incoming paths a skipped base sync excludes.
124
+ *
125
+ * @param {{ workTree: string, git: Function, baseBranch: string, baselineRef?: string }} ctx
126
+ * @returns {{ diffBase: string, exclude: string[] }}
127
+ */
128
+ function resolveScopeRefs({ workTree, git, baseBranch, baselineRef }) {
129
+ const scopeBase = resolveScopeBase({ workTree, git, baseBranch });
130
+ if (!baselineRef) return { diffBase: scopeBase, exclude: [] };
131
+ return {
132
+ diffBase: baselineRef,
133
+ exclude: listIncomingFiles({ workTree, git, scopeBase, baselineRef }),
134
+ };
135
+ }
136
+
137
+ /**
138
+ * Guards plus the scoped file list and the paths whose rows stay untouched. A
139
+ * dirty baseline file would otherwise be swept into the commit.
92
140
  *
93
- * @param {{ workTree: string, baseBranch: string, storyBranch: string, git: Function, relPath: string, additionalFormats?: string[] }} ctx
94
- * @returns {{ reason: string } | { files: string[] }}
141
+ * @param {{ workTree: string, baseBranch: string, storyBranch: string, git: Function, relPath: string, additionalFormats?: string[], baselineRef?: string }} ctx
142
+ * @returns {{ reason: string } | { files: string[], exclude: string[] }}
95
143
  */
96
144
  function resolveScope({
97
145
  workTree,
@@ -100,6 +148,7 @@ function resolveScope({
100
148
  git,
101
149
  relPath,
102
150
  additionalFormats,
151
+ baselineRef,
103
152
  }) {
104
153
  if (currentBranch(workTree, git) !== storyBranch) {
105
154
  return { reason: 'wrong-branch' };
@@ -107,14 +156,22 @@ function resolveScope({
107
156
  if (listDirtyPaths(workTree, git).includes(relPath)) {
108
157
  return { reason: 'dirty-tree' };
109
158
  }
159
+ const { diffBase, exclude } = resolveScopeRefs({
160
+ workTree,
161
+ git,
162
+ baseBranch,
163
+ baselineRef,
164
+ });
110
165
  const isScorable = fileFilterFor(KIND, { additionalFormats });
111
166
  const files = listChangedFiles({
112
167
  cwd: workTree,
113
- baseBranch: resolveScopeBase({ workTree, git, baseBranch }),
168
+ baseBranch: diffBase,
114
169
  storyBranch,
115
170
  git,
116
171
  }).filter((f) => isScorable(f));
117
- return files.length === 0 ? { reason: 'no-changed-files' } : { files };
172
+ return files.length === 0
173
+ ? { reason: 'no-changed-files' }
174
+ : { files, exclude };
118
175
  }
119
176
 
120
177
  /**
@@ -179,13 +236,15 @@ async function attempt(fn, label) {
179
236
  * storyId: number|string,
180
237
  * baseBranch: string,
181
238
  * storyBranch?: string,
239
+ * baselineRef?: string,
182
240
  * config?: object,
183
241
  * logger?: object,
184
242
  * gitSync?: (cwd: string, ...args: string[]) => string,
185
243
  * refreshBaseline?: typeof defaultRefreshBaseline,
186
244
  * scorer?: (files: string[], opts: object) => Promise<object[]>|object[],
187
245
  * }} opts
188
- * @returns {Promise<{ ran: boolean, committed: boolean, sha?: string, movedPaths?: string[], reason?: string }>}
246
+ * @returns {Promise<{ ran: boolean, committed: boolean, sha?: string, movedPaths?: string[], reason?: string, moved?: Array<{ path: string, before: number|null, after: number|null }>, partners?: Record<string, string[]> }>}
247
+ * `moved` and `partners` (write-scope clone partners) whenever a scan completed.
189
248
  */
190
249
  export async function runDuplicationCloseRescore({
191
250
  cwd,
@@ -193,6 +252,7 @@ export async function runDuplicationCloseRescore({
193
252
  storyId,
194
253
  baseBranch,
195
254
  storyBranch,
255
+ baselineRef,
196
256
  config,
197
257
  logger = DefaultLogger,
198
258
  gitSync = defaultGitSync,
@@ -224,12 +284,13 @@ export async function runDuplicationCloseRescore({
224
284
  git,
225
285
  relPath,
226
286
  additionalFormats: gate.value.additionalFormats,
287
+ baselineRef,
227
288
  }),
228
289
  'git-failed',
229
290
  );
230
291
  if (scope.reason) return skip(logger, scope.reason);
231
292
  if (scope.value.reason) return skip(logger, scope.value.reason);
232
- const { files } = scope.value;
293
+ const { files, exclude } = scope.value;
233
294
 
234
295
  const priorRows = readPriorEnvelope(writePath, fs)?.rows ?? [];
235
296
  const refreshed = await attempt(
@@ -239,13 +300,15 @@ export async function runDuplicationCloseRescore({
239
300
  cwd: workTree,
240
301
  writePath,
241
302
  scopeFiles: files,
303
+ excludeWriteFiles: exclude,
242
304
  epsilon: getBaselineEpsilon(KIND),
243
305
  ...(scorer ? { scorer } : {}),
244
306
  }),
245
307
  'scorer-failed',
246
308
  );
247
309
  if (refreshed.reason) return skip(logger, refreshed.reason);
248
- if (!refreshed.value?.wrote) return skip(logger, 'unchanged');
310
+ const { partners = {} } = refreshed.value;
311
+ if (!refreshed.value.wrote) return unchanged(logger, partners);
249
312
 
250
313
  const moved = diffScopedRows({
251
314
  files: refreshed.value.scope?.files ?? files,
@@ -264,9 +327,8 @@ export async function runDuplicationCloseRescore({
264
327
  'git-failed',
265
328
  );
266
329
  if (committed.reason) return skip(logger, committed.reason);
267
- const movedPaths = moved.map((m) => m.path);
268
330
  logger.warn?.(
269
- `${TAG} re-scored ${movedPaths.length} duplication row(s) on story #${storyId}; committed as ${committed.value}.`,
331
+ `${TAG} re-scored ${moved.length} duplication row(s) on story #${storyId}; committed as ${committed.value}.`,
270
332
  );
271
- return { ran: true, committed: true, sha: committed.value, movedPaths };
333
+ return committedResult(committed.value, moved, partners);
272
334
  }
@@ -118,6 +118,9 @@ function compact(obj) {
118
118
  * Full-suite lock wait; `waitBudget` is merge-wait only.
119
119
  * @param {{ lockWaitMs: number, hostWaitMs: number|null, testRunMs: number, source: 'close'|'credited-run', spawns: object[] }|null} [args.suiteTimings]
120
120
  * @param {Record<string, number>|null} [args.phaseDurations] Seconds per phase.
121
+ * @param {{ mode: string, outcome: string, reason: string, incoming: number }|null} [args.baseSync]
122
+ * Close's base-sync decision; `null` when no sync ran, absent when not passed.
123
+ * @param {'pushed'|'skipped-already-at-head'|null} [args.pushOutcome]
121
124
  * @param {string} [args.timestamp]
122
125
  * @param {{ schema: object|null, error: string|null }} [args.schemaSource]
123
126
  * Test seam.
@@ -141,6 +144,8 @@ export function buildTerminalEnvelope({
141
144
  lockWait,
142
145
  suiteTimings,
143
146
  phaseDurations,
147
+ baseSync,
148
+ pushOutcome,
144
149
  timestamp = new Date().toISOString(),
145
150
  schemaSource,
146
151
  }) {
@@ -164,6 +169,8 @@ export function buildTerminalEnvelope({
164
169
  lockWait: lockWait ?? null,
165
170
  suiteTimings: suiteTimings ?? null,
166
171
  phaseDurations,
172
+ baseSync,
173
+ pushOutcome,
167
174
  timestamp,
168
175
  });
169
176