@unbrained/pm-cli 2026.8.17 → 2026.8.19

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 (204) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/AGENTS.md +4 -3
  3. package/CHANGELOG.md +51 -5
  4. package/README.md +3 -3
  5. package/dist/cli/error-guidance.js +8 -4
  6. package/dist/cli/help-content.js +32 -13
  7. package/dist/cli/help-json-payload.d.ts +15 -0
  8. package/dist/cli/help-json-payload.js +101 -23
  9. package/dist/cli/main.js +6 -2
  10. package/dist/cli/register-list-query.js +138 -54
  11. package/dist/cli/register-mutation.js +8 -8
  12. package/dist/cli/register-operations.js +6 -6
  13. package/dist/cli-bundle/bundle-manifest.json +149 -149
  14. package/dist/cli-bundle/chunks/chunk-4NRRH7AM.js +2 -0
  15. package/dist/cli-bundle/chunks/chunk-4THEB6PD.js +13 -0
  16. package/dist/cli-bundle/chunks/{chunk-HBJAS566.js → chunk-BHYMXLAE.js} +2 -2
  17. package/dist/cli-bundle/chunks/chunk-GWMXAQOD.js +197 -0
  18. package/dist/cli-bundle/chunks/chunk-HVFQTLYM.js +35 -0
  19. package/dist/cli-bundle/chunks/chunk-OI4XI562.js +5 -0
  20. package/dist/cli-bundle/chunks/{chunk-3UEGXBMR.js → chunk-OIOKV6NO.js} +58 -54
  21. package/dist/cli-bundle/chunks/chunk-QXSH7BLM.js +3 -0
  22. package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +3 -0
  23. package/dist/cli-bundle/chunks/{chunk-7IBRGCHX.js → chunk-TOXJM4WA.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-JOKATURE.js → chunk-YBMRWW4E.js} +44 -44
  25. package/dist/cli-bundle/chunks/register-list-query-Y56KINDU.js +11 -0
  26. package/dist/cli-bundle/chunks/register-mutation-AUWVCW4M.js +20 -0
  27. package/dist/cli-bundle/chunks/register-operations-PZQPHXW5.js +2 -0
  28. package/dist/cli-bundle/chunks/{register-setup-DOSFBGKE.js → register-setup-I4LUHGVW.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/chunk-34QBIYZI.js +155 -0
  30. package/dist/cli-bundle/focused-chunks/{chunk-MHPIL773.js → chunk-BJRYFVSH.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/chunk-DKPLYW3L.js +2 -0
  32. package/dist/cli-bundle/focused-chunks/{chunk-SALH6B6K.js → chunk-EF6ZS5GH.js} +44 -44
  33. package/dist/cli-bundle/focused-chunks/{chunk-XKAMP5OU.js → chunk-ESISGDAY.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-SYZENPIT.js → chunk-EXBCLIBU.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/chunk-JDOMQ7VQ.js +4 -0
  36. package/dist/cli-bundle/focused-chunks/chunk-L623ZPNK.js +2 -0
  37. package/dist/cli-bundle/focused-chunks/chunk-MCZXYZAF.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/chunk-ODHQEECS.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/{chunk-ZQPGZZWQ.js → chunk-PRHY2IMX.js} +3 -3
  40. package/dist/cli-bundle/focused-chunks/chunk-RZU5U6Q7.js +2 -0
  41. package/dist/cli-bundle/focused-chunks/{chunk-ATEY76SX.js → chunk-US7VEYZG.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/chunk-VXDSU5MC.js +26 -0
  43. package/dist/cli-bundle/focused-chunks/chunk-YBMGXBFV.js +16 -0
  44. package/dist/cli-bundle/focused-chunks/chunk-YLVBJ6GF.js +2 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-CYFK5UPB.js → chunk-ZBIQQYMI.js} +2 -2
  46. package/dist/cli-bundle/main.js +13 -13
  47. package/dist/cli-bundle/sdk-authoring.js +1 -1
  48. package/dist/cli-bundle/sdk-contracts.js +2 -1
  49. package/dist/cli-bundle/sdk-core.js +28 -28
  50. package/dist/cli-bundle/sdk-governance.js +1 -1
  51. package/dist/cli-bundle/sdk-graph.js +1 -1
  52. package/dist/cli-bundle/sdk-merge.js +32 -32
  53. package/dist/cli-bundle/sdk-query.js +1 -1
  54. package/dist/cli-bundle/sdk-runtime.js +1 -1
  55. package/dist/cli-bundle/sdk-testing.js +1 -1
  56. package/dist/cli-bundle/sdk.js +5 -4
  57. package/dist/core/config/nested-settings.js +8 -2
  58. package/dist/core/extensions/exporter-output-contract.d.ts +12 -0
  59. package/dist/core/extensions/exporter-output-contract.js +67 -0
  60. package/dist/core/extensions/extension-types.d.ts +36 -1
  61. package/dist/core/extensions/extension-types.js +2 -2
  62. package/dist/core/extensions/loader.js +35 -44
  63. package/dist/core/history/event-index.d.ts +5 -0
  64. package/dist/core/history/event-index.js +133 -27
  65. package/dist/core/sentry/helpers.js +3 -3
  66. package/dist/core/shared/constants.js +5 -2
  67. package/dist/core/shared/errors.d.ts +2 -0
  68. package/dist/core/shared/errors.js +2 -2
  69. package/dist/core/store/settings-validator.d.ts +4 -0
  70. package/dist/core/store/settings-validator.js +3 -2
  71. package/dist/core/store/settings.js +8 -2
  72. package/dist/mcp/tool-definitions.js +12 -7
  73. package/dist/sdk/agent/refusal-closure.d.ts +41 -0
  74. package/dist/sdk/agent/refusal-closure.js +92 -0
  75. package/dist/sdk/agent/refusal-reachability.d.ts +1 -1
  76. package/dist/sdk/agent/refusal-reachability.js +4 -4
  77. package/dist/sdk/agent-capability-contracts.d.ts +13 -0
  78. package/dist/sdk/agent-capability-contracts.js +104 -7
  79. package/dist/sdk/authoring.d.ts +1 -1
  80. package/dist/sdk/authoring.js +2 -2
  81. package/dist/sdk/cli-bootstrap.d.ts +2 -2
  82. package/dist/sdk/cli-bootstrap.js +4 -4
  83. package/dist/sdk/cli-contracts/command-aliases.d.ts +34 -2
  84. package/dist/sdk/cli-contracts/command-aliases.js +80 -13
  85. package/dist/sdk/cli-contracts/commander-mutation-options.js +30 -6
  86. package/dist/sdk/cli-contracts/commander-types.js +5 -4
  87. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
  88. package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
  89. package/dist/sdk/cli-contracts/flag-contracts.d.ts +5 -0
  90. package/dist/sdk/cli-contracts/flag-contracts.js +84 -13
  91. package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +55 -0
  92. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +240 -0
  93. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +151 -0
  94. package/dist/sdk/cli-contracts/grammar-contracts.js +958 -0
  95. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +33 -5
  96. package/dist/sdk/cli-contracts/runtime-contracts.js +100 -23
  97. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +28 -1
  98. package/dist/sdk/cli-contracts/tool-option-contracts.js +38 -3
  99. package/dist/sdk/cli-contracts/tool-parameter-tables.js +7 -2
  100. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
  101. package/dist/sdk/cli-contracts/tool-schema.js +20 -11
  102. package/dist/sdk/cli-contracts.d.ts +5 -4
  103. package/dist/sdk/cli-contracts.js +7 -6
  104. package/dist/sdk/completion.js +13 -15
  105. package/dist/sdk/compose.d.ts +3 -3
  106. package/dist/sdk/compose.js +2 -2
  107. package/dist/sdk/context-intent-contracts.d.ts +2 -2
  108. package/dist/sdk/context-intent-contracts.js +22 -7
  109. package/dist/sdk/contracts.d.ts +3 -0
  110. package/dist/sdk/contracts.js +5 -2
  111. package/dist/sdk/core.d.ts +1 -1
  112. package/dist/sdk/core.js +3 -3
  113. package/dist/sdk/environment/host-environment-errors.js +3 -3
  114. package/dist/sdk/flag-invocation-contracts.d.ts +37 -0
  115. package/dist/sdk/flag-invocation-contracts.js +218 -9
  116. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +186 -14
  117. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +194 -26
  118. package/dist/sdk/guide-topics.js +5 -5
  119. package/dist/sdk/index.d.ts +10 -7
  120. package/dist/sdk/index.js +10 -7
  121. package/dist/sdk/init-agent-guidance.js +3 -3
  122. package/dist/sdk/mutation-events.d.ts +18 -2
  123. package/dist/sdk/mutation-events.js +59 -16
  124. package/dist/sdk/output-projection.d.ts +2 -0
  125. package/dist/sdk/output-projection.js +11 -5
  126. package/dist/sdk/output.d.ts +44 -0
  127. package/dist/sdk/output.js +28 -2
  128. package/dist/sdk/query/complete-list.d.ts +94 -0
  129. package/dist/sdk/query/complete-list.js +173 -0
  130. package/dist/sdk/query/get.js +25 -6
  131. package/dist/sdk/query/list.js +19 -2
  132. package/dist/sdk/query/search-contracts.d.ts +1 -1
  133. package/dist/sdk/query/search-contracts.js +23 -9
  134. package/dist/sdk/query/search.js +3 -3
  135. package/dist/sdk/query.d.ts +1 -0
  136. package/dist/sdk/query.js +3 -2
  137. package/dist/sdk/read-output/continuation.d.ts +1 -1
  138. package/dist/sdk/read-output/continuation.js +7 -24
  139. package/dist/sdk/read-output-contracts.d.ts +2 -2
  140. package/dist/sdk/read-output-contracts.js +89 -13
  141. package/dist/sdk/read-output-rows.d.ts +4 -0
  142. package/dist/sdk/read-output-rows.js +47 -18
  143. package/dist/sdk/runtime-extended-actions.js +10 -2
  144. package/dist/sdk/runtime.d.ts +8 -2
  145. package/dist/sdk/runtime.js +18 -11
  146. package/dist/sdk/workspace-snapshot.d.ts +2 -0
  147. package/dist/sdk/workspace-snapshot.js +10 -2
  148. package/dist/types.d.ts +5 -0
  149. package/dist/types.js +2 -2
  150. package/docs/AGENT_GUIDE.md +25 -9
  151. package/docs/CLI_GRAMMAR.md +106 -0
  152. package/docs/COMMANDS.md +39 -27
  153. package/docs/ONBOARDING.md +4 -4
  154. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +11 -2
  155. package/docs/QUICKSTART.md +1 -1
  156. package/docs/README.md +2 -0
  157. package/docs/READ_OUTPUT_CONTRACTS.md +10 -6
  158. package/docs/RELEASING.md +30 -6
  159. package/docs/SDK.md +42 -2
  160. package/docs/SDK_ARTIFACT_OUTPUT.md +72 -0
  161. package/docs/SDK_CONTEXT_COORDINATION.md +46 -12
  162. package/docs/TESTING.md +14 -1
  163. package/docs/agent-task-token-baseline.json +5 -5
  164. package/docs/generated/AGENT_COMMAND_SURFACE.md +78 -78
  165. package/docs/generated/FLAG_LEXICON_BUDGETS.md +76 -0
  166. package/marketplace.json +2 -2
  167. package/package.json +5 -2
  168. package/packages/pm-beads/package.json +1 -1
  169. package/packages/pm-calendar/package.json +1 -1
  170. package/packages/pm-command-kit/package.json +1 -1
  171. package/packages/pm-digital-twin/package.json +1 -1
  172. package/packages/pm-governance-audit/package.json +1 -1
  173. package/packages/pm-guide-shell/package.json +1 -1
  174. package/packages/pm-kanban/package.json +1 -1
  175. package/packages/pm-lifecycle-hooks/package.json +1 -1
  176. package/packages/pm-linked-test-adapters/package.json +1 -1
  177. package/packages/pm-search-advanced/package.json +1 -1
  178. package/packages/pm-templates/package.json +1 -1
  179. package/packages/pm-todos/package.json +1 -1
  180. package/packages/pm-vcs/package.json +1 -1
  181. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  182. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  183. package/scripts/generate-agent-capability-surfaces.mjs +20 -14
  184. package/sdk/public-surface.json +1245 -60
  185. package/dist/cli-bundle/chunks/chunk-2QLOXC3V.js +0 -3
  186. package/dist/cli-bundle/chunks/chunk-4JPYF536.js +0 -35
  187. package/dist/cli-bundle/chunks/chunk-6VDLG2FC.js +0 -13
  188. package/dist/cli-bundle/chunks/chunk-ION3E43Q.js +0 -197
  189. package/dist/cli-bundle/chunks/chunk-OAC5NIV4.js +0 -3
  190. package/dist/cli-bundle/chunks/chunk-TPXZIBIV.js +0 -5
  191. package/dist/cli-bundle/chunks/chunk-YM2YAMF7.js +0 -2
  192. package/dist/cli-bundle/chunks/register-list-query-Q7KII4G5.js +0 -10
  193. package/dist/cli-bundle/chunks/register-mutation-4WBRPXLV.js +0 -20
  194. package/dist/cli-bundle/chunks/register-operations-SSENDH5B.js +0 -2
  195. package/dist/cli-bundle/focused-chunks/chunk-267MUUS6.js +0 -16
  196. package/dist/cli-bundle/focused-chunks/chunk-2NNFLLNG.js +0 -2
  197. package/dist/cli-bundle/focused-chunks/chunk-2QSAKMIH.js +0 -2
  198. package/dist/cli-bundle/focused-chunks/chunk-BUCG4ZI2.js +0 -2
  199. package/dist/cli-bundle/focused-chunks/chunk-EHXIKD6K.js +0 -2
  200. package/dist/cli-bundle/focused-chunks/chunk-KGEXTMPG.js +0 -2
  201. package/dist/cli-bundle/focused-chunks/chunk-KP2VQQVQ.js +0 -2
  202. package/dist/cli-bundle/focused-chunks/chunk-POEEAD2V.js +0 -4
  203. package/dist/cli-bundle/focused-chunks/chunk-XPIC53VA.js +0 -26
  204. package/dist/cli-bundle/focused-chunks/chunk-ZT2DJS27.js +0 -155
@@ -1,5 +1,5 @@
1
1
 
2
- !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]="0e2d29be-ff70-5e69-9bba-bef5ecd05fa1")}catch(e){}}();
2
+ !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]="0f857893-8441-54ad-af99-abaae9af864d")}catch(e){}}();
3
3
  const FLAG_DESCRIPTIONS = Object.freeze({
4
4
  "--body": "Set the item body.",
5
5
  "--body-file": "Read the item body from a file.",
@@ -38,23 +38,156 @@ const BOOLEAN_FLAG_PREFIXES = [
38
38
  "--check-",
39
39
  "--dry-run",
40
40
  "--explain",
41
- "--filter-",
41
+ "--fail-",
42
+ "--fix-",
42
43
  "--full",
43
44
  "--has-",
44
45
  "--include-",
45
46
  "--json",
46
47
  "--no-",
47
- "--only",
48
+ "--prune-",
48
49
  "--quiet",
50
+ "--refresh-",
49
51
  "--require-",
50
52
  "--runtime-only",
51
53
  "--schema-only",
54
+ "--skip-",
52
55
  "--stream",
53
56
  "--strict-",
54
57
  "--summary",
55
58
  "--today",
56
59
  "--verbose",
57
60
  ];
61
+ const BOOLEAN_FLAG_NAMES = new Set([
62
+ "--activate",
63
+ "--active-only",
64
+ "--adopt",
65
+ "--adopt-all",
66
+ "--all",
67
+ "--all-actionable",
68
+ "--all-affected-ids",
69
+ "--all-day",
70
+ "--all-streams",
71
+ "--append-stable",
72
+ "--auto-fix",
73
+ "--auto-pm-context",
74
+ "--availability-only",
75
+ "--background",
76
+ "--brief",
77
+ "--by-assignee",
78
+ "--by-priority",
79
+ "--by-tag",
80
+ "--catalog",
81
+ "--claim",
82
+ "--clear",
83
+ "--clear-comments",
84
+ "--clear-criteria",
85
+ "--clear-deps",
86
+ "--clear-docs",
87
+ "--clear-events",
88
+ "--clear-files",
89
+ "--clear-learnings",
90
+ "--clear-notes",
91
+ "--clear-reminders",
92
+ "--clear-tests",
93
+ "--clear-type-options",
94
+ "--cli-only",
95
+ "--closed",
96
+ "--compact",
97
+ "--completion",
98
+ "--count",
99
+ "--counts",
100
+ "--deactivate",
101
+ "--declarative",
102
+ "--defaults",
103
+ "--describe",
104
+ "--diff",
105
+ "--doctor",
106
+ "--empty-body",
107
+ "--explore",
108
+ "--field-utilization",
109
+ "--filter-empty-body",
110
+ "--flags-only",
111
+ "--follow",
112
+ "--force",
113
+ "--global",
114
+ "--highlight",
115
+ "--hybrid",
116
+ "--id-only",
117
+ "--if-available",
118
+ "--ignore-global",
119
+ "--include_unparented",
120
+ "--infer",
121
+ "--init",
122
+ "--install",
123
+ "--isolated",
124
+ "--lean",
125
+ "--list",
126
+ "--local",
127
+ "--manage",
128
+ "--markdown",
129
+ "--metadata-coverage",
130
+ "--next",
131
+ "--normalize-provenance",
132
+ "--only",
133
+ "--only-last",
134
+ "--output-row-contract",
135
+ "--override-linked-pm-context",
136
+ "--packages-only",
137
+ "--past",
138
+ "--phrase-exact",
139
+ "--profile",
140
+ "--progress",
141
+ "--project",
142
+ "--promote-to-item-dep",
143
+ "--provenance",
144
+ "--provenance-summary",
145
+ "--raw",
146
+ "--ready-only",
147
+ "--ready_only",
148
+ "--rebuild",
149
+ "--recent",
150
+ "--reload",
151
+ "--repair",
152
+ "--replace-deps",
153
+ "--replace-docs",
154
+ "--replace-files",
155
+ "--replace-tests",
156
+ "--required",
157
+ "--required-on-create",
158
+ "--run",
159
+ "--runtime-probe",
160
+ "--save-baseline",
161
+ "--scaffold",
162
+ "--semantic",
163
+ "--shared-host-safe",
164
+ "--storage",
165
+ "--title-exact",
166
+ "--token-accounting",
167
+ "--trace",
168
+ "--tree",
169
+ "--unbounded",
170
+ "--uninstall",
171
+ "--validate-paths",
172
+ "--verify",
173
+ "--watch",
174
+ "--with-packages",
175
+ ]);
176
+ const VALUE_FLAG_NAMES = new Set(["--only-index"]);
177
+ const VALUE_COMMAND_FLAGS = new Set([
178
+ "activity:--stream",
179
+ "eval:--fail-under",
180
+ "validate:--fix-scope",
181
+ ]);
182
+ const OPTIONAL_VALUE_COMMAND_FLAGS = new Set([
183
+ "activity:--stream",
184
+ "close:--validate-close",
185
+ "close-many:--validate-close",
186
+ "comments:--author",
187
+ "learnings:--author",
188
+ "notes:--author",
189
+ ]);
190
+ const OPTIONAL_VALUE_FLAGS = new Set(["--regression"]);
58
191
  function resolveFlagInputSources(command, flag) {
59
192
  if (flag === "--stdin" || flag === "--stdin-json")
60
193
  return ["stdin"];
@@ -65,8 +198,9 @@ function resolveFlagInputSources(command, flag) {
65
198
  }
66
199
  return ["argv"];
67
200
  }
68
- function flagTakesValue(contract) {
69
- const explicitlyValued = contract.value_name !== undefined ||
201
+ function flagTakesValue(command, contract) {
202
+ const explicitlyValued = VALUE_COMMAND_FLAGS.has(`${command}:${contract.flag}`) ||
203
+ contract.value_name !== undefined ||
70
204
  contract.value_type === "string" ||
71
205
  contract.value_type === "number" ||
72
206
  contract.list === true ||
@@ -74,12 +208,18 @@ function flagTakesValue(contract) {
74
208
  const inferredBoolean = contract.value_type === "boolean" ||
75
209
  contract.flag === "--stdin" ||
76
210
  contract.flag === "--stdin-json" ||
211
+ (contract.flag.startsWith("--filter-") &&
212
+ (contract.flag.endsWith("-missing") ||
213
+ contract.flag.startsWith("--filter-has-") ||
214
+ contract.flag.startsWith("--filter-no-"))) ||
77
215
  BOOLEAN_FLAG_PREFIXES.some((prefix) => contract.flag.startsWith(prefix));
78
- return explicitlyValued || !inferredBoolean;
216
+ return (explicitlyValued ||
217
+ VALUE_FLAG_NAMES.has(contract.flag) ||
218
+ (!BOOLEAN_FLAG_NAMES.has(contract.flag) && !inferredBoolean));
79
219
  }
80
220
  /** Enrich one vocabulary row with deterministic invocation and input-channel metadata. */
81
221
  export function enrichCliFlagInvocationContract(command, contract) {
82
- const takesValue = flagTakesValue(contract);
222
+ const takesValue = flagTakesValue(command, contract);
83
223
  const inputSources = resolveFlagInputSources(command, contract.flag);
84
224
  const description = contract.description ??
85
225
  FLAG_DESCRIPTIONS[contract.flag] ??
@@ -88,7 +228,9 @@ export function enrichCliFlagInvocationContract(command, contract) {
88
228
  ...contract,
89
229
  description,
90
230
  takes_value: takesValue,
91
- value_required: takesValue,
231
+ value_required: takesValue &&
232
+ !OPTIONAL_VALUE_FLAGS.has(contract.flag) &&
233
+ !OPTIONAL_VALUE_COMMAND_FLAGS.has(`${command}:${contract.flag}`),
92
234
  ...(takesValue ? { value_name: contract.value_name ?? "value" } : {}),
93
235
  value_type: takesValue ? (contract.value_type ?? "string") : "boolean",
94
236
  required: contract.required === true,
@@ -105,5 +247,72 @@ export function enrichCliFlagInvocationContract(command, contract) {
105
247
  export function enrichCliFlagInvocationContracts(command, contracts) {
106
248
  return contracts.map((contract) => enrichCliFlagInvocationContract(command, contract));
107
249
  }
250
+ /** Compare generated invocation rows with independently observed executable arity. */
251
+ export function verifyCliFlagInvocationParity(command, declarations, observations) {
252
+ const normalizedCommand = command.trim().toLowerCase();
253
+ const findings = [];
254
+ const observedByFlag = new Map();
255
+ let matchingObservationCount = 0;
256
+ for (const observation of observations) {
257
+ if (observation.command.trim().toLowerCase() !== normalizedCommand)
258
+ continue;
259
+ matchingObservationCount += 1;
260
+ if (observedByFlag.has(observation.flag)) {
261
+ findings.push({
262
+ code: "duplicate_observation",
263
+ command: normalizedCommand,
264
+ flag: observation.flag,
265
+ detail: `${normalizedCommand} ${observation.flag} was observed more than once.`,
266
+ });
267
+ continue;
268
+ }
269
+ observedByFlag.set(observation.flag, observation);
270
+ }
271
+ const declaredFlags = new Set(declarations.map(({ flag }) => flag));
272
+ for (const declaration of declarations) {
273
+ const observation = observedByFlag.get(declaration.flag);
274
+ if (!observation) {
275
+ findings.push({
276
+ code: "missing_observation",
277
+ command: normalizedCommand,
278
+ flag: declaration.flag,
279
+ detail: `${normalizedCommand} ${declaration.flag} has no executable option observation.`,
280
+ });
281
+ continue;
282
+ }
283
+ for (const [field, code] of [
284
+ ["takes_value", "takes_value_mismatch"],
285
+ ["value_required", "value_required_mismatch"],
286
+ ["repeatable", "repeatable_mismatch"],
287
+ ]) {
288
+ if (declaration[field] === observation[field])
289
+ continue;
290
+ findings.push({
291
+ code,
292
+ command: normalizedCommand,
293
+ flag: declaration.flag,
294
+ detail: `${normalizedCommand} ${declaration.flag} declares ${field}=${String(declaration[field])} but the executable option reports ${String(observation[field])}.`,
295
+ });
296
+ }
297
+ }
298
+ for (const observation of observedByFlag.values()) {
299
+ if (declaredFlags.has(observation.flag))
300
+ continue;
301
+ findings.push({
302
+ code: "undeclared_observation",
303
+ command: normalizedCommand,
304
+ flag: observation.flag,
305
+ detail: `${normalizedCommand} ${observation.flag} is executable but absent from invocation contracts.`,
306
+ });
307
+ }
308
+ findings.sort((left, right) => left.flag.localeCompare(right.flag) ||
309
+ left.code.localeCompare(right.code));
310
+ return {
311
+ ok: findings.length === 0,
312
+ declared_count: declarations.length,
313
+ observed_count: matchingObservationCount,
314
+ findings,
315
+ };
316
+ }
108
317
  //# sourceMappingURL=flag-invocation-contracts.js.map
109
- //# debugId=0e2d29be-ff70-5e69-9bba-bef5ecd05fa1
318
+ //# debugId=0f857893-8441-54ad-af99-abaae9af864d
@@ -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]="d188630b-bf34-53f4-a93e-78698013994e")}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]="ed64096a-fd80-52e9-926e-fb2d4d2030e7")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_1 = [
5
5
  {
6
6
  code: "acceptance_criteria_mutation_conflict",
@@ -38,6 +38,42 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
38
38
  canonical_code: "acceptance_criteria_semicolon_forbidden",
39
39
  aliases: [],
40
40
  },
41
+ {
42
+ code: "accepted_rejected_value",
43
+ meaning: "Accepted rejected value 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/agent/refusal-closure.ts"],
49
+ emitting_commands: ["*"],
50
+ canonical_code: "accepted_rejected_value",
51
+ aliases: [],
52
+ },
53
+ {
54
+ code: "alias_collision",
55
+ meaning: "Alias collision condition.",
56
+ stability: "provisional",
57
+ exit_code: 1,
58
+ class: "generic_failure",
59
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
60
+ sources: ["sdk/cli-contracts/flag-lexicon-contracts.ts"],
61
+ emitting_commands: ["*"],
62
+ canonical_code: "alias_collision",
63
+ aliases: [],
64
+ },
65
+ {
66
+ code: "alias_target_missing",
67
+ meaning: "Alias target missing condition.",
68
+ stability: "provisional",
69
+ exit_code: 1,
70
+ class: "generic_failure",
71
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
72
+ sources: ["sdk/cli-contracts/grammar-contracts.ts"],
73
+ emitting_commands: ["*"],
74
+ canonical_code: "alias_target_missing",
75
+ aliases: [],
76
+ },
41
77
  {
42
78
  code: "already_claimed_by",
43
79
  meaning: "Already claimed by condition.",
@@ -50,18 +86,6 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
50
86
  canonical_code: "already_claimed_by",
51
87
  aliases: [],
52
88
  },
53
- {
54
- code: "ambiguous_list_all",
55
- meaning: "Ambiguous list all condition.",
56
- stability: "stable",
57
- exit_code: 2,
58
- class: "usage",
59
- recovery: "Inspect the structured error guidance and retry the suggested command.",
60
- sources: ["cli/register-list-query.ts"],
61
- emitting_commands: ["*"],
62
- canonical_code: "ambiguous_list_all",
63
- aliases: [],
64
- },
65
89
  {
66
90
  code: "ambiguous_option_combination",
67
91
  meaning: "Ambiguous option combination condition.",
@@ -182,6 +206,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
182
206
  canonical_code: "body_file_unreadable",
183
207
  aliases: [],
184
208
  },
209
+ {
210
+ code: "budget_exceeded",
211
+ meaning: "Budget exceeded condition.",
212
+ stability: "provisional",
213
+ exit_code: 1,
214
+ class: "generic_failure",
215
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
216
+ sources: ["sdk/cli-contracts/flag-lexicon-contracts.ts"],
217
+ emitting_commands: ["*"],
218
+ canonical_code: "budget_exceeded",
219
+ aliases: [],
220
+ },
185
221
  {
186
222
  code: "bundle_integrity_torn_install",
187
223
  meaning: "Bundle integrity torn install condition.",
@@ -482,6 +518,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
482
518
  canonical_code: "dependency_temporal_order_invalid",
483
519
  aliases: [],
484
520
  },
521
+ {
522
+ code: "duplicate_canonical_flag",
523
+ meaning: "Duplicate canonical flag condition.",
524
+ stability: "provisional",
525
+ exit_code: 1,
526
+ class: "generic_failure",
527
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
528
+ sources: ["sdk/cli-contracts/flag-lexicon-contracts.ts"],
529
+ emitting_commands: ["*"],
530
+ canonical_code: "duplicate_canonical_flag",
531
+ aliases: [],
532
+ },
485
533
  {
486
534
  code: "duplicate_command",
487
535
  meaning: "Duplicate command condition.",
@@ -494,6 +542,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
494
542
  canonical_code: "duplicate_command",
495
543
  aliases: [],
496
544
  },
545
+ {
546
+ code: "duplicate_destination",
547
+ meaning: "Duplicate destination condition.",
548
+ stability: "provisional",
549
+ exit_code: 1,
550
+ class: "generic_failure",
551
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
552
+ sources: ["sdk/cli-contracts/grammar-contracts.ts"],
553
+ emitting_commands: ["*"],
554
+ canonical_code: "duplicate_destination",
555
+ aliases: [],
556
+ },
497
557
  {
498
558
  code: "duplicate_edge",
499
559
  meaning: "Duplicate edge condition.",
@@ -506,6 +566,30 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
506
566
  canonical_code: "duplicate_edge",
507
567
  aliases: [],
508
568
  },
569
+ {
570
+ code: "duplicate_observation",
571
+ meaning: "Duplicate observation condition.",
572
+ stability: "provisional",
573
+ exit_code: 1,
574
+ class: "generic_failure",
575
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
576
+ sources: ["sdk/flag-invocation-contracts.ts"],
577
+ emitting_commands: ["*"],
578
+ canonical_code: "duplicate_observation",
579
+ aliases: [],
580
+ },
581
+ {
582
+ code: "duplicate_probe",
583
+ meaning: "Duplicate probe condition.",
584
+ stability: "provisional",
585
+ exit_code: 1,
586
+ class: "generic_failure",
587
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
588
+ sources: ["sdk/agent/refusal-closure.ts"],
589
+ emitting_commands: ["*"],
590
+ canonical_code: "duplicate_probe",
591
+ aliases: [],
592
+ },
509
593
  {
510
594
  code: "duplicate_sweep_cost_limit",
511
595
  meaning: "Duplicate sweep cost limit condition.",
@@ -566,6 +650,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
566
650
  canonical_code: "duplicate_target_self",
567
651
  aliases: [],
568
652
  },
653
+ {
654
+ code: "empty_corpus",
655
+ meaning: "Empty corpus condition.",
656
+ stability: "provisional",
657
+ exit_code: 1,
658
+ class: "generic_failure",
659
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
660
+ sources: ["sdk/agent/refusal-closure.ts"],
661
+ emitting_commands: ["*"],
662
+ canonical_code: "empty_corpus",
663
+ aliases: [],
664
+ },
569
665
  {
570
666
  code: "empty_surface",
571
667
  meaning: "Empty surface condition.",
@@ -1082,6 +1178,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1082
1178
  canonical_code: "improvement_observation_conflict",
1083
1179
  aliases: [],
1084
1180
  },
1181
+ {
1182
+ code: "inconsistent_concept_kind",
1183
+ meaning: "Inconsistent concept kind condition.",
1184
+ stability: "provisional",
1185
+ exit_code: 1,
1186
+ class: "generic_failure",
1187
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1188
+ sources: ["sdk/cli-contracts/flag-lexicon-contracts.ts"],
1189
+ emitting_commands: ["*"],
1190
+ canonical_code: "inconsistent_concept_kind",
1191
+ aliases: [],
1192
+ },
1085
1193
  {
1086
1194
  code: "init_existing_settings_requires_force",
1087
1195
  meaning: "Init existing settings requires force condition.",
@@ -1268,6 +1376,22 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1268
1376
  canonical_code: "invalid_event_cursor",
1269
1377
  aliases: [],
1270
1378
  },
1379
+ {
1380
+ code: "invalid_event_cursor_mode",
1381
+ meaning: "Invalid event cursor mode condition.",
1382
+ stability: "provisional",
1383
+ exit_code: 2,
1384
+ class: "usage",
1385
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1386
+ sources: [
1387
+ "cli/register-list-query.ts",
1388
+ "sdk/mutation-events.ts",
1389
+ "sdk/runtime-extended-actions.ts",
1390
+ ],
1391
+ emitting_commands: ["*"],
1392
+ canonical_code: "invalid_event_cursor_mode",
1393
+ aliases: [],
1394
+ },
1271
1395
  {
1272
1396
  code: "invalid_event_follow_interval",
1273
1397
  meaning: "Invalid event follow interval condition.",
@@ -1664,6 +1788,54 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1664
1788
  canonical_code: "merge_conflict_markers_detected",
1665
1789
  aliases: ["history_merge_conflict_markers_detected"],
1666
1790
  },
1791
+ {
1792
+ code: "merge_decisions_unreviewed",
1793
+ meaning: "Merge decisions unreviewed condition.",
1794
+ stability: "provisional",
1795
+ exit_code: 1,
1796
+ class: "generic_failure",
1797
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1798
+ sources: ["core/diagnostics/remediation.ts"],
1799
+ emitting_commands: ["*"],
1800
+ canonical_code: "merge_decisions_unreviewed",
1801
+ aliases: [],
1802
+ },
1803
+ {
1804
+ code: "merge_git_config_unwritable",
1805
+ meaning: "Merge git config unwritable condition.",
1806
+ stability: "stable",
1807
+ exit_code: 5,
1808
+ class: "dependency_failed",
1809
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1810
+ sources: ["sdk/merge/install.ts"],
1811
+ emitting_commands: ["*"],
1812
+ canonical_code: "merge_git_config_unwritable",
1813
+ aliases: [],
1814
+ },
1815
+ {
1816
+ code: "merge_reconcile_discards_require_acceptance",
1817
+ meaning: "Merge reconcile discards require acceptance condition.",
1818
+ stability: "provisional",
1819
+ exit_code: 4,
1820
+ class: "conflict",
1821
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1822
+ sources: ["sdk/merge/reconcile.ts"],
1823
+ emitting_commands: ["*"],
1824
+ canonical_code: "merge_reconcile_discards_require_acceptance",
1825
+ aliases: [],
1826
+ },
1827
+ {
1828
+ code: "merge_root_not_found",
1829
+ meaning: "Merge root not found condition.",
1830
+ stability: "stable",
1831
+ exit_code: 3,
1832
+ class: "not_found",
1833
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1834
+ sources: ["sdk/merge/install.ts"],
1835
+ emitting_commands: ["*"],
1836
+ canonical_code: "merge_root_not_found",
1837
+ aliases: [],
1838
+ },
1667
1839
  ];
1668
1840
  //# sourceMappingURL=generated-error-code-catalog-part-1.js.map
1669
- //# debugId=d188630b-bf34-53f4-a93e-78698013994e
1841
+ //# debugId=ed64096a-fd80-52e9-926e-fb2d4d2030e7