@unbrained/pm-cli 2026.11.21 → 2026.11.22

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 (203) hide show
  1. package/.agents/skills/pm-developer/SKILL.md +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/dist/cli/register-history-maintenance.js +2 -2
  4. package/dist/cli-bundle/bundle-manifest.json +1 -1
  5. package/dist/cli-bundle/chunks/chunk-3W47ZZ5T.js +9 -0
  6. package/dist/cli-bundle/chunks/{chunk-PJXKA4QU.js → chunk-4TB5D6HL.js} +37 -37
  7. package/dist/cli-bundle/chunks/{chunk-WELSVDPU.js → chunk-5ZMVLWE3.js} +2 -2
  8. package/dist/cli-bundle/chunks/chunk-6BBDEIKC.js +33 -0
  9. package/dist/cli-bundle/chunks/{chunk-JVGRFU5H.js → chunk-AR4NP5HI.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-XHJ3H5PL.js → chunk-B4PPFOPY.js} +3 -3
  11. package/dist/cli-bundle/chunks/{chunk-5647LU3A.js → chunk-B76TFRO2.js} +47 -45
  12. package/dist/cli-bundle/chunks/{chunk-YJEBK7HU.js → chunk-CAR2L5NW.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-D6ILFXZY.js → chunk-EIGUKEV6.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-XWHJIRNV.js → chunk-GTPCAJMZ.js} +2 -2
  15. package/dist/cli-bundle/chunks/chunk-GYP24M7W.js +2 -0
  16. package/dist/cli-bundle/chunks/{chunk-CASX6SFI.js → chunk-HC2OPETM.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-NCFCBKIP.js → chunk-HKUV74K3.js} +2 -2
  18. package/dist/cli-bundle/chunks/chunk-HXHYDO2R.js +115 -0
  19. package/dist/cli-bundle/chunks/{chunk-S6HB3WL2.js → chunk-J2LABXBL.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-BKSVHOWI.js → chunk-J52BEBSS.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-NT5AKFE5.js → chunk-OJTMGDON.js} +31 -31
  22. package/dist/cli-bundle/chunks/{chunk-SRVTCYAU.js → chunk-TC6XLIYO.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-AHQB7W2H.js → chunk-U7EL3AYA.js} +2 -2
  24. package/dist/cli-bundle/chunks/chunk-VQFWW4EF.js +6 -0
  25. package/dist/cli-bundle/chunks/{chunk-CIKGG34F.js → chunk-X6MIWTTT.js} +2 -2
  26. package/dist/cli-bundle/chunks/chunk-XC5Q2ZV7.js +2 -0
  27. package/dist/cli-bundle/chunks/{chunk-RMIRNYRG.js → chunk-XFHPKXAE.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-6QLEXRUG.js → chunk-YHVLVSEZ.js} +2 -2
  29. package/dist/cli-bundle/chunks/{item-revision-R5SZPJZ5.js → item-revision-4QBMZXKX.js} +2 -2
  30. package/dist/cli-bundle/chunks/item-transaction-QY3PUHEI.js +2 -0
  31. package/dist/cli-bundle/chunks/{mutation-actor-3TG636XG.js → mutation-actor-FWLYWJ37.js} +2 -2
  32. package/dist/cli-bundle/chunks/{mutation-admission-LICSDNNO.js → mutation-admission-7ZDCK3G2.js} +2 -2
  33. package/dist/cli-bundle/chunks/{register-list-query-SPGPS3OS.js → register-list-query-RR5KACJ3.js} +2 -2
  34. package/dist/cli-bundle/chunks/{register-mutation-WWVECKFQ.js → register-mutation-57AJQWFV.js} +2 -2
  35. package/dist/cli-bundle/chunks/{register-operations-L6HFJNWD.js → register-operations-RKWST7CU.js} +2 -2
  36. package/dist/cli-bundle/chunks/{register-setup-K7UFG5TD.js → register-setup-CMI23PC5.js} +2 -2
  37. package/dist/cli-bundle/chunks/{stage-57KH3KAC.js → stage-4KDVXC5Z.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/{chunk-YOAYY3HE.js → chunk-2ZD7275J.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-532WZV65.js → chunk-324AHXJO.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/chunk-3XSWH6QC.js +91 -0
  41. package/dist/cli-bundle/focused-chunks/{chunk-QGKLRXP7.js → chunk-4JZITIJB.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/{chunk-CU2BRAOX.js → chunk-4KTFKSS3.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/chunk-5C5TK3ET.js +78 -0
  44. package/dist/cli-bundle/focused-chunks/chunk-AKJYOZZP.js +2 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-MKM5NKD7.js → chunk-BRZV7BFV.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-RPE6IX26.js → chunk-HDEKFSOK.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-LNHUE4VV.js → chunk-IWOXAUDU.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-J63D6QST.js → chunk-ML3JHCC6.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-JMQJBZQ5.js → chunk-OPGOOP25.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/{chunk-XCJSHNXK.js → chunk-RE7ZWT7D.js} +3 -3
  51. package/dist/cli-bundle/focused-chunks/chunk-RKQNVYGF.js +3 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-WXMI4AV5.js → chunk-RQ252B6V.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-7A4QWNZX.js → chunk-URGHTTT3.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-IQK5NPMG.js → chunk-USPYKWQG.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/chunk-UWS3FC4D.js +102 -0
  56. package/dist/cli-bundle/focused-chunks/chunk-UXQGFGAT.js +44 -0
  57. package/dist/cli-bundle/focused-chunks/{chunk-UOC6257J.js → chunk-WZWXGDYY.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-NP72ZDXE.js → chunk-YKSLZPLT.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/chunk-ZWJTY4ID.js +2 -0
  60. package/dist/cli-bundle/focused-chunks/{item-revision-3V3UIP5X.js → item-revision-2O6MLPEX.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/item-transaction-GLACUTPL.js +2 -0
  62. package/dist/cli-bundle/focused-chunks/{mutation-actor-62HKR5IO.js → mutation-actor-TCYDPUGG.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{mutation-admission-X4PF2SG3.js → mutation-admission-LY73EJWM.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/{stage-O7T7CXBB.js → stage-DQ7RQQ52.js} +2 -2
  65. package/dist/cli-bundle/main.js +2 -2
  66. package/dist/cli-bundle/sdk-authoring.js +1 -1
  67. package/dist/cli-bundle/sdk-contracts.js +2 -2
  68. package/dist/cli-bundle/sdk-core.js +1 -1
  69. package/dist/cli-bundle/sdk-governance.js +1 -1
  70. package/dist/cli-bundle/sdk-graph.js +1 -1
  71. package/dist/cli-bundle/sdk-merge.js +70 -58
  72. package/dist/cli-bundle/sdk-query.js +1 -1
  73. package/dist/cli-bundle/sdk-runtime.js +1 -1
  74. package/dist/cli-bundle/sdk-testing.js +1 -1
  75. package/dist/cli-bundle/sdk.js +11 -11
  76. package/dist/core/diagnostics/remediation.js +1 -1
  77. package/dist/core/fs/atomic-create.js +1 -1
  78. package/dist/core/fs/file-glob.js +1 -1
  79. package/dist/core/history/bridge.js +2 -0
  80. package/dist/core/history/drift-scan.js +1 -1
  81. package/dist/core/history/history-rewrite.js +1 -1
  82. package/dist/core/history/history.d.ts +12 -0
  83. package/dist/core/history/history.js +2 -2
  84. package/dist/core/history/projection.js +1 -1
  85. package/dist/core/history/read.d.ts +9 -0
  86. package/dist/core/history/read.js +1 -1
  87. package/dist/core/history/replay.d.ts +46 -5
  88. package/dist/core/history/replay.js +2 -2
  89. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  90. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  91. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  92. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  93. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +2 -2
  94. package/dist/sdk/completion/fish.js +3 -2
  95. package/dist/sdk/completion/zsh.js +3 -2
  96. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  97. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  98. package/dist/sdk/governance/health/history-drift-remedies.js +2 -0
  99. package/dist/sdk/governance/health.js +2 -2
  100. package/dist/sdk/history/append-only-repair.d.ts +30 -0
  101. package/dist/sdk/history/append-only-repair.js +6 -0
  102. package/dist/sdk/history/maintenance.d.ts +8 -2
  103. package/dist/sdk/history/maintenance.js +1 -1
  104. package/dist/sdk/history/reanchor-refusal.js +2 -0
  105. package/dist/sdk/history/reseed.d.ts +15 -0
  106. package/dist/sdk/history/reseed.js +2 -0
  107. package/dist/sdk/history/salvage.d.ts +19 -8
  108. package/dist/sdk/history/salvage.js +5 -3
  109. package/dist/sdk/history-compact.js +1 -1
  110. package/dist/sdk/history-redact.js +1 -1
  111. package/dist/sdk/history-repair.d.ts +8 -2
  112. package/dist/sdk/history-repair.js +1 -1
  113. package/dist/sdk/index.d.ts +1 -1
  114. package/dist/sdk/item-transaction.d.ts +33 -1
  115. package/dist/sdk/item-transaction.js +1 -1
  116. package/dist/sdk/lifecycle/restore.js +1 -1
  117. package/dist/sdk/merge/three-way.d.ts +22 -3
  118. package/dist/sdk/merge/three-way.js +8 -2
  119. package/dist/sdk/public-surface.json +1 -1
  120. package/dist/sdk/runtime/actions.js +1 -1
  121. package/dist/sdk/runtime-input.d.ts +6 -2
  122. package/dist/sdk/runtime-input.js +1 -1
  123. package/dist/sdk/runtime-primitives.d.ts +1 -1
  124. package/dist/sdk/runtime-primitives.js +1 -1
  125. package/dist/sdk/runtime.d.ts +7 -0
  126. package/dist/sdk/runtime.js +1 -1
  127. package/dist/sdk/structured-mutations.d.ts +5 -5
  128. package/dist/sdk/structured-mutations.js +1 -1
  129. package/dist/sdk/transactions/item-finalization.js +2 -0
  130. package/dist/types.d.ts +20 -0
  131. package/dist/types.js +1 -1
  132. package/docs/AGENT_GUIDE.md +1 -1
  133. package/docs/AGENT_RUNTIME_PRIMITIVES.md +1 -1
  134. package/docs/COMMANDS.md +6 -2
  135. package/docs/HISTORY_RECOVERY.md +229 -5
  136. package/docs/README.md +2 -2
  137. package/docs/SDK.md +103 -4
  138. package/docs/SDK_CONTEXT_COORDINATION.md +3 -2
  139. package/marketplace.json +1 -1
  140. package/node_modules/tar/package.json +2 -3
  141. package/package.json +30 -2
  142. package/packages/pm-beads/package.json +1 -1
  143. package/packages/pm-calendar/package.json +1 -1
  144. package/packages/pm-command-kit/package.json +1 -1
  145. package/packages/pm-digital-twin/package.json +1 -1
  146. package/packages/pm-governance-audit/package.json +1 -1
  147. package/packages/pm-guide-shell/package.json +1 -1
  148. package/packages/pm-kanban/package.json +1 -1
  149. package/packages/pm-lifecycle-hooks/package.json +1 -1
  150. package/packages/pm-linked-test-adapters/package.json +1 -1
  151. package/packages/pm-search-advanced/package.json +1 -1
  152. package/packages/pm-templates/package.json +1 -1
  153. package/packages/pm-todos/package.json +1 -1
  154. package/packages/pm-vcs/package.json +1 -1
  155. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  156. package/plugins/pm-claude/package.json +1 -1
  157. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  158. package/plugins/pm-codex/package.json +1 -1
  159. package/plugins/pm-codex/plugin.json +1 -1
  160. package/runtime-dependencies.json +1 -1
  161. package/dist/cli-bundle/chunks/chunk-2DXRTIC6.js +0 -21
  162. package/dist/cli-bundle/chunks/chunk-IUIOTAF6.js +0 -9
  163. package/dist/cli-bundle/chunks/chunk-KVBIMFUG.js +0 -6
  164. package/dist/cli-bundle/chunks/chunk-RULHZRFN.js +0 -2
  165. package/dist/cli-bundle/chunks/chunk-SA4BNP3Q.js +0 -2
  166. package/dist/cli-bundle/chunks/chunk-YKJKQ7DM.js +0 -115
  167. package/dist/cli-bundle/chunks/item-transaction-7DFCG73I.js +0 -2
  168. package/dist/cli-bundle/focused-chunks/chunk-CWWKRI5P.js +0 -2
  169. package/dist/cli-bundle/focused-chunks/chunk-HGFNL5XI.js +0 -2
  170. package/dist/cli-bundle/focused-chunks/chunk-OSLQD5VH.js +0 -102
  171. package/dist/cli-bundle/focused-chunks/chunk-QSJW6NSQ.js +0 -66
  172. package/dist/cli-bundle/focused-chunks/chunk-SRDQSA6M.js +0 -91
  173. package/dist/cli-bundle/focused-chunks/chunk-URJ2E6AS.js +0 -3
  174. package/dist/cli-bundle/focused-chunks/chunk-XQQSSKJI.js +0 -44
  175. package/dist/cli-bundle/focused-chunks/item-transaction-HLBW7B3J.js +0 -2
  176. package/dist/sdk/agent/refusal-closure.js +0 -2
  177. package/dist/sdk/agent/refusal-reachability.js +0 -4
  178. package/dist/sdk/agent/task-transcript-contracts.js +0 -2
  179. package/dist/sdk/agent/tracker-preflight-contracts.js +0 -2
  180. package/dist/sdk/authoring.js +0 -2
  181. package/dist/sdk/compose.js +0 -2
  182. package/dist/sdk/contracts.js +0 -2
  183. package/dist/sdk/core-governance.js +0 -2
  184. package/dist/sdk/core.js +0 -2
  185. package/dist/sdk/corpus-shape.js +0 -2
  186. package/dist/sdk/define.js +0 -2
  187. package/dist/sdk/environment/agent-environment.js +0 -2
  188. package/dist/sdk/governance/artifact-ledgers.js +0 -2
  189. package/dist/sdk/governance/coverage-assurance.js +0 -2
  190. package/dist/sdk/governance/reliability.js +0 -2
  191. package/dist/sdk/governance.js +0 -2
  192. package/dist/sdk/graph/adapter.js +0 -2
  193. package/dist/sdk/graph/conformance.js +0 -2
  194. package/dist/sdk/graph/index.js +0 -2
  195. package/dist/sdk/graph.js +0 -2
  196. package/dist/sdk/index.js +0 -2
  197. package/dist/sdk/query.js +0 -2
  198. package/dist/sdk/relationship-migration.js +0 -2
  199. package/dist/sdk/testing.js +0 -8
  200. package/dist/sdk/workspace-recipe.js +0 -2
  201. package/docs/AGENT_PROVENANCE_ADR.md +0 -206
  202. package/docs/DEFECT_RECURRENCE.md +0 -257
  203. package/docs/PERFORMANCE.md +0 -204
@@ -4,8 +4,12 @@ Tracked by [pm-96fsma](../.agents/pm/issues/pm-96fsma.toon),
4
4
  [pm-m0yjtg](../.agents/pm/issues/pm-m0yjtg.toon),
5
5
  [pm-qw1uw6](../.agents/pm/issues/pm-qw1uw6.toon),
6
6
  [pm-e3gn0z](../.agents/pm/issues/pm-e3gn0z.toon),
7
- [pm-wlqxg3](../.agents/pm/tasks/pm-wlqxg3.toon), and
8
- [pm-nb4zwz](../.agents/pm/issues/pm-nb4zwz.toon).
7
+ [pm-wlqxg3](../.agents/pm/tasks/pm-wlqxg3.toon),
8
+ [pm-nb4zwz](../.agents/pm/issues/pm-nb4zwz.toon),
9
+ [pm-jbplbq](../.agents/pm/issues/pm-jbplbq.toon),
10
+ [pm-gh1715](../.agents/pm/issues/pm-gh1715.toon),
11
+ [pm-3os5p6](../.agents/pm/issues/pm-3os5p6.toon), and
12
+ [pm-rpucvb](../.agents/pm/issues/pm-rpucvb.toon).
9
13
 
10
14
  Project management depends on trustworthy context. History is not just an
11
15
  activity feed: it is the reconstructable source for prior item states, including
@@ -76,9 +80,31 @@ pm history-repair <id> --salvage-tail --json
76
80
  pm history <id> --verify --strict-exit
77
81
  ```
78
82
 
79
- Salvage requires a nonempty, hash-verified prefix and retains its bytes unchanged.
80
- The receipt records the first invalid physical line, discarded UTF-8 byte count,
81
- discarded-suffix SHA-256, and retained record count. An appended `history_salvage`
83
+ Salvage retains every record byte unchanged. Discarding an invalid suffix
84
+ requires a nonempty, hash-verified prefix, because truncation must not cut a
85
+ chain whose damage it cannot see. It also removes lines whose JSON value is a
86
+ null, a boolean or a number wherever they sit, because such a value cannot hold
87
+ a record. Removing only such lines conceals nothing, so it does not require the
88
+ chain to verify: a stream with both a scalar line and a chain break is salvaged
89
+ first, the result reports `verify_ok: false` with the `verify_errors`, and its
90
+ `history_chain_unverified` warning names the append-only repair preview, with
91
+ the rewriting preview for a break a bridge cannot repair. `pm history-repair
92
+ <id> --append-only` then bridges the break. A stream of only scalar lines is
93
+ salvaged to an empty stream without a salvage record, because no record is
94
+ left to anchor one on. For a live item, the result's `history_stream_empty`
95
+ warning names `pm history-repair <id>`, which rebuilds the stream (see below).
96
+ With nothing to discard, salvage refuses and names the repair the chain needs.
97
+ Salvage checks the item identity at every replayed state, so a stream that
98
+ names another item anywhere refuses, even when a later delete cleared the id.
99
+ The salvage record is planned before the lock, so a preview refuses wherever
100
+ the write would, for example on a digest algorithm this pm cannot compute. A
101
+ broken stream that declares no hash epoch keeps its salvage record implicit. A string,
102
+ an array or a complete malformed object might encode one, so salvage refuses
103
+ those. A truncated object at the tail, such as `{"ts":`, is part of the invalid
104
+ suffix after the verified prefix and is discarded with it.
105
+ The receipt records the first discarded physical line, discarded UTF-8 byte
106
+ count, SHA-256 of the discarded bytes in file order, retained record count, and
107
+ `non_record_lines` when scalar lines were removed. An appended `history_salvage`
82
108
  event records that receipt without copying potentially private damaged contents.
83
109
  Salvage does not rehash prior entries, reconcile item state, or normalize
84
110
  provenance. It refuses bulk selection, conflicting repair modes, merge conflict
@@ -87,6 +113,14 @@ with attached corruption. Recover those cases from version control or a backup.
87
113
  Non-UTF-8 streams are also refused, so receipt hashes and rollback snapshots
88
114
  always describe the original bytes rather than a lossy decoded approximation.
89
115
 
116
+ Every reader that goes through the shared history decoder refuses a history
117
+ line that is valid JSON but not an object with `history_record_invalid`. The
118
+ merge driver parses its inputs itself and reports such a line as invalid JSON
119
+ at that line. The error names the item (`item_id`), the value kind
120
+ (`reason`, for example `a JSON null`) and the physical line (`details.line`), and
121
+ its next step is the salvage preview above. Readers never report such a line as
122
+ `unknown_error`. `pm health` keeps reporting the stream under `unreadable_streams`.
123
+
90
124
  The public SDK uses the same operation:
91
125
 
92
126
  ```ts
@@ -103,6 +137,196 @@ console.log(preview.salvage);
103
137
  The CLI and MCP expose this SDK-owned contract; package authors do not need a
104
138
  separate recovery implementation.
105
139
 
140
+ ## Rebuild a missing history stream
141
+
142
+ A live item whose history stream is absent, or holds no record (the default
143
+ `history.missing_stream: auto_create` policy recreates a deleted stream as an
144
+ empty file on read), is reported by `pm health` as
145
+ `history_drift_missing_stream`. When the stream was deleted by mistake, restore
146
+ it from version control first. Otherwise rebuild it:
147
+
148
+ ```bash
149
+ pm history-repair <id> --dry-run --json
150
+ pm history-repair <id> --json
151
+ pm health --strict-exit
152
+ ```
153
+
154
+ The repair writes one sealed `history_repair` record from the empty document
155
+ to the on-disk item, after any whitespace the stream held, so it keeps every
156
+ existing byte in either repair mode. An existing empty stream gets the record
157
+ through `O_APPEND`, on the exact bytes the repair verified. An absent stream is
158
+ published complete: the record is staged and flushed beside it, then
159
+ hard-linked into the absent path, so no partial or empty stream is ever
160
+ visible. A stream that another writer created or extended meanwhile refuses
161
+ with `stream_changed`. A filesystem whose link call fails with `EPERM`,
162
+ `ENOTSUP`, `EOPNOTSUPP` or `ENOSYS` refuses with `stream_publish_unsupported`;
163
+ any other link failure (for example `EISDIR`, which Windows exFAT reports;
164
+ [pm-ue6pqv](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-ue6pqv.toon),
165
+ tracker record excluded from npm) surfaces as that error. On a local
166
+ filesystem nothing is published either way. A network filesystem can publish
167
+ the link and lose the reply, so before restoring or retrying, check whether the
168
+ item's stream file exists as a regular file, without running a pm command on
169
+ the item first: under the default `auto_create` policy a pm read recreates an
170
+ absent stream as an empty file. If it exists, verify it with `pm history <id>
171
+ --verify --full`. Restore the stream from version control, or repair from a
172
+ clone on a filesystem with hard links, only when nothing valid was published. A
173
+ history path that is a symbolic link refuses with `stream_not_regular_file`,
174
+ both in the preview and in the write, and `pm health` reports it as
175
+ `history_drift_unrepairable_stream` instead of advising the rebuild. `context.history_reseed` and the result's
176
+ `reseed` receipt record why (`missing_stream` or `empty_stream`) and
177
+ `prior_versions: "unrecorded"`: version 1 is the item as of the repair, and
178
+ earlier versions cannot be read or restored. The record is maintenance, so it
179
+ does not count as work on the item. `pm history-repair --all`, with or without
180
+ `--append-only`, rebuilds every missing stream in one pass. A deleted item's
181
+ empty stream has nothing to anchor on and keeps refusing, as do the audited
182
+ merge-reconciliation modes, which prove their evidence against recorded
183
+ history.
184
+
185
+ ## Bridge a broken chain without rewriting it
186
+
187
+ A change made outside pm, such as a hand edit or a merge resolution that
188
+ bypassed the driver, breaks the item's history chain. `pm health` previews
189
+ the append-only repair for every broken chain and reports
190
+ `history_drift_chain_mismatch` when a bridge can repair it. A break only the
191
+ rewriting repair can fix (`pm history-repair <id>`), such as a recorded patch
192
+ that applies only on top of the unrecorded change, is reported as
193
+ `history_drift_chain_unbridgeable`. A stream neither repair can keep, such as
194
+ one whose sealed record no longer matches its seal, is reported as
195
+ `history_drift_unrepairable_stream`. Restore that one from version control:
196
+ the rewriting repair refuses it with `history_record_integrity_invalid`. Such a
197
+ stream, and one a newer pm wrote (`history_drift_version_skew`, including a
198
+ record seal format this pm cannot read, which refuses with
199
+ `history_record_version_unsupported`), keeps only that verdict: its chain- and
200
+ hash-mismatch warnings would advise a repair that refuses, so health drops
201
+ them from the advice while `details` keeps the evidence.
202
+ Repair a bridgeable break append-only:
203
+
204
+ ```bash
205
+ pm history-repair <id> --append-only --dry-run --json
206
+ pm history-repair <id> --append-only --json
207
+ pm health --strict-exit
208
+ ```
209
+
210
+ The repair appends one sealed `history_repair` record carrying a `bridge`. The
211
+ bridge names each break by the `after_hash` before it (`gap_from`), the
212
+ `before_hash` after it (`gap_to`) and that entry's `record_hash`. Its
213
+ `segment_digest` commits to every record from the first break up to the bridge,
214
+ so no record it covers can change under it, sealed or not. Its patch
215
+ reconciles replay with the on-disk item. Its anchors keep the hash epoch the
216
+ stream already uses:
217
+
218
+ - If any record declares an epoch, the newest declared epoch.
219
+ - For an implicit stream, the epoch the verified records prove, unless the
220
+ last record's own anchor proves another epoch. Then the newest epoch it
221
+ proves wins.
222
+ - The epoch-2 variant that replay or the on-disk item proves.
223
+
224
+ The repair refuses with `hash_surface_ambiguous` when nothing proves the epoch
225
+ or the variant. The record is appended with `O_APPEND` to the exact bytes the
226
+ repair verified. If another writer that ignores pm's lock appends in the same
227
+ moment, its bytes are kept and the repair reports `stream_changed`. Every earlier line stays
228
+ byte-identical, so the stream before the repair remains a prefix of the
229
+ repaired stream. Other clones, worktrees and append-only consumers keep the
230
+ bytes they already hold. `--all --append-only` attempts every drifted stream:
231
+ it bridges each bridgeable break, rebuilds each missing stream, and refuses a
232
+ stream a bridge cannot repair with a typed reason. When several streams drift
233
+ and every one is a bridgeable chain mismatch or a missing stream, `pm health`
234
+ names it as the bulk remedy. With other drift present a bridgeable mismatch
235
+ keeps its per-item `--append-only` remedy, and while any stream is unreadable,
236
+ unrepairable, written by a newer pm or attributed to a pending merge receipt,
237
+ every remedy stays per item.
238
+
239
+ Verification accepts a break exactly when the next bridge names it. Inside the
240
+ bridged segment it checks the recorded links, and each further break must be
241
+ the next one the bridge names. Wherever replay proves an entry's recorded
242
+ before-state, for example after a later change overwrote the edited field, that
243
+ entry's recorded effect must match too. Every record from the break to the
244
+ bridge must be complete, with item anchors that are well-formed digests of its
245
+ algorithm (`record_incomplete`). A declared epoch inside the segment governs the
246
+ records after it, and the bridge must keep the epoch the stream declared
247
+ (`bridge_epoch_mismatch`). The bridge must name no break that did
248
+ not occur, must match its `segment_digest`, and must re-anchor replay on its
249
+ own `after_hash`. A forged, unsealed or partial bridge is drift
250
+ (`bridge_invalid`, `bridge_unnamed_break`, `bridge_names_absent_break`,
251
+ `bridge_link_mismatch`, `bridge_segment_mismatch` or
252
+ `bridge_after_hash_mismatch`).
253
+
254
+ A later rewriting repair keeps a verified bridged segment's records unchanged.
255
+ Like every rewriting repair, it re-serializes the file, so it normalizes line
256
+ endings and spacing; only `--append-only` keeps the existing bytes.
257
+ Three rewrites must dissolve the bridge into an ordinary re-anchored record:
258
+
259
+ - a rewrite that changes an entry before the segment
260
+ - a merge union, which rebases every patch
261
+ - `history-redact`, which recomputes every state anchor
262
+
263
+ Each keeps the original bridge as rewrite evidence. It also marks every entry
264
+ the segment covered with a sealed `replay_inexact`, because those states were
265
+ re-anchored without the unrecorded change. Each rewrite locates a bridge's segment from the bridge's own commitments. The
266
+ segment digest proves the segment from a start that the first break's record
267
+ hash or recorded anchors name, so a rewrite that repairs a record before the
268
+ segment still marks it. When no intact commitment proves the segment, the
269
+ rewrite marks every record since the previous bridge, and the bridge record
270
+ itself. That over-restricts but never serves a version as exact. `history-redact` refuses a stream whose
271
+ bridge does not locate its segment (`history_redact_bridge_unlocated`) instead
272
+ of dropping that bridge's evidence. The markers are written before anything can
273
+ void the bridge:
274
+
275
+ - Provenance normalization writes them before it reseals a covered record.
276
+ - A merge union writes them on the records a bridge covers on either original
277
+ branch, before it interleaves the branches. It also marks every event the
278
+ merged order places between such a segment's first record and its bridge.
279
+ Every merge, including identical and fast-forward results, keeps a marker
280
+ either branch already carries, except on records a retained live bridge
281
+ covers.
282
+ - A compaction checkpoint taken at an inexact version keeps the marker. When two clones bridged the same
283
+ break independently, the merge driver keeps ours byte-for-byte unless a marker
284
+ theirs carries must be propagated onto one of ours' records, in which case the
285
+ changed stream is written. It appends the other bridge as a neutral record with
286
+ an empty patch (`equivalent_bridges`), so both repairs' provenance survives. It
287
+ does this only when both sides and the result verify.
288
+
289
+ Versions between a break and its bridge cannot be reconstructed exactly,
290
+ because the unrecorded change is missing from replay. `pm restore` and
291
+ `pm get --at` refuse them with `history_version_unreconstructable`, both before
292
+ and after a dissolution. Versions before the break and from the bridge onward
293
+ remain addressable. While the bridge is live, `pm history-compact` cannot
294
+ checkpoint such a version either. It refuses with
295
+ `history_compact_boundary_bridged` and names the
296
+ nearest durable `--before` versions before the break and from the bridge
297
+ onward, or timestamps when a legacy checkpoint has no trustworthy offset. After
298
+ a rewrite has dissolved the bridge, a checkpoint at a marked version is allowed
299
+ and inherits the marker, so reads and restores keep refusing it.
300
+
301
+ Clones that repaired the same break independently and then kept working
302
+ diverge in a run of the same repair, live or neutral and in either order,
303
+ followed by ordinary records. The merge driver first turns both runs into one
304
+ shared run: ours, plus neutral copies of theirs' repairs ours lacks. It then
305
+ orders only the later records, so reciprocal merges merge again without
306
+ contradictory orders. It does this only when no repair of the runs recurs
307
+ later and both rewritten sides still verify; otherwise the streams merge as
308
+ recorded. Its receipt keeps the original coordinates: the shared prefix of
309
+ the two inputs, and theirs' neutral copies count as theirs.
310
+
311
+ The repair refuses with `history_append_only_repair_unavailable` and names the
312
+ rewriting repair as the fallback when a bridge cannot carry the drift:
313
+
314
+ | `reason` | Meaning |
315
+ |---|---|
316
+ | `chain_failure_not_a_break` | The stream fails for another reason, such as a broken record envelope. |
317
+ | `patch_does_not_replay` | A recorded patch only applies on top of the unrecorded change. |
318
+ | `item_missing` | No on-disk item exists to anchor the bridge. |
319
+ | `stream_not_utf8` | The stream bytes cannot be kept exactly. |
320
+ | `stream_changed` | The stream changed or was replaced after the repair verified it. The record may already be in the stream, so run `pm health` and inspect the stream before retrying. |
321
+ | `hash_surface_ambiguous` | Neither replay nor the on-disk item proves the tail's epoch-2 variant. |
322
+ | `bridge_does_not_verify` | The extended stream would not verify. |
323
+
324
+ A preview reports the recorded effects the reconciliation overwrites
325
+ (`reconciliation`, with the `history_repair_reconcile_discards_events` warning),
326
+ as the rewriting repair does. `pm history-repair <id>` without `--append-only`
327
+ still re-anchors every recorded entry after the break, for single-writer
328
+ trackers that want a continuous chain.
329
+
106
330
  ## Permanent item identities
107
331
 
108
332
  Reading a deleted ID returns `item_deleted`, distinct from an unknown ID.
package/docs/README.md CHANGED
@@ -81,13 +81,13 @@ pm guide release --json
81
81
  - [Agent Recovery and Guidance](AGENT_RECOVERY_AND_GUIDANCE.md) - policy refusal evidence, canonical help, and managed instruction freshness.
82
82
  - [Declarative Workflow Policies](WORKFLOW_POLICIES.md) - portable lifecycle requirements, independent approvals, and completeness reports.
83
83
  - [Mutation Integrity](MUTATION_INTEGRITY.md) - shared CLI/SDK/MCP author, secret, append-only disposition, and stale-work guardrails.
84
- - [Agent Provenance ADR Amendment](AGENT_PROVENANCE_ADR.md) - extensible model, effort, role, and host provenance with privacy and compatibility boundaries.
84
+ - [Agent Provenance ADR Amendment](https://github.com/unbraind/pm-cli/blob/main/docs/AGENT_PROVENANCE_ADR.md) (repository-only, excluded from npm) - extensible model, effort, role, and host provenance with privacy and compatibility boundaries.
85
85
  - [SDK Agent Session and Episode Context](SDK_AGENT_SESSION_CONTEXT.md) - inherited role/topic context, cross-process episode identity, and deterministic history grouping.
86
86
  - [SDK Agent Environments](AGENT_ENVIRONMENTS.md) - calibrated observations, total verdicts, isolated episodes, and an executable public-SDK environment.
87
87
  - [Improvement Ledger and History Analytics](IMPROVEMENT_ANALYTICS.md) - audited quantitative observations, live provenance coverage, and bounded observational fleet outcomes.
88
88
  - [Project Assurance Primitives](ASSURANCE.md) - SDK-owned measurements, assertions, lifecycle gates, cost receipts, and durable verdict history shared by CLI and MCP.
89
89
  - [Planning Measurements](PLANNING_MEASUREMENTS.md) - lifecycle coverage, set-membership aggregation, and derived deadline constraints.
90
- - [Defect Recurrence and Boundary Evidence](DEFECT_RECURRENCE.md) - captured external samples, structured defect-escape evidence, incremental change-risk indexing, and executable recovery-producer census.
90
+ - [Defect Recurrence and Boundary Evidence](https://github.com/unbraind/pm-cli/blob/main/docs/DEFECT_RECURRENCE.md) (repository-only, excluded from npm) - captured external samples, structured defect-escape evidence, incremental change-risk indexing, and executable recovery-producer census.
91
91
  - [Recurrence and Executable Recovery Contracts](RECURRENCE_RECOVERY_CONTRACTS.md) - terminal-item recurrence, duplicate-intake routing, capability-aware reindex recovery, and target-aware generated test guidance.
92
92
  - [Trustworthy Context and Evidence Contracts](TRUSTWORTHY_CONTEXT_EVIDENCE.md) - full-record assurance, graph composition, boolean health rows, lossless linked-test removal, and role-labelled recovery.
93
93
  - [Context Integrity Contracts](CONTEXT_INTEGRITY_CONTRACTS.md) - sparse-read identity, closed extension manifests, lossless remote docs, direction-locked graph impact, and cross-version history epochs.
package/docs/SDK.md CHANGED
@@ -1362,10 +1362,21 @@ the placeholder "none". Pass unset: ["parent"] to clear it, or omit parent.`;
1362
1362
  CLI refusals keep their flag wording. `PmCreateActionOptions`,
1363
1363
  `PmUpdateActionOptions`, `CreateOperationOptions` and `UpdateOperationOptions`
1364
1364
  type the clearable fields as nullable, so `runCreate`/`runUpdate` accept the
1365
- same input as `PmClient.create`/`update`. A direct SDK `runUpdateMany` folds a
1366
- null in its update record like `runUpdate`, but `runAction("update-many")` drops
1367
- it (pm-w7clh6), so `PmUpdateManyActionOptions` stays non-nullable: use `unset`
1368
- there and in MCP tools.
1365
+ same input as `PmClient.create`/`update`. `update-many` follows the same rule
1366
+ in every typed spelling (pm-w7clh6): a direct SDK `runUpdateMany`, and
1367
+ `runAction("update-many")` with flat fields or a nested `update` record, clear a
1368
+ clearable built-in field given `null` on every matched row and refuse a `null`
1369
+ on any other built-in update option by name before a row changes, so
1370
+ `PmUpdateManyActionOptions` types the clearable fields as nullable.
1371
+ `runAction("update-many")` also refuses, by name, a `null` that would otherwise
1372
+ be read as absent or stored as text: on a selection or control key (`ids`,
1373
+ `list`, `update`, `limit`, `offset`, `dryRun`, `rollback`, the checkpoint keys,
1374
+ any `filter*` key, any key of a nested `list` record), on an outer key beside a
1375
+ nested `update` record, and on a key that is no declared update option, such as
1376
+ a schema or extension field (clear those with `unset`). Those refusals belong
1377
+ to action dispatch; a direct `runUpdateMany` does not add them.
1378
+ MCP tools are unchanged: they never clear a field from a `null`, so use `unset`
1379
+ there.
1369
1380
  CLI adapters retain `--description -`, append stdin, file flags, and legacy
1370
1381
  clear-token compatibility. Values inside CLI `--stdin-json` documents are
1371
1382
  literal data, including `"none"` and `"null"`. Explicit CLI flags override
@@ -1761,6 +1772,12 @@ registries across concurrent requests, and is reentrant: SDK primitives called
1761
1772
  inside the callback reuse the active scope instead of attempting a nested
1762
1773
  activation cycle.
1763
1774
 
1775
+ `runInActiveExtensionScope(pmRoot, run)` is the reentrant form for code that
1776
+ writes through the item store without dispatching an action: it reuses the
1777
+ caller's open scope, and otherwise activates the workspace's extensions for
1778
+ that one call. The SDK's own `finalize` step uses it, so guards and extension
1779
+ fields judge the write the same way whether or not the caller opened a scope.
1780
+
1764
1781
  ```ts
1765
1782
  import {
1766
1783
  commitItemMutations,
@@ -1795,6 +1812,88 @@ const result = await commitItemMutations({
1795
1812
  `commitWorkspaceTransaction` remains the escape hatch for arbitrary domains
1796
1813
  (relationship events, foreign stores, mixed-step plans); `commitItemMutations`
1797
1814
  covers the item-mutation 90% case with correct-by-construction wiring.
1815
+
1816
+ ##### Finalization steps
1817
+
1818
+ An importer often has to write fields that `update` reserves for the lifecycle
1819
+ commands: exact source clocks (`created_at`, `closed_at`, `completed_at`), a
1820
+ terminal `status` with its `close_reason`, or extension fields. Writing them
1821
+ beside the transaction (for example from an `onTransition` observer) leaves an
1822
+ event the transaction does not own, so a later failure refuses compensation
1823
+ with `transaction_partial_mutation` and the tracker stays half-imported. A
1824
+ `finalize` row makes that write a journaled step (GH-1656):
1825
+
1826
+ ```ts
1827
+ await commitItemMutations({
1828
+ pmRoot,
1829
+ transactionId: "github-import-1042",
1830
+ author: "pm-github",
1831
+ mutations: [
1832
+ { op: "update", id: itemId, options: { title: "Fix login flow" } },
1833
+ {
1834
+ op: "finalize",
1835
+ id: itemId,
1836
+ set: {
1837
+ status: "closed",
1838
+ close_reason: "Closed on GitHub as completed",
1839
+ created_at: "2025-03-01T09:00:00.000Z",
1840
+ closed_at: "2025-03-04T16:20:00.000Z",
1841
+ github_number: 1042,
1842
+ },
1843
+ unset: ["assignee"],
1844
+ match: { key: "github_url", value: issueUrl },
1845
+ },
1846
+ ],
1847
+ });
1848
+ ```
1849
+
1850
+ - `set` writes each front-matter field as given and `unset` removes fields
1851
+ (a field the item format always stores, such as `tags`, is left empty). A
1852
+ row needs at least one of them. Values are retained in the journal, so they
1853
+ must be plain JSON data (no class instances, sparse arrays, or `__proto__`,
1854
+ `constructor` and `prototype` keys) and must not be secrets.
1855
+ - Field names are letters, digits and underscores, so an extension field keeps
1856
+ its registered spelling (`legacyId`). `id`, `updated_at`, `pm_format_version`
1857
+ and `type` are refused: the writer
1858
+ derives the first three, and `type` selects the storage location, so it
1859
+ changes through an `update` row. `null` is refused; remove a field with
1860
+ `unset`.
1861
+ - The patched document is read back through the item reader under the
1862
+ workspace schema before it is stored, and every `set` value must be stored
1863
+ in its own JSON shape, an array with every entry. A value the reader
1864
+ refuses, or one that normalization would drop, shorten or replace
1865
+ (`tags: "a"`, `tags: [1]`, duplicate tags, a blank `assignee`), or a set
1866
+ field named like a part of the item format (`front_matter`), refuses the
1867
+ step with `finalization_invalid_document` and writes nothing. `unset`
1868
+ refuses `body` and `front_matter` at admission. Other
1869
+ canonicalization (tag order, status aliases, trimmed strings) applies as it
1870
+ does for every write.
1871
+ - A finalization is a raw front-matter write. Workflow policies and
1872
+ `beforeMutation` guards judge it, with the workspace's extensions active on
1873
+ every call path, but the checks the lifecycle commands add (dependency target
1874
+ resolution, close validation, deferral rules) do not run. Use `update`,
1875
+ `close` and `release` rows for everything those commands can express.
1876
+ - A deferral that the same write resolves (`assignee` set beside a
1877
+ `deferred_fields` entry for `assignee`) is pruned by the store, so the row is
1878
+ refused as not stored as declared.
1879
+ - `match` is re-checked under the item lock and refuses with
1880
+ `upsert_match_changed` when the item no longer carries that field value.
1881
+ `force: true` overrides the assignee-ownership check, as it does for an
1882
+ update.
1883
+ - The step is compensated like an update: the journal captures the version
1884
+ before the write and a failure restores it. The ownership guard is unchanged,
1885
+ so a write by anyone else between the finalization and its compensation
1886
+ still refuses with `transaction_partial_mutation`.
1887
+ - The event is recorded under the native `import` history operation, with the
1888
+ step marker as its message and in `context.item_transaction_step`. Mutation
1889
+ guards and workflow policies judge it as an `import` operation.
1890
+ - Every finalization appends its event, even when no field changes. The event
1891
+ is what recovery reads, so a completed row is adopted and never re-evaluated
1892
+ against state a later row produced. Leave a row out of the batch when the
1893
+ plan already knows it changes nothing.
1894
+
1895
+ `finalize` is an SDK row. Structured mutation documents (`pm item mutate`, MCP
1896
+ `pm_mutate`) accept `create`, `update`, `close` and `release` only.
1798
1897
  Update mutation options use the same lossless acceptance-criteria contract as
1799
1898
  the CLI: criteria are stored in one string with semicolons as boundaries, so
1800
1899
  each `addAc`/`removeAc` entry must be semicolon-free. Every removal must match or
@@ -55,7 +55,8 @@ Use `listMutationEvents({ item: "pm-abcd", verify: true })` or
55
55
  The SDK reads authoritative bytes and verifies each complete selected stream
56
56
  before applying operation, author, timestamp, cursor, or row-limit filters.
57
57
  Selected-record failures are detected even outside the returned page. JSON
58
- parsing failures from `readHistorySnapshot` report `history_json_invalid`;
58
+ parsing failures from `readHistorySnapshot` report `history_json_invalid`, and a
59
+ line that is valid JSON but not an object reports `history_record_invalid`;
59
60
  chain-verification failures report `event_history_integrity_failed` with
60
61
  history-inspection recovery. Follow the returned typed recovery guidance. Select
61
62
  `item` to bound verification cost and exclude unrelated streams. With no item
@@ -257,7 +258,7 @@ and identifier-minified, and command-family registration loads only the create
257
258
  surface for a cold `pm create`.
258
259
 
259
260
  The fixed 10,000-item latency, RSS, correctness, and token budgets remain
260
- unchanged. See [Performance and scale](PERFORMANCE.md) for the reproducible
261
+ unchanged. See [Performance and scale](https://github.com/unbraind/pm-cli/blob/main/docs/PERFORMANCE.md) (repository-only, excluded from npm) for the reproducible
261
262
  gate; never relax a budget to accommodate a new context primitive.
262
263
 
263
264
  ## Contract discovery
package/marketplace.json CHANGED
@@ -1 +1 @@
1
- {"name":"pm","owner":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"description":"Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.","version":"2026.11.21","plugins":[{"name":"pm-claude","source":"./plugins/pm-claude","description":"Native pm CLI integration for Claude Code — 32 MCP tools, 14 workflow skills with slash invocations, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.","version":"2026.11.21","author":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"homepage":"https://github.com/unbraind/pm-cli","repository":"https://github.com/unbraind/pm-cli","license":"MIT","keywords":["pm-cli","project-management","mcp","tasks","agents","workflows","git-native","task-tracker","ai"],"category":"productivity"}]}
1
+ {"name":"pm","owner":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"description":"Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.","version":"2026.11.22","plugins":[{"name":"pm-claude","source":"./plugins/pm-claude","description":"Native pm CLI integration for Claude Code — 32 MCP tools, 14 workflow skills with slash invocations, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.","version":"2026.11.22","author":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"homepage":"https://github.com/unbraind/pm-cli","repository":"https://github.com/unbraind/pm-cli","license":"MIT","keywords":["pm-cli","project-management","mcp","tasks","agents","workflows","git-native","task-tracker","ai"],"category":"productivity"}]}
@@ -2,7 +2,7 @@
2
2
  "author": "Isaac Z. Schlueter",
3
3
  "name": "tar",
4
4
  "description": "tar for node",
5
- "version": "7.5.22",
5
+ "version": "7.5.23",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/isaacs/node-tar.git"
@@ -15,8 +15,7 @@
15
15
  "presnap": "npm run prepare",
16
16
  "prepare": "tshy && bash scripts/build.sh",
17
17
  "preversion": "npm test",
18
- "postversion": "npm publish",
19
- "prepublishOnly": "git push origin --follow-tags",
18
+ "postversion": "git push origin --follow-tags",
20
19
  "format": "prettier --write . --log-level warn",
21
20
  "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts",
22
21
  "lint": "oxlint --fix src test",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-cli",
3
- "version": "2026.11.21",
3
+ "version": "2026.11.22",
4
4
  "description": "Git-native project management CLI for humans and agents.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.28.5",
@@ -90,6 +90,31 @@
90
90
  "files": [
91
91
  "dist/**",
92
92
  "!dist/**/*.map",
93
+ "!dist/sdk/testing.js",
94
+ "!dist/sdk/index.js",
95
+ "!dist/sdk/compose.js",
96
+ "!dist/sdk/agent/refusal-reachability.js",
97
+ "!dist/sdk/environment/agent-environment.js",
98
+ "!dist/sdk/corpus-shape.js",
99
+ "!dist/sdk/agent/task-transcript-contracts.js",
100
+ "!dist/sdk/graph/adapter.js",
101
+ "!dist/sdk/graph/conformance.js",
102
+ "!dist/sdk/graph/index.js",
103
+ "!dist/sdk/graph.js",
104
+ "!dist/sdk/agent/tracker-preflight-contracts.js",
105
+ "!dist/sdk/agent/refusal-closure.js",
106
+ "!dist/sdk/governance/reliability.js",
107
+ "!dist/sdk/core.js",
108
+ "!dist/sdk/governance/artifact-ledgers.js",
109
+ "!dist/sdk/query.js",
110
+ "!dist/sdk/workspace-recipe.js",
111
+ "!dist/sdk/core-governance.js",
112
+ "!dist/sdk/relationship-migration.js",
113
+ "!dist/sdk/authoring.js",
114
+ "!dist/sdk/define.js",
115
+ "!dist/sdk/governance.js",
116
+ "!dist/sdk/governance/coverage-assurance.js",
117
+ "!dist/sdk/contracts.js",
93
118
  "README.md",
94
119
  "CONTRIBUTING.md",
95
120
  "SECURITY.md",
@@ -112,6 +137,9 @@
112
137
  "!docs/REPOSITORY_TESTING.md",
113
138
  "!docs/QUALITY_EVIDENCE.md",
114
139
  "!docs/MCP_2026_07_28_CONFORMANCE.md",
140
+ "!docs/PERFORMANCE.md",
141
+ "!docs/AGENT_PROVENANCE_ADR.md",
142
+ "!docs/DEFECT_RECURRENCE.md",
115
143
  ".claude-plugin/**",
116
144
  "plugins/**",
117
145
  "packages/pm-*/**",
@@ -151,7 +179,7 @@
151
179
  "fast-json-patch": "^3.1.1",
152
180
  "npm-package-arg": "^13.0.2",
153
181
  "semver": "7.8.6",
154
- "tar": "7.5.22",
182
+ "tar": "7.5.23",
155
183
  "yaml": "^2.9.1",
156
184
  "@opentelemetry/api": "1.9.1",
157
185
  "@opentelemetry/core": "2.12.1",
@@ -1 +1 @@
1
- {"name":"@unbrained/pm-beads","version":"2026.11.21","private":true,"type":"module","description":"First-party pm package for importing Beads JSONL records.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-beads"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","beads"],"pm":{"aliases":["beads"],"extensions":["extensions/beads"],"catalog":{"display_name":"Beads Import","category":"migration","summary":"Import Beads JSONL records into pm while preserving source IDs.","tags":["migration","beads","import"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
1
+ {"name":"@unbrained/pm-beads","version":"2026.11.22","private":true,"type":"module","description":"First-party pm package for importing Beads JSONL records.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-beads"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","beads"],"pm":{"aliases":["beads"],"extensions":["extensions/beads"],"catalog":{"display_name":"Beads Import","category":"migration","summary":"Import Beads JSONL records into pm while preserving source IDs.","tags":["migration","beads","import"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
@@ -1 +1 @@
1
- {"name":"@unbrained/pm-calendar","version":"2026.11.21","private":true,"type":"module","description":"First-party pm package for calendar and agenda views.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-calendar"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","calendar","agenda"],"pm":{"aliases":["calendar"],"extensions":["extensions/calendar"],"catalog":{"display_name":"Calendar Views","category":"workflow","summary":"Show agenda, day, week, and month views for deadlines, reminders, and scheduled events.","tags":["calendar","agenda","workflow"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
1
+ {"name":"@unbrained/pm-calendar","version":"2026.11.22","private":true,"type":"module","description":"First-party pm package for calendar and agenda views.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-calendar"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","calendar","agenda"],"pm":{"aliases":["calendar"],"extensions":["extensions/calendar"],"catalog":{"display_name":"Calendar Views","category":"workflow","summary":"Show agenda, day, week, and month views for deadlines, reminders, and scheduled events.","tags":["calendar","agenda","workflow"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
@@ -1 +1 @@
1
- {"name":"@unbrained/pm-command-kit","version":"2026.11.21","private":true,"type":"module","description":"First-party pm exemplar package for the commands capability: registerCommand, registerFlags, and registerParser.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-command-kit"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","sdk","commands","exemplar"],"pm":{"aliases":["command-kit"],"extensions":["extensions/command-kit"],"catalog":{"display_name":"Command Kit Exemplar","category":"sdk","summary":"Copy-paste-able exemplar for registerCommand, registerFlags, and registerParser.","tags":["sdk","commands","parser","exemplar"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
1
+ {"name":"@unbrained/pm-command-kit","version":"2026.11.22","private":true,"type":"module","description":"First-party pm exemplar package for the commands capability: registerCommand, registerFlags, and registerParser.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-command-kit"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","sdk","commands","exemplar"],"pm":{"aliases":["command-kit"],"extensions":["extensions/command-kit"],"catalog":{"display_name":"Command Kit Exemplar","category":"sdk","summary":"Copy-paste-able exemplar for registerCommand, registerFlags, and registerParser.","tags":["sdk","commands","parser","exemplar"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
@@ -1 +1 @@
1
- {"name":"@unbrained/pm-digital-twin","version":"2026.11.21","private":true,"type":"module","description":"Beyond-PM exemplar: a temporal production-facility digital twin built entirely on public pm SDK and extension primitives.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-digital-twin#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-digital-twin"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","sdk","digital-twin","event-sourcing","temporal-graph","exemplar"],"pm":{"aliases":["digital-twin","twin"],"extensions":["extensions/digital-twin"],"catalog":{"display_name":"Digital Twin SDK Exemplar","category":"sdk","summary":"Temporal facility graph proving event replay, point-in-time state, invariants, federation, checkpoints, and compact exports through public SDK contracts.","tags":["sdk","digital-twin","event-sourcing","graph","offline-first","exemplar"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-digital-twin#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-digital-twin","report":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-digital-twin/GAP_REPORT.md"}},"docs":["README.md","GAP_REPORT.md"],"examples":["README.md"]}}
1
+ {"name":"@unbrained/pm-digital-twin","version":"2026.11.22","private":true,"type":"module","description":"Beyond-PM exemplar: a temporal production-facility digital twin built entirely on public pm SDK and extension primitives.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-digital-twin#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-digital-twin"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","sdk","digital-twin","event-sourcing","temporal-graph","exemplar"],"pm":{"aliases":["digital-twin","twin"],"extensions":["extensions/digital-twin"],"catalog":{"display_name":"Digital Twin SDK Exemplar","category":"sdk","summary":"Temporal facility graph proving event replay, point-in-time state, invariants, federation, checkpoints, and compact exports through public SDK contracts.","tags":["sdk","digital-twin","event-sourcing","graph","offline-first","exemplar"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-digital-twin#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-digital-twin","report":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-digital-twin/GAP_REPORT.md"}},"docs":["README.md","GAP_REPORT.md"],"examples":["README.md"]}}
@@ -1 +1 @@
1
- {"name":"@unbrained/pm-governance-audit","version":"2026.11.21","private":true,"type":"module","description":"First-party pm package for governance audit and normalization workflows.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-governance-audit#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-governance-audit"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","governance","audit","normalize","hooks"],"pm":{"aliases":["governance-audit","audit"],"extensions":["extensions/governance-audit"],"catalog":{"display_name":"Governance Audit","category":"governance","summary":"Run dedupe audits, comments audits, and normalize sweeps as package-owned workflows.","tags":["governance","audit","normalize","hooks"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-governance-audit#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-governance-audit","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
1
+ {"name":"@unbrained/pm-governance-audit","version":"2026.11.22","private":true,"type":"module","description":"First-party pm package for governance audit and normalization workflows.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-governance-audit#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-governance-audit"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","governance","audit","normalize","hooks"],"pm":{"aliases":["governance-audit","audit"],"extensions":["extensions/governance-audit"],"catalog":{"display_name":"Governance Audit","category":"governance","summary":"Run dedupe audits, comments audits, and normalize sweeps as package-owned workflows.","tags":["governance","audit","normalize","hooks"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-governance-audit#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-governance-audit","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
@@ -1 +1 @@
1
- {"name":"@unbrained/pm-guide-shell","version":"2026.11.21","private":true,"type":"module","description":"First-party pm package for guide and shell completion workflows.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-guide-shell#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-guide-shell"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","guide","completion","shell"],"pm":{"aliases":["guide-shell"],"extensions":["extensions/guide-shell"],"catalog":{"display_name":"Guide + Shell UX","category":"workflow","summary":"Restore guide documentation and shell completion commands as package-owned UX surfaces.","tags":["guide","completion","shell"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-guide-shell#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-guide-shell","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
1
+ {"name":"@unbrained/pm-guide-shell","version":"2026.11.22","private":true,"type":"module","description":"First-party pm package for guide and shell completion workflows.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-guide-shell#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-guide-shell"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","guide","completion","shell"],"pm":{"aliases":["guide-shell"],"extensions":["extensions/guide-shell"],"catalog":{"display_name":"Guide + Shell UX","category":"workflow","summary":"Restore guide documentation and shell completion commands as package-owned UX surfaces.","tags":["guide","completion","shell"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-guide-shell#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-guide-shell","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
@@ -1 +1 @@
1
- {"name":"@unbrained/pm-kanban","version":"2026.11.21","private":true,"type":"module","description":"First-party pm archetype package: a complete Kanban continuous-flow profile built on public SDK primitives.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-kanban#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-kanban"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","sdk","profile","archetype","kanban","exemplar"],"pm":{"aliases":["kanban"],"extensions":["extensions/kanban"],"catalog":{"display_name":"Kanban Archetype","category":"sdk","summary":"Installable Kanban continuous-flow archetype: Card item type, flow fields, and a ProjectProfileDefinition built on public SDK primitives.","tags":["sdk","profile","archetype","kanban","schema","exemplar"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-kanban#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-kanban","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
1
+ {"name":"@unbrained/pm-kanban","version":"2026.11.22","private":true,"type":"module","description":"First-party pm archetype package: a complete Kanban continuous-flow profile built on public SDK primitives.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-kanban#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-kanban"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","sdk","profile","archetype","kanban","exemplar"],"pm":{"aliases":["kanban"],"extensions":["extensions/kanban"],"catalog":{"display_name":"Kanban Archetype","category":"sdk","summary":"Installable Kanban continuous-flow archetype: Card item type, flow fields, and a ProjectProfileDefinition built on public SDK primitives.","tags":["sdk","profile","archetype","kanban","schema","exemplar"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-kanban#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-kanban","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
@@ -1 +1 @@
1
- {"name":"@unbrained/pm-lifecycle-hooks","version":"2026.11.21","private":true,"type":"module","description":"First-party pm package demonstrating safe lifecycle hook registration.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-lifecycle-hooks#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-lifecycle-hooks"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","hooks","lifecycle","sdk"],"pm":{"aliases":["lifecycle-hooks"],"extensions":["extensions/lifecycle-hooks"],"catalog":{"display_name":"Lifecycle Hooks","category":"sdk","summary":"Default-inert lifecycle hook exemplar for package authors.","tags":["hooks","lifecycle","sdk"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-lifecycle-hooks#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-lifecycle-hooks","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
1
+ {"name":"@unbrained/pm-lifecycle-hooks","version":"2026.11.22","private":true,"type":"module","description":"First-party pm package demonstrating safe lifecycle hook registration.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-lifecycle-hooks#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-lifecycle-hooks"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","hooks","lifecycle","sdk"],"pm":{"aliases":["lifecycle-hooks"],"extensions":["extensions/lifecycle-hooks"],"catalog":{"display_name":"Lifecycle Hooks","category":"sdk","summary":"Default-inert lifecycle hook exemplar for package authors.","tags":["hooks","lifecycle","sdk"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-lifecycle-hooks#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-lifecycle-hooks","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
@@ -1 +1 @@
1
- {"name":"@unbrained/pm-linked-test-adapters","version":"2026.11.21","private":true,"type":"module","description":"First-party pm package for optional linked-test run management adapters and reporters.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-linked-test-adapters#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-linked-test-adapters"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","linked-tests","background-runs","test-runs"],"pm":{"aliases":["linked-test-adapters"],"extensions":["extensions/linked-test-adapters"],"catalog":{"display_name":"Linked Test Adapters","category":"testing","summary":"Restore optional linked-test run management/reporting command surfaces.","tags":["tests","linked-tests","background","reporting"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-linked-test-adapters#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-linked-test-adapters","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
1
+ {"name":"@unbrained/pm-linked-test-adapters","version":"2026.11.22","private":true,"type":"module","description":"First-party pm package for optional linked-test run management adapters and reporters.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-linked-test-adapters#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-linked-test-adapters"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","linked-tests","background-runs","test-runs"],"pm":{"aliases":["linked-test-adapters"],"extensions":["extensions/linked-test-adapters"],"catalog":{"display_name":"Linked Test Adapters","category":"testing","summary":"Restore optional linked-test run management/reporting command surfaces.","tags":["tests","linked-tests","background","reporting"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-linked-test-adapters#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-linked-test-adapters","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}