@unbrained/pm-cli 2026.9.4 → 2026.9.5

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 (190) hide show
  1. package/.agents/skills/HARNESS_COMPATIBILITY.md +1 -1
  2. package/.agents/skills/README.md +2 -2
  3. package/.agents/skills/pm-developer/SKILL.md +4 -1
  4. package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +10 -0
  5. package/.agents/skills/pm-developer/references/GRAPH_AND_RELATIONSHIPS.md +3 -1
  6. package/.agents/skills/pm-extensions/SKILL.md +2 -2
  7. package/.agents/skills/pm-extensions/references/LIFECYCLE.md +3 -3
  8. package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +3 -3
  9. package/.agents/skills/pm-user/SKILL.md +2 -0
  10. package/.agents/skills/pm-user/references/BACKLOG_SHAPING.md +5 -0
  11. package/.agents/skills/pm-user/references/WORKFLOWS.md +20 -5
  12. package/.claude-plugin/marketplace.json +2 -2
  13. package/CHANGELOG.md +26 -1
  14. package/dist/cli/commander-usage.d.ts +2 -0
  15. package/dist/cli/commander-usage.js +15 -12
  16. package/dist/cli/help-json-payload.js +12 -7
  17. package/dist/cli/main.js +15 -6
  18. package/dist/cli/register-list-query.js +4 -2
  19. package/dist/cli/register-mutation.js +4 -2
  20. package/dist/cli/register-operations.js +6 -2
  21. package/dist/cli-bundle/bundle-manifest.json +153 -153
  22. package/dist/cli-bundle/chunks/{chunk-RI4XNOYS.js → chunk-3HBDTJRK.js} +2 -2
  23. package/dist/cli-bundle/chunks/chunk-66VPKFP2.js +5 -0
  24. package/dist/cli-bundle/chunks/{chunk-I2AS367G.js → chunk-HUAQITVW.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-HI6BHPCU.js → chunk-IBYREGSP.js} +2 -2
  26. package/dist/cli-bundle/chunks/chunk-LUI4E32I.js +231 -0
  27. package/dist/cli-bundle/chunks/{chunk-YW4QK2G7.js → chunk-QPZHQY2O.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-X6CMGV6L.js → chunk-SF6SM6U5.js} +2 -2
  29. package/dist/cli-bundle/chunks/chunk-SVK5Y64D.js +40 -0
  30. package/dist/cli-bundle/chunks/chunk-V5GBD5KV.js +9 -0
  31. package/dist/cli-bundle/chunks/{chunk-V72UV7QS.js → chunk-WWAEGW4V.js} +57 -57
  32. package/dist/cli-bundle/chunks/{chunk-A24WAVE6.js → chunk-ZRAQS3UA.js} +2 -2
  33. package/dist/cli-bundle/chunks/{register-list-query-Z5YYSJJG.js → register-list-query-AYKGODWT.js} +3 -3
  34. package/dist/cli-bundle/chunks/{register-mutation-ELSP6I4I.js → register-mutation-YZYG53SQ.js} +4 -4
  35. package/dist/cli-bundle/chunks/register-operations-KFSCC7QV.js +2 -0
  36. package/dist/cli-bundle/chunks/{register-setup-E2AE72QG.js → register-setup-UJCRVGBG.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/chunk-24IG6ONG.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/{chunk-53IHPICX.js → chunk-3ASU6WGI.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/chunk-3ITLIBKS.js +56 -0
  40. package/dist/cli-bundle/focused-chunks/chunk-3NQD5YDG.js +2 -0
  41. package/dist/cli-bundle/focused-chunks/{chunk-7N2TV7WZ.js → chunk-4OSHLNUE.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/chunk-65N6JHAN.js +2 -0
  43. package/dist/cli-bundle/focused-chunks/{chunk-AJR3OP2E.js → chunk-B2TTQGFG.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/chunk-GUBM3RGY.js +20 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-25UJBH4M.js → chunk-H5FOGAVD.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/chunk-JX3RCVCX.js +2 -0
  47. package/dist/cli-bundle/focused-chunks/{chunk-6PWPQKDN.js → chunk-KWWCBWFO.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/chunk-MV752SUC.js +12 -0
  49. package/dist/cli-bundle/focused-chunks/chunk-PKIPMCFS.js +6 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-3646BZ4W.js → chunk-QL66QNWG.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/chunk-RJMR2JIF.js +9 -0
  52. package/dist/cli-bundle/focused-chunks/chunk-WIUPWIZR.js +177 -0
  53. package/dist/cli-bundle/focused-chunks/{chunk-NBMJD6MK.js → chunk-WOCIPMW7.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-MHKUIPJW.js → chunk-YEF5PQQ2.js} +2 -2
  55. package/dist/cli-bundle/main.js +22 -15
  56. package/dist/cli-bundle/sdk-authoring.js +1 -1
  57. package/dist/cli-bundle/sdk-contracts.js +1 -1
  58. package/dist/cli-bundle/sdk-core.js +29 -29
  59. package/dist/cli-bundle/sdk-governance.js +1 -1
  60. package/dist/cli-bundle/sdk-graph.js +1 -1
  61. package/dist/cli-bundle/sdk-merge.js +42 -39
  62. package/dist/cli-bundle/sdk-query.js +1 -1
  63. package/dist/cli-bundle/sdk-runtime.js +1 -1
  64. package/dist/cli-bundle/sdk-testing.js +1 -1
  65. package/dist/cli-bundle/sdk.js +8 -8
  66. package/dist/core/extensions/extension-types.d.ts +2 -0
  67. package/dist/core/extensions/extension-types.js +2 -2
  68. package/dist/core/history/drift-scan.d.ts +5 -0
  69. package/dist/core/history/drift-scan.js +16 -6
  70. package/dist/core/history/event-classification.d.ts +1 -1
  71. package/dist/core/history/event-classification.js +3 -2
  72. package/dist/core/history/history.js +37 -5
  73. package/dist/core/history/identity.d.ts +15 -0
  74. package/dist/core/history/identity.js +31 -0
  75. package/dist/core/history/projection.js +50 -17
  76. package/dist/core/history/read.js +6 -3
  77. package/dist/core/history/replay.d.ts +1 -2
  78. package/dist/core/history/replay.js +4 -4
  79. package/dist/core/history/version-address.d.ts +13 -0
  80. package/dist/core/history/version-address.js +33 -0
  81. package/dist/core/item/actionability.d.ts +21 -1
  82. package/dist/core/item/actionability.js +45 -10
  83. package/dist/core/item/id.js +8 -4
  84. package/dist/core/item/item-type-definition.d.ts +2 -0
  85. package/dist/core/item/item-type-definition.js +9 -2
  86. package/dist/core/item/type-registry.d.ts +5 -1
  87. package/dist/core/item/type-registry.js +9 -4
  88. package/dist/core/shared/errors.d.ts +8 -0
  89. package/dist/core/shared/errors.js +2 -2
  90. package/dist/core/store/item-store.d.ts +14 -0
  91. package/dist/core/store/item-store.js +48 -10
  92. package/dist/core/store/settings-validator.js +3 -2
  93. package/dist/sdk/actionability.d.ts +1 -1
  94. package/dist/sdk/actionability.js +3 -3
  95. package/dist/sdk/cli-contracts/command-aliases.js +11 -2
  96. package/dist/sdk/cli-contracts/completeness.js +4 -3
  97. package/dist/sdk/cli-contracts/flag-contracts.js +29 -5
  98. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +19 -12
  99. package/dist/sdk/cli-contracts/tool-parameter-tables.js +14 -2
  100. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
  101. package/dist/sdk/cli-contracts/tool-schema.js +19 -6
  102. package/dist/sdk/context-intent-contracts.js +3 -3
  103. package/dist/sdk/context-usage.js +9 -11
  104. package/dist/sdk/define.d.ts +1 -1
  105. package/dist/sdk/define.js +2 -2
  106. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +98 -50
  107. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +50 -2
  108. package/dist/sdk/governance/validate-history-drift.js +16 -5
  109. package/dist/sdk/guide-topics.js +116 -2
  110. package/dist/sdk/history/salvage.d.ts +35 -0
  111. package/dist/sdk/history/salvage.js +248 -0
  112. package/dist/sdk/history-compact.js +32 -37
  113. package/dist/sdk/history-read.d.ts +3 -2
  114. package/dist/sdk/history-read.js +6 -3
  115. package/dist/sdk/history-repair.d.ts +5 -0
  116. package/dist/sdk/history-repair.js +14 -2
  117. package/dist/sdk/lifecycle/claim.d.ts +4 -0
  118. package/dist/sdk/lifecycle/claim.js +9 -3
  119. package/dist/sdk/lifecycle/restore.d.ts +1 -0
  120. package/dist/sdk/lifecycle/restore.js +19 -7
  121. package/dist/sdk/output-projection.d.ts +3 -1
  122. package/dist/sdk/output-projection.js +11 -3
  123. package/dist/sdk/public-surface.json +1 -0
  124. package/dist/sdk/query/context.d.ts +9 -0
  125. package/dist/sdk/query/context.js +33 -21
  126. package/dist/sdk/query/get.d.ts +2 -2
  127. package/dist/sdk/query/get.js +4 -3
  128. package/dist/sdk/query/history.d.ts +11 -0
  129. package/dist/sdk/query/history.js +34 -10
  130. package/dist/sdk/query/next.d.ts +15 -1
  131. package/dist/sdk/query/next.js +43 -20
  132. package/dist/sdk/query.d.ts +1 -0
  133. package/dist/sdk/query.js +3 -2
  134. package/dist/sdk/runtime-primitives.d.ts +1 -1
  135. package/dist/sdk/runtime-primitives.js +3 -3
  136. package/dist/types.d.ts +2 -0
  137. package/dist/types.js +2 -2
  138. package/docs/AGENT_GUIDE.md +36 -0
  139. package/docs/HISTORY_RECOVERY.md +146 -0
  140. package/docs/README.md +1 -0
  141. package/docs/RELEASING.md +25 -11
  142. package/docs/SDK_CONTEXT_TRUTH_CONTRACTS.md +24 -1
  143. package/docs/SDK_EXECUTION_CONTRACTS.md +105 -0
  144. package/docs/TESTING.md +5 -0
  145. package/docs/agent-task-token-baseline.json +17 -17
  146. package/docs/agent-task-transcripts.json +2 -1
  147. package/docs/generated/FLAG_LEXICON_BUDGETS.md +10 -10
  148. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +11 -3
  149. package/marketplace.json +2 -2
  150. package/package.json +4 -5
  151. package/packages/pm-beads/package.json +1 -1
  152. package/packages/pm-calendar/package.json +1 -1
  153. package/packages/pm-command-kit/package.json +1 -1
  154. package/packages/pm-digital-twin/package.json +1 -1
  155. package/packages/pm-governance-audit/package.json +1 -1
  156. package/packages/pm-guide-shell/package.json +1 -1
  157. package/packages/pm-kanban/package.json +1 -1
  158. package/packages/pm-lifecycle-hooks/package.json +1 -1
  159. package/packages/pm-linked-test-adapters/package.json +1 -1
  160. package/packages/pm-search-advanced/package.json +1 -1
  161. package/packages/pm-templates/package.json +1 -1
  162. package/packages/pm-todos/package.json +1 -1
  163. package/packages/pm-vcs/package.json +1 -1
  164. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  165. package/plugins/pm-claude/skills/pm-audit/SKILL.md +2 -2
  166. package/plugins/pm-claude/skills/pm-developer/SKILL.md +2 -2
  167. package/plugins/pm-claude/skills/pm-planner/SKILL.md +2 -2
  168. package/plugins/pm-claude/skills/pm-release/SKILL.md +2 -2
  169. package/plugins/pm-claude/skills/pm-workflow/SKILL.md +3 -3
  170. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  171. package/plugins/pm-codex/skills/pm-auditor/SKILL.md +2 -2
  172. package/plugins/pm-codex/skills/pm-native/SKILL.md +3 -4
  173. package/plugins/pm-codex/skills/pm-release/SKILL.md +2 -2
  174. package/scripts/finalize-build.mjs +13 -1
  175. package/dist/cli-bundle/chunks/chunk-6XSKPNCF.js +0 -230
  176. package/dist/cli-bundle/chunks/chunk-OGBVU67G.js +0 -5
  177. package/dist/cli-bundle/chunks/chunk-TXW6VL33.js +0 -38
  178. package/dist/cli-bundle/chunks/chunk-VGLHECAP.js +0 -9
  179. package/dist/cli-bundle/chunks/register-operations-OH7R3ZT4.js +0 -2
  180. package/dist/cli-bundle/focused-chunks/chunk-4YRAVI43.js +0 -12
  181. package/dist/cli-bundle/focused-chunks/chunk-5P4HVOWG.js +0 -176
  182. package/dist/cli-bundle/focused-chunks/chunk-636VVQ7F.js +0 -54
  183. package/dist/cli-bundle/focused-chunks/chunk-B3A6MJYE.js +0 -2
  184. package/dist/cli-bundle/focused-chunks/chunk-BFDDJ2T2.js +0 -2
  185. package/dist/cli-bundle/focused-chunks/chunk-BHUIRZWQ.js +0 -9
  186. package/dist/cli-bundle/focused-chunks/chunk-JADHHPY6.js +0 -6
  187. package/dist/cli-bundle/focused-chunks/chunk-NSKBLHVI.js +0 -20
  188. package/dist/cli-bundle/focused-chunks/chunk-P2GOAOQN.js +0 -2
  189. package/dist/cli-bundle/focused-chunks/chunk-YARWJM2B.js +0 -2
  190. package/sdk/public-surface.json +0 -33034
@@ -1,6 +1,6 @@
1
1
  /** Generated partition 1 of the exhaustive error-code catalog. */
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f9059953-1d3c-5c1c-b739-4ad6cc8815a3")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2d5b7e84-f6a6-5c48-a72b-a929ab2186f7")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_1 = [
5
5
  {
6
6
  code: "acceptance_criteria_mutation_conflict",
@@ -1163,6 +1163,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1163
1163
  canonical_code: "history_author_acknowledge_target_unreadable",
1164
1164
  aliases: [],
1165
1165
  },
1166
+ {
1167
+ code: "history_baseline_unavailable",
1168
+ meaning: "History baseline unavailable condition.",
1169
+ stability: "provisional",
1170
+ exit_code: 1,
1171
+ class: "generic_failure",
1172
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1173
+ sources: ["core/history/projection.ts"],
1174
+ emitting_commands: ["*"],
1175
+ canonical_code: "history_baseline_unavailable",
1176
+ aliases: [],
1177
+ },
1166
1178
  {
1167
1179
  code: "history_drift_chain_mismatch",
1168
1180
  meaning: "History drift chain mismatch condition.",
@@ -1235,6 +1247,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1235
1247
  canonical_code: "history_drift_version_skew",
1236
1248
  aliases: ["validate_history_drift_version_skews"],
1237
1249
  },
1250
+ {
1251
+ code: "history_json_invalid",
1252
+ meaning: "History json invalid condition.",
1253
+ stability: "provisional",
1254
+ exit_code: 1,
1255
+ class: "generic_failure",
1256
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1257
+ sources: ["core/history/read.ts"],
1258
+ emitting_commands: ["*"],
1259
+ canonical_code: "history_json_invalid",
1260
+ aliases: [],
1261
+ },
1238
1262
  {
1239
1263
  code: "history_merge_conflict_markers_detected",
1240
1264
  meaning: "History merge conflict markers detected condition.",
@@ -1247,6 +1271,30 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1247
1271
  canonical_code: "merge_conflict_markers_detected",
1248
1272
  aliases: [],
1249
1273
  },
1274
+ {
1275
+ code: "history_replay_invalid",
1276
+ meaning: "History replay invalid condition.",
1277
+ stability: "provisional",
1278
+ exit_code: 1,
1279
+ class: "generic_failure",
1280
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1281
+ sources: ["core/history/projection.ts"],
1282
+ emitting_commands: ["*"],
1283
+ canonical_code: "history_replay_invalid",
1284
+ aliases: [],
1285
+ },
1286
+ {
1287
+ code: "history_salvage_refused",
1288
+ meaning: "History salvage refused condition.",
1289
+ stability: "provisional",
1290
+ exit_code: 4,
1291
+ class: "conflict",
1292
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1293
+ sources: ["sdk/history/salvage.ts"],
1294
+ emitting_commands: ["*"],
1295
+ canonical_code: "history_salvage_refused",
1296
+ aliases: [],
1297
+ },
1250
1298
  {
1251
1299
  code: "history_stream_over_compact_threshold",
1252
1300
  meaning: "History stream over compact threshold condition.",
@@ -1295,6 +1343,30 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1295
1343
  canonical_code: "history_unknown_author_events",
1296
1344
  aliases: ["validate_history_unknown_author_events"],
1297
1345
  },
1346
+ {
1347
+ code: "history_version_mapping_unavailable",
1348
+ meaning: "History version mapping unavailable condition.",
1349
+ stability: "provisional",
1350
+ exit_code: 2,
1351
+ class: "usage",
1352
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1353
+ sources: ["core/history/version-address.ts"],
1354
+ emitting_commands: ["*"],
1355
+ canonical_code: "history_version_mapping_unavailable",
1356
+ aliases: [],
1357
+ },
1358
+ {
1359
+ code: "history_version_pruned",
1360
+ meaning: "History version pruned condition.",
1361
+ stability: "provisional",
1362
+ exit_code: 2,
1363
+ class: "usage",
1364
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1365
+ sources: ["core/history/projection.ts"],
1366
+ emitting_commands: ["*"],
1367
+ canonical_code: "history_version_pruned",
1368
+ aliases: [],
1369
+ },
1298
1370
  {
1299
1371
  code: "host_environment_capacity_fault",
1300
1372
  meaning: "Host environment capacity fault condition.",
@@ -1797,6 +1869,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1797
1869
  canonical_code: "item_already_active",
1798
1870
  aliases: [],
1799
1871
  },
1872
+ {
1873
+ code: "item_document_encoding_invalid",
1874
+ meaning: "Item document encoding invalid condition.",
1875
+ stability: "provisional",
1876
+ exit_code: 4,
1877
+ class: "conflict",
1878
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1879
+ sources: ["core/store/item-store.ts"],
1880
+ emitting_commands: ["*"],
1881
+ canonical_code: "item_document_encoding_invalid",
1882
+ aliases: [],
1883
+ },
1800
1884
  {
1801
1885
  code: "item_document_invalid",
1802
1886
  meaning: "Item document invalid condition.",
@@ -1833,6 +1917,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1833
1917
  canonical_code: "item_id_collision",
1834
1918
  aliases: [],
1835
1919
  },
1920
+ {
1921
+ code: "item_identity_reserved",
1922
+ meaning: "Item identity reserved condition.",
1923
+ stability: "provisional",
1924
+ exit_code: 4,
1925
+ class: "conflict",
1926
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1927
+ sources: ["core/history/history.ts"],
1928
+ emitting_commands: ["*"],
1929
+ canonical_code: "item_identity_reserved",
1930
+ aliases: [],
1931
+ },
1836
1932
  {
1837
1933
  code: "item_not_found",
1838
1934
  meaning: "Item not found condition.",
@@ -2124,54 +2220,6 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
2124
2220
  canonical_code: "merge_reconcile_receipt_evidence_untrusted",
2125
2221
  aliases: [],
2126
2222
  },
2127
- {
2128
- code: "merge_root_not_found",
2129
- meaning: "Merge root not found condition.",
2130
- stability: "stable",
2131
- exit_code: 3,
2132
- class: "not_found",
2133
- recovery: "Inspect the structured error guidance and retry the suggested command.",
2134
- sources: ["sdk/merge/install.ts"],
2135
- emitting_commands: ["*"],
2136
- canonical_code: "merge_root_not_found",
2137
- aliases: [],
2138
- },
2139
- {
2140
- code: "missing_allowed_values",
2141
- meaning: "Missing allowed values condition.",
2142
- stability: "provisional",
2143
- exit_code: 1,
2144
- class: "generic_failure",
2145
- recovery: "Inspect the structured error guidance and retry the suggested command.",
2146
- sources: ["sdk/agent/refusal-closure.ts"],
2147
- emitting_commands: ["*"],
2148
- canonical_code: "missing_allowed_values",
2149
- aliases: [],
2150
- },
2151
- {
2152
- code: "missing_budget",
2153
- meaning: "Missing budget condition.",
2154
- stability: "provisional",
2155
- exit_code: 1,
2156
- class: "generic_failure",
2157
- recovery: "Inspect the structured error guidance and retry the suggested command.",
2158
- sources: ["sdk/cli-contracts/flag-lexicon-contracts.ts"],
2159
- emitting_commands: ["*"],
2160
- canonical_code: "missing_budget",
2161
- aliases: [],
2162
- },
2163
- {
2164
- code: "missing_cli_flag",
2165
- meaning: "Missing cli flag condition.",
2166
- stability: "provisional",
2167
- exit_code: 1,
2168
- class: "generic_failure",
2169
- recovery: "Inspect the structured error guidance and retry the suggested command.",
2170
- sources: ["sdk/cli-contracts/tool-option-contracts.ts"],
2171
- emitting_commands: ["*"],
2172
- canonical_code: "missing_cli_flag",
2173
- aliases: [],
2174
- },
2175
2223
  ];
2176
2224
  //# sourceMappingURL=generated-error-code-catalog-part-1.js.map
2177
- //# debugId=f9059953-1d3c-5c1c-b739-4ad6cc8815a3
2225
+ //# debugId=2d5b7e84-f6a6-5c48-a72b-a929ab2186f7
@@ -1,7 +1,55 @@
1
1
  /** Generated partition 2 of the exhaustive error-code catalog. */
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f1a77960-6191-5e11-9622-4250be7b0e89")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aa8f034d-d4b6-595b-af76-f7203d062971")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_2 = [
5
+ {
6
+ code: "merge_root_not_found",
7
+ meaning: "Merge root not found condition.",
8
+ stability: "stable",
9
+ exit_code: 3,
10
+ class: "not_found",
11
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
12
+ sources: ["sdk/merge/install.ts"],
13
+ emitting_commands: ["*"],
14
+ canonical_code: "merge_root_not_found",
15
+ aliases: [],
16
+ },
17
+ {
18
+ code: "missing_allowed_values",
19
+ meaning: "Missing allowed values condition.",
20
+ stability: "provisional",
21
+ exit_code: 1,
22
+ class: "generic_failure",
23
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
24
+ sources: ["sdk/agent/refusal-closure.ts"],
25
+ emitting_commands: ["*"],
26
+ canonical_code: "missing_allowed_values",
27
+ aliases: [],
28
+ },
29
+ {
30
+ code: "missing_budget",
31
+ meaning: "Missing budget condition.",
32
+ stability: "provisional",
33
+ exit_code: 1,
34
+ class: "generic_failure",
35
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
36
+ sources: ["sdk/cli-contracts/flag-lexicon-contracts.ts"],
37
+ emitting_commands: ["*"],
38
+ canonical_code: "missing_budget",
39
+ aliases: [],
40
+ },
41
+ {
42
+ code: "missing_cli_flag",
43
+ meaning: "Missing cli flag condition.",
44
+ stability: "provisional",
45
+ exit_code: 1,
46
+ class: "generic_failure",
47
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
48
+ sources: ["sdk/cli-contracts/tool-option-contracts.ts"],
49
+ emitting_commands: ["*"],
50
+ canonical_code: "missing_cli_flag",
51
+ aliases: [],
52
+ },
5
53
  {
6
54
  code: "missing_destination",
7
55
  meaning: "Missing destination condition.",
@@ -2186,4 +2234,4 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
2186
2234
  },
2187
2235
  ];
2188
2236
  //# sourceMappingURL=generated-error-code-catalog-part-2.js.map
2189
- //# debugId=f1a77960-6191-5e11-9622-4250be7b0e89
2237
+ //# debugId=aa8f034d-d4b6-595b-af76-f7203d062971
@@ -6,7 +6,7 @@
6
6
  * orchestration module.
7
7
  */
8
8
 
9
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8bec3c39-b871-5c7c-907c-6da66274d9be")}catch(e){}}();
9
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a2c96f3a-fa7a-538f-ae11-7b821e5b7ab2")}catch(e){}}();
10
10
  import { scanHistoryDrift } from "../../core/history/drift-scan.js";
11
11
  const DEFAULT_DIAGNOSTIC_LIMIT = 5;
12
12
  /** Build the validation warning and bounded evidence projection for history drift. */
@@ -14,7 +14,10 @@ export async function buildValidateHistoryDriftCheck(pmRoot, items, verboseDiagn
14
14
  const drift = await scanHistoryDrift(pmRoot, items);
15
15
  const warningCounts = [
16
16
  ["validate_history_drift_missing_streams", drift.missingStreams.length],
17
- ["validate_history_drift_unreadable_streams", drift.unreadableStreams.length],
17
+ [
18
+ "validate_history_drift_unreadable_streams",
19
+ drift.unreadableStreams.length,
20
+ ],
18
21
  ["validate_history_drift_hash_mismatches", drift.hashMismatches.length],
19
22
  ["validate_history_drift_chain_mismatches", drift.chainMismatches.length],
20
23
  ["validate_history_drift_version_skews", drift.versionSkews.length],
@@ -38,12 +41,20 @@ export async function buildValidateHistoryDriftCheck(pmRoot, items, verboseDiagn
38
41
  ? Number.POSITIVE_INFINITY
39
42
  : DEFAULT_DIAGNOSTIC_LIMIT;
40
43
  const driftedItems = drift.driftedItems.slice(0, diagnosticLimit);
44
+ const identityDiscontinuities = drift.identityDiscontinuities ?? [];
41
45
  return {
42
46
  check: {
43
47
  name: "history_drift",
44
- status: warnings.length === 0 ? "ok" : "warn",
45
- ok: warnings.length === 0,
48
+ status: identityDiscontinuities.length > 0
49
+ ? "error"
50
+ : warnings.length === 0
51
+ ? "ok"
52
+ : "warn",
53
+ ok: identityDiscontinuities.length === 0 && warnings.length === 0,
46
54
  details: {
55
+ identity_discontinuities: identityDiscontinuities.slice(0, diagnosticLimit),
56
+ identity_discontinuities_count: identityDiscontinuities.length,
57
+ identity_discontinuities_truncated: identityDiscontinuities.length > diagnosticLimit,
47
58
  checked_items: items.length,
48
59
  drifted_items_count: drift.driftedItems.length,
49
60
  drifted_items: driftedItems,
@@ -68,4 +79,4 @@ export async function buildValidateHistoryDriftCheck(pmRoot, items, verboseDiagn
68
79
  };
69
80
  }
70
81
  //# sourceMappingURL=validate-history-drift.js.map
71
- //# debugId=8bec3c39-b871-5c7c-907c-6da66274d9be
82
+ //# debugId=a2c96f3a-fa7a-538f-ae11-7b821e5b7ab2
@@ -4,7 +4,7 @@
4
4
  * Provides CLI runtime support for Guide Topics.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7c57f381-8318-5235-aa92-c96c6cedb021")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="feba1227-c2a2-5ca3-83e6-3fd2780e6cbb")}catch(e){}}();
8
8
  import { listPmCommandCapabilityGroups } from "./agent-capability-contracts.js";
9
9
  function normalizeTopicToken(value) {
10
10
  return value.trim().toLowerCase().replaceAll("_", "-");
@@ -518,6 +518,8 @@ const GUIDE_TOPICS = [
518
518
  intent: "Use this when more than one agent or worktree mutates the same tracker and the results must merge without hand resolution.",
519
519
  commands: [
520
520
  "pm merge install",
521
+ "pm merge report",
522
+ "pm merge reconcile --dry-run",
521
523
  "pm claim <ID>",
522
524
  "pm release <ID>",
523
525
  "pm validate --check-history-drift",
@@ -530,6 +532,17 @@ const GUIDE_TOPICS = [
530
532
  prompt: "Run the merge installer in every fresh clone or worktree before the first branch merge of tracker data.",
531
533
  commands: ["pm merge install", "pm health --check-only"],
532
534
  },
535
+ {
536
+ name: "Settle A Merge Before Trusting Health",
537
+ goal: "A lossless merge still leaves pending receipts that strict health reports until they are reconciled.",
538
+ prompt: "After any branch merge that touched tracker data, read the merge report, preview the reconciliation, then apply it; only then treat a health verdict as a statement about the data.",
539
+ commands: [
540
+ "pm merge report",
541
+ "pm merge reconcile --dry-run",
542
+ 'pm merge reconcile --message "Post-merge history reconciliation"',
543
+ "pm health --check-only",
544
+ ],
545
+ },
533
546
  {
534
547
  name: "Hand Work Between Agents Safely",
535
548
  goal: "Ownership and evidence survive the handoff.",
@@ -553,6 +566,107 @@ const GUIDE_TOPICS = [
553
566
  ],
554
567
  related: ["workflows", "assurance", "commands"],
555
568
  },
569
+ {
570
+ id: "evidence",
571
+ aliases: ["record", "annotations", "learnings", "history-maintenance"],
572
+ title: "Evidence, Durable Knowledge, and Record Maintenance",
573
+ summary: "Append comments, notes, learnings, files, docs, and tests to items, and maintain the immutable history those records live in.",
574
+ intent: "Use this when work must be explained to the next agent, when a durable lesson should outlive the item, or when a history stream needs verification, repair, redaction, compaction, or author attribution.",
575
+ commands: [
576
+ 'pm comments <ID> "<progress or verification evidence>"',
577
+ 'pm notes <ID> --add "<rationale that belongs on the item>"',
578
+ 'pm learnings <ID> --add "<lesson that should outlive the item>"',
579
+ "pm append <ID> --body -",
580
+ "pm files <ID> --add path=<path>,scope=project,note=<why>",
581
+ "pm history <ID> --verify --strict-exit",
582
+ "pm history-repair --all --dry-run",
583
+ "pm history-redact <ID> --literal <secret> --dry-run",
584
+ "pm history-compact <ID> --dry-run",
585
+ "pm history-author-acknowledge --all-actionable --dry-run",
586
+ "pm close-many --ids <ID>,<ID> --reason <text> --dry-run",
587
+ "pm test-all --status open --limit 10 --progress",
588
+ ],
589
+ workflows: [
590
+ {
591
+ name: "Record While Working, Not After",
592
+ goal: "Another agent can rebuild the full situation from the item alone.",
593
+ prompt: "Add a comment for each verified step, a note for each rationale the item body does not carry, and a learning for each lesson that applies beyond this item. Prefer appending over rewriting.",
594
+ commands: [
595
+ 'pm comments <ID> "Evidence: <what changed and what passed>"',
596
+ 'pm notes <ID> --add "Decision log: <why this shape>"',
597
+ 'pm learnings <ID> --add "<durable lesson>"',
598
+ "pm learnings <ID> --limit 5",
599
+ ],
600
+ },
601
+ {
602
+ name: "Verify And Repair A History Stream",
603
+ goal: "Every mutation stays provable and the chain re-anchors after drift.",
604
+ prompt: "Verify the chain with a strict exit before trusting a stream, preview any repair, and record why the repair was needed in the audit message.",
605
+ commands: [
606
+ "pm history <ID> --verify --strict-exit",
607
+ "pm history-repair --all --dry-run",
608
+ 'pm history-repair --all --message "<why the chain drifted>"',
609
+ "pm validate --check-history-drift",
610
+ ],
611
+ },
612
+ {
613
+ name: "Redact, Compact, Or Attribute Without Losing Proof",
614
+ goal: "Sensitive text, stream length, and unknown authors are handled through audited rewrites.",
615
+ prompt: "Preview every history rewrite with --dry-run, read the receipt, then apply. Compaction renumbers ordinal versions, so record the checkpoint it created.",
616
+ commands: [
617
+ "pm history-redact <ID> --literal <secret> --dry-run",
618
+ "pm history-compact <ID> --dry-run",
619
+ "pm history-author-acknowledge --all-actionable --dry-run",
620
+ ],
621
+ },
622
+ ],
623
+ docs: [
624
+ {
625
+ path: "docs/COMMANDS.md",
626
+ purpose: "Annotation, bulk, and history-and-recovery command families.",
627
+ },
628
+ {
629
+ path: "docs/MUTATION_INTEGRITY.md",
630
+ purpose: "Provenance and content-safety policy every mutation shares.",
631
+ },
632
+ {
633
+ path: "docs/AGENT_GUIDE.md",
634
+ purpose: "Evidence expectations in the agent loop and self-repair remediation.",
635
+ },
636
+ ],
637
+ related: ["workflows", "assurance", "merge", "graph"],
638
+ },
639
+ {
640
+ id: "automation",
641
+ aliases: ["calendar", "reminders", "meetings", "events"],
642
+ title: "Reminders, Events, and Meetings",
643
+ summary: "Attach time to items so context and agenda views can surface deadlines, meetings, and reminders when they matter.",
644
+ intent: "Use this when an item needs a due signal, a scheduled event, or a meeting record that later context reads should surface.",
645
+ commands: [
646
+ "pm remind <title> --at <when> --parent <ID>",
647
+ "pm event <title> --start <when> --parent <ID>",
648
+ "pm meet <title> --start <when> --duration <span> --parent <ID>",
649
+ "pm context --limit 10",
650
+ ],
651
+ workflows: [
652
+ {
653
+ name: "Put A Deadline Where Context Will Find It",
654
+ goal: "Time-bound work surfaces in the agenda section of context reads.",
655
+ prompt: "Record the reminder or event under the item that owns the work, then confirm it appears in the agenda summary of a context read.",
656
+ commands: [
657
+ "pm remind <title> --at <when> --parent <ID>",
658
+ "pm context --limit 10",
659
+ ],
660
+ },
661
+ ],
662
+ docs: [
663
+ {
664
+ path: "docs/COMMANDS.md",
665
+ purpose: "Calendar and context command family.",
666
+ },
667
+ ],
668
+ related: ["workflows", "quickstart", "extensions"],
669
+ },
556
670
  ];
557
671
  const TOPIC_BY_TOKEN = new Map();
558
672
  for (const topic of GUIDE_TOPICS) {
@@ -591,4 +705,4 @@ export function resolveGuideTopic(rawTopic) {
591
705
  return TOPIC_BY_TOKEN.get(normalized) ?? null;
592
706
  }
593
707
  //# sourceMappingURL=guide-topics.js.map
594
- //# debugId=7c57f381-8318-5235-aa92-c96c6cedb021
708
+ //# debugId=feba1227-c2a2-5ca3-83e6-3fd2780e6cbb
@@ -0,0 +1,35 @@
1
+ import { type HistoryItemHashVersion } from "../../core/history/history.js";
2
+ import type { ItemTypeRegistry } from "../../core/item/type-registry.js";
3
+ import type { HistoryEntry, PmSettings } from "../../types/index.js";
4
+ import type { HistorySubject } from "../history-redact.js";
5
+ import type { HistoryRepairCommandOptions, HistoryRepairResult } from "../history-repair.js";
6
+ /** Evidence describing only the discarded suffix, without retaining its contents. */
7
+ export interface HistorySalvageReceipt {
8
+ /** One-based physical line where invalid trailing bytes begin. */
9
+ first_invalid_line: number;
10
+ /** UTF-8 bytes removed from the suffix. */
11
+ discarded_bytes: number;
12
+ /** SHA-256 of the removed bytes for local backup comparison. */
13
+ discarded_sha256: string;
14
+ /** Number of complete verified records retained. */
15
+ retained_entries: number;
16
+ }
17
+ /**
18
+ * Select a hash-verified prefix. Any parseable JSON after the first invalid
19
+ * line makes the corruption interior and therefore unsalvageable by truncation.
20
+ */
21
+ export declare function inspectHistoryTail(raw: string): {
22
+ entries: HistoryEntry[];
23
+ prefix: string;
24
+ receipt: HistorySalvageReceipt | null;
25
+ itemHashVersion: HistoryItemHashVersion;
26
+ };
27
+ /** Salvage one explicitly selected stream under its normal ownership and lock policy. */
28
+ export declare function salvageHistoryTail(params: {
29
+ pmRoot: string;
30
+ subject: HistorySubject;
31
+ settings: PmSettings;
32
+ typeRegistry: ItemTypeRegistry;
33
+ options: HistoryRepairCommandOptions;
34
+ author: string;
35
+ }): Promise<HistoryRepairResult>;