@unbrained/pm-cli 2026.11.20 → 2026.11.21

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 (168) hide show
  1. package/.agents/skills/pm-sdk/SKILL.md +1 -1
  2. package/.agents/skills/pm-test-audit/SKILL.md +1 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/CONTRIBUTING.md +2 -1
  5. package/dist/cli/error-guidance.js +2 -2
  6. package/dist/cli/register-list-query.js +2 -2
  7. package/dist/cli/runtime/refusal-credential-redaction.js +1 -1
  8. package/dist/cli-bundle/bundle-manifest.json +1 -1
  9. package/dist/cli-bundle/chunks/chunk-2DXRTIC6.js +21 -0
  10. package/dist/cli-bundle/chunks/{chunk-XK25TAJZ.js → chunk-5647LU3A.js} +4 -4
  11. package/dist/cli-bundle/chunks/{chunk-OXG5XPC7.js → chunk-6QLEXRUG.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-MGYAJONE.js → chunk-AHQB7W2H.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-3BOR22MC.js → chunk-BKSVHOWI.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-KQSPKWFH.js → chunk-CASX6SFI.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-ZVEHACE6.js → chunk-CIKGG34F.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-KDDIHGAO.js → chunk-D6ILFXZY.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-M5D3CEMY.js → chunk-IUIOTAF6.js} +4 -4
  18. package/dist/cli-bundle/chunks/{chunk-GXGW6KHB.js → chunk-JVGRFU5H.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-KQIZ34SF.js +3 -0
  20. package/dist/cli-bundle/chunks/{chunk-2IZGNOGT.js → chunk-KVBIMFUG.js} +2 -2
  21. package/dist/cli-bundle/chunks/chunk-LQBWLNZJ.js +3 -0
  22. package/dist/cli-bundle/chunks/{chunk-5LF5QZT3.js → chunk-NCFCBKIP.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-HJQ3XPS3.js → chunk-NT5AKFE5.js} +30 -30
  24. package/dist/cli-bundle/chunks/chunk-PJXKA4QU.js +125 -0
  25. package/dist/cli-bundle/chunks/{chunk-KEBLUTC3.js → chunk-RMIRNYRG.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-6HRPGEBF.js → chunk-RULHZRFN.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-FF4TXJDH.js → chunk-S6HB3WL2.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-4QQPM3IY.js → chunk-SA4BNP3Q.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-DG2EOOFX.js → chunk-SRVTCYAU.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-4TZW4NLM.js → chunk-WELSVDPU.js} +2 -2
  31. package/dist/cli-bundle/chunks/{chunk-6X2AGUOT.js → chunk-XHJ3H5PL.js} +2 -2
  32. package/dist/cli-bundle/chunks/{chunk-ZAO7VGX3.js → chunk-XWHJIRNV.js} +2 -2
  33. package/dist/cli-bundle/chunks/chunk-YJEBK7HU.js +8 -0
  34. package/dist/cli-bundle/chunks/{chunk-FOYRE23V.js → chunk-YKJKQ7DM.js} +43 -43
  35. package/dist/cli-bundle/chunks/{chunk-Y4LXVPA5.js → chunk-YMUSRWV4.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-HQYIKAC6.js → chunk-YR2KEBHP.js} +2 -2
  37. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-ELEMA7IW.js → indexed-receipt-blobs-ITTXIN4K.js} +2 -2
  38. package/dist/cli-bundle/chunks/{item-revision-GE2CQECR.js → item-revision-R5SZPJZ5.js} +2 -2
  39. package/dist/cli-bundle/chunks/item-transaction-7DFCG73I.js +2 -0
  40. package/dist/cli-bundle/chunks/{mutation-actor-5GYX7LP3.js → mutation-actor-3TG636XG.js} +2 -2
  41. package/dist/cli-bundle/chunks/{mutation-admission-72TYKPGU.js → mutation-admission-LICSDNNO.js} +2 -2
  42. package/dist/cli-bundle/chunks/{register-list-query-OQZZEWEB.js → register-list-query-SPGPS3OS.js} +10 -10
  43. package/dist/cli-bundle/chunks/{register-mutation-YZEUZ6XT.js → register-mutation-WWVECKFQ.js} +2 -2
  44. package/dist/cli-bundle/chunks/{register-operations-JNVCF7EW.js → register-operations-L6HFJNWD.js} +2 -2
  45. package/dist/cli-bundle/chunks/{register-setup-LDKULZSD.js → register-setup-K7UFG5TD.js} +2 -2
  46. package/dist/cli-bundle/chunks/{settlement-hook-E5LHZ4RD.js → settlement-hook-BXN5LEQD.js} +2 -2
  47. package/dist/cli-bundle/chunks/{stage-Q2QZ2IBG.js → stage-57KH3KAC.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-IXYBN6D2.js → chunk-3IRCYJI5.js} +3 -3
  49. package/dist/cli-bundle/focused-chunks/{chunk-DH4DHL6V.js → chunk-3V53UBHN.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/{chunk-7SB6VKEI.js → chunk-532WZV65.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-KQJNJZKP.js → chunk-7A4QWNZX.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/chunk-CR7CGEB2.js +3 -0
  53. package/dist/cli-bundle/focused-chunks/chunk-CU2BRAOX.js +2 -0
  54. package/dist/cli-bundle/focused-chunks/{chunk-MJP3TFVW.js → chunk-CWWKRI5P.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-FPKVHC3Q.js → chunk-HGFNL5XI.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/chunk-IQK5NPMG.js +13 -0
  57. package/dist/cli-bundle/focused-chunks/{chunk-UATP3RK3.js → chunk-J63D6QST.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-ZKGGGU2K.js → chunk-JMQJBZQ5.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-O25KFLLA.js → chunk-LNHUE4VV.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-BZCLW5V7.js → chunk-MKM5NKD7.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-5VSXKA35.js → chunk-NP72ZDXE.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-PZSTRYTA.js → chunk-OSLQD5VH.js} +37 -37
  63. package/dist/cli-bundle/focused-chunks/{chunk-V55XZFOP.js → chunk-QGKLRXP7.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/{chunk-TNKI6WKG.js → chunk-QSJW6NSQ.js} +53 -53
  65. package/dist/cli-bundle/focused-chunks/{chunk-PKMDWIP3.js → chunk-RPE6IX26.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/chunk-SRDQSA6M.js +91 -0
  67. package/dist/cli-bundle/focused-chunks/{chunk-PQXTZLK3.js → chunk-UOC6257J.js} +2 -2
  68. package/dist/cli-bundle/focused-chunks/{chunk-SJE3PYPI.js → chunk-URJ2E6AS.js} +2 -2
  69. package/dist/cli-bundle/focused-chunks/chunk-WXMI4AV5.js +8 -0
  70. package/dist/cli-bundle/focused-chunks/{chunk-PRFEOCNZ.js → chunk-XCJSHNXK.js} +2 -2
  71. package/dist/cli-bundle/focused-chunks/{chunk-QNJQPJWO.js → chunk-XQQSSKJI.js} +5 -5
  72. package/dist/cli-bundle/focused-chunks/{chunk-JUYJ7NXL.js → chunk-YOAYY3HE.js} +2 -2
  73. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-ZTRFCPH7.js → indexed-receipt-blobs-AF4U3F3D.js} +2 -2
  74. package/dist/cli-bundle/focused-chunks/{item-revision-OXDZHMJ7.js → item-revision-3V3UIP5X.js} +2 -2
  75. package/dist/cli-bundle/focused-chunks/{item-transaction-54VSTT6L.js → item-transaction-HLBW7B3J.js} +2 -2
  76. package/dist/cli-bundle/focused-chunks/{mutation-actor-6DYIF6NH.js → mutation-actor-62HKR5IO.js} +2 -2
  77. package/dist/cli-bundle/focused-chunks/{mutation-admission-2BYXANVJ.js → mutation-admission-X4PF2SG3.js} +2 -2
  78. package/dist/cli-bundle/focused-chunks/{settlement-hook-OUBUN45C.js → settlement-hook-ARYCZQY4.js} +2 -2
  79. package/dist/cli-bundle/focused-chunks/{stage-FGHSB3QX.js → stage-O7T7CXBB.js} +2 -2
  80. package/dist/cli-bundle/main.js +25 -25
  81. package/dist/cli-bundle/sdk-authoring.js +1 -1
  82. package/dist/cli-bundle/sdk-contracts.js +1 -1
  83. package/dist/cli-bundle/sdk-core.js +1 -1
  84. package/dist/cli-bundle/sdk-governance.js +1 -1
  85. package/dist/cli-bundle/sdk-graph.js +1 -1
  86. package/dist/cli-bundle/sdk-merge.js +58 -57
  87. package/dist/cli-bundle/sdk-query.js +1 -1
  88. package/dist/cli-bundle/sdk-runtime.js +1 -1
  89. package/dist/cli-bundle/sdk-testing.js +1 -1
  90. package/dist/cli-bundle/sdk.js +11 -11
  91. package/dist/core/extensions/index.d.ts +2 -0
  92. package/dist/core/extensions/index.js +1 -1
  93. package/dist/core/fs/fs-utils.d.ts +3 -1
  94. package/dist/core/fs/fs-utils.js +1 -1
  95. package/dist/core/history/history-stream-policy.js +1 -1
  96. package/dist/core/history/read.d.ts +11 -1
  97. package/dist/core/history/read.js +1 -1
  98. package/dist/core/history/stream-summary.d.ts +129 -0
  99. package/dist/core/history/stream-summary.js +3 -0
  100. package/dist/core/shared/errors.d.ts +8 -0
  101. package/dist/core/shared/errors.js +1 -1
  102. package/dist/core/shared/url-credentials.js +1 -1
  103. package/dist/sdk/cli-contracts/registration-helpers.js +2 -2
  104. package/dist/sdk/governance/gc.js +1 -1
  105. package/dist/sdk/governance/health-merge-evidence.js +1 -1
  106. package/dist/sdk/governance/validate.js +1 -1
  107. package/dist/sdk/governance/workspace-position.js +1 -1
  108. package/dist/sdk/history-provenance.js +1 -1
  109. package/dist/sdk/index.d.ts +1 -1
  110. package/dist/sdk/index.js +1 -1
  111. package/dist/sdk/merge/index.d.ts +1 -1
  112. package/dist/sdk/merge/index.js +1 -1
  113. package/dist/sdk/merge/install.d.ts +20 -6
  114. package/dist/sdk/merge/install.js +3 -3
  115. package/dist/sdk/merge/worktree-config.js +2 -1
  116. package/dist/sdk/public-surface.json +1 -1
  117. package/dist/sdk/query/activity.d.ts +67 -5
  118. package/dist/sdk/query/activity.js +1 -1
  119. package/dist/sdk/query/context.d.ts +13 -3
  120. package/dist/sdk/query/context.js +2 -2
  121. package/dist/sdk/query.d.ts +1 -1
  122. package/dist/sdk/query.js +1 -1
  123. package/docs/COMMANDS.md +56 -2
  124. package/docs/MERGE_SAFETY.md +8 -0
  125. package/docs/MUTATION_INTEGRITY.md +3 -1
  126. package/docs/PERFORMANCE.md +17 -2
  127. package/docs/README.md +6 -4
  128. package/docs/SDK.md +25 -1
  129. package/docs/TESTING.md +8 -697
  130. package/docs/WORKSPACE_POSITION_AND_LIFECYCLE.md +1 -1
  131. package/marketplace.json +1 -1
  132. package/package.json +6 -2
  133. package/packages/pm-beads/package.json +1 -1
  134. package/packages/pm-calendar/package.json +1 -1
  135. package/packages/pm-command-kit/package.json +1 -1
  136. package/packages/pm-digital-twin/package.json +1 -1
  137. package/packages/pm-governance-audit/package.json +1 -1
  138. package/packages/pm-guide-shell/package.json +1 -1
  139. package/packages/pm-kanban/package.json +1 -1
  140. package/packages/pm-lifecycle-hooks/package.json +1 -1
  141. package/packages/pm-linked-test-adapters/package.json +1 -1
  142. package/packages/pm-search-advanced/package.json +1 -1
  143. package/packages/pm-templates/package.json +1 -1
  144. package/packages/pm-todos/package.json +1 -1
  145. package/packages/pm-vcs/package.json +1 -1
  146. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  147. package/plugins/pm-claude/package.json +1 -1
  148. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  149. package/plugins/pm-codex/package.json +1 -1
  150. package/plugins/pm-codex/plugin.json +1 -1
  151. package/runtime-dependencies.json +1 -1
  152. package/dist/cli-bundle/chunks/chunk-5OFMWP3Q.js +0 -3
  153. package/dist/cli-bundle/chunks/chunk-7ESF676D.js +0 -125
  154. package/dist/cli-bundle/chunks/chunk-7EZZ4W7O.js +0 -20
  155. package/dist/cli-bundle/chunks/chunk-VS565KBX.js +0 -2
  156. package/dist/cli-bundle/chunks/chunk-W4TLA5H3.js +0 -8
  157. package/dist/cli-bundle/chunks/item-transaction-YSAWJRA2.js +0 -2
  158. package/dist/cli-bundle/focused-chunks/chunk-3LRSQXCN.js +0 -2
  159. package/dist/cli-bundle/focused-chunks/chunk-FOA7XKWP.js +0 -2
  160. package/dist/cli-bundle/focused-chunks/chunk-I7XBR2RM.js +0 -91
  161. package/dist/cli-bundle/focused-chunks/chunk-SIPDQBJI.js +0 -8
  162. package/dist/cli-bundle/focused-chunks/chunk-TRCXANRR.js +0 -12
  163. package/docs/MCP_2026_07_28_CONFORMANCE.md +0 -41
  164. package/docs/QUALITY_EVIDENCE.md +0 -130
  165. package/docs/generated/FLAG_LEXICON_BUDGETS.md +0 -117
  166. package/docs/performance/cli-transport-overhead.md +0 -51
  167. package/docs/performance/runner-qualification.md +0 -36
  168. package/docs/performance/sdk-entrypoint-import-costs.md +0 -32
package/docs/TESTING.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Testing
2
2
 
3
- This page describes safe local tests, linked tests, coverage, and release-readiness checks.
3
+ This page describes sandbox-safe linked tests: how `pm test` runs, isolates and
4
+ trusts the commands an item links. The checks this repository runs on itself
5
+ (standard local checks, CI layout and retries, coverage governance, quality
6
+ gates and release readiness) live in
7
+ [Repository Testing](https://github.com/unbraind/pm-cli/blob/main/docs/REPOSITORY_TESTING.md)
8
+ (repository-only, excluded from the npm package).
4
9
 
5
10
  Current linked-test and merge-fence work: [pm-t05d8d](../.agents/pm/issues/pm-t05d8d.toon), [pm-kynkl8](../.agents/pm/issues/pm-kynkl8.toon).
6
11
 
@@ -48,610 +53,6 @@ Tracked documentation work: [pm-u9d0](../.agents/pm/epics/pm-u9d0.toon).
48
53
 
49
54
  Local/hosted gate parity is tracked by [pm-ei6x66](../.agents/pm/tasks/pm-ei6x66.toon).
50
55
 
51
- ## Standard Local Checks
52
-
53
- ```bash
54
- pnpm build
55
- pnpm lint
56
- pnpm typecheck
57
- node scripts/run-tests.mjs test
58
- node scripts/run-tests.mjs coverage
59
- ```
60
-
61
- Coverage mode records assertion results in a fresh, private runner workspace.
62
- Its verdict distinguishes those results from Vitest's process exit and the
63
- independent exact-count coverage gate. Vitest can exit nonzero for coverage or
64
- reporter failures even when assertions passed. Missing or malformed receipts
65
- never establish a passing assertion result. Exit codes retain their existing
66
- meaning: `1` for a Vitest refusal, `2` for an exact-gate refusal, and `3` when
67
- both processes refuse admission. No coverage threshold or source denominator
68
- is reduced. This behavior is tracked by
69
- [pm-qmb6h8](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-qmb6h8.toon)
70
- (repository-only tracker record, excluded from npm).
71
-
72
- The Linux killed-owner integration suite always exercises Node. Its additional
73
- Bun case runs locally when `bun --version` succeeds; CI requires Bun and retains
74
- the case even when the executable is missing, so a broken CI setup fails visibly.
75
- Install Bun before claiming local Node-and-Bun recovery coverage. This fixture
76
- policy is tracked by
77
- [pm-gh1609](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1609.toon)
78
- (repository tracker record excluded from npm).
79
-
80
- For the exact ordered local preflight used to make release-readiness claims,
81
- run the registry-owned entrypoint:
82
-
83
- ```bash
84
- pnpm verify:preflight
85
- ```
86
-
87
- `scripts/release/gate-registry.json` is the executable plan for this command:
88
- each ordered step declares its command, arguments, environment, capture mode,
89
- and whether an explicit skip flag is permitted. Receipts distinguish passed
90
- steps from declared skips, and `quality:gate-registry` maps hosted workflow
91
- claims to the same canonical gate IDs. Hosted-only environment isolation and
92
- tracker-integrity steps remain explicit entries with reasons rather than
93
- silently disappearing from local parity.
94
-
95
- The full-source command-example scan runs after parallel contract files in the
96
- existing serial cohort. It keeps the same source corpus, assertions and
97
- 30-second deadline, so concurrent contract workers do not consume its
98
- policy-check budget. This allocation is tracked by
99
- [pm-a3c6g4](../.agents/pm/tasks/pm-a3c6g4.toon); broader runner qualification
100
- remains with [pm-bj7rq0](../.agents/pm/issues/pm-bj7rq0.toon).
101
-
102
- The same cohort runs the complete cold transport-floor and executable refusal
103
- gate fixture files after parallel contracts
104
- ([pm-serial-cold-gates](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-serial-cold-gates.toon),
105
- a repository-only tracker record excluded from npm). Their original 30-second
106
- and 360-second test deadlines, assertions, negative controls, retries, and product
107
- benchmark thresholds are unchanged. Isolated passes qualify this allocation;
108
- they do not establish passing product latency or replace complete-suite proof.
109
-
110
- The same serial cohort runs the ten-thousand-item aggregation, cold governance
111
- read, and surface-replication fixture files after parallel contracts
112
- ([pm-ckb8w5](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-ckb8w5.toon),
113
- a repository-only tracker record excluded from npm). Their original input
114
- populations, assertions, per-test deadlines and retry policy remain in force.
115
-
116
- The context decision keeper also runs in that phase, preserving its 200-item
117
- corpus and 30-second completion-regression deadline. Allocation is tracked by
118
- [pm-j2vwbh](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-j2vwbh.toon)
119
- (a repository-only tracker record excluded from npm).
120
-
121
- `node scripts/run-tests.mjs` wraps Vitest in temporary tracker roots, disables
122
- external Sentry delivery for the build, test workers, and their nested CLI
123
- children, then cleans the roots up. Instrumentation tests can still exercise
124
- Sentry initialization through their mocked module boundary; ordinary negative
125
- fixtures must never create production incidents from a developer host.
126
-
127
- Temporary directories must live outside the checkout and outside any ancestor
128
- workspace with initialized tracker data. The runner rejects a checkout-local
129
- temporary root and every initialized standard or root-layout ancestor tracker,
130
- including physical symlink aliases, before allocating fixtures or starting build
131
- or test processes ([pm-bukwmy](../.agents/pm/issues/pm-bukwmy.toon),
132
- [pm-runner-ancestor-tracker](../.agents/pm/issues/pm-runner-ancestor-tracker.toon)).
133
- Unrelated valid settings files remain admissible; unreadable or invalid ancestor
134
- settings refuse ancestry certification. If the default
135
- temporary filesystem is full, set `TMPDIR` (or `TEMP`/`TMP` on Windows) to an
136
- existing isolated scratch directory; an ignored directory inside the repository
137
- is not isolated. Filesystem fixtures must honor `node:os`'s `tmpdir()` and remove
138
- only the temporary directories they created.
139
-
140
- Public SDK changes additionally run semantic surface and import-cost contracts:
141
-
142
- ```bash
143
- pnpm sdk:surface:check
144
- pnpm benchmark:sdk-entrypoints:check
145
- pnpm benchmark:transport:check
146
- ```
147
-
148
- The surface gate detects exported signature, type-parameter, declaration-kind,
149
- and stable error-code drift across the aggregate and every narrow SDK
150
- entrypoint. The performance gates protect entrypoint import cost and one-item
151
- CLI cold-start overhead without touching the repository tracker.
152
-
153
- `pnpm lint` and `pnpm quality:static` are the same canonical local static gate.
154
- The gate layers ESLint rules for
155
- shipped source, package, plugin, and script surfaces that match the CodeFactor
156
- maintainability findings this repo tracks (`complexity`,
157
- `no-unsafe-optional-chaining`, and the relevant `eslint-plugin-unicorn`
158
- mechanical rules), jscpd duplicate detection across source and tests, and the
159
- repo-specific `quality:static` gate. The dedicated `quality:static` gate remains
160
- authoritative for source/exported docstring coverage, orphan-module checks,
161
- directory-load caps, and the TypeScript-aware duplicate/complexity checks that
162
- are tailored to pm's source layout; `pnpm lint` delegates to it instead of
163
- running a second threshold profile. It also includes a changed-file
164
- CodeFactor-parity complexity scan for shipped source, package, and script files
165
- so PR-local CodeFactor maintainability annotations fail locally before commit or
166
- push. Existing legacy high-complexity test fixtures are tracked separately and
167
- must not be used as precedent for new changed production/script code.
168
-
169
- Module-usage checks share the SDK boundary's literal-specifier parser and walk
170
- nested AST nodes, including lazy `import("./module.js")` references. Unused
171
- modules, comment-only references, and computed paths do not gain incoming
172
- references. The regression is tracked by
173
- [pm-f38ovr](../.agents/pm/issues/pm-f38ovr.toon); no module allowance or threshold
174
- increase is required to keep optional SDK capabilities lazy.
175
-
176
- The same required static gate validates an explicit seven-day Dependabot
177
- cooldown for every updater and requires both npm and GitHub Actions entries.
178
- Missing values, semver overrides outside 7–90 days, invalid YAML, removed
179
- updaters, and include/exclude bypasses fail the gate. The maximum follows
180
- [GitHub's cooldown limits](https://docs.github.com/en/code-security/tutorials/secure-your-dependencies/optimizing-pr-creation-version-updates).
181
- Security updates retain GitHub's separate security-update behavior.
182
- The negative controls are tracked by [pm-gkut](../.agents/pm/issues/pm-gkut.toon)
183
- and [pm-dmo5](../.agents/pm/issues/pm-dmo5.toon).
184
-
185
- Release synchronization and commit staging share one distribution manifest
186
- inventory. The [pm-t4prek regression](../tests/unit/scripts/release/version-manifests.spec.ts)
187
- bumps versions in a temporary Git repository and reads the resulting commit to
188
- verify workspace versions and exact plugin runtime pins. The pipeline checks
189
- version consistency immediately before staging, including required string
190
- versions and runtime pins in both plugin package manifests; tests of a prepared working
191
- tree alone cannot establish that the release commit contains those changes.
192
-
193
- `lint:duplicates` runs three zero-clone profiles: the broad repository profile,
194
- the production cross-format profile, and a supplemental long-table profile at
195
- 28 lines / 80 tokens. The last profile detects the historical GH-508 normalizer
196
- tables below the other profiles' token floors; it does not replace their shorter
197
- line thresholds. Its real detector regression rejects the historical table rows
198
- and accepts a shared declaration. The earlier 12-line / 60-token exploratory
199
- census informed calibration, but is not the enforced profile. These bounded
200
- profiles do not claim complete equivalence with hosted analyzers.
201
- See [pm-xspd](../.agents/pm/chores/pm-xspd.toon) for calibration evidence.
202
-
203
- The local parity rules catch analyzer classes before push. The mandatory hosted
204
- proof runs after the final commit is pushed and both apps have finished:
205
-
206
- ```bash
207
- pnpm quality:hosted-analysis
208
- ```
209
-
210
- This command reads commit-scoped GitHub results for `git rev-parse HEAD`. It
211
- passes only when DeepScan explicitly reports `0 new` issues and CodeFactor
212
- completes successfully with `No issues found.` The exact commit is authoritative.
213
- For GitHub merge and squash commits whose apps report only on the reviewed PR
214
- head, the gate accepts that evidence only after proving the source and target
215
- have the same immutable Git tree. Squash commits also require one unambiguous
216
- GitHub PR association to a closed PR merged into `main`. Missing, pending,
217
- failed, skipped, stale, ambiguous, and different-tree results all fail.
218
- `pnpm release:gates` includes the same non-skippable verification, so run it
219
- only after the pushed reviewed head's hosted analyzers are terminal.
220
-
221
- ## Published Workspace Compatibility
222
-
223
- Tracked by [pm-pae3wo](../.agents/pm/tasks/pm-pae3wo.toon) and [pm-gh1458](../.agents/pm/issues/pm-gh1458.toon).
224
- Run `node scripts/release/workspace-compatibility.mjs --json` after building.
225
- The policy in `scripts/release/workspace-compatibility-policy.json` requires
226
- the two immediately preceding stable calendar releases. Each installed release
227
- writes a disposable workspace read by the current runtime, and the current
228
- runtime writes one read by that release. Exact scalar and container values must
229
- survive CLI and public SDK reads, ordinary writes with their registration
230
- disabled, history restoration, native Git merges, reconciliation, and history
231
- verification. Missing releases, metadata loss, or invalid merged histories fail
232
- the gate. CI, nightly quality, release publication, and local preflight require
233
- this matrix alongside the independent legacy Markdown migration check.
234
-
235
- Metadata probes and installs explicitly use the public npm registry with
236
- separate empty user/global configurations and a fresh temporary cache. Inherited
237
- npm settings and registry-auth environment variables are removed, so host
238
- configuration cannot change the artifacts selected by the declared window.
239
-
240
- The current item-operation boundary refuses a stored `pm_format_version`
241
- ahead of its supported version with `item_format_version_unsupported` and
242
- upgrade guidance. Reads, updates, deletion, and restoration preserve the
243
- original item/history on refusal, including documents whose metadata/body
244
- shapes are invalid for the current runtime. Admission precedes schema validation
245
- so restore cannot misclassify newer data as ordinary corruption. Static fixture
246
- modules read separate JSON data; published SDK probes use the public package
247
- entrypoint from their own consumer directory. Raw parsers still preserve future version
248
- markers for integrity inspection; inventory diagnostics are not permission to
249
- rewrite an unsupported item.
250
-
251
- Format 1 remains readable and is still used for ordinary records. Persisting
252
- linked-test editor stamps requires format 2, and a linked-test setup entry
253
- (`phase: setup`) requires format 3, on create as well as on edit. The same mutation records that
254
- marker in history; ordinary subsequent writes, restoration and current-runtime
255
- merges retain it. Restoring an older state does not lower the reader requirement
256
- while newer history remains. Existing format-1 editor records written by
257
- 2026.10.12–13 keep their original hashes during inspection and acquire the
258
- format-2 guard on the next real write. Upgrade every reader, CI runtime and Git
259
- merge driver before operating on guarded records. Never re-anchor history or
260
- remove the marker to make an older verifier pass.
261
-
262
- The additional published-artifact matrix pins the reported 2026.10.9, 10 and 13
263
- hosts. It proves original history-prefix preservation, exact nested stamps,
264
- write refusal when the project still pins 2026.10.9, and CLI/public SDK format
265
- refusal by 2026.10.10 and 13 without byte changes, ordinary
266
- current writes, restored states, and native Git merge/reconciliation with the
267
- upgraded driver. Baseline records still pass the two-prior-release matrix.
268
- The 2026.10.9 host predates format admission and is not a supported reader of
269
- guarded records; update project pins and resolved dependencies before writing
270
- them. That host's mutation bootstrap can then reject the newer project pin.
271
-
272
- Run the matrix from the built workspace root. Exact-tag release recovery retains
273
- the reviewed matrix controls, policy and static fixtures outside the checkout,
274
- then tests the selected tagged runtime through its manifest and public SDK. A
275
- historical tag need not contain newly added gate scripts; recovery still runs
276
- the mandatory matrix without rewriting the tagged source or skipping policy.
277
-
278
- ## Focused Test Runs
279
-
280
- ```bash
281
- node scripts/run-tests.mjs test -- tests/unit/output.spec.ts
282
- node scripts/run-tests.mjs test -- tests/integration/cli.integration.spec.ts
283
- ```
284
-
285
- Use focused runs while iterating, then run coverage before closure when risk or scope warrants it.
286
-
287
- ## CI Job Layout and Runner Budget
288
-
289
- Every pull-request push draws from the account-wide hosted-runner pool (20
290
- concurrent jobs, 5 on macOS, shared by every repository on the account), so the
291
- required CI asks for as few runners as the proofs allow
292
- ([pm-m6ig79](../.agents/pm/issues/pm-m6ig79.toon)):
293
-
294
- | Job | Runs |
295
- |---|---|
296
- | `Build foundation (Ubuntu, Node 24)` | Build, `dist` artifact, packed tarball. |
297
- | `Packed runtime (<os>)` × 3 | Packed first run on Node 22.18.0 and 24 in isolated prefixes, dist version smoke; Ubuntu adds the Node 22 telemetry and snapshot regressions, macOS the native shell and portability checks, Windows the full npm npx and Bun bunx acceptance. |
298
- | `Gates (static)` | Typecheck, version, changelog, secret scan, `pnpm lint` (`quality:static`), package artifact, token budgets, tracker merge-safety and assurance gates. |
299
- | `Gates (smokes)` | Shell completion, npx/plugin smokes, host isolation, context evaluation, compatibility migration and published workspace compatibility. |
300
- | `Coverage shard N/4` × 4, `Gates (coverage)` | Sharded coverage, then the merged 100% threshold. |
301
- | `Windows regression cohort` × 3, `Windows regression (Node 24)` | Script and native Windows cohorts, all running at once, then their aggregate. |
302
-
303
- Add a proof as a step inside the job that owns its platform and runtime rather
304
- than as a new job: a sub-minute job still waits in the shared queue before it
305
- starts.
306
-
307
- ## CI Retry and Timeout Diagnostics
308
-
309
- The required `Gates (coverage)` job runs after the coverage matrix settles and
310
- explicitly requires every shard to succeed. Failed, canceled, skipped, or missing
311
- shard outcomes fail that required context before checkout or report merging.
312
- Shard artifacts retain failure diagnostics. After successful shard admission,
313
- coverage-threshold failures still retain merged reports and Codecov uploads.
314
- This enforcement is tracked by [pm-0p4aal](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-0p4aal.toon).
315
- Tracker records live in the repository and are excluded from the npm package.
316
-
317
- Platform regressions from [pm-hrhfgi](../.agents/pm/issues/pm-hrhfgi.toon) and
318
- [pm-zk67yf](../.agents/pm/issues/pm-zk67yf.toon) have portable negative controls.
319
- Complete source scans process at most 32 item files per batch; the descriptor
320
- pressure fixture fails unbounded reads while requiring genuine permission
321
- failures to remain visible. The 10,000-item aggregation fixture separately
322
- verifies completeness before pagination. Git fixtures that assert exact bytes
323
- declare repository-local `core.autocrlf=false` and `core.eol=lf` so host defaults
324
- cannot change the restoration target. Send generated shell scripts through
325
- stdin (`bash -s`) so their size cannot exceed Windows command-line limits.
326
- Runtime compaction is tested through a
327
- real directory alias as well as its physical path, including original source
328
- mapping and repeated-compaction byte stability. These tests run in the full
329
- suite on the Nightly Validation platform matrix.
330
-
331
- CI retains the 30-second per-test timeout and retries one failed attempt. A
332
- test that passes only on retry is reported as flaky rather than silently folded
333
- into the pass count; a persistent assertion still fails after the bounded
334
- retry. Local runs do not retry, so deterministic failures stay immediate while
335
- iterating.
336
-
337
- The complete receipt-operation, receipt-health classification, aborted-operation recovery, receipt-settlement, merge-portability and
338
- lossless-collection-union integration files run in the existing serial
339
- `lifecycle-performance` project after parallel contracts. Both nightly shards and
340
- full coverage use that same project partition, retaining every case and its
341
- original assertions, deadlines and retry policy. This allocation is tracked by
342
- [pm-89297t](../.agents/pm/tasks/pm-89297t.toon) and
343
- [pm-receipt-serial](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-receipt-serial.toon)
344
- (tracker records are excluded from npm); it does not classify or erase
345
- historical failed attempts.
346
-
347
- The complete nightly suites use two Vitest shards on Linux Node 22/26 and
348
- macOS Node 24, and four shards on Windows Node 24 and Linux Node 24 coverage.
349
- Every partition must pass within the existing 20-minute job limit. Sharding
350
- retains the complete file population, serial phase, assertions, per-test
351
- deadlines and retry policy. Linux coverage blobs merge only after all native
352
- partitions succeed; the aggregate retains exact 100% lines, branches, functions
353
- and statements. Missing, canceled, skipped or failed partitions refuse admission.
354
- The recurrence collector retains retired families alongside current partitions
355
- and the coverage aggregate, preserving original failed attempts. This allocation
356
- is tracked by [pm-gxq0dt](../.agents/pm/issues/pm-gxq0dt.toon); the prior macOS
357
- allocation remains completed in [pm-qrirz8](../.agents/pm/tasks/pm-qrirz8.toon).
358
-
359
- Vitest's GitHub reporter emits annotations and retry evidence. The repository
360
- reliability reporter additionally writes
361
- `.vitest-reports/reliability-<shard>.json` and appends a job-summary table with
362
- the test identity, file, duration, effective timeout, retry count, shard, and
363
- failure detail. Tests completing at or above 80% of their timeout are recorded
364
- as at-risk before load turns them into timeouts. Coverage shards upload this
365
- JSON beside their blob report, so recurrence can be measured without decoding
366
- the coverage artifact or re-reading raw logs.
367
-
368
- `PM_TEST_SHARD` supplies a stable shard identity and
369
- `PM_TEST_RELIABILITY_REPORT_DIR` can redirect the JSON report for an isolated
370
- harness. These variables affect diagnostics only; they do not change test
371
- selection, retry count, timeout, or verdicts.
372
-
373
- ## Coverage Governance
374
-
375
- Coverage gating now targets literal all-source coverage across runtime code families:
376
-
377
- - `vitest.config.ts` includes canonical authoring sources across `src`, `packages` (`.ts`), `scripts`, `plugins`, and `docs/examples`.
378
- - Generated package JavaScript mirrors are not separately gated; coverage is enforced on their TypeScript sources.
379
- - Thresholds are strict `100/100/100/100` for lines, branches, functions, and statements.
380
- - Avoid reintroducing curated coverage allowlists; keep the full all-source corpus measurable and gated.
381
- - Prefer extending existing test files and shared helpers so new coverage remains fast and non-duplicative.
382
- - Prefer extracting deterministic pure helpers (and unit-testing them) when an orchestration-heavy file is difficult to cover directly.
383
- - Vitest 5 clears every mock's recorded calls before each test (`clearMocks` defaults to `true`; [pm-fokyhh](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/chores/pm-fokyhh.toon), a repository-only tracker record excluded from npm). A spy created in `vi.hoisted` that observes work done while the module under test is imported must record into its own array, as the SDK exemplar entry specs do; `mock.calls` is empty by the time the test body runs.
384
-
385
- Static quality also enforces source documentation coverage through `pnpm
386
- quality:static`: every `src/**/*.ts` source file needs a module TSDoc block,
387
- every exported declaration needs a non-module TSDoc block, and known generated
388
- boilerplate summaries are rejected.
389
-
390
- ## Test Strength and Documentation Content
391
-
392
- The required static gate also runs [SDK mutation testing and the documentation
393
- content ratchet](QUALITY_EVIDENCE.md), tracked by
394
- [pm-zclzll](../.agents/pm/tasks/pm-zclzll.toon) and
395
- [pm-dvwm](../.agents/pm/chores/pm-dvwm.toon). These add behavioral and content
396
- checks while retaining exact 100/100/100/100 coverage and all docstring floors.
397
-
398
- ## TOON Storage Round-Trip Gate
399
-
400
- History-only lifecycle reconstruction and recovery contracts are described in
401
- [History durability and recovery](HISTORY_RECOVERY.md). Their integration suite
402
- is part of the required all-source test run and compares historical projections
403
- against independently captured item files, including after removing those files.
404
-
405
- TOON item serialization is a fail-closed storage boundary. Before returning
406
- bytes to any create, update, merge, migration, or package caller, pm decodes the
407
- new `@toon-format/toon` output and compares it with the JSON-like canonical
408
- payload. A decode failure or the first field-level mismatch raises
409
- `item_document_roundtrip_failed`; no item bytes are written.
410
-
411
- The property suite exercises generated and adversarial agent text, including
412
- array-header spellings, colons, quotes, backslashes, newlines, Unicode, comment
413
- prefixes, and bracketed endpoint-shaped strings:
414
-
415
- ```bash
416
- node scripts/run-tests.mjs test -- tests/fuzz/project-boundaries.fuzz.spec.ts
417
- ```
418
-
419
- Major codec upgrades additionally require a complete read/serialize/read sweep
420
- over every tracked `.toon` item, strict history and storage validation, the
421
- packed npx consumer smoke, and Bun SDK/bunx execution. A dependency-only green
422
- unit suite is not sufficient evidence for changing the canonical storage
423
- codec.
424
-
425
- ### Directory-load cap and the `tests/unit` split
426
-
427
- `pnpm quality:static` also caps each directory under `src/`, `tests/`, and
428
- `packages/` at **120 `.ts` files** (`--max-files-per-dir`, default `120`). This
429
- keeps any single directory navigable and forces load to be partitioned by area
430
- rather than piling into one folder. `tests/unit/` is therefore split into
431
- per-area subdirectories (`tests/unit/commands/`, `tests/unit/core/`,
432
- `tests/unit/cli/`, `tests/unit/mcp/`, `tests/unit/extensions/`, …) instead of a
433
- single flat directory.
434
-
435
- When adding a unit test, place it in the matching `tests/unit/<area>/`
436
- subdirectory (or merge into an existing spec there); never add a file directly
437
- to `tests/unit/`. The
438
- [`static-quality-gate directory-load contract`](../tests/integration/ci-workflow-contract.spec.ts)
439
- test asserts the live repository stays at or below the cap and that the magic
440
- number matches the gate default, so drift is caught before CI's `static` gate
441
- fails.
442
-
443
- ## Search Quality Evaluation
444
-
445
- `search-advanced` exposes an advisory golden-query harness for relevance drift checks.
446
-
447
- Fixture source:
448
-
449
- - `tests/search-eval/golden-queries.json`
450
-
451
- Local run:
452
-
453
- ```bash
454
- pm package install search-advanced --project
455
- pm reindex --mode keyword --eval --eval-fixtures tests/search-eval/golden-queries.json --json
456
- ```
457
-
458
- Fixture authoring notes:
459
-
460
- - Each fixture must include `query`, `expected_top_ids`, and optionally `mode` (`keyword|semantic|hybrid`) and `min_ndcg_at_5` (`0..1`).
461
- - Keep expected IDs deterministic and scoped to stable seed data so CI does not flap.
462
- - Add new fixtures for regressions before tuning search defaults.
463
-
464
- The repository-native `pm eval` corpus is a required CI and release gate:
465
-
466
- ```bash
467
- pnpm build
468
- pnpm quality:retrieval-eval
469
- ```
470
-
471
- `tests/search-eval/retrieval-gate-baseline.json` enforces query count, nDCG,
472
- MRR, precision, and recall. The corpus includes at least one intentionally
473
- non-saturated judgment set so recall regressions remain observable. The
474
- required context-quality command also runs an impossible perfect-score negative
475
- control and fails if `pm eval --fail-under` stops returning a non-zero exit.
476
- Refresh the baseline only with `pnpm quality:retrieval-eval:update` after
477
- reviewing query-level ranking changes.
478
-
479
- Development tools must also pass the [development dependency security gate](https://github.com/unbraind/pm-cli/blob/main/docs/DEVELOPMENT_DEPENDENCY_SECURITY.md) (repository-only, excluded from npm), including the full audit and installed bundle integrity policy.
480
-
481
- ## Context Quality Evaluation
482
-
483
- The required context relevance gate proves that `pm context` and `pm next`
484
- assemble the right bounded working set, not only that search returns relevant
485
- documents.
486
-
487
- Fixture and baseline sources:
488
-
489
- - `tests/context-eval/golden-scenarios.json` — reviewable scratch,
490
- real-shaped, synthetic-scale, and returning-agent continuity judgments.
491
- - `tests/context-eval/baseline.json` — committed aggregate and per-scenario
492
- metrics from the accepted structural/scorer behavior.
493
-
494
- Run the required gate locally:
495
-
496
- ```bash
497
- pnpm build
498
- pnpm quality:context-eval
499
- ```
500
-
501
- The gate creates isolated temporary trackers through `PmClient`, reads them only
502
- through the public `context()` / `next()` SDK primitives, and reports nDCG,
503
- reciprocal rank, required-item recall, continuity coverage, token-budget
504
- adherence, and served-item signal attribution. It fails when an explicit corpus
505
- threshold is missed or any aggregate metric regresses below the committed
506
- baseline.
507
-
508
- Benchmark and evaluation populations that need realistic project structure
509
- should use the public SDK shapes documented in
510
- [Portable Corpus Shapes](CORPUS_SHAPES.md). `pnpm benchmark:corpus-shapes`
511
- remeasures the same SDK operations across equal-count `scratch` and
512
- `representative` populations and records their measured profiles.
513
-
514
- When a deliberate ranking change improves or intentionally redefines the golden
515
- judgments, review the scenario-level diff first, then refresh the baseline:
516
-
517
- ```bash
518
- pnpm quality:context-eval -- --update
519
- pnpm quality:context-eval
520
- ```
521
-
522
- Do not update the baseline merely to make CI green. Change judgments and
523
- rationales in the corpus when product intent changes, and commit the corpus,
524
- baseline, scorer tests, and SDK documentation together.
525
-
526
- Context-intent classification has a separate calibration receipt and one
527
- manifest-backed recovery spelling:
528
-
529
- ```bash
530
- pnpm context:intent:calibrate
531
- pnpm context:intent:calibrate --update
532
- ```
533
-
534
- The gate verifies that `package.json` exposes that exact script before it reads
535
- or refreshes `scripts/release/context-intent-calibration.json`. A missing or
536
- renamed script therefore fails with the same command contributors are told to
537
- run, and pnpm forwards `--update` to the calibration gate.
538
-
539
- ## Hosted Gate Registry
540
-
541
- Tracked by [pm-k6t4yb](../.agents/pm/tasks/pm-k6t4yb.toon) and
542
- [pm-b2hc4x](../.agents/pm/tasks/pm-b2hc4x.toon).
543
-
544
- Every workflow job is discovered by its stable `workflow-file#job-id` identity
545
- and matched exactly against `scripts/release/gate-registry.json`; human-facing
546
- step names never define the inventory. Each registry entry declares:
547
-
548
- - a canonical pm owner;
549
- - the enforced workflow jobs it participates in;
550
- - actionable failure taxonomy;
551
- - explicit bypass policy and audit rationale;
552
- - an executable negative-control test and assertion.
553
-
554
- Run the fail-closed inventory locally:
555
-
556
- ```bash
557
- pnpm quality:gate-registry
558
- node scripts/release/gate-registry.mjs --inventory
559
- ```
560
-
561
- `pnpm quality:static` includes the registry. A new workflow job fails until it
562
- is declared under at least one canonical gate, and a removed or renamed job id
563
- fails until stale policy is reconciled. Display-name edits do not mutate gate
564
- identity. Public source claims are mapped to exact evidence strings and an
565
- enforced registry entry so documentation cannot silently advertise advisory
566
- behavior.
567
- The inventory output lists registry-derived `registered` job IDs beside the
568
- parsed `workflow_jobs`; validation requires the two sets to match exactly.
569
-
570
- ## Tracker Context-Quality Ratchets
571
-
572
- Tracked by [pm-ips23h](../.agents/pm/issues/pm-ips23h.toon),
573
- [pm-kpftft](../.agents/pm/tasks/pm-kpftft.toon), and
574
- [pm-4ok4ex](../.agents/pm/tasks/pm-4ok4ex.toon), with lifecycle-stable outcome
575
- reachability owned by [pm-g4k74y](../.agents/pm/issues/pm-g4k74y.toon) and
576
- [pm-bzmeaa](../.agents/pm/tasks/pm-bzmeaa.toon).
577
-
578
- The SDK-owned assurance registry stores tracker context-quality measurements,
579
- floors, ceilings, lifetimes, enforcement, and executable negative controls in
580
- `.agents/pm/assurance.json`. The `tracker-context-quality` gate covers stored
581
- relationship kinds, validator debt, health checks, graph findings, structural
582
- cut points, and typed reachability to outcome milestones. One workspace
583
- assurance context reuses identical graph, validate, and health evaluations, so
584
- a broad gate has one authoritative snapshot without repeatedly rescanning it.
585
- Outcome enforcement uses an all-status reachable population, unreachable
586
- ceiling, and basis-point floor. Active and terminal populations remain
587
- diagnostics: absolute per-lifecycle floors would mistake normal close or reopen
588
- transitions for relationship loss.
589
-
590
- Run the same gate used by hosted CI:
591
-
592
- ```bash
593
- pnpm quality:tracker-measurements
594
- pm assurance run tracker-context-quality --trigger ci --dry-run --json
595
- ```
596
-
597
- Every native assertion contains both a passing boundary case and an impossible
598
- case that must fail. Changes flow through `pm assurance put`, which refuses a
599
- weaker bound, scope, lifetime, or enforcement unless a verified Decision item
600
- authorizes it. `scripts/release/gate-registry.json` separately inventories the
601
- retired bespoke gate and gives every graph subcommand either a named automated
602
- consumer or an explicit interactive-only classification.
603
-
604
- ## Agent Output Token Budgets
605
-
606
- Run the required PR gate locally:
607
-
608
- ```bash
609
- pnpm build
610
- pnpm quality:token-budget
611
- ```
612
-
613
- The isolated fixture contains a medium-scale linked workspace. Discovery
614
- surfaces (`--help` and contract projections) use reviewable ratcheted byte
615
- baselines. Answer surfaces including activity, deps, graph, duplicates, events,
616
- health, list, get, context, next, search, and validate are measured against
617
- their live SDK command contracts. A deliberately full, unbounded activity query
618
- must exceed the default contract, proving the gate can fail when a default
619
- becomes accidentally unbounded.
620
-
621
- Refresh `scripts/release/token-budgets.json` only for an intentional discovery
622
- surface change:
623
-
624
- ```bash
625
- node scripts/release/token-budget-gate.mjs --update
626
- pnpm quality:token-budget
627
- ```
628
-
629
- The manifest records baseline bytes and estimated tokens for visible review
630
- deltas. Updating it cannot raise answer ceilings, which remain owned by
631
- `PM_COMMAND_OUTPUT_BUDGET_CONTRACTS`.
632
-
633
- Diagnostic ceilings share the executable refusal gate:
634
-
635
- ```bash
636
- pnpm quality:recovery-closure
637
- ```
638
-
639
- The gate replays 117 refusal contracts: 18 closed-domain rows, 88
640
- grammar-derived required-argument omissions, seven closed positional-action
641
- families, and four tracker-preflight states. It also ratchets ten representative
642
- failure paths against `PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS`. Every diagnostic
643
- must fit its declared JSON ceiling and preserve a mechanically actionable
644
- correction; executable retry argv is never collection-truncated. The
645
- missing-probe negative control and the authoritative tracker-state snapshot
646
- prove that the corpus cannot silently shrink or turn a refusal into a mutation.
647
-
648
- The gate starts every fixture command from a closed environment allowlist. It
649
- retains only declared process-portability inputs such as `PATH`, temporary and
650
- home roots, and Windows process-launch variables, then supplies fixed locale,
651
- timezone, author, telemetry, and isolated tracker settings. Undeclared host
652
- values cannot reach measured output, including future harness variables that
653
- the descriptor registry does not yet know about.
654
-
655
56
  ## Linked Tests
656
57
 
657
58
  For in-place metadata corrections and context admission/refusal semantics, see
@@ -739,7 +140,7 @@ pm test <item-id> --run
739
140
  again) and is not part of the trust fingerprint.
740
141
  - An item with a setup entry is stored at item format 3, so hosts that predate
741
142
  the phase refuse the item instead of silently dropping the field (see
742
- [Published Workspace Compatibility](#published-workspace-compatibility)).
143
+ [Published Workspace Compatibility](https://github.com/unbraind/pm-cli/blob/main/docs/REPOSITORY_TESTING.md#published-workspace-compatibility), repository-only and excluded from npm).
743
144
  Create, edits and the SDK import writer (`commitImportedItem`) all stamp it
744
145
  through `stampRequiredItemFormat`, and package import adapters keep
745
146
  `phase: setup` through an export and re-import.
@@ -751,23 +152,6 @@ Use `--progress` for long foreground sweeps; it prints parent-level
751
152
  `pm test-all` selection, per-item start/end, and final summary lines in addition
752
153
  to the linked-test command progress emitted by `pm test`.
753
154
 
754
- ## Package Ecosystem Smoke
755
-
756
- After `pnpm build`, external package compatibility can be checked without
757
- touching the repository tracker:
758
-
759
- ```bash
760
- pnpm smoke:external-packages -- --limit 10
761
- pnpm smoke:external-packages -- --package pm-changelog
762
- ```
763
-
764
- The harness creates one temporary project per package, sets sandboxed `PM_PATH`
765
- and `PM_GLOBAL_PATH`, installs the package with `pm install npm:<name>
766
- --project`, runs `pm package doctor --project --detail deep --trace`, and probes
767
- runtime contracts with `pm contracts --runtime-only --availability-only`. Use
768
- `--discover-only` for the npm package list and `--keep-temp` only when debugging
769
- a failing package root.
770
-
771
155
  ## PM Context Modes
772
156
 
773
157
  Linked PM commands default to schema context: settings and extensions are seeded, but tracker item data stays isolated.
@@ -1032,7 +416,7 @@ tokenized recovery preserves measurement values and run selectors and keeps
1032
416
  clone-local command trust enforced. Measurement evidence describes execution;
1033
417
  it cannot be added to an item without running its linked tests.
1034
418
 
1035
- See [startup runner qualification](performance/runner-qualification.md) for the
419
+ See [startup runner qualification](https://github.com/unbraind/pm-cli/blob/main/docs/performance/runner-qualification.md) (repository-only, excluded from npm) for the
1036
420
  independent control measurements retained by the SDK and CLI performance gates.
1037
421
 
1038
422
  Linked tests can include assertion metadata:
@@ -1084,76 +468,3 @@ pm test-runs list --json
1084
468
  The package activates the `test-runs` command family and keeps subprocess
1085
469
  handling behind an explicit package permission declaration, so it is a useful
1086
470
  smoke target for package, permission, and command-contract changes.
1087
-
1088
- ## Release-Readiness Checks
1089
-
1090
- For substantial changes:
1091
-
1092
- ```bash
1093
- pnpm build
1094
- pnpm typecheck
1095
- node scripts/run-tests.mjs coverage
1096
- pm validate --check-resolution --check-history-drift
1097
- pm health --check-only
1098
- ```
1099
-
1100
- When release readiness requires external GitHub security telemetry in addition to
1101
- local checks, run:
1102
-
1103
- ```bash
1104
- gh issue list --state open --limit 100 --json number,title,updatedAt,url
1105
- gh pr list --state open --limit 50 --json number,title,headRefName,reviewDecision,url
1106
- gh api "repos/unbraind/pm-cli/dependabot/alerts?state=open&per_page=100"
1107
- gh api "repos/unbraind/pm-cli/secret-scanning/alerts?state=open&per_page=100"
1108
- gh api "repos/unbraind/pm-cli/code-scanning/alerts?state=open&per_page=100"
1109
- ```
1110
-
1111
- `code-scanning/alerts` can return `404 no analysis found` until at least one
1112
- CodeQL run has completed.
1113
-
1114
- For documentation-only changes, at minimum run:
1115
-
1116
- ```bash
1117
- pnpm build
1118
- rg -n "forbidden-private-token-or-path" README.md docs
1119
- ```
1120
-
1121
- Replace the placeholder pattern with the actual sensitive term being guarded in the current task.
1122
-
1123
- ## Contract Snapshot Gate
1124
-
1125
- Tracked by [pm-d6kq](../.agents/pm/tasks/pm-d6kq.toon).
1126
-
1127
- `pm contracts --full --json` is a public machine-readable SDK and agent surface.
1128
- Keep its committed golden snapshot current when command contracts, schemas,
1129
- aliases, or extension-provided command contracts intentionally change:
1130
-
1131
- ```bash
1132
- pnpm build
1133
- pnpm contracts:update
1134
- pnpm contracts:check
1135
- ```
1136
-
1137
- CI runs `pnpm contracts:check` in the static gate. Snapshot diffs should be
1138
- reviewed like an API change and paired with the package-owned changelog flow
1139
- when the contract surface changes intentionally.
1140
-
1141
- The agent-facing output-size gate is separate from schema drift. Run
1142
- `pnpm quality:token-surface` after changing help, contracts, or MCP tool
1143
- registration. It measures root help, every advertised command help page, the
1144
- summary/default/full contracts family, and MCP `tools/list` against
1145
- `scripts/agent-token-surface-baseline.json`. Use
1146
- `pnpm quality:token-surface:update` only for an intentional reviewed change;
1147
- the baseline stores explicit byte ceilings with headroom rather than volatile
1148
- timestamps or package versions.
1149
-
1150
- The CLI contract snapshot is separate from the TypeScript SDK surface snapshot.
1151
- When public SDK declarations or SDK error codes change, also run:
1152
-
1153
- ```bash
1154
- pnpm sdk:surface:check
1155
- ```
1156
-
1157
- Use `pnpm sdk:surface:update` only for reviewed additive changes. Breaking
1158
- changes require the explicit `--acknowledge-breaking "<release rationale>"`
1159
- argument documented in [SDK](SDK.md#public-surface-compatibility).