Skip to content

chore: adopt pm-cli 2026.7.27 dependency ranges - #39

Merged
unbraind merged 2 commits into
mainfrom
chore/adopt-pm-cli-2026.7.27
Jul 27, 2026
Merged

chore: adopt pm-cli 2026.7.27 dependency ranges#39
unbraind merged 2 commits into
mainfrom
chore/adopt-pm-cli-2026.7.27

Conversation

@unbraind

@unbraind unbraind commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

Adopt @unbrained/pm-cli 2026.7.27 and adapt to its output_format service-override render contract.

Dependency ranges

section old new
peerDependencies >=2026.7.26 >=2026.7.27
devDependencies ^2026.7.26 ^2026.7.27

Package own version was already 2026.7.27; no own-version change needed.

Required source adaptation: output_format service override

2026.7.27 changed the output_format service-override contract so that an
override's bare return value is rendered (it no longer falls through to
default rendering when the override echoes the inbound payload). The previous
no-op return ctx.payload therefore rendered the whole command context
(command / global / pm_root / format / options / result) instead of
just the handler result — confirmed as a regression versus 2026.7.26, where
pm pm-graph export printed ok: true / graph ....

Fix: the no-op passthrough now defers with { handled: false } (the canonical
ServiceOverrideDecision passthrough). The __pmGraphRawOutput marker path is
unchanged, so pm pm-graph export --format <fmt> still emits the raw string
straight to stdout. git diff is a one-line behavioral change plus an updated
comment.

Flag-collision audit

grep -rnE -- '--(json|quiet|path|lean|id-only|author|no-changed-fields|full-changed-fields|pm-path)\b' src/*

All --json hits are help-payload flag descriptions, manual arg re-parsing
helpers, or --json tokens passed to programmatic pm list-all shell-outs.
No registerCommand declares a top-level flags: array (the two commands
that take positionals — pm-graph query, pm-graph neighbors — declare
arguments: only). No host-owned global flag is declared in any flags array, so
registration does not abort.

Gates (all pass)

gate result
npm run build OK
npm run typecheck OK
npm run check OK
npm test 95/95 pass
npm run changelog:full OK (no CHANGELOG.md diff — the adoption chore is not release-tagged)
npm run changelog:check OK — "Changelog is up to date"

Activation proof (2026.7.27 CLI, throwaway workspace)

W=$(mktemp -d); cd "$W"; export PM_PATH="$W/.pm"
pm init probe --json          # exit 0
pm install /home/steve/container/pm-cli/fleet/pm-graph --json   # installed_extension_failed: null
pm pm-graph ping --help       # exit 0, real Usage (not unknown_command)
pm extension --explore --json # pm-graph: active=true, runtime_active=true,
                              #   activation_status="ok", version="2026.7.27",
                              #   all 15 command_paths registered from the local source

Two+ own commands exercised (no external credentials):

  • pm pm-graph statusok: true, neo4jConfigured: false, version: 2026.7.27 (exit 0)
  • pm pm-graph pingok: true, source: pm-graph, version: 2026.7.27 (exit 0)
  • pm pm-graph analyze --json{ ok: true, itemCount: 0, cycleCount: 0, ... } (exit 0)

Note: pm extension list/catalog lists the bundled first-party catalog only;
the locally path-installed pm-graph is surfaced by pm extension --explore --json.

pm item

Adoption chore tracked and closed in this repo's tracker; link resolves after merge:

Summary by Sourcery

Adopt pm-cli 2026.7.27 and update the extension to align with the new output_format service override behavior while keeping existing pm-graph command output semantics.

Bug Fixes:

  • Restore correct pm-graph export output by deferring from the output_format override with an explicit passthrough decision instead of returning the full command context.

Enhancements:

  • Update the extension’s reported version metadata and status output to 2026.7.27.
  • Record the associated pm chore and history entries for this dependency adoption.

Chores:

  • Bump @unbrained/pm-cli peer and dev dependency ranges to 2026.7.27.

Summary by cubic

Adopt @unbrained/pm-cli 2026.7.27 and align the output_format service override with the new render contract to keep output correct and preserve raw export behavior. Add tests to lock the decline/claim behavior.

  • Dependencies

    • Bumped peerDependencies to >=2026.7.27 and devDependencies to ^2026.7.27.
  • Bug Fixes

    • Updated output_format no-op to return { handled: false }, fixing full-context prints.
    • Kept __pmGraphRawOutput path so pm-graph export --format still writes raw text to stdout.
    • Added SDK harness tests (createExtensionTestHarness, runRegisteredServiceOverrideForTest) for decline/claim behavior; suite now 97 passing.

Written for commit 3350b14. Summary will update on new commits.

Review in cubic

Bump @unbrained/pm-cli peerDependencies from >=2026.7.26 to >=2026.7.27
and devDependencies from ^2026.7.26 to ^2026.7.27.

Adapt the output_format service override to the 2026.7.27 render
contract: a service override's bare return value is now rendered, so the
previous no-op `return ctx.payload` rendered the whole command context
instead of just the result. The no-op path now defers with
`{ handled: false }` (the canonical ServiceOverrideDecision passthrough);
the __pmGraphRawOutput marker path is unchanged so --format exports still
emit raw output.

All gates pass: build, typecheck, check, 95 tests, changelog:full,
changelog:check. Activation proof on the 2026.7.27 CLI confirms the
extension is active: `pm pm-graph ping --help` exits 0 with real usage
(not unknown_command); `pm extension --explore --json` shows pm-graph
runtime_active true, activation_status ok, version 2026.7.27, and all 15
commands registered; `pm pm-graph status`, `pm pm-graph ping`, and
`pm pm-graph analyze --json` all exit 0. Flag-collision audit clean: no
host-owned global flags declared in any extension flags array.
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@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.

Sorry @unbraind, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@unbraind, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c98776e4-d369-413c-9404-2eddb6467c87

📥 Commits

Reviewing files that changed from the base of the PR and between 2dafede and 3350b14.

📒 Files selected for processing (4)
  • .agents/pm/history/pm-graph-vgj0.jsonl
  • .agents/pm/tasks/pm-graph-vgj0.toon
  • CHANGELOG.md
  • test/export-and-contract.test.ts

Walkthrough

The PR adopts @unbrained/pm-cli 2026.7.27, records the completed adoption workflow, and changes the output_format override to return { handled: false } when no raw export marker is present.

Changes

pm-cli adoption

Layer / File(s) Summary
CLI dependency and adoption records
.agents/pm/chores/*, .agents/pm/history/*, package.json
Dependency ranges are updated to 2026.7.27, with chore and history records documenting activation, flag-collision checks, and validation results.
Export output override
src/index.ts
The output_format override unwraps marked raw export output and otherwise returns { handled: false } instead of returning the full command payload.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • unbraind/pm-graph#24: Also changes src/index.ts export output handling and the __pmGraphRawOutput contract.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: updating pm-cli dependency ranges to 2026.7.27.
Description check ✅ Passed The description is directly related to the dependency bump and output_format contract adaptation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/adopt-pm-cli-2026.7.27

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 commented Jul 27, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates this extension to consume @unbrained/pm-cli 2026.7.27, adjusts the output_format service override to comply with the new rendering contract, and bumps the extension’s own reported/peer/dev CLI versions plus associated metadata and chore tracking files.

Sequence diagram for updated output_format service override behavior

sequenceDiagram
    participant PmCliHost
    participant OutputFormatOverride
    participant Stdout

    PmCliHost->>OutputFormatOverride: output_format(ctx)
    alt pm_graph_export_with_raw_marker
        OutputFormatOverride-->>PmCliHost: raw_string
        PmCliHost-->>Stdout: raw_string
    else other_commands_or_no_marker
        OutputFormatOverride-->>PmCliHost: handled_false
        PmCliHost-->>Stdout: default_rendering_of_result
    end
Loading

File-Level Changes

Change Details Files
Adapt output_format service override to new pm-cli 2026.7.27 rendering contract while preserving raw-output behavior for pm-graph export.
  • Update output_format override comment to describe 2026.7.27 behavior where an override’s bare return value is rendered by the host.
  • Change the non-marked-path code path from returning ctx.payload to returning { handled: false } so default rendering is used instead of dumping the full command context.
  • Keep the __pmGraphRawOutput handling path unchanged so pm pm-graph export --format still writes the raw string directly to stdout.
src/index.ts
dist/index.js
Align extension’s reported versioning and pm-cli dependency ranges with 2026.7.27 and add associated chore/history artifacts.
  • Update EXTENSION_VERSION constant and status command’s reported version string from 2026.7.26 to 2026.7.27.
  • Bump @unbrained/pm-cli devDependency from ^2026.7.26 to ^2026.7.27 and peerDependency minimum from >=2026.7.26 to >=2026.7.27.
  • Regenerate build artifacts and package-lock to reflect new dependency version.
  • Add pm chore and history tracker files for this adoption chore.
dist/index.js
package.json
package-lock.json
.agents/pm/chores/pm-graph-gzw9.toon
.agents/pm/history/pm-graph-gzw9.jsonl
dist/index.js.map

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

@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown

Greptile Summary

Adopt @unbrained/pm-cli 2026.7.27 and update the output_format override to explicitly decline unrelated payloads.

  • Raises the peer and development dependency ranges to 2026.7.27.
  • Returns { handled: false } for payloads not owned by the raw export path.
  • Adds SDK-harness regression coverage for declined payloads and raw export output.
  • Updates generated distribution artifacts, changelog, and tracker records.

Confidence Score: 5/5

The PR appears safe to merge with no blocking failures remaining.

No blocking failure remains.

T-Rex T-Rex Logs

What T-Rex did

  • Compared baseline harness exit code 1 caused by incorrect ordinary payload handling and observed that the current harness exits code 0 with ordinary handled false and raw export handled true.
  • Verified that the real CLI ping emits only normal result fields and does not include global, format, options, or result command-context fields.
  • Confirmed that the real export stdout parses as raw graph JSON with no ok envelope and exactly matches pretty-printed JSON plus host newline, with empty stderr.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/index.ts Updates the output-format service override to use the 2026.7.27 explicit decline contract.
test/export-and-contract.test.ts Adds real SDK-harness coverage for both decline and raw-output service-override behavior.
package.json Raises the pm-cli development and peer dependency requirements to 2026.7.27.
package-lock.json Locks pm-cli 2026.7.27 and synchronizes the root dependency metadata.
dist/index.js Regenerates the distributed implementation with the service-contract and version updates.

Reviews (2): Last reviewed commit: "test: cover the output_format decline co..." | Re-trigger Greptile

…cases

The existing export-and-contract test asserted only that registerService was
called for output_format, using a hand-rolled api double behind an `as any`
cast. That can never observe the override's RETURN value — which is exactly what
regressed under pm-cli 2026.7.27, where an override's bare return IS what the
host renders, so the previous `return ctx.payload` decline path made every
command print the whole command context instead of its own result.

Adds two cases driven through pm's real service runner via
createExtensionTestHarness + runRegisteredServiceOverrideForTest:

- an unrelated command's payload is declined (handled:false, payload returned
  untouched, no extension_service_override_* warnings);
- a pm-graph export raw-output payload is still claimed verbatim.

The registration-only sibling test stays in place — it still guards activate()
wiring. Suite: 97 pass / 0 fail.

Related upstream report: unbraind/pm-cli#776.

pm items:
- pm-graph-vgj0 (Task) — real harness coverage for the decline contract
@unbraind

Copy link
Copy Markdown
Owner Author

Bot feedback triage — all four read, voted, and answered

@greptile-apps 👍 — 5/5 with no actionable defects, and the summary correctly identified the
substantive part: ordinary results are now deferred to host rendering while marked raw exports are
still returned directly. Thank you for running the code.

@coderabbitai 👍 — real review this time (not rate-limited), 5/5 pre-merge checks, no actionable
comments. Two notes for your model on this repo:

  • The Docstring Coverage check passed as skipped ("no functions found in the changed files").
    That is accurate for the original diff, but a follow-up commit on this branch adds two test
    functions — so the check should have something to evaluate on re-review.
  • You linked #24 as possibly related, which is a
    good catch: that PR established the __pmGraphRawOutput contract this one now guards. The two
    together are the whole story of this override.

@sourcery-ai 👍 — accurate walkthrough of the override change.

@gemini-code-assist 👎 — consumer Gemini Code Assist is sunset; all review activity has ceased.
No signal, and explicitly not an approval.

New commit since your reviews: 3350b14

The original diff changed the override's behaviour but shipped no test that could detect the
regression
. The existing export-and-contract test asserts only that registerService was called
for output_format, using a hand-rolled api double behind an as any cast — a double can never
evaluate the override's return value, which is the entire bug.

3350b14 adds two cases driven through pm's real service runner
(createExtensionTestHarness + runRegisteredServiceOverrideForTest from
@unbrained/pm-cli/sdk/testing):

  1. an unrelated command's payload is declinedhandled: false, payload returned untouched,
    and no extension_service_override_* warnings;
  2. a pm-graph export raw-output payload is still claimed verbatim.

Suite: 97 pass / 0 fail. The registration-only sibling test is deliberately kept — it still
guards activate() wiring.

Context worth retaining

The contract is narrow and easy to break silently: pm's isServiceOverrideDecision accepts a
decline only when handled === false and Reflect.ownKeys(value).length === 1. Any extra key
converts the decline back into a claim. And on the claim side, formatEffectiveOutput honours a
claimed result only when typeof result === "string", so a claimed non-string is silently dropped.

Filed upstream as unbraind/pm-cli#776 — the
semantics changed under a Fixed changelog entry with no breaking marker or migration note, it
fails silently and globally with exit code 0, and ServiceOverrideDecision is unexported while its
runtime constructors are exported. pm-starter (the reference template, so the broken pattern was
being taught) and pm-slack-standup carried the same payload-echo pattern and are fixed in
pm-starter#40 and
pm-slack-standup#14.

@coderabbitai review

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- follow-up commit summary and diff ---'
git show --stat --oneline --decorate --no-renames 3350b14
git show --format=fuller --no-ext-diff --unified=80 --no-renames 3350b14 -- '*.ts' 'package.json'

echo '--- TypeScript file outlines ---'
git diff-tree --no-commit-id --name-only -r 3350b14 -- '*.ts' | while IFS= read -r file; do
  echo "### $file"
  ast-grep outline "$file" --items all --view expanded || true
done

echo '--- output_format registration and test-runner usages ---'
rg -n -C 6 --type ts \
  '(registerService\s*\(|output_format|createExtensionTestHarness\s*\(|runRegisteredServiceOverrideForTest\s*\()' \
  .

Length of output: 26143


@unbraind Thanks for the detailed triage and contract context. I reviewed 3350b14; no actionable findings.

The two harness-based tests close the critical gap in the prior registration-only assertion: they exercise the actual registered output_format override through pm-cli’s runner and verify both the strict decline path (including no warnings) and the raw-string claim path. I also confirmed the implementation retains the guarded marker behavior and returns the exact { handled: false } decision for non-matching payloads.

I did not independently execute the suite because this review environment cannot run repository code; the review is based on static inspection of the new commit.

🐇✅


✏️ Learnings added
Learnt from: unbraind
URL: https://github.com/unbraind/pm-graph/pull/39

Timestamp: 2026-07-27T15:28:44.368Z
Learning: In `pm-graph`, the `output_format` service override contract from `unbrained/pm-cli` 2026.7.27 is shape-sensitive: a decline is recognized only when the override returns exactly `{ handled: false }` with no additional own properties. Returning the inbound payload instead is treated as a claim and can cause the host to render the command context.

Learnt from: unbraind
URL: https://github.com/unbraind/pm-graph/pull/39

Timestamp: 2026-07-27T15:28:44.368Z
Learning: In `pm-graph`'s `output_format` override, claimed output is honored by pm-cli only when it is a string. The override must claim only `pm-graph export` payloads containing the `__pmGraphRawOutput` marker and return that raw string verbatim; claimed non-string values are silently dropped.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@unbraind
unbraind merged commit 0c222c2 into main Jul 27, 2026
8 checks passed
@unbraind
unbraind deleted the chore/adopt-pm-cli-2026.7.27 branch July 27, 2026 21:25
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