Declare the pm CLI floor in the field the CLI actually enforces

Merged
UN
3mo ago
+236-44

This package declared its pm CLI compatibility floor only in peerDependencies (>=2026.8.3). npm enforces that at install time — but npm never sees a globally installed host CLI, and the pm CLI does not read peerDependencies at all. The CLI enforces exactly one declaration: a top-level pm_min_version in manifest.json. This package declared one, but at a version below its own peer floor, so the CLI enforced a weaker minimum than npm.

The enforcement claim was verified, not assumed

Against @unbrained/pm-cli 2026.8.15, an extension whose manifest declared pm_min_version: "2099.1.1":

  • was refused at install (ok: false),
  • never registered its command (absent from pm --help),
  • and made pm health report ok: false with
    extension_pm_min_version_unmet:project:pm-floortest:required=2099.1.1:current=2026.8.15.

So the field works — it was simply not being used correctly here.

What changed

beforeafter
manifest.json → pm_min_version2026.7.28 — below the peer floor2026.8.3
package.json → peerDependencies>=2026.8.3>=2026.8.3 (unchanged)
package.json → devDependencies^2026.8.62026.8.15 (exact)

The manifest floor is set to the same version the peer floor already declares, so this makes no new compatibility claim — it makes the existing one apply on the path the CLI actually takes. The dev dependency becomes an exact pin so a working copy and CI resolve the same CLI.

Why .gitattributes is in the diff

The newer pinned CLI rewrites the merge-driver fence from # pm-cli:merge-drivers:start/end to # pm-cli:merge-drivers:v2:start/end via the prepare script. That fence has been flip-flopping between contributors running different CLI versions; committing it under an exact pin is what stops it.

Regression test, proved on revert

test/compatibility-floor.test.ts binds all three declarations together. Every assertion was checked by actually reverting the fix:

tree statetest exit code
fix in place0
pm_min_version removed from manifest1
dev pin loosened back to a caret range1
manifest floor set to a version ≠ peer floor1

It is also linked as an acceptance test on the pm item and runs green through the CLI (pm test pm-github-7d1h --run → ok: true), with assert_stdout_regex bound to the three real node:test titles so a renamed or deleted test fails the linked check instead of passing silently.

Gates

typecheck ✅ · docstring ✅ · coverage ✅ · npm test ✅ 254 pass / 0 fail · changelog:check ✅

pm items

  • pm-github-7d1h — The pm CLI compatibility floor is declared where npm enforces it and absent from the field the CLI actually reads (closed)

Fleet context

The same defect was found in eight fleet packages and is fixed identically in each: pm-graph, pm-ops, pm-slack, pm-starter, pm-ts-starter, pm-github, pm-presets, pm-slack-standup. Upstream unbraind/pm-cli#1032 tracks the underlying ergonomics problem: a manifest can declare a version bound in a field nothing reads, and no tool warns.

Summary by Sourcery

Align the pm CLI compatibility floor across manifest, package metadata, and development tooling, and add a regression test to keep them in sync.

Bug Fixes:

  • Set the manifest pm_min_version to match the existing pm-cli peer dependency floor so the CLI enforces the intended minimum version.

Enhancements:

  • Pin the pm CLI devDependency to an exact version at or above the declared floor to ensure consistent local and CI behavior.
  • Record the compatibility-floor change in the changelog and add project issue history metadata files.
  • Normalize the manifest description punctuation and update repository attributes to match the pinned CLI's generated merge-driver markers.

Tests:

  • Add a compatibility-floor test suite that verifies the peer dependency is a >= floor, the manifest pm_min_version equals that floor, and the devDependency is an exact pin at or above it.

Summary by cubic

Aligns the pm CLI minimum across the fields npm and the CLI enforce so installs behave the same everywhere. Before: manifest pm_min_version was 2026.7.28 and peerDependencies["@unbrained/pm-cli"] was >=2026.8.3. After: both enforce 2026.8.3, with CI pinning @unbrained/pm-cli to 2026.8.15.

  • Set manifest.json pm_min_version to 2026.8.3; exact-pin @unbrained/pm-cli in devDependencies to 2026.8.15; update .gitattributes merge-driver fence to :v2: and add extension merge rules.
  • Add test/compatibility-floor.test.ts: assert peerDependencies["@unbrained/pm-cli"] is a >= floor (not an exact pin); require exact three-part versions; compare YYYY.M.D numerically (not lexicographically); narrow manifest.pm_min_version to string before comparing; include ordering cases; each assertion fails on targeted reverts.
  • Append issue-history audit notes derived from the history stream; no runtime impact.
  • Migration: users running @unbrained/pm-cli below 2026.8.3 must upgrade.