Skip to content

Certify pm CLI 2026.9.23 and adopt the guarded pm-ops merge-driver launcher - #119

Merged
unbraind merged 3 commits into
mainfrom
certify-pm-cli-2026-9-23-and-roll-out-guarded-merge-driver-launcher
Sep 25, 2026
Merged

unbraind merged 3 commits into
mainfrom
certify-pm-cli-2026-9-23-and-roll-out-guarded-merge-driver-launcher

Conversation

@unbraind

@unbraind unbraind commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fleet wave of 2026-09-25 (companion epic pm-cli-website-5s6z), applied by the fleet's deterministic wave script and verified by this repository's own gates.

  • Certify pm CLI 2026.9.23, exact pins in package.json and package-lock.json: @unbrained/pm-cli 2026.9.21 -> 2026.9.23, pm-ops 2026.9.18 -> 2026.9.23, pm-changelog 2026.9.18 -> 2026.9.23.
  • Guarded merge-driver launcher (companion pm-cli-website-xy19): scripts/prepare-merge-driver.ts is now the template pm-ops 2026.9.23 ships, copied unchanged (it replaces the static-import launcher). It imports nothing from pm-ops, so a production install of a clone (npm ci --omit=dev) skips with one notice instead of dying on ERR_MODULE_NOT_FOUND, while a stale or broken pm-ops still fails the install. prepare-merge-driver.test.ts compares the file byte-for-byte with node_modules/pm-ops/templates/prepare-merge-driver.ts (pm-ops covers every branch of that template with real fixtures) and runs it to prove the drivers register.

pm items

Verification

Check Result
git config --get-regexp '^merge\.pm' after npm ci drivers registered
CI health block (pm health ... --require-merge-drivers), executed from ci.yml exit 0
npm run release:check exit 0 (ok - the flag changes the heading: '## 2026.1.2-2 - 2026-01-02' with it, '## 2026.1.2-2' w)
changelog:full then changelog:check regenerated after the pm writes, consistent

Summary by Sourcery

Certify the pm toolchain at 2026.9.23 and harden merge-driver setup for production installs.

Bug Fixes:

  • Allow production clone installs without pm-ops to complete while still failing for stale or broken pm-ops installations.

Enhancements:

  • Adopt the guarded pm-ops merge-driver launcher and document its installation behavior.

Build:

  • Update the pm CLI, pm-ops, and pm-changelog development dependencies to version 2026.9.23.

Documentation:

  • Update the README to describe the canonical guarded merge-driver launcher and its production-install behavior.

Tests:

  • Verify the launcher matches the pinned pm-ops template and covers successful registration, omitted dependencies, stale packages, installer failures, and signal termination.

Chores:

  • Record the associated project-management chore and release history updates.

Summary by cubic

Pins the pm toolchain to 2026.9.23 and replaces the static-import merge-driver launcher with the guarded template pm-ops ships. npm ci --omit=dev in a clone now skips with one notice instead of failing on a missing pm-ops import, while a stale or broken pm-ops still fails the install.

  • Bumps @unbrained/pm-cli to 2026.9.23 and pm-ops and pm-changelog to 2026.9.23 in package.json and package-lock.json.
  • Copies scripts/prepare-merge-driver.ts byte-for-byte from the pm-ops template; a test keeps it identical and runs it in fresh git-init checkouts to confirm each .gitattributes driver registers, covering the omit-dev skip, stale pm-ops, and failing and killed installers.
  • Updates the README to describe the launcher's actual behavior, replacing the old PATH-only guard description.

Written for commit 7b89e71. Summary will update on new commits.

Review in cubic

…uncher

- Pins @unbrained/pm-cli 2026.9.21 -> 2026.9.23, pm-ops 2026.9.18 -> 2026.9.23, pm-changelog 2026.9.18 -> 2026.9.23 exactly (package.json and package-lock.json).
- scripts/prepare-merge-driver.ts is now the launcher template pm-ops ships, copied unchanged: it
  imports nothing from pm-ops, so `npm ci --omit=dev` in a clone skips with one notice instead of
  failing, while a stale or broken pm-ops still fails. A test keeps it byte-identical to the pinned
  template and proves it registers the drivers.

pm items: pm-context-h04z. Companion epic pm-cli-website-5s6z. release:check exits 0.
@sourcery-ai

sourcery-ai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR upgrades the pinned pm toolchain to 2026.9.23 and adopts its guarded merge-driver launcher, which avoids hard failure when pm-ops is omitted from production installs while still failing for stale or broken installations. Documentation, changelog/project-management records, exact lockfile pins, and tests are updated; the tests enforce byte-for-byte template parity and verify merge-driver registration.

Sequence diagram for guarded merge-driver installation

sequenceDiagram
    participant NPM as npm prepare
    participant Launcher as prepare-merge-driver.ts
    participant Resolver as Node module resolver
    participant PMOps as pm-ops installer
    participant Git as Git config

    NPM->>Launcher: execute
    Launcher->>Resolver: resolve pm-ops/merge-driver/prepare
    alt pm-ops is absent
        Resolver-->>Launcher: MODULE_NOT_FOUND
        Launcher->>Resolver: resolve pm-ops/package.json
        Resolver-->>Launcher: MODULE_NOT_FOUND
        Launcher-->>NPM: print skip notice
    else pm-ops is installed
        Resolver-->>Launcher: installer path
        Launcher->>PMOps: spawn installer
        PMOps->>Git: register merge drivers
        Git-->>PMOps: drivers registered
        PMOps-->>NPM: success or installer failure
    end
Loading

Flow diagram for merge-driver launcher failure guarding

flowchart TD
    A[Run prepare-merge-driver.ts] --> B[Resolve pm-ops merge-driver entry]
    B -->|Entry found| C[Spawn pm-ops installer]
    C --> D[Register Git merge drivers]
    B -->|Entry missing| E[Resolve pm-ops package]
    E -->|Package absent| F[Print one skip notice]
    E -->|Package present| G[Re-throw resolution error]
    C -->|Installer fails| H[Fail npm install]
Loading

File-Level Changes

Change Details Files
Certify the pm toolchain at release 2026.9.23 with exact dependency and lockfile pins.
  • Update pm CLI, pm-ops, and pm-changelog development dependencies.
  • Regenerate corresponding package-lock entries.
  • Record the chore and generated project-management history.
Replace the merge-driver hook with the guarded pm-ops launcher template.
  • Resolve the pm-ops installer at runtime without importing pm-ops directly.
  • Skip only when pm-ops is absent, while surfacing stale, malformed, or failing installations.
  • Run the installer as a child process and propagate its exit status.
  • Document production-install behavior and launcher provenance.
scripts/prepare-merge-driver.ts
README.md
Add regression coverage that protects launcher provenance and verifies driver registration.
  • Compare the committed launcher byte-for-byte with the installed pm-ops template.
  • Execute the launcher and assert pm merge drivers are registered.
test/prepare-merge-driver.test.ts
Regenerate the changelog with the certification and launcher adoption entry.
  • Add an Unreleased entry linked to the pm chore.
CHANGELOG.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 35ec37e6-8ad6-4f65-ae07-27edee94e400


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="test/prepare-merge-driver.test.ts" line_range="24-27" />
<code_context>
+});
+
+test("the prepare launcher registers pm's merge drivers in this checkout", () => {
+  const run = spawnSync(process.execPath, [launcher], { cwd: root, encoding: "utf8" });
+  assert.equal(run.status, 0, run.stderr);
+  const drivers = spawnSync("git", ["config", "--get-regexp", "^merge\\.pm"], { cwd: root, encoding: "utf8" });
+  assert.match(drivers.stdout, /^merge\.pm/m);
+});
</code_context>
<issue_to_address>
**issue (testing):** The test only checks whether any `merge.pm` configuration exists after the launcher exits successfully; it does not verify that this invocation registered the expected drivers. A pre-existing local Git configuration therefore lets the test pass even if the launcher becomes a no-op or registers no drivers.

**Triggers:** When the repository already has merge.pm entries, as it does after a prior `npm install`/`prepare` run.

**Suggested fix:** Run the launcher against an isolated Git config or assert the complete expected driver definitions, including their names and commands.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: test/prepare-merge-driver.test.ts:27


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread test/prepare-merge-driver.test.ts Outdated
@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Updates build toolchain and replaces merge-driver launcher.

The PR appears safe to merge based on the reviewed changes.

Summary

The PR pins the pm toolchain to 2026.9.23 and adopts the guarded pm-ops merge-driver launcher. Since the previous review, it clarifies the launcher documentation and records that update in the project-management history.

  • The previously reported test-isolation issue is resolved; the current test uses a fresh Git checkout and checks the declared driver set.
  • No new actionable issue was established.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[npm prepare] --> B{pm-ops installer available?}
  B -- No, package absent --> C[Skip with notice]
  B -- No, package present --> D[Fail installation]
  B -- Yes --> E[Run pm-ops installer]
  E --> F{Installer succeeds?}
  F -- Yes --> G[Complete prepare]
  F -- No --> D
Loading

Reviews (3) · Last reviewed commit: "Describe the guarded merge-driver launch..."

Comment thread test/prepare-merge-driver.test.ts Outdated
…d driver

Review round 1 (Sourcery, Greptile): the first test could pass on merge drivers this repository's own
npm ci had already registered, and it accepted any single driver. Each case now runs the launcher as
npm's prepare hook would, inside a fresh git-init checkout with this repository's .gitattributes and
tracker settings, and asserts the exact driver set .gitattributes declares. It also covers the
omit-dev skip, a stale pm-ops, and failing and signal-killed installers.

pm item: pm-context-h04z.
Review round 1 (Greptile): the README still described the old PATH-only guard. The prepare hook hands
over to pm-ops's installer, which runs pm merge install when pm is on PATH; the launcher skips with one
notice when pm-ops is absent (npm ci --omit=dev in a clone) and fails on a stale or broken pm-ops.

pm item: pm-context-h04z.
@unbraind

unbraind commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner Author

Review round complete before merge. All 2 inline bot threads were answered in-thread, and each was either fixed in this PR or tracked on the companion hub (launcher template: pm-cli-website-dqg7; release-workflow verifier: pm-cli-website-mxrp). Greptile's latest review covers the current head 7b89e71 with Confidence Score: 5/5. Sourcery skipped this head (its weekly diff allowance), so its earlier findings on this PR are the last it gave, and all were answered. CodeRabbit posted only its free-plan notice: this repository has fewer than 10 stars, so it doesn't review automatically, and its one-review-per-hour allowance is kept for PRs that need it. Every required check is green on 7b89e71.

@unbraind
unbraind merged commit 179204a into main Sep 25, 2026
11 checks passed
@unbraind
unbraind deleted the certify-pm-cli-2026-9-23-and-roll-out-guarded-merge-driver-launcher branch September 25, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant