@dzhechkov/harness-core 0.8.38 → 0.8.40

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 (192) hide show
  1. package/.dz-manifest.json +281 -161
  2. package/README.md +145 -2
  3. package/dist/agentdb-index.d.ts +3 -3
  4. package/dist/agentdb-index.js +5 -5
  5. package/dist/agentdb-index.js.map +1 -1
  6. package/dist/amendment-trace.d.ts.map +1 -1
  7. package/dist/amendment-trace.js +4 -1
  8. package/dist/amendment-trace.js.map +1 -1
  9. package/dist/backlog.d.ts +2 -1
  10. package/dist/backlog.d.ts.map +1 -1
  11. package/dist/backlog.js +3 -2
  12. package/dist/backlog.js.map +1 -1
  13. package/dist/brain.d.ts.map +1 -1
  14. package/dist/brain.js +9 -2
  15. package/dist/brain.js.map +1 -1
  16. package/dist/bto-optimize.d.ts.map +1 -1
  17. package/dist/bto-optimize.js +9 -12
  18. package/dist/bto-optimize.js.map +1 -1
  19. package/dist/claim-check.d.ts.map +1 -1
  20. package/dist/claim-check.js +50 -14
  21. package/dist/claim-check.js.map +1 -1
  22. package/dist/cmd-usage.d.ts.map +1 -1
  23. package/dist/cmd-usage.js +48 -2
  24. package/dist/cmd-usage.js.map +1 -1
  25. package/dist/compounding.d.ts +66 -0
  26. package/dist/compounding.d.ts.map +1 -1
  27. package/dist/compounding.js +76 -9
  28. package/dist/compounding.js.map +1 -1
  29. package/dist/doctor-instrument.d.ts +65 -0
  30. package/dist/doctor-instrument.d.ts.map +1 -0
  31. package/dist/doctor-instrument.js +91 -0
  32. package/dist/doctor-instrument.js.map +1 -0
  33. package/dist/experiment-assign.d.ts +110 -0
  34. package/dist/experiment-assign.d.ts.map +1 -0
  35. package/dist/experiment-assign.js +229 -0
  36. package/dist/experiment-assign.js.map +1 -0
  37. package/dist/feature-adr-checkpoints.d.ts +7 -2
  38. package/dist/feature-adr-checkpoints.d.ts.map +1 -1
  39. package/dist/feature-adr-checkpoints.js +20 -5
  40. package/dist/feature-adr-checkpoints.js.map +1 -1
  41. package/dist/feature-adr-envelope.d.ts +12 -0
  42. package/dist/feature-adr-envelope.d.ts.map +1 -1
  43. package/dist/feature-adr-envelope.js +12 -1
  44. package/dist/feature-adr-envelope.js.map +1 -1
  45. package/dist/feature-adr-routing.d.ts +4 -0
  46. package/dist/feature-adr-routing.d.ts.map +1 -1
  47. package/dist/feature-adr-routing.js +4 -0
  48. package/dist/feature-adr-routing.js.map +1 -1
  49. package/dist/feature-tier.d.ts.map +1 -1
  50. package/dist/feature-tier.js +13 -1
  51. package/dist/feature-tier.js.map +1 -1
  52. package/dist/guard.d.ts +17 -0
  53. package/dist/guard.d.ts.map +1 -1
  54. package/dist/guard.js +15 -0
  55. package/dist/guard.js.map +1 -1
  56. package/dist/index.d.ts +14 -7
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +11 -5
  59. package/dist/index.js.map +1 -1
  60. package/dist/ledger-cost-fill.d.ts +58 -0
  61. package/dist/ledger-cost-fill.d.ts.map +1 -0
  62. package/dist/ledger-cost-fill.js +78 -0
  63. package/dist/ledger-cost-fill.js.map +1 -0
  64. package/dist/loop-blobs.generated.js +2 -2
  65. package/dist/loop-blobs.generated.js.map +1 -1
  66. package/dist/mutation-gate.d.ts +59 -0
  67. package/dist/mutation-gate.d.ts.map +1 -1
  68. package/dist/mutation-gate.js +65 -1
  69. package/dist/mutation-gate.js.map +1 -1
  70. package/dist/name-check.d.ts +20 -1
  71. package/dist/name-check.d.ts.map +1 -1
  72. package/dist/name-check.js +42 -1
  73. package/dist/name-check.js.map +1 -1
  74. package/dist/no-stubs.d.ts +10 -0
  75. package/dist/no-stubs.d.ts.map +1 -1
  76. package/dist/no-stubs.js +13 -9
  77. package/dist/no-stubs.js.map +1 -1
  78. package/dist/operations.d.ts +13 -0
  79. package/dist/operations.d.ts.map +1 -1
  80. package/dist/operations.js +88 -2
  81. package/dist/operations.js.map +1 -1
  82. package/dist/patterns.d.ts +24 -0
  83. package/dist/patterns.d.ts.map +1 -1
  84. package/dist/patterns.js +49 -9
  85. package/dist/patterns.js.map +1 -1
  86. package/dist/publish-source-scope.d.ts +32 -0
  87. package/dist/publish-source-scope.d.ts.map +1 -0
  88. package/dist/publish-source-scope.js +53 -0
  89. package/dist/publish-source-scope.js.map +1 -0
  90. package/dist/publish.d.ts +5 -0
  91. package/dist/publish.d.ts.map +1 -1
  92. package/dist/publish.js +32 -21
  93. package/dist/publish.js.map +1 -1
  94. package/dist/qe-bridge.d.ts +4 -1
  95. package/dist/qe-bridge.d.ts.map +1 -1
  96. package/dist/qe-bridge.js +21 -11
  97. package/dist/qe-bridge.js.map +1 -1
  98. package/dist/rake-analyzer.d.ts +10 -3
  99. package/dist/rake-analyzer.d.ts.map +1 -1
  100. package/dist/rake-analyzer.js +84 -22
  101. package/dist/rake-analyzer.js.map +1 -1
  102. package/dist/recap.d.ts.map +1 -1
  103. package/dist/recap.js +8 -4
  104. package/dist/recap.js.map +1 -1
  105. package/dist/registry.d.ts +58 -0
  106. package/dist/registry.d.ts.map +1 -1
  107. package/dist/registry.js +62 -5
  108. package/dist/registry.js.map +1 -1
  109. package/dist/release.d.ts +20 -1
  110. package/dist/release.d.ts.map +1 -1
  111. package/dist/release.js +48 -4
  112. package/dist/release.js.map +1 -1
  113. package/dist/reqe.d.ts.map +1 -1
  114. package/dist/reqe.js +11 -1
  115. package/dist/reqe.js.map +1 -1
  116. package/dist/round-exec.d.ts +10 -0
  117. package/dist/round-exec.d.ts.map +1 -1
  118. package/dist/round-exec.js +3 -2
  119. package/dist/round-exec.js.map +1 -1
  120. package/dist/round.d.ts +19 -0
  121. package/dist/round.d.ts.map +1 -1
  122. package/dist/round.js +1 -0
  123. package/dist/round.js.map +1 -1
  124. package/dist/run-records.d.ts +18 -4
  125. package/dist/run-records.d.ts.map +1 -1
  126. package/dist/run-records.js +61 -7
  127. package/dist/run-records.js.map +1 -1
  128. package/dist/score.d.ts.map +1 -1
  129. package/dist/score.js +8 -1
  130. package/dist/score.js.map +1 -1
  131. package/dist/sign.d.ts +23 -0
  132. package/dist/sign.d.ts.map +1 -1
  133. package/dist/sign.js +52 -0
  134. package/dist/sign.js.map +1 -1
  135. package/dist/skills-verify.d.ts +8 -5
  136. package/dist/skills-verify.d.ts.map +1 -1
  137. package/dist/skills-verify.js +59 -7
  138. package/dist/skills-verify.js.map +1 -1
  139. package/dist/store-guard-prune.d.ts +22 -0
  140. package/dist/store-guard-prune.d.ts.map +1 -0
  141. package/dist/store-guard-prune.js +54 -0
  142. package/dist/store-guard-prune.js.map +1 -0
  143. package/dist/sweep-failure-classify.d.ts +45 -0
  144. package/dist/sweep-failure-classify.d.ts.map +1 -0
  145. package/dist/sweep-failure-classify.js +90 -0
  146. package/dist/sweep-failure-classify.js.map +1 -0
  147. package/dist/workflow-run-dispatch.d.ts +14 -2
  148. package/dist/workflow-run-dispatch.d.ts.map +1 -1
  149. package/dist/workflow-run-dispatch.js +14 -2
  150. package/dist/workflow-run-dispatch.js.map +1 -1
  151. package/package.json +1 -1
  152. package/sbom.json +460 -160
  153. package/src/agentdb-index.ts +5 -5
  154. package/src/amendment-trace.ts +4 -1
  155. package/src/backlog.ts +3 -2
  156. package/src/brain.ts +8 -2
  157. package/src/bto-optimize.ts +10 -8
  158. package/src/claim-check.ts +48 -12
  159. package/src/cmd-usage.ts +52 -2
  160. package/src/compounding.ts +112 -9
  161. package/src/doctor-instrument.ts +153 -0
  162. package/src/experiment-assign.ts +276 -0
  163. package/src/feature-adr-checkpoints.ts +20 -5
  164. package/src/feature-adr-envelope.ts +24 -1
  165. package/src/feature-adr-routing.ts +4 -0
  166. package/src/feature-tier.ts +14 -1
  167. package/src/guard.ts +24 -0
  168. package/src/index.ts +22 -5
  169. package/src/loop-blobs.generated.ts +2 -2
  170. package/src/mutation-gate.ts +113 -1
  171. package/src/name-check.ts +43 -1
  172. package/src/no-stubs.ts +14 -5
  173. package/src/operations.ts +85 -3
  174. package/src/patterns.ts +49 -8
  175. package/src/publish-source-scope.ts +53 -0
  176. package/src/publish.ts +38 -16
  177. package/src/qe-bridge.ts +22 -11
  178. package/src/rake-analyzer.ts +75 -20
  179. package/src/rake-signatures.json +98 -0
  180. package/src/recap.ts +8 -4
  181. package/src/registry.ts +91 -1
  182. package/src/release.ts +54 -4
  183. package/src/reqe.ts +11 -1
  184. package/src/round-exec.ts +13 -2
  185. package/src/round.ts +20 -0
  186. package/src/run-records.ts +78 -10
  187. package/src/score.ts +8 -1
  188. package/src/sign.ts +53 -0
  189. package/src/skills-verify.ts +69 -9
  190. package/src/store-guard-prune.ts +81 -0
  191. package/src/sweep-failure-classify.ts +88 -0
  192. package/src/workflow-run-dispatch.ts +14 -2
@@ -0,0 +1,91 @@
1
+ import { isAbsolute, relative, sep } from 'node:path';
2
+ /** Strip semver build metadata: `0.8.32+a1b2c3` and `0.8.32` are the same release. */
3
+ function withoutBuildMetadata(version) {
4
+ const plus = version.indexOf('+');
5
+ return plus < 0 ? version : version.slice(0, plus);
6
+ }
7
+ function isInsideRoot(candidate, root) {
8
+ const fromRoot = relative(root, candidate);
9
+ return fromRoot === '' || (!isAbsolute(fromRoot) && fromRoot !== '..' && !fromRoot.startsWith(`..${sep}`));
10
+ }
11
+ /**
12
+ * Decide whether the executable answering `dz doctor` is the workspace's current instrument.
13
+ *
14
+ * LIMITS NAMED BY INDEPENDENT REVIEW (Claude Sonnet, 2026-09-20), none of them hidden behind a
15
+ * passing test:
16
+ * - Containment is a case-SENSITIVE path comparison. On a case-insensitive filesystem, or where the
17
+ * same location is reachable under two path forms, an in-tree binary can read as external. This
18
+ * repo runs on Linux; the cost of being wrong is one extra `warn` line and never an exit code.
19
+ * - The caller attributes a version by walking up from the binary to the NEAREST `package.json`.
20
+ * A shim in package A that loads package B's code is attributed to A, and a broken install with
21
+ * no own manifest is attributed to whatever ancestor has one. The detail always prints the
22
+ * resolved binary path so a reader can see which file was actually measured.
23
+ */
24
+ export function checkInstrumentFreshness(input) {
25
+ const binary = input.binPath ?? '(unresolved)';
26
+ const binaryVersion = input.binVersion ?? 'unknown';
27
+ const treeVersion = input.treeVersion ?? 'unknown';
28
+ if (!input.isMonorepo) {
29
+ return {
30
+ freshness: 'unknown',
31
+ level: 'ok',
32
+ detail: `not applicable in a consumer project: no packages/@dzhechkov tree version to compare; resolved binary ${binary}; binary version ${binaryVersion}; tree version ${treeVersion}`,
33
+ };
34
+ }
35
+ if (input.binPath !== null && input.projectRootRealpathed && isInsideRoot(input.binPath, input.projectRoot)) {
36
+ return {
37
+ freshness: 'same',
38
+ level: 'ok',
39
+ detail: `resolved binary ${input.binPath} is inside project root ${input.projectRoot}; binary version ${binaryVersion}; tree version ${treeVersion}; this binary is the tree instrument`,
40
+ };
41
+ }
42
+ if (!input.projectRootRealpathed) {
43
+ return {
44
+ freshness: 'unknown',
45
+ level: 'unknown',
46
+ detail: `project root ${input.projectRoot} could not be resolved through its symlinks, so it cannot be told whether the answering binary is the tree's own; version could not be determined safely; resolved binary ${binary}; binary version ${binaryVersion}; tree version ${treeVersion}`,
47
+ };
48
+ }
49
+ if (input.binPath === null || input.binVersion === null || input.treeVersion === null) {
50
+ return {
51
+ freshness: 'unknown',
52
+ level: 'unknown',
53
+ detail: `instrument version could not be determined; resolved binary ${binary}; binary version ${binaryVersion}; tree version ${treeVersion}`,
54
+ };
55
+ }
56
+ // Semver says build metadata after `+` does not participate in equality, so a pipeline that
57
+ // stamps a commit hash onto the version must not read as a stale instrument.
58
+ if (withoutBuildMetadata(input.binVersion) === withoutBuildMetadata(input.treeVersion)) {
59
+ return {
60
+ freshness: 'same',
61
+ level: 'ok',
62
+ detail: `resolved binary ${input.binPath}; binary version ${input.binVersion}; tree version ${input.treeVersion}; versions match`,
63
+ };
64
+ }
65
+ return {
66
+ freshness: 'stale',
67
+ level: 'warn',
68
+ detail: `resolved binary ${input.binPath}; binary version ${input.binVersion}; tree version ${input.treeVersion}; the answering instrument is stale`,
69
+ };
70
+ }
71
+ /** Decide whether enabled bandit re-ranking has the on-disk state needed to operate. */
72
+ export function checkRankingState(input) {
73
+ const binary = input.binPath ?? '(unresolved)';
74
+ if (!input.flagOn) {
75
+ return {
76
+ level: 'ok',
77
+ detail: `bandit re-ranking feature is off; no state is expected at ${input.statePath}; answering binary ${binary}`,
78
+ };
79
+ }
80
+ if (input.stateExists) {
81
+ return {
82
+ level: 'ok',
83
+ detail: `bandit re-ranking is on and state is present at ${input.statePath}; answering binary ${binary}`,
84
+ };
85
+ }
86
+ return {
87
+ level: 'warn',
88
+ detail: `bandit re-ranking is on but state is absent at ${input.statePath}; answering binary ${binary}`,
89
+ };
90
+ }
91
+ //# sourceMappingURL=doctor-instrument.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-instrument.js","sourceRoot":"","sources":["../src/doctor-instrument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAuDtD,sFAAsF;AACtF,SAAS,oBAAoB,CAAC,OAAe;IAC3C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,YAAY,CAAC,SAAiB,EAAE,IAAY;IACnD,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC3C,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,QAAQ,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC;AAC7G,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAA2B;IAClE,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,IAAI,cAAc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AAC,UAAU,CAAC,KAAK,oBAAoB,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;QACvF,OAAO;YACL,SAAS,EAAE,MAAM;YACjB,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,mBAAmB,KAAK,CAAC,OAAO,oBAAoB,KAAK,CAAC,UAAU,kBAAkB,KAAK,CAAC,WAAW,kBAAkB;SAClI,CAAC;IACJ,CAAC;IAED,OAAO;QACL,SAAS,EAAE,OAAO;QAClB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,mBAAmB,KAAK,CAAC,OAAO,oBAAoB,KAAK,CAAC,UAAU,kBAAkB,KAAK,CAAC,WAAW,qCAAqC;KACrJ,CAAC;AACJ,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,IAAI,cAAc,CAAC;IAC/C,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClB,OAAO;YACL,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,6DAA6D,KAAK,CAAC,SAAS,sBAAsB,MAAM,EAAE;SACnH,CAAC;IACJ,CAAC;IACD,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QACtB,OAAO;YACL,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,mDAAmD,KAAK,CAAC,SAAS,sBAAsB,MAAM,EAAE;SACzG,CAAC;IACJ,CAAC;IACD,OAAO;QACL,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,kDAAkD,KAAK,CAAC,SAAS,sBAAsB,MAAM,EAAE;KACxG,CAAC;AACJ,CAAC"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Deterministic, blocked arm assignment for a prospective ablation (ADR-001, ablation-c-start).
3
+ *
4
+ * WHY. The owner's question — does the Step-8 QE mode change task speed — is only answerable
5
+ * causally if the variant a task receives is decided by chance, BEFORE the work starts, and tied to
6
+ * the task's own identity so a repeated query for the same task never reassigns it. This module is
7
+ * that decision: a PURE function of `(experiment, stratum, seed, index)`. No filesystem, no clock,
8
+ * no network — the caller (the cli) owns the journal, the lock, and the "did work already start?"
9
+ * check; this module only computes.
10
+ *
11
+ * ALGORITHM — block randomization, one pair per arm-combination per block. `mulberry32` is the
12
+ * repo's ONLY pseudo-random generator (`compounding.ts` — "no second RNG in this repo"); reused
13
+ * here rather than adding a second stream. Block size is `arms.length * 2` — two occurrences of
14
+ * every arm per block, so a completed block is always perfectly balanced and `propensity` (the
15
+ * arm's actual share of its block) is a fixed `1 / arms.length` — never guessed, never assumed
16
+ * 0.5 by default (NFR-4). The block's own permutation is seeded from
17
+ * `fnv1a(JSON.stringify([experiment, stratum, seed, block]))` (a JSON-tuple, not a delimiter join —
18
+ * the same reason `workOrderDigestInput` in epoch-replay.ts uses tuples: a delimiter in `experiment`
19
+ * or `stratum` could otherwise make two different keys hash identically) — so different strata (and
20
+ * different experiments) never share a stream, and the SAME `(experiment, stratum, seed, index)`
21
+ * always rederives the SAME arm (A1 idempotency, A2 block balance, A3 propensity).
22
+ */
23
+ export interface AssignArmInput {
24
+ readonly experiment: string;
25
+ readonly stratum: string;
26
+ /** Pre-registered seed — fixed once, before any assignment is made. */
27
+ readonly seed: number;
28
+ /** 0-based ordinal of this task within its `(experiment, stratum)` sequence. */
29
+ readonly index: number;
30
+ /** The arms on offer, e.g. `['direct', 'reference']`. At least 2, all non-empty, all unique. */
31
+ readonly arms: readonly string[];
32
+ }
33
+ export type AssignArmResult = {
34
+ readonly ok: true;
35
+ readonly arm: string;
36
+ readonly propensity: number;
37
+ readonly block: number;
38
+ readonly position: number;
39
+ } | {
40
+ readonly ok: false;
41
+ readonly reason: string;
42
+ };
43
+ /**
44
+ * Deterministically assign one arm to task ordinal `index` within `(experiment, stratum)`. Refuses
45
+ * (never throws, never guesses) on any malformed input — empty strings, a non-integer seed/index, a
46
+ * negative index, fewer than two arms, duplicate or blank arm names.
47
+ */
48
+ export declare function assignArm(input: AssignArmInput): AssignArmResult;
49
+ export interface AssignmentRecord {
50
+ readonly ts: string;
51
+ readonly experiment: string;
52
+ readonly taskId: string;
53
+ readonly stratum: string;
54
+ readonly seed: number;
55
+ readonly index: number;
56
+ readonly block: number;
57
+ readonly position: number;
58
+ readonly arm: string;
59
+ readonly propensity: number;
60
+ readonly assignedAt: string;
61
+ }
62
+ export interface ReadAssignmentsResult {
63
+ readonly records: readonly AssignmentRecord[];
64
+ /** Non-blank lines that did not parse as a valid assignment record. Never silently dropped: a
65
+ * caller checking "is this task assigned?" must be able to tell "no" from "the journal is
66
+ * unreadable here" (A5). */
67
+ readonly malformedLines: number;
68
+ }
69
+ export type VerifyAssignmentResult = {
70
+ readonly ok: true;
71
+ } | {
72
+ readonly ok: false;
73
+ readonly reason: string;
74
+ /** Lead delta after Codex r2: `null` when the record failed on its SEED — there is nothing to
75
+ * expect, because the tuple it would be derived from is itself the thing under suspicion. */
76
+ readonly expected: {
77
+ readonly arm: string;
78
+ readonly block: number;
79
+ readonly position: number;
80
+ readonly propensity: number;
81
+ } | null;
82
+ readonly actual: {
83
+ readonly arm: string;
84
+ readonly block: number;
85
+ readonly position: number;
86
+ readonly propensity: number;
87
+ };
88
+ };
89
+ /**
90
+ * fix-round-1 (Codex r1 HIGH #7) — "syntactically valid journal corruption is accepted and returned
91
+ * as the task's assignment". A record that passes `isValidAssignmentRecord`'s SHAPE checks can still
92
+ * have been hand-edited to a different arm/block/position/propensity while keeping every field the
93
+ * right TYPE (e.g. flipping `arm:"direct"` to `arm:"reference"`, or `position:99`). The only way to
94
+ * catch that is to REDERIVE the assignment from the record's own tuple
95
+ * `(experiment, stratum, seed, index)` via the SAME pure `assignArm` that produced it, and compare —
96
+ * never trust the stored arm/block/position/propensity on their own. `arms` is the experiment's own
97
+ * registered arm set (from its `dz experiment init` config), passed in by the caller — this module
98
+ * stays pure and fs-free.
99
+ */
100
+ export declare function verifyAssignmentRecord(record: AssignmentRecord, arms: readonly string[], pinnedSeed?: number): VerifyAssignmentResult;
101
+ /**
102
+ * Parse a JSONL assignments journal (one record per line) into records, WITHOUT touching the
103
+ * filesystem — the caller reads the file, this only parses its text (NFR-1: the core stays
104
+ * `node:fs`-free). A line that is blank is skipped silently (append-only files end in a trailing
105
+ * newline); a line that is non-blank but does not parse as JSON, or parses to something missing a
106
+ * required field, counts toward `malformedLines` and is otherwise ignored — corruption is named, not
107
+ * folded into "not assigned" (A5).
108
+ */
109
+ export declare function readAssignments(text: string): ReadAssignmentsResult;
110
+ //# sourceMappingURL=experiment-assign.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experiment-assign.d.ts","sourceRoot":"","sources":["../src/experiment-assign.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gGAAgG;IAChG,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC3H;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAkBpD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,eAAe,CA+BhE;AAED,MAAM,WAAW,gBAAgB;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AAQ,CAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3H,CAAC;AAEN;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,sBAAsB,CAkErI;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,CAiBnE"}
@@ -0,0 +1,229 @@
1
+ /**
2
+ * Deterministic, blocked arm assignment for a prospective ablation (ADR-001, ablation-c-start).
3
+ *
4
+ * WHY. The owner's question — does the Step-8 QE mode change task speed — is only answerable
5
+ * causally if the variant a task receives is decided by chance, BEFORE the work starts, and tied to
6
+ * the task's own identity so a repeated query for the same task never reassigns it. This module is
7
+ * that decision: a PURE function of `(experiment, stratum, seed, index)`. No filesystem, no clock,
8
+ * no network — the caller (the cli) owns the journal, the lock, and the "did work already start?"
9
+ * check; this module only computes.
10
+ *
11
+ * ALGORITHM — block randomization, one pair per arm-combination per block. `mulberry32` is the
12
+ * repo's ONLY pseudo-random generator (`compounding.ts` — "no second RNG in this repo"); reused
13
+ * here rather than adding a second stream. Block size is `arms.length * 2` — two occurrences of
14
+ * every arm per block, so a completed block is always perfectly balanced and `propensity` (the
15
+ * arm's actual share of its block) is a fixed `1 / arms.length` — never guessed, never assumed
16
+ * 0.5 by default (NFR-4). The block's own permutation is seeded from
17
+ * `fnv1a(JSON.stringify([experiment, stratum, seed, block]))` (a JSON-tuple, not a delimiter join —
18
+ * the same reason `workOrderDigestInput` in epoch-replay.ts uses tuples: a delimiter in `experiment`
19
+ * or `stratum` could otherwise make two different keys hash identically) — so different strata (and
20
+ * different experiments) never share a stream, and the SAME `(experiment, stratum, seed, index)`
21
+ * always rederives the SAME arm (A1 idempotency, A2 block balance, A3 propensity).
22
+ */
23
+ import { fnv1a } from './feature-adr-checkpoints.js';
24
+ import { mulberry32 } from './compounding.js';
25
+ function isNonEmptyString(v) {
26
+ return typeof v === 'string' && v.trim() !== '';
27
+ }
28
+ /** Fisher-Yates, driven by the given deterministic RNG. Does not mutate its input. */
29
+ function shuffle(items, rand) {
30
+ const out = items.slice();
31
+ for (let i = out.length - 1; i > 0; i--) {
32
+ const j = Math.floor(rand() * (i + 1));
33
+ const tmp = out[i];
34
+ out[i] = out[j];
35
+ out[j] = tmp;
36
+ }
37
+ return out;
38
+ }
39
+ /**
40
+ * Deterministically assign one arm to task ordinal `index` within `(experiment, stratum)`. Refuses
41
+ * (never throws, never guesses) on any malformed input — empty strings, a non-integer seed/index, a
42
+ * negative index, fewer than two arms, duplicate or blank arm names.
43
+ */
44
+ export function assignArm(input) {
45
+ if (!isNonEmptyString(input?.experiment))
46
+ return { ok: false, reason: 'experiment: expected a non-empty string' };
47
+ if (!isNonEmptyString(input?.stratum))
48
+ return { ok: false, reason: 'stratum: expected a non-empty string' };
49
+ if (!Number.isInteger(input?.seed) || input.seed < 0)
50
+ return { ok: false, reason: 'seed: expected a non-negative integer' };
51
+ if (!Number.isInteger(input?.index) || input.index < 0)
52
+ return { ok: false, reason: 'index: expected a non-negative integer' };
53
+ if (!Array.isArray(input?.arms) || input.arms.length < 2) {
54
+ return { ok: false, reason: 'arms: expected an array of at least 2 arm names' };
55
+ }
56
+ if (!input.arms.every(isNonEmptyString))
57
+ return { ok: false, reason: 'arms: every arm name must be a non-empty string' };
58
+ const seen = new Set();
59
+ for (const a of input.arms) {
60
+ if (seen.has(a))
61
+ return { ok: false, reason: `arms: duplicate arm name ${JSON.stringify(a)}` };
62
+ seen.add(a);
63
+ }
64
+ const blockSize = input.arms.length * 2; // two copies of every arm — always a perfect block
65
+ const block = Math.floor(input.index / input.arms.length / 2); // == Math.floor(index / blockSize)
66
+ const position = input.index % blockSize;
67
+ const key = JSON.stringify({ experiment: input.experiment, stratum: input.stratum, seed: input.seed, block });
68
+ const rand = mulberry32(parseInt(fnv1a(key), 16) >>> 0);
69
+ // Base card set for this block: every arm twice, in the input's own order — then permuted by the
70
+ // block-seeded stream, so the CONTENT of every block is fixed by construction (perfect balance)
71
+ // and only the ORDER is randomized.
72
+ const cards = [];
73
+ for (const a of input.arms) {
74
+ cards.push(a);
75
+ cards.push(a);
76
+ }
77
+ const permuted = shuffle(cards, rand);
78
+ const arm = permuted[position];
79
+ const propensity = 2 / blockSize; // == 1 / arms.length — the arm's fixed, actual share of its block
80
+ return { ok: true, arm, propensity, block, position };
81
+ }
82
+ /** fix-round-1 (Codex r1 HIGH #7): `new Date().toISOString()` is the ONLY producer of `ts`/
83
+ * `assignedAt` (see the cli's `experimentJournalPath` writer) — a record whose timestamp does not
84
+ * match that exact shape did not come from this code path, so it is corruption, not merely an
85
+ * unusual value. */
86
+ const ISO_TIMESTAMP_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
87
+ function isValidIsoTimestamp(v) {
88
+ // Lead delta after Codex r2 (MEDIUM): shape + `Date.parse` accepts impossible calendar dates —
89
+ // `2026-02-30T00:00:00.000Z` parses (it rolls into March) and passed. Round-tripping through
90
+ // `toISOString()` is the exact check: only a real instant re-serializes to the same string.
91
+ if (typeof v !== 'string' || !ISO_TIMESTAMP_RE.test(v))
92
+ return false;
93
+ const ms = Date.parse(v);
94
+ return Number.isFinite(ms) && new Date(ms).toISOString() === v;
95
+ }
96
+ /**
97
+ * PURELY STRUCTURAL: every field is present and the right TYPE. This is `readAssignments`'s gate —
98
+ * it decides whether a journal LINE parses at all (A5's `malformedLines`). It deliberately does NOT
99
+ * validate timestamp FORMAT, propensity RANGE, or arm MEMBERSHIP: a line that is well-typed but
100
+ * semantically wrong (a hand-edited `position:99`, `propensity:2`, a flipped `arm`) is exactly the
101
+ * "syntactically valid corruption" `verifyAssignmentRecord` below exists to catch — folding those
102
+ * checks in here would make a single semantically-tampered record poison `readAssignments` for
103
+ * every caller, including ones (like `status`'s per-task duration math) that need to name WHICH
104
+ * task is bad rather than refuse the whole read (fix-round-1 HIGH #7/#8 — see `verifyAssignmentRecord`).
105
+ */
106
+ function isValidAssignmentRecord(v) {
107
+ if (typeof v !== 'object' || v === null)
108
+ return false;
109
+ const r = v;
110
+ return (isNonEmptyString(r['ts']) &&
111
+ isNonEmptyString(r['experiment']) &&
112
+ isNonEmptyString(r['taskId']) &&
113
+ isNonEmptyString(r['stratum']) &&
114
+ Number.isInteger(r['seed']) && r['seed'] >= 0 &&
115
+ Number.isInteger(r['index']) && r['index'] >= 0 &&
116
+ Number.isInteger(r['block']) && r['block'] >= 0 &&
117
+ Number.isInteger(r['position']) && r['position'] >= 0 &&
118
+ isNonEmptyString(r['arm']) &&
119
+ typeof r['propensity'] === 'number' && Number.isFinite(r['propensity']) &&
120
+ isNonEmptyString(r['assignedAt']));
121
+ }
122
+ /**
123
+ * fix-round-1 (Codex r1 HIGH #7) — "syntactically valid journal corruption is accepted and returned
124
+ * as the task's assignment". A record that passes `isValidAssignmentRecord`'s SHAPE checks can still
125
+ * have been hand-edited to a different arm/block/position/propensity while keeping every field the
126
+ * right TYPE (e.g. flipping `arm:"direct"` to `arm:"reference"`, or `position:99`). The only way to
127
+ * catch that is to REDERIVE the assignment from the record's own tuple
128
+ * `(experiment, stratum, seed, index)` via the SAME pure `assignArm` that produced it, and compare —
129
+ * never trust the stored arm/block/position/propensity on their own. `arms` is the experiment's own
130
+ * registered arm set (from its `dz experiment init` config), passed in by the caller — this module
131
+ * stays pure and fs-free.
132
+ */
133
+ export function verifyAssignmentRecord(record, arms, pinnedSeed) {
134
+ // Lead delta after Codex r2 (BLOCKER): rederiving from `record.seed` proves the record is
135
+ // internally CONSISTENT, never that it is AUTHENTIC — a row carrying any seed at all passes,
136
+ // because the check compares the row with itself. The experiment's pinned seed (from its
137
+ // `dz experiment init` config, the one value fixed before the first assignment) is the trusted
138
+ // side of the comparison; a row that disagrees with it is tampered, however well-formed.
139
+ if (pinnedSeed !== undefined && record.seed !== pinnedSeed) {
140
+ return {
141
+ ok: false,
142
+ reason: `assignment-tampered: task ${JSON.stringify(record.taskId)} carries seed ${record.seed}, but experiment ${JSON.stringify(record.experiment)} is pinned to seed ${pinnedSeed} — a record's own seed can never authenticate it`,
143
+ expected: null,
144
+ actual: { arm: record.arm, block: record.block, position: record.position, propensity: record.propensity },
145
+ };
146
+ }
147
+ const recomputed = assignArm({ experiment: record.experiment, stratum: record.stratum, seed: record.seed, index: record.index, arms });
148
+ const actual = { arm: record.arm, block: record.block, position: record.position, propensity: record.propensity };
149
+ const expected = recomputed.ok
150
+ ? { arm: recomputed.arm, block: recomputed.block, position: recomputed.position, propensity: recomputed.propensity }
151
+ : { arm: '(tuple refused)', block: -1, position: -1, propensity: -1 };
152
+ if (!recomputed.ok) {
153
+ return {
154
+ ok: false,
155
+ reason: `assignment-tampered: task ${JSON.stringify(record.taskId)}'s stored tuple (experiment=${JSON.stringify(record.experiment)}, stratum=${JSON.stringify(record.stratum)}, seed=${record.seed}, index=${record.index}) no longer rederives a valid assignment (${recomputed.reason}) — the stored record does not match what assignArm would produce from its own tuple`,
156
+ expected,
157
+ actual,
158
+ };
159
+ }
160
+ if (expected.arm !== actual.arm || expected.block !== actual.block || expected.position !== actual.position || expected.propensity !== actual.propensity) {
161
+ return {
162
+ ok: false,
163
+ reason: `assignment-tampered: task ${JSON.stringify(record.taskId)}'s stored assignment does not match what assignArm rederives from its own tuple (experiment=${JSON.stringify(record.experiment)}, stratum=${JSON.stringify(record.stratum)}, seed=${record.seed}, index=${record.index}) — the journal line was modified after it was written`,
164
+ expected,
165
+ actual,
166
+ };
167
+ }
168
+ // fix-round-1 HIGH #7 (named explicitly in the brief, beyond what recompute-and-compare already
169
+ // implies): timestamp FORMAT, propensity RANGE, and arm MEMBERSHIP. Recompute already makes a
170
+ // WRONG arm/propensity/block/position fail above; these three checks catch what recompute cannot
171
+ // — `assignArm` never produces a `ts`/`assignedAt` at all (they are wall-clock, not derived from
172
+ // the tuple), so a hand-edited "not-a-date" needs its own check.
173
+ if (!isValidIsoTimestamp(record.ts) || !isValidIsoTimestamp(record.assignedAt)) {
174
+ return {
175
+ ok: false,
176
+ reason: `assignment-tampered: task ${JSON.stringify(record.taskId)}'s ts/assignedAt is not a valid ISO-8601 UTC timestamp (ts=${JSON.stringify(record.ts)}, assignedAt=${JSON.stringify(record.assignedAt)})`,
177
+ expected,
178
+ actual,
179
+ };
180
+ }
181
+ if (!(record.propensity >= 0 && record.propensity <= 1)) {
182
+ return {
183
+ ok: false,
184
+ reason: `assignment-tampered: task ${JSON.stringify(record.taskId)}'s propensity ${record.propensity} is outside the valid [0,1] range`,
185
+ expected,
186
+ actual,
187
+ };
188
+ }
189
+ if (!arms.includes(record.arm)) {
190
+ return {
191
+ ok: false,
192
+ reason: `assignment-tampered: task ${JSON.stringify(record.taskId)}'s arm ${JSON.stringify(record.arm)} is not one of this experiment's registered arms (${arms.join(', ')})`,
193
+ expected,
194
+ actual,
195
+ };
196
+ }
197
+ return { ok: true };
198
+ }
199
+ /**
200
+ * Parse a JSONL assignments journal (one record per line) into records, WITHOUT touching the
201
+ * filesystem — the caller reads the file, this only parses its text (NFR-1: the core stays
202
+ * `node:fs`-free). A line that is blank is skipped silently (append-only files end in a trailing
203
+ * newline); a line that is non-blank but does not parse as JSON, or parses to something missing a
204
+ * required field, counts toward `malformedLines` and is otherwise ignored — corruption is named, not
205
+ * folded into "not assigned" (A5).
206
+ */
207
+ export function readAssignments(text) {
208
+ const records = [];
209
+ let malformedLines = 0;
210
+ for (const raw of String(text ?? '').split('\n')) {
211
+ const line = raw.trim();
212
+ if (line === '')
213
+ continue;
214
+ let parsed;
215
+ try {
216
+ parsed = JSON.parse(line);
217
+ }
218
+ catch {
219
+ malformedLines++;
220
+ continue;
221
+ }
222
+ if (isValidAssignmentRecord(parsed))
223
+ records.push(parsed);
224
+ else
225
+ malformedLines++;
226
+ }
227
+ return { records, malformedLines };
228
+ }
229
+ //# sourceMappingURL=experiment-assign.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experiment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,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QACxB,IAAI,IAAI,KAAK,EAAE;YAAE,SAAS;QAC1B,IAAI,MAAe,CAAC;QACpB,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAAC,MAAM,CAAC;YACP,cAAc,EAAE,CAAC;YACjB,SAAS;QACX,CAAC;QACD,IAAI,uBAAuB,CAAC,MAAM,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;;YACrD,cAAc,EAAE,CAAC;IACxB,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;AACrC,CAAC"}
@@ -185,7 +185,7 @@ export declare function decideCheckpointResume(opts: {
185
185
  /** Serialize one checkpoint line, or null when the result is null/oversize/unserializable —
186
186
  * the caller logs the skip loudly; a missing checkpoint only costs a re-run, never corrupts.
187
187
  * A null result is never persisted (Codex QE #8: it would later parse as a resumable entry). */
188
- export declare function serializeCheckpoint(stage: string, inputHash: string, result: unknown): string | null;
188
+ export declare function serializeCheckpoint(stage: string, inputHash: string, result: unknown, ts?: string): string | null;
189
189
  export interface ParsedCheckpointRead {
190
190
  entries: Record<string, CheckpointEntry>;
191
191
  listing: Set<string>;
@@ -209,7 +209,12 @@ export declare function shellQuote(s: string): string;
209
209
  export declare function checkpointReadCmd(fdirAbs: string): string;
210
210
  /** The one Bash command the write agent runs: mkdir the state dir, then append ONE line. The line
211
211
  * is single-quote-escaped as a whole — JSON.stringify output never contains literal newlines, so
212
- * printf '%s\n' emits exactly one record. */
212
+ * printf '%s\n' emits exactly one record.
213
+ *
214
+ * The record's `ts` is stamped SHELL-SIDE (`date -u`), the same idiom the decision-recall ledger
215
+ * uses, because the workflow sandbox forbids `Date` and this function must stay pure. A line that
216
+ * is not a JSON object falls back to the plain append: an unstamped record beats a lost one, and
217
+ * the return type stays `string` so no caller grows a new failure path. */
213
218
  export declare function checkpointAppendCmd(fdirAbs: string, line: string): string;
214
219
  export type CaptureMode = 'capture' | 'backfill' | 'skip-disabled' | 'skip-empty';
215
220
  /** Decide whether this completion is captured. A resumed stage is backfilled rather than
@@ -1 +1 @@
1
- {"version":3,"file":"feature-adr-checkpoints.d.ts","sourceRoot":"","sources":["../src/feature-adr-checkpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;qGACqG;AACrG,eAAO,MAAM,YAAY,UAAU,CAAC;AAEpC;;0DAE0D;AAC1D,eAAO,MAAM,iBAAiB,8DAA+D,CAAC;AAC9F,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE;;;;8EAI8E;AAC9E,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAUlE,CAAC;AAEF,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB;;;;;;;;;;;;;;;;;;OAkBG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;yFACyF;AACzF,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAElD;;qGAEqG;AACrG;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,wBAAwB,CAAC;AAE3D,wGAAwG;AACxG,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOzC;AAED;;kFAEkF;AAClF,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;;;;;;0DAO0D;AAC1D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,OAAO,E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B,CAAC,IAAI,EAAE;IACvC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAoBrB;AAED,uEAAuE;AACvE,MAAM,MAAM,sBAAsB,GAC9B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACnF;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B,GAAG,sBAAsB,CAqBzB"}
@@ -173,12 +173,12 @@ export function decideCheckpointResume(opts) {
173
173
  /** Serialize one checkpoint line, or null when the result is null/oversize/unserializable —
174
174
  * the caller logs the skip loudly; a missing checkpoint only costs a re-run, never corrupts.
175
175
  * A null result is never persisted (Codex QE #8: it would later parse as a resumable entry). */
176
- export function serializeCheckpoint(stage, inputHash, result) {
176
+ export function serializeCheckpoint(stage, inputHash, result, ts) {
177
177
  if (result === null || result === undefined)
178
178
  return null;
179
179
  let line;
180
180
  try {
181
- line = JSON.stringify({ stage, inputHash, result });
181
+ line = JSON.stringify({ stage, inputHash, result, ...(ts === undefined ? {} : { ts }) });
182
182
  }
183
183
  catch {
184
184
  return null;
@@ -190,6 +190,8 @@ export function serializeCheckpoint(stage, inputHash, result) {
190
190
  /** Sentinel separating the checkpoint file body from the artifact listing in the single read-back
191
191
  * command's stdout. */
192
192
  export const CHECKPOINT_LS_SENTINEL = '---FA-CKPT-LS---';
193
+ /** A writer-produced UTC instant. A malformed supplied value is unmeasured, not a bad record. */
194
+ const CHECKPOINT_TIMESTAMP = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?Z$/;
193
195
  /** Parse the read-back agent's stdout: JSONL entries (LAST occurrence of a stage wins — a re-run
194
196
  * overwrites by append), then the sentinel ON ITS OWN LINE, then one artifact path per line
195
197
  * (relative to the feature dir). The sentinel match is LINE-ANCHORED: JSON.stringify never emits
@@ -210,7 +212,11 @@ export function parseCheckpointRead(text) {
210
212
  try {
211
213
  const e = JSON.parse(t);
212
214
  if (e && typeof e === 'object' && typeof e.stage === 'string' && typeof e.inputHash === 'string' && 'result' in e && e.result !== null && e.result !== undefined) {
213
- out.entries[e.stage] = e;
215
+ const { ts, ...entry } = e;
216
+ // Narrow to `string` before the spread: under exactOptionalPropertyTypes an optional
217
+ // `ts?: string` refuses `string | undefined`, and an unmeasured record must carry NO key
218
+ // rather than an explicit undefined.
219
+ out.entries[e.stage] = typeof ts === 'string' && CHECKPOINT_TIMESTAMP.test(ts) ? { ...entry, ts } : entry;
214
220
  }
215
221
  else {
216
222
  // last-wins holds for BAD records too: a stage-identifiable null/invalid record ERASES the
@@ -246,11 +252,20 @@ export function checkpointReadCmd(fdirAbs) {
246
252
  }
247
253
  /** The one Bash command the write agent runs: mkdir the state dir, then append ONE line. The line
248
254
  * is single-quote-escaped as a whole — JSON.stringify output never contains literal newlines, so
249
- * printf '%s\n' emits exactly one record. */
255
+ * printf '%s\n' emits exactly one record.
256
+ *
257
+ * The record's `ts` is stamped SHELL-SIDE (`date -u`), the same idiom the decision-recall ledger
258
+ * uses, because the workflow sandbox forbids `Date` and this function must stay pure. A line that
259
+ * is not a JSON object falls back to the plain append: an unstamped record beats a lost one, and
260
+ * the return type stays `string` so no caller grows a new failure path. */
250
261
  export function checkpointAppendCmd(fdirAbs, line) {
251
262
  const dir = shellQuote(fdirAbs + '/.fa-state');
252
263
  const file = shellQuote(fdirAbs + '/.fa-state/checkpoints.jsonl');
253
- return 'mkdir -p ' + dir + " && printf '%s\\n' " + shellQuote(line) + ' >> ' + file;
264
+ const plain = 'mkdir -p ' + dir + " && printf '%s\\n' " + shellQuote(line) + ' >> ' + file;
265
+ if (typeof line !== 'string' || !line.startsWith('{'))
266
+ return plain;
267
+ return 'ts=$(date -u +%Y-%m-%dT%H:%M:%SZ); mkdir -p ' + dir
268
+ + ' && { printf \'{"ts":"%s",\' "$ts"; printf \'%s\\n\' ' + shellQuote(line.slice(1)) + '; } >> ' + file;
254
269
  }
255
270
  /** Decide whether this completion is captured. A resumed stage is backfilled rather than
256
271
  * skipped: its input (stage template + args) and checkpointed output are both in scope at the