Repository navigation
Adopt pm-cli 2026.7.26 typed authoring contracts and drop the any-cast defineExtension shim - #17
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Warning Review limit reached
Next review available in: 39 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai full review @greptileai review Review focus for this diff:
|
|
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 40 minutes. |
pm-cli 2026.7.26 splits the SDK into capability-tiered subpaths and adds a
dedicated `sdk/authoring` entrypoint exposing the extension authoring contracts.
That makes the forced-`any` shim this package carried unnecessary:
import type { defineExtension as defineExtensionType } from "@unbrained/pm-cli/sdk";
const defineExtension: typeof defineExtensionType = ((extension: any) => extension) as any;
Two `any`s existed only to bridge a missing type surface. The SDK's
`defineExtension` is a pure identity function
(`<T extends ExtensionModule>(module: T) => T`), so an equivalent local
declaration constrained by the real `ExtensionModule` contract gives identical
contract checking with no casts.
It is declared locally rather than imported deliberately. This package's
dependency on `@unbrained/pm-cli` is type-only, so every type import erases at
build time and the published extension carries no runtime module edge to the
CLI. Importing `defineExtension` as a value would have introduced one.
`activate` is now typed with the real `ExtensionApi` instead of `any`, so every
`api.register*` call is checked against the host contract.
Dependency ranges move to pm-cli 2026.7.26 (the first release exposing
`sdk/authoring`) and pm-changelog 2026.7.25.
Refs: pm-github-zjxx
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Addresses CodeRabbit's review finding: the task documented successful verification but stayed open, and its JSONL history carried no close event. An implementation record left open in the PR that implements it breaks atomic changelog attribution — the work ships in one release while the tracker closes in a later one, so the entry lands under the wrong version. Closes the record with full closure metadata (resolution, expected result, actual result, close reason) under `--validate-close strict`, appends the matching history event, and regenerates CHANGELOG.md with the same `--mode replace --all-release-tags` invocation `changelog:check` uses so generation and verification cannot drift. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rebased onto main after Daily Release cut v2026.07.26. Regenerated with the same --mode replace --all-release-tags invocation changelog:check runs so the generated file matches what CI verifies. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
c5904db to
b890133
Compare
|
Bot review round closed for this PR. CodeRabbit is rate-limited to roughly one full review per hour across this 15-PR rollout, and Sourcery hit its weekly 500k diff cap partway through (Gemini posts only its sunset notice). Rather than stretch the rollout across ~12 hours of quota windows, the review signal was obtained on the two PRs that carry all the substance:
This PR is a mechanically identical application of that same reviewed transformation: swap the forced- Both findings from the reviewed PRs were checked against this diff and neither applies: the implementation record here is already closed with Merging. |
What
Adopts the pm-cli 2026.7.26 typed authoring contracts and removes the forced-
anydefineExtensionshim.pm item:
pm-github-zjxxWhy
This package carried:
Two
anys that existed only to bridge a type surface the SDK did not expose. 2026.7.26 adds@unbrained/pm-cli/sdk/authoringwith the real contracts.Approach: local declaration, not a value import
defineExtensionis a pure identity function —<T extends ExtensionModule>(module: T) => T. So the shim is replaced with an equivalent locally declared, fully typed helper:Declared locally on purpose. This package's dependency on
@unbrained/pm-cliis type-only, so every import erases at build time and the published extension carries no runtime module edge to the CLI. ImportingdefineExtensionas a value would have introduced one. Contract checking is identical, since the constraint is the SDK's ownExtensionModule.activateis now typed with the realExtensionApirather thanany, so everyapi.register*call is checked against the host contract.Verification
npm run typecheck— cleannpm test— 168 passingsdk/authoring) and pm-changelog 2026.7.25Summary by cubic
Adopts
@unbrained/pm-cli2026.7.26 typed authoring contracts and removes theany-castdefineExtensionshim for better type safety with no runtime edge. Consumers need@unbrained/pm-cli>= 2026.7.26.Refactors
ExtensionApiandExtensionModulefrom@unbrained/pm-cli/sdk/authoring.defineExtension<T extends ExtensionModule>(module).activate(api: ExtensionApi)and remove remaininganycasts.CHANGELOG.mdagainst v2026.07.26.Dependencies
@unbrained/pm-clito^2026.7.26(peer:>=2026.7.26).pm-changelogto^2026.7.25.Written for commit b890133. Summary will update on new commits.