@unbrained/pm-cli 2026.11.11 → 2026.11.12

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 (155) hide show
  1. package/.agents/skills/pm-test-audit/SKILL.md +2 -1
  2. package/.agents/skills/pm-user/references/ECOSYSTEM_PLANNING.md +2 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/AGENTS.md +2 -2
  5. package/CHANGELOG.md +19 -0
  6. package/CONTRIBUTING.md +1 -1
  7. package/README.md +1 -1
  8. package/dist/cli/register-mutation.js +2 -2
  9. package/dist/cli/register-operations.js +1 -1
  10. package/dist/cli-bundle/bundle-manifest.json +1 -1
  11. package/dist/cli-bundle/chunks/{chunk-FM375BHH.js → chunk-2DUUL53Z.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-5N3JMGXU.js → chunk-2K6GJUW7.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-DIWTFDU7.js → chunk-3DWEBVIK.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-XN2BRWDD.js → chunk-5NGGI7JC.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-NIOOJ3AG.js → chunk-5NY6EQSX.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-XJUYJXHZ.js → chunk-6ESY4Y2B.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-JLQ7O6UV.js → chunk-A7L5IEYV.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-WEAF3OY4.js → chunk-EALO2FPM.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-ZJDYBXMC.js → chunk-FJNHTBJ2.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-GZ52WAY2.js → chunk-FOT5K5OM.js} +36 -36
  21. package/dist/cli-bundle/chunks/{chunk-GOLQYO6M.js → chunk-GDS4DC5A.js} +47 -43
  22. package/dist/cli-bundle/chunks/{chunk-EBAHNZJT.js → chunk-GLPUIQDB.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-SPERPX27.js → chunk-KJL42AN5.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-Z4YEH7VQ.js → chunk-MR3CRLA7.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-QCTA2UFR.js → chunk-OBTU2BHJ.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-ZSL6U53K.js → chunk-OFIXSWJS.js} +2 -2
  27. package/dist/cli-bundle/chunks/chunk-PS2YAPXC.js +9 -0
  28. package/dist/cli-bundle/chunks/{chunk-4RHXGQMK.js → chunk-T4UC3ZKL.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-JESMEJTD.js → chunk-U7MZIX3D.js} +2 -2
  30. package/dist/cli-bundle/chunks/chunk-UTNPDAID.js +31 -0
  31. package/dist/cli-bundle/chunks/{chunk-DV7WBAKQ.js → chunk-UY7Z3ZHQ.js} +2 -2
  32. package/dist/cli-bundle/chunks/{item-revision-LNIHK36Q.js → item-revision-SYJT6TVZ.js} +2 -2
  33. package/dist/cli-bundle/chunks/item-transaction-YXZ27UC6.js +2 -0
  34. package/dist/cli-bundle/chunks/{mutation-admission-WZY22LVH.js → mutation-admission-T57TAVWI.js} +2 -2
  35. package/dist/cli-bundle/chunks/{register-list-query-DYGPLVRL.js → register-list-query-5XZXTPNG.js} +2 -2
  36. package/dist/cli-bundle/chunks/register-mutation-V6WJFL77.js +20 -0
  37. package/dist/cli-bundle/chunks/register-operations-5RAWXY2F.js +2 -0
  38. package/dist/cli-bundle/chunks/{register-setup-G66U2WFV.js → register-setup-HCKCSQWQ.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-M5FZTPFA.js → chunk-5OCUNAQN.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/chunk-AIYJHVKV.js +44 -0
  41. package/dist/cli-bundle/focused-chunks/chunk-BB2GMKRB.js +2 -0
  42. package/dist/cli-bundle/focused-chunks/{chunk-JYWVRXLD.js → chunk-BHYGUVAU.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/chunk-GAXO2UQX.js +2 -0
  44. package/dist/cli-bundle/focused-chunks/{chunk-VVGXPF4W.js → chunk-GB2N4OM7.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/chunk-IPIFI4NT.js +3 -0
  46. package/dist/cli-bundle/focused-chunks/chunk-KN7RBRRH.js +26 -0
  47. package/dist/cli-bundle/focused-chunks/{chunk-3SH3L3DB.js → chunk-LAIN47EJ.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/chunk-RXY6BFRW.js +2 -0
  49. package/dist/cli-bundle/focused-chunks/{chunk-NMU3QFAU.js → chunk-SPAEZKVA.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/chunk-TZO6L523.js +2 -0
  51. package/dist/cli-bundle/focused-chunks/{chunk-3A6XMQZJ.js → chunk-VUNX6NBR.js} +53 -53
  52. package/dist/cli-bundle/focused-chunks/{item-revision-B3BIG66B.js → item-revision-PWJNBW3F.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{item-transaction-4JDWOXNB.js → item-transaction-T6HXC3NS.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{mutation-admission-577MXOGD.js → mutation-admission-CLPOLSXZ.js} +2 -2
  55. package/dist/cli-bundle/main.js +2 -2
  56. package/dist/cli-bundle/sdk-authoring.js +1 -1
  57. package/dist/cli-bundle/sdk-contracts.js +2 -2
  58. package/dist/cli-bundle/sdk-core.js +1 -1
  59. package/dist/cli-bundle/sdk-governance.js +1 -1
  60. package/dist/cli-bundle/sdk-merge.js +57 -57
  61. package/dist/cli-bundle/sdk-query.js +1 -1
  62. package/dist/cli-bundle/sdk-runtime.js +1 -1
  63. package/dist/cli-bundle/sdk-testing.js +1 -1
  64. package/dist/cli-bundle/sdk.js +12 -12
  65. package/dist/core/item/parse.d.ts +13 -1
  66. package/dist/core/item/parse.js +4 -4
  67. package/dist/sdk/agent/command-recovery.js +1 -1
  68. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  69. package/dist/sdk/cli-contracts/completeness.js +1 -1
  70. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  71. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  72. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  73. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  74. package/dist/sdk/completion/bash.js +1 -1
  75. package/dist/sdk/completion/fish.js +3 -1
  76. package/dist/sdk/completion/zsh.js +3 -1
  77. package/dist/sdk/docs.d.ts +14 -2
  78. package/dist/sdk/docs.js +1 -1
  79. package/dist/sdk/files.d.ts +14 -2
  80. package/dist/sdk/files.js +1 -1
  81. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  82. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  83. package/dist/sdk/governance/boundary-fixtures.d.ts +25 -0
  84. package/dist/sdk/governance/boundary-fixtures.js +1 -1
  85. package/dist/sdk/governance/defect-recurrence.d.ts +8 -1
  86. package/dist/sdk/governance/defect-recurrence.js +2 -2
  87. package/dist/sdk/guide-topics.js +1 -1
  88. package/dist/sdk/index.d.ts +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/lifecycle/dependency-removal.js +2 -0
  91. package/dist/sdk/lifecycle/start-blockers.d.ts +9 -0
  92. package/dist/sdk/lifecycle/start-blockers.js +1 -1
  93. package/dist/sdk/lifecycle/update.d.ts +10 -4
  94. package/dist/sdk/lifecycle/update.js +2 -2
  95. package/dist/sdk/linked-artifacts.d.ts +73 -3
  96. package/dist/sdk/linked-artifacts.js +2 -2
  97. package/dist/sdk/public-surface.json +1 -1
  98. package/dist/sdk/runtime/actions.js +1 -1
  99. package/dist/sdk/test/command-args.js +1 -1
  100. package/dist/sdk/test/execution.d.ts +15 -3
  101. package/dist/sdk/test/execution.js +2 -2
  102. package/docs/AGENT_GUIDE.md +2 -2
  103. package/docs/AGENT_UX_CONTRACTS.md +7 -1
  104. package/docs/BUILD_AND_RELEASE_ACCEPTANCE.md +1 -1
  105. package/docs/COMMANDS.md +16 -9
  106. package/docs/CORPUS_SHAPES.md +1 -1
  107. package/docs/DEFECT_RECURRENCE.md +20 -1
  108. package/docs/ONBOARDING.md +1 -1
  109. package/docs/README.md +6 -6
  110. package/docs/SDK.md +30 -0
  111. package/docs/SDK_CONTEXT_INTEGRITY.md +2 -0
  112. package/docs/TESTING.md +1 -1
  113. package/docs/generated/FLAG_LEXICON_BUDGETS.md +6 -6
  114. package/marketplace.json +1 -1
  115. package/package.json +8 -1
  116. package/packages/pm-beads/package.json +1 -1
  117. package/packages/pm-calendar/package.json +1 -1
  118. package/packages/pm-command-kit/package.json +1 -1
  119. package/packages/pm-digital-twin/package.json +1 -1
  120. package/packages/pm-governance-audit/package.json +1 -1
  121. package/packages/pm-guide-shell/package.json +1 -1
  122. package/packages/pm-kanban/package.json +1 -1
  123. package/packages/pm-lifecycle-hooks/package.json +1 -1
  124. package/packages/pm-linked-test-adapters/package.json +1 -1
  125. package/packages/pm-search-advanced/package.json +1 -1
  126. package/packages/pm-templates/package.json +1 -1
  127. package/packages/pm-todos/package.json +1 -1
  128. package/packages/pm-vcs/package.json +1 -1
  129. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  130. package/plugins/pm-claude/package.json +1 -1
  131. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  132. package/plugins/pm-codex/package.json +1 -1
  133. package/plugins/pm-codex/plugin.json +1 -1
  134. package/runtime-dependencies.json +1 -1
  135. package/dist/cli-bundle/chunks/chunk-SVVFJPNW.js +0 -9
  136. package/dist/cli-bundle/chunks/chunk-WWW5WHHJ.js +0 -31
  137. package/dist/cli-bundle/chunks/item-transaction-TMUYPSMR.js +0 -2
  138. package/dist/cli-bundle/chunks/register-mutation-MP5JCBAJ.js +0 -20
  139. package/dist/cli-bundle/chunks/register-operations-QEASK3EF.js +0 -2
  140. package/dist/cli-bundle/focused-chunks/chunk-2ZS3I5ZP.js +0 -2
  141. package/dist/cli-bundle/focused-chunks/chunk-33EK522E.js +0 -26
  142. package/dist/cli-bundle/focused-chunks/chunk-6ICHSVEY.js +0 -2
  143. package/dist/cli-bundle/focused-chunks/chunk-6TJXTKZD.js +0 -44
  144. package/dist/cli-bundle/focused-chunks/chunk-DW5S67LO.js +0 -2
  145. package/dist/cli-bundle/focused-chunks/chunk-UCUESVFW.js +0 -2
  146. package/dist/cli-bundle/focused-chunks/chunk-V27M5UQH.js +0 -3
  147. package/docs/CONTEXT_ALGORITHM_PORTFOLIO.md +0 -167
  148. package/docs/DEVELOPMENT_DEPENDENCY_SECURITY.md +0 -246
  149. package/docs/PR_REVIEW_LOOP.md +0 -96
  150. package/docs/RELEASE_LEDGER_RECONCILIATION.md +0 -148
  151. package/docs/RELEASE_RELIABILITY.md +0 -147
  152. package/docs/RELEASING.md +0 -805
  153. package/docs/performance/corpus-shape-comparison.json +0 -1
  154. package/docs/performance/latest-scale-report.json +0 -1
  155. package/docs/performance/scale-100k-report.json +0 -1
package/docs/RELEASING.md DELETED
@@ -1,805 +0,0 @@
1
- # Releasing `@unbrained/pm-cli`
2
-
3
- This page is for maintainers cutting npm and GitHub releases. It assumes release work is tracked with `pm`.
4
- For local progressive-disclosure routing, install `guide-shell` with `pm install guide-shell --project`, then use `pm guide release`.
5
-
6
- ## Agent Quick Context
7
-
8
- - Release versioning is calendar SemVer-compatible: one production version
9
- (`YYYY.M.D`) per UTC day. Older history can contain `YYYY.M.D-N` ordinals,
10
- but release preparation no longer creates them.
11
- - Daily release preparation is owned by the GitHub Actions auto-release workflow.
12
- - Publishing is owned by the tag-driven GitHub Actions release workflow.
13
- - Do not run manual `npm publish`.
14
- - Run local parity gates before pushing release tags.
15
- - Treat `pnpm sdk:surface:check` as a release compatibility gate; never
16
- regenerate an unexplained public API diff.
17
- - Use `pm guide release --json` for machine-readable release docs routing after `guide-shell` is installed.
18
-
19
- Tracked documentation work: [pm-u9d0](../.agents/pm/epics/pm-u9d0.toon),
20
- [pm-4s24d2](../.agents/pm/issues/pm-4s24d2.toon),
21
- [pm-39cqqx](../.agents/pm/tasks/pm-39cqqx.toon), stable peer compatibility
22
- [pm-csuce0](../.agents/pm/issues/pm-csuce0.toon), and artifact budgets
23
- [pm-998juj](../.agents/pm/tasks/pm-998juj.toon), plus exact-tag recovery
24
- [pm-lwnifd](../.agents/pm/issues/pm-lwnifd.toon), and SDK-bound reliability
25
- classification [pm-dqtzva](../.agents/pm/issues/pm-dqtzva.toon).
26
- The local/hosted gate selection contract is tracked by
27
- [pm-ei6x66](../.agents/pm/tasks/pm-ei6x66.toon). Release-candidate analyzer
28
- provenance is tracked by [pm-u1baah](../.agents/pm/issues/pm-u1baah.toon), and
29
- authoritative blocker-recovery run selection by
30
- [pm-db8onn](../.agents/pm/issues/pm-db8onn.toon), and queued automatic
31
- same-day recovery by [pm-dm2vfz](../.agents/pm/issues/pm-dm2vfz.toon).
32
- Bounded Sentry request latency is tracked by
33
- [pm-b9g2cs](../.agents/pm/issues/pm-b9g2cs.toon), and exact-tag changelog
34
- stabilization by [pm-e63v1x](../.agents/pm/issues/pm-e63v1x.toon). Dual-phase
35
- package sizing around Sentry injection is tracked by
36
- [pm-llbnua](../.agents/pm/issues/pm-llbnua.toon).
37
-
38
- ## Version Policy
39
-
40
- Examples:
41
-
42
- - first release on 2026-05-01: `2026.5.1`
43
- - the next production release after `2026.5.1` is the next UTC day's
44
- calendar version; do not create `2026.5.1-2`
45
-
46
- Inspect the next SemVer-compatible calendar version for diagnostics:
47
-
48
- ```bash
49
- pnpm version:next
50
- ```
51
-
52
- This diagnostic preserves validation compatibility with historical ordinal
53
- tags, but never proposes one. When today's stable release already exists it
54
- fails with immutable-tag recovery guidance, because an ordinal would be a
55
- SemVer prerelease excluded from ordinary stable package peer ranges. An
56
- explicit pipeline `--version` must equal the current UTC calendar date; past,
57
- future, malformed, and ordinal targets fail before Git inspection.
58
-
59
- Validate the current package version:
60
-
61
- ```bash
62
- pnpm version:check
63
- ```
64
-
65
- ## One-Time Setup
66
-
67
- - Use npm trusted publishing for `.github/workflows/release.yml` so GitHub-hosted release jobs exchange their OIDC identity for a short-lived npm publish credential and publish signed packages. Keep `id-token: write`, the `release` environment, Node 24 or newer, npm 11.5.1 or newer, and `npm publish --access public --provenance`. The npm Trusted Publisher must match repository `unbraind/pm-cli`, workflow `release.yml`, and environment `release`. The release job performs a tokenless `npm publish --dry-run` OIDC exchange before the long release gates and fails early with npm's sanitized exchange diagnostic when the registry refuses the configured identity. Do not pass `registry-url` to `actions/setup-node`: its generated token-placeholder npmrc can suppress npm's OIDC exchange when no token is present. Keep `@unbrained/pm-cli` public; trusted publishing authorizes `npm publish`, not `npm access`, so restore package visibility manually before retrying if an anonymous metadata probe fails. Do not expose `NODE_AUTH_TOKEN` or `NPM_TOKEN` to the publish step; if private dependencies ever require a read token, scope it only to the install step.
68
- - Add `RELEASE_PAT` to the `release` environment from a maintainer token with `contents:write` and branch-protection bypass rights. Auto Release creates a checked version/changelog commit and tag on `main`; the default `GITHUB_TOKEN` has `contents:write` but cannot satisfy protected-branch required status checks for that freshly-created commit. The workflow does not persist this elevated token during checkout or dependency installation; `run-release-pipeline.mjs` scopes it to the git push process.
69
- - Add `SENTRY_AUTH_TOKEN` as an optional GitHub Environment or repository secret when Sentry release creation and sourcemap upload should run. Add `SENTRY_PERSONAL_ADMIN_TOKEN` for the GitHub-hosted Sentry issue-threshold gate; CI-scoped release tokens may not have issue-read scope. The release workflow skips Sentry upload cleanly when `SENTRY_AUTH_TOKEN` is absent, but fails the reliability threshold gate when `SENTRY_PERSONAL_ADMIN_TOKEN` is absent; local maintainers should still run the token-backed Sentry gate before release.
70
- - Keep any `release` environment compatible with free GitHub features. This repository is public, so environment secrets and tag/branch deployment rules are compatible with the free GitHub path; do not add paid-only release gates.
71
- - Ensure `GITHUB_TOKEN` has `contents: write` for GitHub Release creation.
72
- - Keep `package.json` repository, homepage, and bugs URLs aligned with `https://github.com/unbraind/pm-cli`.
73
- - Keep npm publishing compatible with provenance. The release workflow must keep `id-token: write`, a GitHub-hosted runner, Node 24 or newer, npm 11.5.1 or newer, tokenless public metadata probes, and `npm publish --access public --provenance` through the configured Trusted Publisher.
74
-
75
- ## Automated Daily Driver
76
-
77
- `.github/workflows/auto-release.yml` runs once per day and can also be dispatched manually.
78
-
79
- ### Independent morning dispatch
80
-
81
- Tracked by [pm-9url9h](../.agents/pm/tasks/pm-9url9h.toon). An independent
82
- operator-managed timer can invoke `scripts/release/dispatch-daily-release.mjs`
83
- at **04:45 Europe/Vienna** (02:45 UTC in summer, 03:45 UTC in winter).
84
- The aim is completion before 06:30–07:00 local time; host availability, GitHub
85
- runner capacity and release gates can prevent that target. The host must be
86
- awake, online and able to authenticate with `gh` unattended.
87
-
88
- The existing **02:35 UTC GitHub cron remains enabled as a fallback**. Either
89
- clock can arrive first. The dispatcher checks both release workflows for active
90
- runs and skips an existing exact UTC-day tag. Tag existence is explicitly not
91
- publication proof: incomplete publication still requires the normal immutable-tag
92
- recovery procedure. Hosted concurrency and the one-release-per-UTC-day guard
93
- remain the final protection if a native run races the external request.
94
-
95
- The standalone dispatcher requires an absolute private state directory:
96
-
97
- ```bash
98
- node scripts/release/dispatch-daily-release.mjs --state-dir /absolute/private/state --check
99
- ```
100
-
101
- `--check` reads prerequisites without dispatching or writing state, including
102
- outside the morning window. Without it, the dispatcher accepts only
103
- 04:45–05:15 Vienna time and sends `workflow_dispatch` to `auto-release.yml` on
104
- `main` with explicit `push=true`, `dry_run=false`, and `telemetry_mode=off`,
105
- matching scheduled production policy. It never builds from the operator's
106
- working branch, changes release secrets or bypasses hosted gates.
107
-
108
- An exclusive daily intent file is written **before** sending the request. A
109
- timeout can mean GitHub accepted the request, so an uncertain attempt is retained
110
- and never automatically resent that UTC day. Inspect hosted run history before
111
- any manual recovery. Pre-dispatch read failures leave no intent; a timer may
112
- try again within the morning window. Late persistent-timer catch-up is a no-op.
113
- Install a reviewed copy outside development checkouts so branch edits cannot
114
- silently change an unattended service.
115
-
116
- Keep dispatcher output in the service journal: `dispatch_accepted` proves only
117
- API acceptance. Verify the hosted run, GitHub Release and exact npm version
118
- separately. These runs remain `workflow_dispatch`; they do not improve or erase
119
- the native `schedule` denominator in [Release Reliability](RELEASE_RELIABILITY.md).
120
- Disable the independent timer to roll back; the original hosted schedule and
121
- publication path continue unchanged. Host-specific unit files and authentication
122
- configuration belong in private operator documentation.
123
-
124
- ### Hosted release policy
125
-
126
- Pinned tool downloads retain their existing versions and mandatory acceptance
127
- checks. Codecov CLI v11.3.1 uses its immutable GitHub release asset API endpoint,
128
- with the reviewed SHA-256 verified before execution. The Release workflow first
129
- requires uncached pinned Bun bootstrap and exact version checks on native macOS
130
- and Windows runners. Both must pass before the Build, Test, Publish job can run;
131
- a failed download or mismatched runtime therefore blocks npm publication. The
132
- later installed-package acceptance remains a separate check of the published
133
- artifact. macOS Bun acceptance uses
134
- the official pinned asset URL with `?download=1` after repeated HTTP 504s on the
135
- ordinary route; binary caching stays disabled. A failed download still fails the
136
- job. Recover an incomplete release against its existing tag after reviewed
137
- transport changes land; a download failure does not authorize another automatic
138
- version. A completed, explicitly skipped publication job with an empty step list
139
- remains eligible for first-publication recovery. Missing job evidence is still
140
- refused, and accepted publication in any other attempt still blocks a second
141
- publication. Tracked by [pm-gh1694](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1694.toon)
142
- (repository-only tracker record, excluded from npm).
143
-
144
- - release only when commits exist after the latest release tag
145
- - ignore tracker-governance-only commits for publish eligibility: `.agents/pm/**` and the mechanically generated `CHANGELOG.md` projection do not create a package release by themselves, while any product, test, documentation, workflow, or other changed path remains release-relevant
146
- - create at most one production tag and npm version per UTC day; if no tag was
147
- created, a non-`github-actions[bot]` closure of the exact bot-created
148
- `Auto Release blocked` issue on the same UTC day triggers one preparation
149
- retry
150
- - if today's tag already exists, a queued schedule or blocker closure bypasses
151
- candidate preparation and accepts the immutable result only after independent
152
- public-distribution evidence confirms the exact release; incomplete
153
- publication continues through bounded recovery instead of being accepted
154
- from tag presence alone
155
- - release preparation must pass all quality and compatibility gates before commit+tag push
156
- - before dependency installation or build, auto-release verifies that the
157
- candidate has exact-commit analyzer results or an immutable tree-identical
158
- reviewed PR head with successful DeepScan and CodeFactor results
159
- - after the automatic version commit lands, main CI accepts its parent's
160
- analyzer evidence only when the commit is the exact immutable-tagged release
161
- projection: the canonical commit message, every expected distribution
162
- manifest changed by version substitution alone, and only the generated
163
- changelog heading changed. Any other path or content still fails closed
164
- - `CHANGELOG.md` is generated by the latest npm `pm-changelog` package (`pm install npm:pm-changelog --project`, then `pm changelog generate --mode replace --all-release-tags`) from closed tracker items across git release tag windows and checked in CI; do not edit it by hand
165
- - Release preparation passes `--date-from-version` with the target calendar version so the generated heading already has its UTC release date before the tag exists. This keeps the preparation commit consistent with canonical post-tag generation and the normal `main` changelog check.
166
- - protected-branch pushes require `RELEASE_PAT`; Auto Release fails fast before the expensive release gates when `push=true`, `dry_run=false`, and that secret is not configured
167
- - release reliability gating requires `SENTRY_PERSONAL_ADMIN_TOKEN` for issue-threshold checks; Auto Release fails before creating the version commit/tag when the token is missing and `push=true`, while sourcemap upload remains optional through `SENTRY_AUTH_TOKEN`
168
- - after creating and pushing a new tag, auto-release waits for the tag-push `.github/workflows/release.yml` run to finish instead of dispatching a second publish workflow
169
- - native scheduled and declared morning-dispatcher failures open or update the
170
- same daily blocker with trigger origin, preflight state (`push`, `dry_run`,
171
- `release_pat_configured`, and `sentry_personal_admin_token_configured`) and
172
- detected cause. Successful automatic recovery closes it only after exact
173
- publication verification; operator dispatch does not manage this lifecycle.
174
- This behavior is tracked by [pm-automatic-release-alerts](../.agents/pm/tasks/pm-automatic-release-alerts.toon).
175
- - when either automatic origin fails across multiple UTC days, auto-release supersedes a stale open blocker with a fresh current-day blocker so same-day retry detection follows the latest automatic failure
176
- - closing the exact bot-created `Auto Release blocked: scheduled run failed`
177
- issue as a maintainer or agent records a same-day retry marker, then either
178
- retries preparation when no tag exists or watches an active exact-tag Release
179
- workflow. If only failed or missing evidence exists, it dispatches the
180
- reviewed current `release.yml` from `main` with the immutable tag input; it
181
- never reruns historical workflow code. It comments with the recovered tag on
182
- success and reopens the same issue on failure. A second close on the same UTC
183
- day is refused
184
- before release mutation and reported as `retry_already_attempted`, and
185
- workflow cleanup closures by `github-actions[bot]` are ignored.
186
- - after a scheduled run publishes a tag and the downstream release workflow succeeds, auto-release closes any open `Auto Release blocked` issue so the GitHub tracker reflects current release health
187
- - workflow concurrency can leave a delayed schedule queued behind another
188
- production run. The queued schedule resolves the current UTC-day immutable
189
- result before candidate provenance, proves publication, and exits without
190
- evaluating the generated release commit as a new candidate
191
-
192
- Dependency advisory diagnostics are tracked by
193
- [pm-z20n3s](../.agents/pm/tasks/pm-z20n3s.toon). Both Auto Release and Release
194
- retain the original `.cache/dependency-security/receipt.json` after the gate,
195
- including failures, as `dependency-advisory-<run-id>-<attempt>` for seven days.
196
- Only that public receipt is uploaded, with explicit hidden-file inclusion.
197
- It records registry and OSV findings or unavailable evidence without raw
198
- stderr, credentials, telemetry, or sibling caches. Missing receipts warn rather
199
- than masking the original failure. Retention never changes the gate verdict.
200
-
201
- Pipeline entrypoint:
202
-
203
- ```bash
204
- node scripts/release/run-release-pipeline.mjs
205
- ```
206
-
207
- Tracked by [pm-prrlce](../.agents/pm/issues/pm-prrlce.toon): hosted preparation
208
- uses `--push --defer-push` to write an exact producer binding. Auto Release uploads
209
- `release-producer-binding-<attempt>` before verifying and atomically pushing its
210
- prepared refs. Publication independently fetches the verified run's artifact and
211
- compares the tag name, target commit, tag object and declaration. Missing, expired,
212
- ambiguous or mismatched evidence fails closed; artifact retention is 90 days.
213
- A branch advance after sealing refuses publication rather than rebasing into a
214
- different target. Local `--push` refuses before Git inspection or asset mutation;
215
- local preparation without pushing remains supported. Historical admission remains
216
- limited to the reviewed exact-object inventory.
217
-
218
- The pipeline performs:
219
-
220
- 1. change detection + one-release-per-day guard
221
- 2. a single `YYYY.M.D` version bump; ordinal targets and the removed
222
- `--allow-same-day-release` override fail closed
223
- 3. latest `pm-changelog` install and main changelog refresh through package-owned full-history generation; the release pipeline passes `--release-version`, `--all-release-tags`, and the canonical `--exclude-tag changelog-exclude` policy so the pending release section matches post-tag CI checks
224
- 4. build, clone-local merge-driver installation, then the remaining strict gates (typecheck, docs/skills freshness, coverage, static quality, compatibility, security, smoke checks, reliability gate); this ordering makes the checkout-owned CLI available before bootstrap, matches CI, and prevents fresh-clone tracker measurements from observing undeclared merge-driver repairs
225
- 5. release note generation from changelog + pm evidence
226
- 6. commit and tag creation (plus optional push)
227
-
228
- The generated changelog includes clickable pm item links to the tracked `.toon` files. Missing release evidence should be fixed in pm item history, not by hand-editing `CHANGELOG.md`.
229
-
230
- ## Changelog Classification (Contributor-Facing)
231
-
232
- `pnpm changelog:pm` routes closed pm items into keep-a-changelog sections using `pm-changelog` classification logic. Use explicit type/tag metadata when you want deterministic section routing.
233
-
234
- Signal tiers:
235
-
236
- - **Strong signals**: item `type` + `tags`
237
- - **Weak signal**: item `title` (after stripping CLI-flag-like tokens such as `--add`)
238
-
239
- Category precedence (first matching bucket wins):
240
-
241
- | Priority | Category | Trigger terms (from strong + weak signals unless noted) |
242
- |---|---|---|
243
- | 1 | `Security` | `security`, `cve`, `vulnerability` |
244
- | 2 | `Deprecated` | `deprecated`, `deprecation` |
245
- | 3 | `Removed` | `removed`, `remove`, `deleted`, `delete` |
246
- | 4 | `Fixed` | `fix`, `fixed`, `bug`, `bugfix`, `hotfix`, `regression` |
247
- | 5 | `Added` | `feature`, `feat`, `added`, `add`, `new` |
248
- | 6 | `Changed` | strong-signal `change`, `changed`, `refactor`, `update`, `updated`, `improve`; for non-bug-like types only, title fallback is also used |
249
- | 7 | `Other` | no classifier match |
250
-
251
- Bug-like default:
252
-
253
- - Items with type `Issue`, `Bug`, `Bugfix`, or `Defect` default to `Fixed` unless a higher-priority category already matched.
254
- - This bug-like default runs before title-only `Changed` fallback to avoid misrouting command-name issue titles (for example "`pm update ...`" issue reports).
255
-
256
- Practical examples:
257
-
258
- - `Issue` + title `pm update --add-tags fails` -> `Fixed`
259
- - `Task` + tag `refactor` -> `Changed`
260
- - `Feature` + tag `security` -> `Security`
261
- - `Issue` + tag `feature` -> `Added` (explicit stronger signal beats default)
262
-
263
- If a changelog routing rule appears incorrect, fix classifier behavior in the `pm-changelog` package/repo and then consume the updated package here. Do not patch generator internals in this repository.
264
-
265
- ## Local Release Parity Checklist
266
-
267
- 1. Confirm the UTC calendar date. Do not use an ordinal diagnostic as a
268
- production target.
269
-
270
- ```bash
271
- pnpm version:next
272
- ```
273
-
274
- 2. Verify previous-version tracker compatibility in a temporary project before release asset edits.
275
-
276
- Create representative data with the latest published package and then read, mutate, run linked tests, validate, and health-check the same temp `PM_PATH` with the current build. The temp run must use isolated `PM_PATH` and `PM_GLOBAL_PATH`; never point compatibility tests at the repository's real tracker data.
277
-
278
- Minimum coverage:
279
-
280
- - parent and dependency links
281
- - comments, notes, learnings, body, reminders, events
282
- - linked files, docs, and tests
283
- - legacy markdown item files (including external YAML wrappers before JSON front matter) migrating cleanly to TOON
284
- - closed issue metadata and history drift checks
285
- - current-build write mutation and item-count preservation
286
-
287
- 3. Review private reliability signals.
288
-
289
- Use maintainer-only local workflows for reliability checks and incident triage. Keep operational details, infrastructure topology, and raw diagnostics out of tracked release documentation and release notes.
290
-
291
- Run the public Sentry/telemetry threshold gate through the package script alias:
292
-
293
- ```bash
294
- pnpm sentry:telemetry:gate -- --telemetry-mode best-effort
295
- ```
296
-
297
- The Sentry threshold gate reads the latest event for each issue and classifies
298
- expected handled failures from the SDK error catalog. An event is ignored only
299
- when it is handled, its `pm.error_code` resolves to a declared canonical code,
300
- its `pm.exit_code` exactly matches that code's transport contract, and the
301
- semantic class is `usage`, `not_found`, or `conflict`. Message and title prose
302
- never participate. Unknown codes, missing or mismatched exits, unhandled
303
- events, and every `generic_failure` or `dependency_failed` remain blocking.
304
- This keeps rewording independent from release policy and makes stale or broad
305
- message allowlists impossible. The gate skips issues seen only in
306
- `environment=test` (opted-in CI tests); an issue with any other event counts
307
- whenever any of its events falls inside the activity window. Activity and
308
- environment are separate Sentry queries, because Sentry applies `lastSeen` after
309
- an environment filter: a combined query would also skip an issue whose
310
- production event predates the window while a test event falls inside it. When
311
- the listing of issues with non-test events may be truncated, nothing is skipped,
312
- and a failed listing fails the gate. Both listings follow Sentry's next-page links
313
- up to `--sentry-limit` (default `200`); when active issues remain beyond it, the
314
- gate fails, because it cannot judge issues it never read.
315
-
316
- Sentry API requests use a 120-second deadline by default. Operators can set
317
- `--sentry-request-timeout-ms` between `1` and `300000` when reproducing
318
- provider latency, while the emitted gate receipt records the effective value.
319
- The release workflow pins `120000`; query timeouts remain fail-closed and must
320
- not be treated as an empty issue set.
321
-
322
- If private reliability checks identify repeated user friction, either confirm the current release already contains the remediation with regression coverage or fix it before continuing.
323
-
324
- The build writes `dist/cli-bundle/bundle-manifest.json` atomically with SHA-256 digests for every emitted bundle file. At startup, `pm` reports `bundle_integrity_torn_install` only when a module-loader failure is accompanied by manifest proof that an upgrade or rebuild changed, removed, or corrupted the active bundle. Reinstall `@unbrained/pm-cli` and retry after that diagnostic. Ordinary `ERR_MODULE_NOT_FOUND` and export failures with an intact manifest remain unexpected failures and must continue to block reliability gates.
325
-
326
- 4. Run the same release pipeline locally.
327
-
328
- Runtime install reproducibility is tracked by
329
- [pm-gh1417](../.agents/pm/issues/pm-gh1417.toon). The committed
330
- `runtime-dependencies.json` records only the exact production closure from the
331
- tested `pnpm-lock.yaml`, including integrity, nested conflicts and optional
332
- edges. After changing dependencies, run `pnpm install`, then
333
- `node scripts/release/runtime-lock.mjs apply`. Static and publication gates reject
334
- drift; never generate the ledger by resolving fresh registry ranges.
335
-
336
- `pnpm pack:distribution` builds an isolated publication tree, copies the exact
337
- installed runtime closure into physical package directories and sets npm's
338
- `bundleDependencies`. It excludes pnpm's development store and source maps.
339
- The release workflow publishes this staged tarball with provenance; CI and
340
- packed smoke tests use the same staging command. Application distribution and
341
- bundled runtime have separate committed size and file-count limits, so runtime
342
- payload cannot hide application growth. The ledger ships with the tarball for
343
- installed-version verification. [pm-iceees](../.agents/pm/issues/pm-iceees.toon)
344
- keeps selected optional-peer subtrees complete: npm deliberately skips peer edges
345
- when gathering bundled files, so staged runtime manifests record the exact tested
346
- peer bindings as ordinary or optional dependency entries. Package code, source
347
- and installed manifests, and peer declarations remain intact.
348
- [pm-2csj4k](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-2csj4k.toon) (repository-only tracker record excluded from npm) adds one root entry per required
349
- peer: Bun installs resolve a package's dependencies from the registry instead of
350
- its `bundleDependencies`, so the published root manifest pins every non-optional
351
- peer target that the ledger installs at the root to its tested version and
352
- bundles it. A peer resolved only in a nested `node_modules` is not pinned,
353
- because the root manifest may name only root-installed packages, which the
354
- installed-runtime verifier enforces. Without the pin,
355
- `@sentry/node`'s `@opentelemetry/api ^1.9.1` resolved to 1.10.0 and Bun warned
356
- against the bundled OpenTelemetry packages' `<1.10.0` peer ranges. Optional-only
357
- peers and direct dependencies are unchanged, and the packed smoke runs a verbose
358
- `bun add` and fails on any peer-range warning. A real archive regression resolves the peer's descendant
359
- from an extracted package and the installed-runtime verifier still refuses any
360
- missing locked package. npm 12 ignores published shrinkwraps; shipping
361
- a shrinkwrap alone therefore cannot enforce this contract. SDK consumers
362
- supply the bounded optional Node types peer themselves.
363
-
364
- Physical entrypoint verification is tracked by
365
- [pm-tl7vlu](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-tl7vlu.toon)
366
- (repository-only tracker record excluded from npm). The dependency advisory CLI
367
- resolves both its invocation and module to physical paths, so directory aliases
368
- and Node's symlink-preserving main-module mode still execute verification and
369
- return a receipt or failure status. Module imports expose the collector without
370
- starting verification.
371
-
372
- Push the final implementation commit through a reviewed pull request first,
373
- wait for DeepScan and CodeFactor to finish on that reviewed SHA, then run the
374
- canonical registry-owned preflight:
375
-
376
- ```bash
377
- pnpm verify:preflight
378
- ```
379
-
380
- The registry supplies the ordered executable plan, command arguments,
381
- environment, capture policy, and explicit skip policy. Its receipt distinguishes
382
- passed checks from declared skips. The same registry maps named PR, nightly,
383
- and release workflow gates; hosted-only entries must explain why no faithful
384
- local equivalent exists. Analyzer provenance is the first executable step, so
385
- an unreleasable candidate fails before build, coverage, or package work.
386
-
387
- The preflight includes the mandatory local hosted-analysis proof:
388
-
389
- ```bash
390
- pnpm quality:hosted-analysis
391
- ```
392
-
393
- The gate accepts only DeepScan's explicit zero-new-issue status and
394
- CodeFactor's explicit no-issues result. Both contexts are required by `main`
395
- branch protection, and the release pipeline reruns the same immutable-tree
396
- proof. The gate reads branch protection through REST first; if that transport
397
- is unavailable or its core API quota is exhausted, it queries the equivalent
398
- GraphQL rules across every cursor-paginated page and still requires one exact
399
- `main` rule with strict updates plus both analyzer contexts. Malformed,
400
- truncated, missing, or ambiguous admin policy data fails closed. GitHub Actions'
401
- ephemeral token cannot request the repository `Administration: read` permission
402
- required by both of those policy surfaces. When both admin transports reject
403
- that token, the gate uses the contents-readable `GET /branches/main` summary
404
- and requires that the exact candidate is the current protected branch head,
405
- protection is enabled and enforced, and CodeFactor plus DeepScan are effective
406
- required contexts. That summary intentionally cannot attest the admin-only
407
- strict-update setting: its receipt reports `strict: null`,
408
- `strict_verified: false`, and `verification_scope: effective_required_checks`
409
- instead of inventing a positive result. Exact, immutable identical-tree, or
410
- fully validated deterministic-release analyzer provenance remains mandatory
411
- and is emitted beside the policy receipt,
412
- so the restricted-token recovery cannot admit an unanalyzed or different-tree
413
- candidate. A maintainer token with administration-read access still verifies
414
- and reports `strict: true` through REST or paginated GraphQL. It reads the
415
- release commit first. When GitHub does not copy app results
416
- onto a merge commit, the gate may reuse a reviewed merge-parent or squash-PR
417
- head only when its immutable Git tree SHA exactly matches the release commit.
418
- Squash provenance additionally requires one unambiguous GitHub association to a
419
- closed PR merged into `main` with the release commit as its merge commit.
420
- Missing, ambiguous, or different-tree provenance fails closed.
421
-
422
- The automatic release commit is the sole non-identical-tree derivation. The
423
- gate requires one parent, the canonical release subject and body, an immutable
424
- `v<version>` tag resolving to the candidate, the complete expected manifest
425
- inventory, exact old-version to new-version substitutions in every manifest,
426
- and an exact `Unreleased` changelog-heading replacement. Fixed distribution
427
- paths come from the same inventory as version synchronization and staging.
428
- Plugin runtime package manifests are mandatory when present in the immutable
429
- parent tree; historical parents that predate those files remain verifiable.
430
- The package-generated
431
- replacement may be `## <version>` or the historical
432
- `## <version> - <YYYY-MM-DD>` form, with the date matching the calendar version.
433
- The complete heading must match and every other changelog byte must remain
434
- unchanged. The gate then resolves the parent through the same exact or reviewed
435
- identical-tree analyzer contract.
436
- Added, deleted, renamed, missing, or otherwise modified paths are refused, as
437
- are malformed manifests, changelog edits, untagged commits, and parents without
438
- successful analyzer evidence. The receipt reports
439
- `analysis_source: deterministic_release_transform` and names both the release
440
- parent and the parent's analyzer source; it never describes the changed release
441
- tree as identical to the analyzed tree.
442
-
443
- The supported default-branch arrival path is a reviewed pull request. A direct
444
- push to `main` is releasable only if both analyzers attached successful evidence
445
- to that exact commit or it is the narrowly validated automatic release
446
- projection above; when neither condition holds, the gate explicitly refuses the
447
- candidate instead of letting the next scheduled release discover the missing
448
- precondition after expensive work. CI runs `Release analyzer readiness (main)`
449
- on every product-relevant push to `main`, providing continuous visibility
450
- between release attempts. If GitHub's commit-association endpoint has not yet
451
- published a new merge, the gate reads the pull-request number from GitHub's
452
- standard merge message and accepts it only after the immutable PR resource
453
- confirms that exact merge SHA, `main` base, and reviewed head. Remediate a
454
- refused direct-main candidate by landing the next tree-changing fix through a
455
- reviewed PR; never copy, synthesize, or bypass analyzer evidence.
456
-
457
- ### Reviewed Delivery Closeout
458
-
459
- The reviewed delivery includes its PM evidence, item closure, and generated
460
- changelog. Complete those mutations on the implementation branch before merge
461
- whenever their evidence is already available. A pull request is not complete
462
- while known tracker or changelog closeout remains queued for a direct push.
463
-
464
- When a repository update genuinely depends on the merge SHA or a post-merge
465
- hosted result, create a normal follow-up branch from `main` and land that update
466
- through another reviewed pull request. Do not push `.agents/pm/**` or
467
- `CHANGELOG.md` closeout directly to `main`. Although tracker-only commits do not
468
- create package-release eligibility by themselves, the direct commit still
469
- becomes the default-branch head and lacks the reviewed analyzer evidence needed
470
- by the next release-relevant candidate. `Release analyzer readiness (main)`
471
- must fail closed in that state; its failure is a provenance control, not an
472
- analyzer approval. Restore readiness only with a tree-changing, `main`-based,
473
- reviewed pull request—never by copying statuses, weakening the gate, or
474
- synthesizing a pull-request association.
475
-
476
- ```bash
477
- # Read-only parity check
478
- pnpm release:pipeline:dry-run
479
-
480
- # Full local preparation (version/changelog mutation + local commit/tag)
481
- pnpm release:pipeline
482
- ```
483
-
484
- The static phase includes `pnpm sdk:surface:check`,
485
- `pnpm benchmark:sdk-entrypoints:check`, and
486
- `pnpm benchmark:transport:check`. The packaging phase runs the
487
- `package-artifact` preflight step (`scripts/release/package-artifact-gate.mjs`,
488
- the gate behind `pnpm quality:package-artifact`) before any version commit or
489
- tag exists. It evaluates npm's actual packlist against the committed
490
- unpacked-size, file-count, required-runtime-file, and forbidden source-map
491
- budgets, so an over-budget candidate never receives an immutable tag. The
492
- `package-artifact-sentry-injected` step then runs the same gate with
493
- `--profile=sentry-injected --simulate-injection`. It runs the installed
494
- `sentry-cli` on a disposable copy of `dist/` and adds each packed file's
495
- measured growth to the packlist, so it checks the bytes the release will
496
- publish without rewriting the checkout. An incremental rebuild does not
497
- re-emit unchanged modules, so injecting the checkout itself would leave
498
- injected files behind. Release
499
- additionally reruns the packlist gate immediately after Sentry debug-ID
500
- injection and before any Sentry upload or finalization, using the derived
501
- `sentry-injected` profile: the base ceiling plus `max_bytes_per_injected_file`
502
- for every packed `dist/**/*.js` file. `sentry-cli sourcemaps inject dist/`
503
- adds one fixed-length snippet to each such file (358 bytes with
504
- `@sentry/cli` 3.8.2), so a fixed allowance stopped covering the transform once
505
- the file count grew and blocked the already-tagged 2026.11.5
506
- ([pm-998juj](../.agents/pm/tasks/pm-998juj.toon)).
507
- `tests/unit/scripts/release/sentry-injection-allowance.spec.ts` runs the
508
- installed `sentry-cli` against a fixture, so an upgrade that grows the snippet
509
- fails in the pull request that upgrades it, not on a tag. CI constrains the base
510
- build, publication constrains the exact mutated artifact users install, and a
511
- rejected package cannot leave finalized observability artifacts. Additive SDK
512
- exports require a reviewed
513
- snapshot refresh. A removal or semantic signature change fails until the
514
- maintainer supplies
515
- `pnpm sdk:surface:update -- --acknowledge-breaking "<release rationale>"`;
516
- pair that acknowledgement with migration guidance, compatible extension
517
- version bounds where applicable, and the next eligible date-based release.
518
-
519
- Build finalization removes redundant indentation from emitted `.d.ts` files
520
- ([pm-chw71s](../.agents/pm/tasks/pm-chw71s.toon)). String and template type
521
- contents, comments, JSDoc, symbols and module boundaries retain their original
522
- tokens. Source declarations remain readable, and packed TypeScript consumers
523
- verify the emitted surface before publication. Artifact ceilings remain unchanged.
524
- Whitespace after explicit declaration delimiters is also compacted, while
525
- newlines that may supply automatic semicolons are retained. Literal contents
526
- and documentation remain intact; the publication-weight owner is
527
- [pm-998juj](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-998juj.toon)
528
- and this delimiter-compaction tranche is
529
- [pm-5aze0q](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-5aze0q.toon)
530
- (repository-only tracker records excluded from npm).
531
-
532
- The generated error-code catalog ships as compact rows
533
- ([pm-998juj](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-998juj.toon), a repository-only tracker record excluded from npm).
534
- `scripts/generate-error-code-catalog.mjs` omits every derivable field: the
535
- meaning sentence, the class implied by the exit code, the shared recovery
536
- guidance, provisional stability, every-command emitters, a self canonical code
537
- and empty aliases. `expandPmErrorCodeCatalogRows` restores them at load time,
538
- so `PM_ERROR_CODE_CATALOG` and every serialized projection stay byte-identical.
539
- The catalog appears once in the tsc emit and once in each CLI bundle, and the
540
- compact rows removed about 320 KB from the packed distribution.
541
-
542
- The publication tree ships only the emitted declarations a consumer can reach
543
- ([pm-998juj](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-998juj.toon)).
544
- `exportedDeclarationClosure` in `scripts/release/package-distribution.mjs`
545
- walks every exported `types` entry through its relative `from` and `import()`
546
- specifiers. The exports map refuses unexported subpaths, so a consumer cannot
547
- import any other `dist/**/*.d.ts`: the CLI internals behind `./cli`, the MCP
548
- servers, and internal SDK and core modules. Packing leaves those out, and the
549
- checkout keeps every declaration. A manifest without an exports map ships every
550
- declaration, because any subpath then stays importable. The walk fails closed. An exported or
551
- referenced declaration missing from the packlist, or a relative specifier that
552
- is not a `.js` module path, refuses the pack instead of publishing a dangling
553
- type reference. The packed smoke's strict TypeScript consumer imports every
554
- exported types entry, so it compiles the complete shipped closure. The cut
555
- dropped 212 declarations (266,135 bytes) from the 2026.11.6 distribution.
556
- Artifact ceilings remain unchanged. The tsc `.js` emit still ships, because the
557
- `pm` and MCP bins and the `./cli` export import it directly.
558
-
559
- 5. Land the implementation through a reviewed pull request, then use hosted
560
- preparation for publication.
561
-
562
- Local preparation without `--push` is a diagnostic preview. Its local producer
563
- declaration cannot authorize publication. Once the reviewed implementation is on
564
- `main`, dispatch the existing Auto Release workflow from that default branch:
565
-
566
- ```bash
567
- gh workflow run auto-release.yml --ref main \
568
- -f push=true -f dry_run=false -f telemetry_mode=off -f trigger_origin=operator
569
- ```
570
-
571
- Hosted preparation runs the mandatory gates, creates the version commit and
572
- annotated tag, and seals their exact producer binding in an immutable artifact
573
- before verifying and atomically pushing either ref. It waits for the single
574
- tag-driven Release workflow to publish and accept that exact package. Do not push
575
- locally prepared tags or invoke `npm publish` separately.
576
-
577
- If today's immutable tag already exists, use the exact-tag recovery procedure
578
- below. A local diagnostic tag does not prove hosted preparation or publication;
579
- never move a published tag or mint a second automatic version for the same UTC day.
580
-
581
- ## GitHub Workflow
582
-
583
- `.github/workflows/release.yml` runs on `v*.*.*` tags and handles:
584
-
585
- - full-history checkout
586
- - manual `workflow_dispatch` by tag for recovery. An isolated anonymous exact-version probe keeps already-published recovery on the reviewed dispatch-time `main` source; when the immutable tag exists but npm publication never completed, recovery preserves the reviewed package gate and budget in runner-temporary storage before checking out that exact tagged source. The controls inspect the untouched tagged package without becoming part of it, so recovery applies the current fail-closed distribution policy while retaining the original version guard and immutable package bytes.
587
- - pnpm install with frozen lockfile
588
- - version policy and tag guard
589
- - secret scan
590
- - build, clone-local merge-driver installation, typecheck, test, and coverage
591
- - generated changelog verification and `pm-changelog` installation before the
592
- tracker-bearing static gate, so a clean checkout does not misclassify the
593
- managed extension's linked files as missing. Every exact-tag source,
594
- including an ordinary tag push and recovery of an unpublished immutable tag,
595
- regenerates only `CHANGELOG.md` with the tagged checkout's canonical package
596
- script and fails if that operation changes any other tracked source path
597
- (apart from managed-extension install metadata). Reviewed `main` recovery
598
- sources retain the non-mutating drift check.
599
- - static quality gate (shared complexity, duplication, dead/orphan module, file/folder hygiene, source/exported docstring coverage profile)
600
- - temporary-project compatibility gate against latest published tracker data
601
- - reliability threshold gate (Sentry severity threshold, bounded to a recent-activity window via `--sentry-window-days` (default `14`, `0` = unbounded) so a stale benign unresolved issue cannot block every scheduled release; Sentry requests use the fail-closed bounded `--sentry-request-timeout-ms` contract (default `120000`, maximum `300000`); `--telemetry-mode` gate policy: `off` | `best-effort` | `required`). Scheduled `auto-release.yml` failures open/update an `Auto Release blocked` GitHub issue so blocked daily releases are never silently skipped.
602
- - extension grammar acceptance ([pm-gh1466](../.agents/pm/issues/pm-gh1466.toon), [pm-gh1467](../.agents/pm/issues/pm-gh1467.toon)): the existing flag parity gate includes a synthetic extension population, and packed smoke runs the same independent echo oracle on Node and Bun. Immediately before publication, `extension-flag-acceptance.mjs` extracts the exact tarball passed to `npm publish`, resolves its public SDK exports and manifest executable, and checks help, machine contracts, handler options, remaining arguments and refusals. Any failed or missing case stops publication. The retained receipt records executed case identities, runtime, resolved entrypoints, fixture digest and tarball SHA-256. This proves candidate behavior; published-installed acceptance remains a separate claim. Exact-tag recovery preserves both the reviewed runner and its fixture outside the tagged checkout.
603
- - diagnostic privacy acceptance ([pm-geywoc](../.agents/pm/issues/pm-geywoc.toon)): the same candidate runner requires the independent synthetic diagnostic fixture through the installed public SDK. A disposable loopback collector verifies real serialized error events, streamed spans, and finalized logs, including scope attributes. Quoted keys, Unicode escapes in keys/delimiters/separators, nested serialized JSON, containers and incomplete values must lose their sensitive markers; safe text, numeric/boolean attributes and caller scope must remain intact. Opaque encoded boundaries redact the remaining text, and a long backslash control bounds scanning cost. Missing, failed or duplicate case receipts block acceptance. Recovery preserves the diagnostic fixture with the runner. This local export proof is separate from hosted Sentry ingestion and does not change user consent.
604
- - sandboxed `pm` coverage
605
- - a base npm pack dry run, optional Sentry debug-ID injection, a second
606
- `sentry-injected` packlist budget over the exact publishable bytes, and only
607
- then optional Sentry release metadata/upload/finalization and the npx tarball
608
- smoke test. Sentry release metadata and sourcemaps are uploaded only from
609
- tag sources. Recovery of an already-published version from reviewed `main`
610
- preserves that version's existing Sentry commits and sourcemaps; local debug-ID
611
- injection still validates the candidate artifact budget without changing the
612
- published release's symbolication data.
613
- - generated release notes from changelog plus sanitized tracker metadata. The
614
- tracker read projects only release-relevant fields and explicitly removes row
615
- and token limits. The generator validates the completeness receipt before
616
- summarizing; partial, unreadable, or malformed input produces a visible warning
617
- instead of claiming no items closed. The regression suite exercises a real
618
- workspace exceeding the default JSON budget. Tracked by
619
- [pm-svxdsx](../.agents/pm/issues/pm-svxdsx.toon).
620
- - artifact uploads
621
- - `npm publish --access public --provenance --tag latest`, skipped on retry
622
- only when the exact version is anonymously visible from a fresh npm cache.
623
- If the package is public but the target version is absent, the workflow
624
- publishes immediately without attempting a package-access mutation. A
625
- dispatch may do so only when its source-selection preflight pinned the
626
- checkout to the requested immutable tag; reviewed-main recovery continues
627
- to refuse publication of a missing target. Only
628
- when neither the target nor package metadata is anonymously visible, the
629
- same-tag recovery path fails closed and instructs the maintainer to restore
630
- public package visibility outside the workflow. Trusted publishing does not
631
- authorize package-access mutations. Permission, authentication, and registry
632
- failures stop the workflow instead of risking an immutable-version overwrite.
633
- The checked-out tag's `package.json` supplies
634
- the canonical package identity to both the publish guard and the
635
- post-publish npm/npx/bunx verifier so those identities cannot drift. The
636
- explicit stable dist-tag also preserves
637
- correct `latest` behavior when rerunning historical ordinal tags.
638
- - post-publish npm/npx/bunx verification in the separate `publication` job,
639
- which needs the publishing job and owns a 110-minute limit, so a slow build
640
- phase can no longer cut the registry wait short. npm's publish-time malware
641
- scan holds a new version for about five minutes and sometimes far longer
642
- (2026.11.8 became visible 55m22s after publish); the verifier polls for
643
- about ninety minutes, and an exhausted wait names the version, the scan and
644
- the publication-only re-run
645
- ([pm-0jzl5t](../.agents/pm/issues/pm-0jzl5t.toon)). The job checks out
646
- the exact commit the release job published (recorded after exact-tag source
647
- selection), so the verifiers read the same `package.json` identity as the
648
- publish guard; previous-release selection keeps the reviewed dispatch-source
649
- selector. The verifier runs
650
- `scripts/release/verify-published-release.mjs`, using isolated empty npm and
651
- Bun caches plus an empty npm user config so maintainer credentials and cached
652
- metadata cannot mask a public-registry outage. The verifier dispatches a real
653
- `pm contracts` command through both explicit-bin and package-default
654
- invocations, performs stateless JSON-RPC `server/discover` against the
655
- symlink-resolved `pm-mcp` bin under both npx and bunx, and launches the exact
656
- public `pm-mcp-http` bin under both executors on an isolated loopback port for
657
- a real Streamable HTTP `server/discover` exchange. Both transports require
658
- canonical `2026-07-28` metadata/result envelopes. HTTP startup is bounded to
659
- two 20-second attempts per executor so the complete retry budget remains below
660
- the hosted step timeout. Signal-aware process-group cleanup escalates from
661
- `SIGTERM` to `SIGKILL` after a bounded grace period, including when the outer
662
- evaluator times out or an intermediate executor exits before its server
663
- descendant. Direct executor exit is not treated as process-group cleanup. The
664
- verifier derives bin coverage from `package.json`, and proves missing-bin and
665
- missing-command controls fail.
666
- - exact-package installed acceptance through
667
- `scripts/release/verify-installed-agent-session.mjs`. Separate npm and Bun
668
- install roots must contain the resolved executable, then each drives the
669
- cold-start `init -> context -> create -> claim -> annotate -> files -> close
670
- -> validate -> get -> context` loop. The structured report identifies the
671
- failing step and records per-step output ceilings and estimated token cost.
672
- - GitHub Release creation
673
- - GitHub Release metadata verification through the same local verification script
674
-
675
- The Auto Release parent has a 290-minute orchestration limit: 60 minutes for
676
- preparation and gates, 30 for aggregate runner queue delays, the serial
677
- 60-minute build-and-publish, 110-minute publication verification, 15-minute
678
- acceptance and 5-minute advertisement job limits, and 10 minutes for
679
- orchestration overhead. Runner queue time consumes
680
- the waiting parent's wall time even when no child job is executing. The
681
- reserve accommodates delays without extending a child job or changing a
682
- quality gate. Extreme queue delays can still exhaust the parent; recover the
683
- existing immutable tag after checking its publication evidence rather than
684
- creating another daily version. Tracked by
685
- [pm-29bwud](../.agents/pm/issues/pm-29bwud.toon).
686
-
687
- Monitor:
688
-
689
- ```bash
690
- gh run list --workflow Release --limit 5
691
- gh run watch <run-id> --exit-status
692
- ```
693
-
694
- ## Verified Coverage Uploads
695
-
696
- Tracked by [pm-2x67z9](../.agents/pm/issues/pm-2x67z9.toon). CI downloads the
697
- official Codecov CLI from an immutable GitHub release and checks the reviewed
698
- SHA-256 before making it executable. Both coverage and test-result uploads
699
- require that verifier to succeed and retain mandatory upload failures plus
700
- the exact PR-head identity. The pinned action's supported `url` input selects
701
- the official `https://codecov.io` Cloud host for the current coverage and
702
- test-result APIs; certificate validation remains required for every request.
703
- Both uploads disable verbose logging because debug output can expose signed
704
- storage upload URLs in public Actions logs. Normal upload-result diagnostics
705
- remain available, and upload errors still fail the required gate.
706
- Failed tests can still upload diagnostic reports
707
- after successful verification. Update the release URL and digest together;
708
- verify the official artifact and its adoption age before changing those pins.
709
- The shell regression executes the real checksum with approved and corrupt
710
- download fixtures; a failed check must prevent executable permission and uploads.
711
-
712
- ## Post-Release Verification
713
-
714
- Use the [rolling reliability report](RELEASE_RELIABILITY.md) as well as the
715
- latest release result. Its first-attempt denominator, explicit outcome receipts,
716
- and UTC dispatch policy preserve failures even after a recovery succeeds.
717
-
718
- ```bash
719
- npm view @unbrained/pm-cli@<version> version dist.integrity dist.unpackedSize --json
720
- npx --yes --package @unbrained/pm-cli@<version> -- pm --json --no-extensions contracts --summary
721
- npx --yes @unbrained/pm-cli@<version> pm --json --no-extensions contracts --summary
722
- bunx --silent --bun --package @unbrained/pm-cli@<version> pm --json --no-extensions contracts --summary
723
- bunx --silent --bun @unbrained/pm-cli@<version> pm --json --no-extensions contracts --summary
724
- pnpm release:verify-installed-agent -- --version <version> --manager both --json
725
- gh release view v<version> --json tagName,name,isDraft,isPrerelease,url
726
- pnpm release:verify-published -- --version <version>
727
- ```
728
-
729
- The executable remains `pm` even though the npm package is scoped.
730
-
731
- Use the npm registry package for maintainer global updates. Do not use `npm install -g https://github.com/unbraind/pm-cli.git` as the normal update path; npm can leave a stale shim while replacing git-sourced global installs. If a workstation is already in that state, run `bash scripts/install.sh --repair` or `npm uninstall -g @unbrained/pm-cli && npm install -g @unbrained/pm-cli@latest`.
732
-
733
- ## Failure Handling
734
-
735
- - If local gates fail, fix and rerun before tagging.
736
- - Treat failed scheduled Nightly Validation jobs as release-health blockers until triaged. The nightly workflow opens or updates a GitHub issue for each failing scheduled OS/Node matrix entry, with the run URL and commit SHA, so cross-platform regressions do not rely on someone manually scanning the Actions tab.
737
- - Treat a green manual Auto Release dry-run (`push=false` or `dry_run=true`) as gate confidence only. It does not prove the protected-branch publish path; scheduled production runs still require `RELEASE_PAT` and `SENTRY_PERSONAL_ADMIN_TOKEN` to be configured in the `release` environment.
738
- - If release preparation fails before creating a tag, fix the cause and retry
739
- preparation on the same UTC day.
740
- - Once a tag exists, never move or replace it and never create a same-day
741
- ordinal recovery version. Rerun `.github/workflows/release.yml` with
742
- `workflow_dispatch` and `tag=v<version>` (or close the current bot-created
743
- blocker once to trigger the guarded exact-run recovery). The workflow skips
744
- npm publication for a version visible to its isolated anonymous probe, keeping
745
- reviewed dispatch-time `main`. A definitive missing-version response can pin
746
- source to the immutable tag only after admission reads complete workflow and
747
- job inventories, validates totals and unique identities, and checks matching
748
- attempts. Prior successful `Publish to npm` evidence refuses
749
- publication while metadata is unavailable: acceptance can precede visibility.
750
- Unavailable, malformed, incomplete or inconsistent evidence also refuses it.
751
- Only the executing attempt is excluded; its earlier attempts remain checked.
752
- This admission check also runs before first publication, using reviewed
753
- controls retained outside recovery checkout. Push and dispatch publishers
754
- share exact-tag concurrency. See [pm-publication-acceptance-fence](../.agents/pm/issues/pm-publication-acceptance-fence.toon).
755
- A never-published tag then reapplies the version guard, installs the managed
756
- changelog extension, regenerates the package changelog with the tagged
757
- checkout's canonical policy under a tracked-path mutation guard, and permits
758
- first publication only from that tagged source. Ordinary tag-push releases
759
- use the same guarded regeneration because their tag did not exist when the
760
- release commit's changelog was prepared. Other registry failures stop before
761
- source selection or publication.
762
- - If the `publication` job fails because npm has not yet made a version that
763
- `Publish to npm` accepted visible, the package is held by npm's publish-time
764
- scan, not lost. Do not dispatch a recovery or touch the tag. Once
765
- `npm view @unbrained/pm-cli@<version> version` succeeds, run
766
- `gh run rerun <run-id> --failed`: only the publication job and the skipped
767
- acceptance and advertisement jobs run again, without rebuilding or
768
- republishing. The failure message prints the exact command
769
- ([pm-0jzl5t](../.agents/pm/issues/pm-0jzl5t.toon)). Close the bot-created
770
- `Auto Release blocked` issue by hand after that run succeeds; the parent run
771
- that recorded the failure stays red.
772
- - If an immutable published package contains a defect that cannot be repaired
773
- by rerunning the same tag workflow, document the incident and ship the code
774
- fix in the next UTC day's release.
775
- - A manual exact-tag `workflow_dispatch` recovery uses isolated anonymous
776
- registry probes and never mutates package access. A visible package with a
777
- missing target version proceeds directly to exact-tag OIDC publication. When
778
- neither the package nor target version is anonymously visible, recovery fails
779
- closed until a maintainer restores public visibility outside the workflow. An
780
- already-visible immutable version is still verified and never republished.
781
- Recovery starts from the
782
- dispatch-time commit SHA and fails unless the dispatch ref is the repository
783
- default branch (`main`). It remains on that reviewed source when the exact
784
- npm version exists. When the version is definitively absent, it switches to
785
- the resolved commit behind `RELEASE_TAG`, requires `package.json` to match the
786
- tag, installs the clone-local merge driver and managed changelog extension,
787
- and may publish that exact source after every gate passes.
788
- - Record failure evidence and remediation in the release `pm` item.
789
-
790
- ### Silent skip debugging
791
-
792
- When auto-release exits green but does not cut a version, inspect the pipeline's JSON skip `reason` from `scripts/release/run-release-pipeline.mjs` (or rerun locally with `pnpm release:pipeline:dry-run -- --json`):
793
-
794
- - tracker-only skip family: `tracker_only_changes_since_last_tag` (all changed paths are `.agents/pm/**` and/or the generated `CHANGELOG.md` projection; a product-visible path is the required negative control)
795
- - changelog-empty skip family: `empty_generated_changelog_section_for_target_version` (generated release section exists but has no non-empty entries)
796
-
797
- `pm-changelog` is maintained in a separate repository/package. Classifier or release-window bugs must be fixed and released there first, then consumed here via the latest npm package (`pm install npm:pm-changelog --project`) before rerunning release generation.
798
-
799
- Before local changelog regeneration diagnostics, always refresh tags first:
800
-
801
- ```bash
802
- git fetch --tags --force
803
- ```
804
-
805
- Without a forced tag refresh, local tag windows can drift from origin and produce misleading changelog or skip diagnostics.