@unbrained/pm-cli 2026.5.4 → 2026.5.6

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.
package/docs/RELEASING.md CHANGED
@@ -33,8 +33,8 @@ pnpm version:check
33
33
 
34
34
  ## One-Time Setup
35
35
 
36
- - Add `NPM_TOKEN` as a GitHub Environment or repository secret.
37
- - Add `SENTRY_AUTH_TOKEN` as an optional GitHub Environment or repository secret when Sentry release creation and sourcemap upload should run. The release workflow skips this step cleanly when the secret is absent.
36
+ - Prefer npm Trusted Publishing for `.github/workflows/release.yml` so GitHub-hosted release jobs can publish with short-lived OIDC credentials. Keep `id-token: write`, `npm publish --access public --provenance`, and the package repository URL aligned with npm's Trusted Publisher configuration. If Trusted Publishing is not configured yet, add `NPM_TOKEN` as a GitHub Environment or repository secret as the fallback publisher credential.
37
+ - 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` only when the GitHub-hosted Sentry issue-threshold gate should read unresolved issues; CI-scoped release tokens may not have issue-read scope. The release workflow skips Sentry upload cleanly when `SENTRY_AUTH_TOKEN` is absent and skips the GitHub-hosted issue-threshold gate when `SENTRY_PERSONAL_ADMIN_TOKEN` is absent; local maintainers should still run the token-backed Sentry gate before release.
38
38
  - 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.
39
39
  - Ensure `GITHUB_TOKEN` has `contents: write` for GitHub Release creation.
40
40
  - Keep `package.json` repository, homepage, and bugs URLs aligned with `https://github.com/unbraind/pm-cli`.
@@ -47,9 +47,12 @@ pnpm version:check
47
47
  Policy:
48
48
 
49
49
  - release only when commits exist after the latest release tag
50
+ - ignore `.agents/pm`-only tracker commits for publish eligibility so post-release evidence and closure updates do not create a package release by themselves
50
51
  - release at most once per UTC day by default
51
52
  - same-day follow-up release (`YYYY.M.D-N`) is manual-only via `allow_same_day_release=true`
52
53
  - release preparation must pass all quality and compatibility gates before commit+tag push
54
+ - external Sentry checks run when a Sentry token is configured; local maintainers can make Sentry and private telemetry mandatory with `--telemetry-mode required`
55
+ - after creating and pushing a new tag, auto-release dispatches `.github/workflows/release.yml` with that tag and waits for the publish workflow to finish, because GitHub does not start normal push/tag workflows from `GITHUB_TOKEN` pushes
53
56
 
54
57
  Pipeline entrypoint:
55
58
 
@@ -82,6 +85,7 @@ Minimum coverage:
82
85
  - parent and dependency links
83
86
  - comments, notes, learnings, body, reminders, events
84
87
  - linked files, docs, and tests
88
+ - json_markdown items with external YAML wrappers before JSON front matter
85
89
  - closed issue metadata and history drift checks
86
90
  - current-build write mutation and item-count preservation
87
91
 
@@ -114,6 +118,7 @@ git push origin v<version>
114
118
  `.github/workflows/release.yml` runs on `v*.*.*` tags and handles:
115
119
 
116
120
  - full-history checkout
121
+ - manual `workflow_dispatch` by tag for automation handoff or recovery when a tag already exists
117
122
  - pnpm install with frozen lockfile
118
123
  - version policy and tag guard
119
124
  - secret scan
@@ -126,7 +131,7 @@ git push origin v<version>
126
131
  - npm pack dry run and npx tarball smoke test
127
132
  - generated release notes from changelog plus sanitized tracker metadata
128
133
  - artifact uploads
129
- - `npm publish --access public --provenance`
134
+ - `npm publish --access public --provenance`, skipped on retry when the exact version is already present on npm
130
135
  - post-publish npm/npx/bunx verification
131
136
  - GitHub Release creation
132
137
 
@@ -141,16 +146,18 @@ gh run watch <run-id> --exit-status
141
146
 
142
147
  ```bash
143
148
  npm view @unbrained/pm-cli@<version> version dist.integrity dist.unpackedSize --json
144
- npx --yes @unbrained/pm-cli@<version> --version
145
- bunx @unbrained/pm-cli@<version> --version
149
+ npx --yes --package @unbrained/pm-cli@<version> -- pm --version
150
+ bunx --bun @unbrained/pm-cli@<version> pm --version
146
151
  gh release view v<version> --json tagName,name,isDraft,isPrerelease,url
147
152
  ```
148
153
 
149
154
  The executable remains `pm` even though the npm package is scoped.
150
155
 
156
+ 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`.
157
+
151
158
  ## Failure Handling
152
159
 
153
160
  - If local gates fail, fix and rerun before tagging.
154
161
  - If the tag workflow fails before npm publish, confirm no package was published before moving or replacing a tag.
155
- - If npm publish succeeds but GitHub Release creation fails, recreate only the GitHub Release after verifying the tag and package.
162
+ - If npm publish succeeds but GitHub Release creation fails, rerun `.github/workflows/release.yml` with `workflow_dispatch` and `tag=v<version>`; the workflow skips duplicate npm publish, reruns public verification, and creates the GitHub Release for the existing tag.
156
163
  - Record failure evidence and remediation in the release `pm` item.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-cli",
3
- "version": "2026.5.4",
3
+ "version": "2026.5.6",
4
4
  "description": "Git-native project management CLI for humans and agents.",
5
5
  "type": "module",
6
6
  "author": "unbrained",
@@ -1,7 +1,8 @@
1
1
  param(
2
2
  [string]$Version = "latest",
3
3
  [string]$Prefix = "",
4
- [string]$PackageName = ""
4
+ [string]$PackageName = "",
5
+ [switch]$Repair
5
6
  )
6
7
 
7
8
  Set-StrictMode -Version Latest
@@ -62,6 +63,16 @@ if (Use-LiteralInstallSpec $PackageName) {
62
63
  } else {
63
64
  $installSpec = "$PackageName@$Version"
64
65
  }
66
+
67
+ if ($Repair) {
68
+ Write-Host "Repairing existing global pm install..."
69
+ $repairArgs = @("uninstall", "-g", "@unbrained/pm-cli")
70
+ if ($Prefix -ne "") {
71
+ $repairArgs += @("--prefix", $Prefix)
72
+ }
73
+ & npm @repairArgs *> $null
74
+ }
75
+
65
76
  Write-Host "Installing or updating $installSpec..."
66
77
  # --force keeps repeated installer runs idempotent when pm shim already exists.
67
78
  $npmArgs = @("install", "-g", "--force", $installSpec)
@@ -4,17 +4,19 @@ set -euo pipefail
4
4
  PACKAGE_NAME="${PM_CLI_PACKAGE:-@unbrained/pm-cli}"
5
5
  TARGET_VERSION="latest"
6
6
  PREFIX=""
7
+ REPAIR="false"
7
8
 
8
9
  usage() {
9
10
  cat <<'EOF'
10
11
  Install or update @unbrained/pm-cli globally via npm.
11
12
 
12
13
  Usage:
13
- bash scripts/install.sh [--version <tag>] [--prefix <dir>]
14
+ bash scripts/install.sh [--version <tag>] [--prefix <dir>] [--repair]
14
15
 
15
16
  Options:
16
17
  --version <tag> Package tag/version to install (default: latest)
17
18
  --prefix <dir> npm global prefix override
19
+ --repair Uninstall the registry package first to clear a stale global shim
18
20
  -h, --help Show this help message
19
21
  EOF
20
22
  }
@@ -68,6 +70,10 @@ while [[ $# -gt 0 ]]; do
68
70
  PREFIX="$2"
69
71
  shift 2
70
72
  ;;
73
+ --repair)
74
+ REPAIR="true"
75
+ shift
76
+ ;;
71
77
  -h|--help)
72
78
  usage
73
79
  exit 0
@@ -88,6 +94,16 @@ if is_literal_install_spec "$PACKAGE_NAME"; then
88
94
  else
89
95
  INSTALL_SPEC="${PACKAGE_NAME}@${TARGET_VERSION}"
90
96
  fi
97
+
98
+ if [[ "$REPAIR" == "true" ]]; then
99
+ REPAIR_CMD=(npm uninstall -g @unbrained/pm-cli)
100
+ if [[ -n "$PREFIX" ]]; then
101
+ REPAIR_CMD+=(--prefix "$PREFIX")
102
+ fi
103
+ echo "Repairing existing global pm install..."
104
+ "${REPAIR_CMD[@]}" >/dev/null 2>&1 || true
105
+ fi
106
+
91
107
  # Force is required for idempotent reruns when an existing pm shim already exists.
92
108
  INSTALL_CMD=(npm install -g --force "$INSTALL_SPEC")
93
109
  if [[ -n "$PREFIX" ]]; then