@unbrained/pm-cli 2026.8.4 → 2026.8.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/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +53 -13
- package/dist/cli/error-guidance.js +4 -4
- package/dist/cli/main.js +12 -37
- package/dist/cli/register-setup.d.ts +1 -1
- package/dist/cli/register-setup.js +46 -20
- package/dist/cli/register-structured-mutation.d.ts +2 -0
- package/dist/cli/register-structured-mutation.js +124 -12
- package/dist/cli-bundle/bundle-manifest.json +397 -397
- package/dist/cli-bundle/chunks/append-XAJ5Z4XS.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-QVO3VTA4.js → chunk-343QETLI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q5F6OI7C.js → chunk-3KFVGGRE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6S7I3UKV.js → chunk-3ZJRFYY2.js} +19 -19
- package/dist/cli-bundle/chunks/{chunk-NFF3JAQR.js → chunk-4AVFKHHC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5H47J5FG.js → chunk-4OVGQW22.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-D2MBVMVE.js → chunk-5PBP2ZP3.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-5ZKQPA44.js +2 -0
- package/dist/cli-bundle/chunks/chunk-A3XQ7VPU.js +2 -0
- package/dist/cli-bundle/chunks/chunk-AJE3AHPD.js +8 -0
- package/dist/cli-bundle/chunks/{chunk-2POYGY53.js → chunk-AOBDLU4T.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PYYPQLHC.js → chunk-AYRUGRNS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QMWUL66F.js → chunk-BP6EMEDP.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-UVZREFZU.js → chunk-C3YABSJK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RB65T4RX.js → chunk-CA3BURYF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KIKLF2W4.js → chunk-D7I3TUGV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PQXEB7W4.js → chunk-DQGJ2RWT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OB7TRZ2G.js → chunk-DWOAOZHZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SVDH5CHC.js → chunk-E7BFPLUZ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-CGY5I2GO.js → chunk-F4NREH3G.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DCJ6CM6F.js → chunk-FDBRXV25.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NM5G7RLU.js → chunk-GU3TSEHD.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-HS7OVAUN.js +164 -0
- package/dist/cli-bundle/chunks/{chunk-CU5ENFNP.js → chunk-JFZIS6JF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GOICHIX4.js → chunk-JQ4NZ5EB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HE3DZFN4.js → chunk-L6LGKJX3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BLINBTMX.js → chunk-M357ZCOR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NRDKVOUE.js → chunk-M4VEE3FK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HTYC76A4.js → chunk-MCS73BKB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BKMZTZYL.js → chunk-MDTH7SAE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-H6FITE7D.js → chunk-NE5VRDAI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NPUJ7OLK.js → chunk-OXY3SJ3N.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-PECV7L5T.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-KH4GVBMC.js → chunk-Q3VOP62W.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FQ4EFFDU.js → chunk-QJ7C3JIW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VH2EAGUG.js → chunk-R6LSRGPS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HQ2WU7OY.js → chunk-R6RKEYYW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PA5XRN2A.js → chunk-RAFUN7IX.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-RUAU5OSH.js +2 -0
- package/dist/cli-bundle/chunks/chunk-SD3YXU2U.js +56 -0
- package/dist/cli-bundle/chunks/{chunk-JMKVCQSE.js → chunk-SV3YQ4RY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-B5ZLCD5Z.js → chunk-SVV3DQES.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-J4EPW4GT.js → chunk-SXECIECW.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-T45OHXDW.js +8 -0
- package/dist/cli-bundle/chunks/{chunk-NH35JNK5.js → chunk-TPKDJ5WL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZSH4GNBH.js → chunk-UVVXHGYS.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-V663653R.js +20 -0
- package/dist/cli-bundle/chunks/{chunk-5PZGZMPG.js → chunk-WSI5KZQJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3XZYTRPC.js → chunk-XPOQQJTX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UJHUR3LZ.js → chunk-YCCDXBNU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-ZFBWCKYF.js +2 -0
- package/dist/cli-bundle/chunks/close-DI66JMSB.js +2 -0
- package/dist/cli-bundle/chunks/close-many-VFKT6U3O.js +2 -0
- package/dist/cli-bundle/chunks/comments-E73HIEZJ.js +2 -0
- package/dist/cli-bundle/chunks/copy-WBYVLCPC.js +2 -0
- package/dist/cli-bundle/chunks/{create-RLLCBCXM.js → create-TG67IVFI.js} +2 -2
- package/dist/cli-bundle/chunks/delete-6XKUVVQN.js +2 -0
- package/dist/cli-bundle/chunks/{deps-J4ONTF4X.js → deps-AJUGP2OH.js} +2 -2
- package/dist/cli-bundle/chunks/{docs-YL2DJ4WD.js → docs-QOCLDRKJ.js} +2 -2
- package/dist/cli-bundle/chunks/{files-NGNAIYKK.js → files-3ST5TY64.js} +2 -2
- package/dist/cli-bundle/chunks/focus-R2AWS63Y.js +2 -0
- package/dist/cli-bundle/chunks/{history-compact-HW62K5XP.js → history-compact-7BJFML4S.js} +2 -2
- package/dist/cli-bundle/chunks/{history-redact-HVBKUJOW.js → history-redact-WJN3HYXR.js} +2 -2
- package/dist/cli-bundle/chunks/{history-repair-OPNBH5JJ.js → history-repair-XDNZUB7F.js} +2 -2
- package/dist/cli-bundle/chunks/{learnings-F36PZXT6.js → learnings-SZMUPVNA.js} +2 -2
- package/dist/cli-bundle/chunks/{profile-N3XMWBM7.js → profile-KL53JIAC.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-BKGHBI7Y.js → register-list-query-QH7ONPKU.js} +2 -2
- package/dist/cli-bundle/chunks/register-mutation-OCRQNZK4.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-HIBJXRGB.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-QWBQ6HBS.js +2 -0
- package/dist/cli-bundle/chunks/restore-FXA5QPM7.js +2 -0
- package/dist/cli-bundle/chunks/{schema-4PJQMGUY.js → schema-QJ27OTRV.js} +2 -2
- package/dist/cli-bundle/chunks/update-7GBO4SXG.js +2 -0
- package/dist/cli-bundle/chunks/update-many-VF6ZKQUO.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-27DK4A5O.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-4JC3AOGS.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-6KDHXURF.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-74CWP3A4.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-7AZDTGPA.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-7YTZ7A4E.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ONIX2KKW.js → chunk-CL3NB7VW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-EAXXF2HW.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-L6A4NVQC.js → chunk-EYO4F74Z.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-GEYU23YS.js +153 -0
- package/dist/cli-bundle/focused-chunks/{chunk-DQ4PLKEE.js → chunk-GIERI4YU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-GSW2Y7VZ.js +5 -0
- package/dist/cli-bundle/focused-chunks/{chunk-WVGJAD7L.js → chunk-LKQXXO62.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UFCPSWIL.js → chunk-MBBMTDD3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OYTK4VNH.js → chunk-ME4XVOBJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-RO5BQFG3.js → chunk-N7QN3NE6.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QL5H3AQH.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-TQMFQYXR.js +29 -0
- package/dist/cli-bundle/focused-chunks/{chunk-SQXVGHMH.js → chunk-XNVXIQ4B.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BOGRY7M6.js → chunk-YHDCGUIW.js} +10 -10
- package/dist/cli-bundle/focused-chunks/{chunk-K37BB4JL.js → chunk-YLPZHWX7.js} +2 -2
- package/dist/cli-bundle/main.js +13 -13
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +28 -28
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +1 -1
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +1 -1
- package/dist/core/extensions/activation-summary.d.ts +4 -0
- package/dist/core/extensions/activation-summary.js +5 -2
- package/dist/core/extensions/contribution-inventory.d.ts +1 -0
- package/dist/core/extensions/contribution-inventory.js +35 -2
- package/dist/core/extensions/extension-hook-runtime.js +5 -3
- package/dist/core/extensions/extension-types.d.ts +18 -1
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/loader.js +8 -13
- package/dist/core/extensions/preflight-ownership.d.ts +5 -0
- package/dist/core/extensions/preflight-ownership.js +42 -0
- package/dist/core/item/item-format.js +14 -20
- package/dist/core/shared/constants.js +3 -2
- package/dist/core/store/item-store.js +2 -2
- package/dist/core/store/settings.js +2 -2
- package/dist/mcp/server.js +12 -6
- package/dist/mcp/tool-definitions.js +14 -7
- package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +18 -18
- package/dist/sdk/cli-contracts/agent-output-contracts.js +51 -23
- package/dist/sdk/cli-contracts/commander-mutation-options.js +26 -2
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +4 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +34 -2
- package/dist/sdk/cli-contracts/registration-helpers.js +4 -2
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +10 -2
- package/dist/sdk/cli-contracts/runtime-contracts.js +21 -5
- package/dist/sdk/cli-contracts/tool-schema.js +4 -2
- package/dist/sdk/cli-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts.js +4 -4
- package/dist/sdk/cli-program.js +3 -3
- package/dist/sdk/compose.d.ts +2 -2
- package/dist/sdk/compose.js +7 -2
- package/dist/sdk/contracts.d.ts +1 -0
- package/dist/sdk/contracts.js +3 -2
- package/dist/sdk/define.d.ts +3 -1
- package/dist/sdk/define.js +3 -8
- package/dist/sdk/dependency-provenance.d.ts +2 -0
- package/dist/sdk/dependency-provenance.js +7 -3
- package/dist/sdk/error-code-catalog.d.ts +23 -0
- package/dist/sdk/error-code-catalog.js +25 -5
- package/dist/sdk/extension/install-sources.d.ts +43 -5
- package/dist/sdk/extension/install-sources.js +36 -2
- package/dist/sdk/extension/migrations.d.ts +114 -0
- package/dist/sdk/extension/migrations.js +175 -0
- package/dist/sdk/extension/scaffold.js +14 -9
- package/dist/sdk/extension/source-resolution.d.ts +50 -0
- package/dist/sdk/extension/source-resolution.js +66 -0
- package/dist/sdk/extension.d.ts +5 -1
- package/dist/sdk/extension.js +24 -26
- package/dist/sdk/generated-error-code-catalog.js +499 -3
- package/dist/sdk/governance/health.js +11 -2
- package/dist/sdk/graph/governance.js +3 -3
- package/dist/sdk/graph/remediation.js +3 -3
- package/dist/sdk/graph/run.js +4 -8
- package/dist/sdk/index.d.ts +7 -2
- package/dist/sdk/index.js +9 -4
- package/dist/sdk/item-transaction.d.ts +51 -6
- package/dist/sdk/item-transaction.js +132 -22
- package/dist/sdk/lifecycle/create.d.ts +4 -0
- package/dist/sdk/lifecycle/create.js +26 -10
- package/dist/sdk/lifecycle-policy.d.ts +9 -0
- package/dist/sdk/lifecycle-policy.js +22 -9
- package/dist/sdk/merge/driver.js +6 -3
- package/dist/sdk/output-contracts.d.ts +67 -0
- package/dist/sdk/output-contracts.js +173 -0
- package/dist/sdk/package-import-adapters.js +2 -2
- package/dist/sdk/package-migrations.d.ts +10 -0
- package/dist/sdk/package-migrations.js +21 -0
- package/dist/sdk/runtime.d.ts +2 -0
- package/dist/sdk/runtime.js +6 -2
- package/dist/sdk/structured-mutations.d.ts +23 -0
- package/dist/sdk/structured-mutations.js +219 -10
- package/dist/sdk/workspace-snapshot.js +58 -12
- package/dist/sdk/workspace.js +30 -4
- package/docs/COMMANDS.md +49 -10
- package/docs/EXTENSIONS.md +3 -3
- package/docs/EXTENSION_LIFECYCLE.md +46 -0
- package/docs/MERGE_SAFETY.md +2 -0
- package/docs/PR_REVIEW_LOOP.md +10 -4
- package/docs/README.md +23 -22
- package/docs/RELEASING.md +36 -23
- package/docs/SCRIPTING.md +32 -9
- package/docs/SDK.md +122 -14
- package/docs/SELF_DESCRIBING_CONTEXT_CONTRACTS.md +13 -0
- package/docs/TESTING.md +25 -0
- package/docs/examples/sdk-contract-consumer/README.md +11 -1
- package/docs/examples/sdk-contract-consumer/package.json +2 -1
- package/docs/examples/sdk-contract-consumer/parse-receipt.mjs +22 -0
- package/marketplace.json +2 -2
- package/package.json +5 -4
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/sdk/public-surface.json +508 -32
- package/dist/cli-bundle/chunks/append-DHBRLHHS.js +0 -2
- package/dist/cli-bundle/chunks/chunk-2INN52SU.js +0 -8
- package/dist/cli-bundle/chunks/chunk-377OOXUF.js +0 -55
- package/dist/cli-bundle/chunks/chunk-6RSK4IFN.js +0 -20
- package/dist/cli-bundle/chunks/chunk-ASJJKA57.js +0 -2
- package/dist/cli-bundle/chunks/chunk-IYAVULRN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-JDPKBV5P.js +0 -2
- package/dist/cli-bundle/chunks/chunk-RRQBHQOV.js +0 -2
- package/dist/cli-bundle/chunks/chunk-SULWTPQO.js +0 -8
- package/dist/cli-bundle/chunks/chunk-V5K52PYW.js +0 -164
- package/dist/cli-bundle/chunks/chunk-XBLOD5TZ.js +0 -2
- package/dist/cli-bundle/chunks/close-VLHNN6YB.js +0 -2
- package/dist/cli-bundle/chunks/close-many-LSJNZKU6.js +0 -2
- package/dist/cli-bundle/chunks/comments-AAIA6A6X.js +0 -2
- package/dist/cli-bundle/chunks/copy-Z7YMLEHN.js +0 -2
- package/dist/cli-bundle/chunks/delete-KNOHHQJM.js +0 -2
- package/dist/cli-bundle/chunks/focus-LFRCGALV.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-GU3DCECN.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-PTWH727R.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-KWV6UD77.js +0 -2
- package/dist/cli-bundle/chunks/restore-4HZSLILR.js +0 -2
- package/dist/cli-bundle/chunks/update-E6LPS5IV.js +0 -2
- package/dist/cli-bundle/chunks/update-many-OSIC6KRO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2VIIXOAD.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5MTKO7TV.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-6GIZK7VQ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-AOP2WIZZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-C2QSL62X.js +0 -28
- package/dist/cli-bundle/focused-chunks/chunk-CL75YW32.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-E7OFMWGT.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-I5F5UK3Q.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-QM2BIVK7.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-T5TSY36R.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-VT6BF2IX.js +0 -2
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Extension Lifecycle Contracts
|
|
2
|
+
|
|
3
|
+
Tracked by [pm-ig5cfe](../.agents/pm/issues/pm-ig5cfe.toon),
|
|
4
|
+
[pm-495lkc](../.agents/pm/issues/pm-495lkc.toon), and
|
|
5
|
+
[pm-miy5k6](../.agents/pm/issues/pm-miy5k6.toon).
|
|
6
|
+
|
|
7
|
+
## Explicit Install-Source Identity
|
|
8
|
+
|
|
9
|
+
A bare target may name both a bundled alias and an already-installed npm
|
|
10
|
+
package. pm preserves the bundled-first compatibility rule but never hides the
|
|
11
|
+
choice. Install results include `source_resolution` with the selected source,
|
|
12
|
+
an `ambiguous` indicator, every matching candidate, and an explicit command for
|
|
13
|
+
each. Use `pm install npm:<package>` to force npm identity or the reported bare
|
|
14
|
+
alias command to force the bundled package. Install-all results carry the same
|
|
15
|
+
receipt on every package row.
|
|
16
|
+
|
|
17
|
+
## Durable Extension Migrations
|
|
18
|
+
|
|
19
|
+
Active packages register schema migrations through `api.registerMigration`.
|
|
20
|
+
Runtime preflight applies runnable migrations, and operators can plan or apply
|
|
21
|
+
the same registrations explicitly:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pm package migrate --project --dry-run --json
|
|
25
|
+
pm package migrate --project --json
|
|
26
|
+
pm health --check-only --json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`pm extension migrate` is the compatibility spelling. The SDK exposes
|
|
30
|
+
`runExtensionMigrations`, `PmClient.packageMigrate`, and the one-shot
|
|
31
|
+
`packageMigrate`/`extensionMigrate` helpers. Dry-run never invokes package code
|
|
32
|
+
or writes state. Apply records deterministic per-migration receipts in
|
|
33
|
+
`.agents/pm/extension-migrations.json` through workspace history. Successful
|
|
34
|
+
migrations become idempotent `skipped` rows in later processes. Failures retain
|
|
35
|
+
their error for health diagnostics and are retried on the next apply. Project
|
|
36
|
+
scope includes active project and global packages because both affect that
|
|
37
|
+
workspace; `--global` restricts execution to global registrations.
|
|
38
|
+
|
|
39
|
+
## Scoped Preflight Ownership
|
|
40
|
+
|
|
41
|
+
`definePreflightOverride` and `api.registerPreflight` accept
|
|
42
|
+
`{ commands, run }`. Command paths are normalized, disjoint registrations
|
|
43
|
+
compose without warnings, and runtime invokes only the matching owner. Empty or
|
|
44
|
+
omitted command ownership retains the legacy global behavior and collides with
|
|
45
|
+
every other override. Activation summaries and persisted contribution
|
|
46
|
+
inventories expose `preflight_ownership` for static doctor and tooling output.
|
package/docs/MERGE_SAFETY.md
CHANGED
|
@@ -63,6 +63,8 @@ pm merge install --dry-run --json
|
|
|
63
63
|
|
|
64
64
|
When both sides change the same scalar or JSON leaf differently, the driver writes a parseable preferred-side result but exits nonzero. Git keeps the path conflicted so a human or coordinating agent must review the losing value and explicitly `git add` the resolution. Use `--prefer theirs` only when that is the intended resolution policy.
|
|
65
65
|
|
|
66
|
+
The driver result's `guidance` always points unresolved conflicts to `pm merge report`. When a clone-local receipt exists, guidance includes its privacy-safe receipt and item ids for exact correlation; discarded values remain confined to the local receipt and never appear in generic logs or tracker history. Tracked by [pm-fbrz7p](../.agents/pm/issues/pm-fbrz7p.toon).
|
|
67
|
+
|
|
66
68
|
For item conflicts, the driver also writes a clone-local receipt below the Git
|
|
67
69
|
directory. It contains retained and discarded values so recovery does not
|
|
68
70
|
depend on a reflog. Raw values never enter public tracker history:
|
package/docs/PR_REVIEW_LOOP.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Pull Request Review Loop
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Trackers: [pm-hq28](../.agents/pm/tasks/pm-hq28.toon), [pm-cp5pbo](../.agents/pm/tasks/pm-cp5pbo.toon)
|
|
4
4
|
|
|
5
5
|
Use `scripts/reviews/pr-review-loop.mjs` to inventory every GitHub pull-request
|
|
6
6
|
conversation surface before deciding that review is complete. The inventory includes
|
|
@@ -11,6 +11,7 @@ reaction state, thread resolution, outdated markers, and the reviewed head SHA.
|
|
|
11
11
|
node scripts/reviews/pr-review-loop.mjs inventory --pr 123 > /tmp/pr-123-review-inventory.json
|
|
12
12
|
node scripts/reviews/pr-review-loop.mjs watch --pr 123 --interval 30 > /tmp/pr-123-review-inventory.json
|
|
13
13
|
node scripts/reviews/pr-review-loop.mjs react --node-id IC_kw... --reaction THUMBS_UP
|
|
14
|
+
node scripts/reviews/pr-review-loop.mjs acknowledge --pr 123 --node-id PRR_kw... --reaction THUMBS_UP --body "CodeRabbit feedback implemented: https://github.com/owner/repo/pull/123#pullrequestreview-456. The suggested edge case is covered by test X."
|
|
14
15
|
node scripts/reviews/pr-review-loop.mjs reply-inline --pr 123 --comment-id 456 --body "Addressed in abc123."
|
|
15
16
|
node scripts/reviews/pr-review-loop.mjs acknowledge-inline --pr 123 --comment-id 456 --node-id PRRC_kw... --reaction THUMBS_UP --body "Addressed in abc123."
|
|
16
17
|
```
|
|
@@ -18,9 +19,14 @@ node scripts/reviews/pr-review-loop.mjs acknowledge-inline --pr 123 --comment-id
|
|
|
18
19
|
Choose `THUMBS_UP` when feedback is useful or correct and `THUMBS_DOWN` when a
|
|
19
20
|
finding is materially incorrect. Use `acknowledge-inline` so the reaction and
|
|
20
21
|
explanation land on the actual review comment and its thread. GitHub does not expose
|
|
21
|
-
a reply thread for top-level PR conversation comments or submitted review summaries
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
a reply thread for top-level PR conversation comments or submitted review summaries.
|
|
23
|
+
Use `acknowledge` for those surfaces: its PR comment must identify the bot, link the
|
|
24
|
+
exact GitHub artifact, and explain whether the feedback was implemented or declined.
|
|
25
|
+
That keeps the response auditable without pretending GitHub created a direct thread.
|
|
26
|
+
The command adds a hidden artifact marker and reuses an existing marked comment on
|
|
27
|
+
retry, so a lost response cannot create duplicate acknowledgements. It reports a
|
|
28
|
+
partial result and exits unsuccessfully when either the comment or reaction write
|
|
29
|
+
fails, allowing the missing write to be retried safely.
|
|
24
30
|
|
|
25
31
|
After every push or reviewer retrigger, run `watch`. It delegates waiting to
|
|
26
32
|
`gh pr checks --watch`, because reviewer agents report completion through GitHub
|
package/docs/README.md
CHANGED
|
@@ -17,17 +17,17 @@ pm guide release --json
|
|
|
17
17
|
|
|
18
18
|
## Read Path
|
|
19
19
|
|
|
20
|
-
| Reader
|
|
21
|
-
|
|
22
|
-
| New user
|
|
23
|
-
| New maintainer
|
|
24
|
-
| Coding agent
|
|
25
|
-
| Maintainer
|
|
26
|
-
| Package author
|
|
27
|
-
| Codex or ChatGPT plugin implementer | [Codex Plugin](CODEX_PLUGIN.md)
|
|
28
|
-
| Codex user
|
|
29
|
-
| Claude Code user
|
|
30
|
-
| Machine client
|
|
20
|
+
| Reader | First page | Then read |
|
|
21
|
+
| ----------------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
22
|
+
| New user | [Quickstart](QUICKSTART.md) | [Command Reference](COMMANDS.md) |
|
|
23
|
+
| New maintainer | [Onboarding](ONBOARDING.md) | [Agent Guide](AGENT_GUIDE.md), [Testing](TESTING.md), [Releasing](RELEASING.md) |
|
|
24
|
+
| Coding agent | [Agent Guide](AGENT_GUIDE.md) | [Configuration](CONFIGURATION.md), then command help |
|
|
25
|
+
| Maintainer | [Contributing](../CONTRIBUTING.md) | [Testing](TESTING.md), [Releasing](RELEASING.md), [Architecture](ARCHITECTURE.md) |
|
|
26
|
+
| Package author | [Packages and Extensions](EXTENSIONS.md) | [SDK](SDK.md), [starter extension](examples/starter-extension/README.md) |
|
|
27
|
+
| Codex or ChatGPT plugin implementer | [Codex Plugin](CODEX_PLUGIN.md) | [Native ChatGPT and Codex Plugin Implementation Plan](CHATGPT_CODEX_PLUGIN_IMPLEMENTATION.md) |
|
|
28
|
+
| Codex user | [Codex Plugin](CODEX_PLUGIN.md) | [Agent Guide](AGENT_GUIDE.md), then [Command Reference](COMMANDS.md) |
|
|
29
|
+
| Claude Code user | [Claude Code Plugin](CLAUDE_CODE_PLUGIN.md) | [Agent Guide](AGENT_GUIDE.md), then [Command Reference](COMMANDS.md) |
|
|
30
|
+
| Machine client | `pm contracts --json` | [CLI Scripting Contract](SCRIPTING.md), [Command Reference](COMMANDS.md#machine-contracts), optionally `pm install guide-shell --project && pm guide commands` |
|
|
31
31
|
|
|
32
32
|
## Documentation Map
|
|
33
33
|
|
|
@@ -35,7 +35,7 @@ pm guide release --json
|
|
|
35
35
|
- [Onboarding](ONBOARDING.md) - first-two-hours maintainer and contributor setup.
|
|
36
36
|
- [Agent Guide](AGENT_GUIDE.md) - canonical agent loop, tracker linking, and token-minimal command choices.
|
|
37
37
|
- [Command Reference](COMMANDS.md) - command families with examples and when to use each family.
|
|
38
|
-
- [CLI Scripting Contract](SCRIPTING.md) - exit codes, stdout/stderr boundaries, stable JSON fields, uniform OR filters, and shell composition recipes.
|
|
38
|
+
- [CLI Scripting Contract](SCRIPTING.md) - exit codes, flat mutation receipts versus read envelopes, stdout/stderr boundaries, stable JSON fields, uniform OR filters, and shell composition recipes.
|
|
39
39
|
- [Configuration](CONFIGURATION.md) - settings, storage formats, output, search, validation, and environment variables.
|
|
40
40
|
- [Testing](TESTING.md) - sandbox-safe local tests and linked-test orchestration.
|
|
41
41
|
- [Security Governance](SECURITY_GOVERNANCE.md) - vulnerability reporting, review discipline, property fuzzing, and OpenSSF limitations.
|
|
@@ -59,6 +59,7 @@ pm guide release --json
|
|
|
59
59
|
- [Portable Corpus Shapes](CORPUS_SHAPES.md) - versioned SDK populations for realistic benchmarks, evaluations, and package tests.
|
|
60
60
|
- [Agent UX Contracts](AGENT_UX_CONTRACTS.md) - ordering-cycle advisories, graph count units, collision safety, compact context, ownership wording, and recovery behavior.
|
|
61
61
|
- [Packages and Extensions](EXTENSIONS.md) - package install workflows, runtime extension lifecycle, and API reference.
|
|
62
|
+
- [Extension Lifecycle Contracts](EXTENSION_LIFECYCLE.md) - source identity, durable migrations, and scoped preflight ownership.
|
|
62
63
|
- [Extension Author Contracts](EXTENSION_AUTHOR_CONTRACTS.md) - the stability guarantees and contract surface package authors build against.
|
|
63
64
|
- [SDK](SDK.md) - public import surfaces and typed authoring examples.
|
|
64
65
|
- [Multi-Branch Merge Safety](MERGE_SAFETY.md) - semantic tracker merge drivers, post-merge integrity gates, delete/modify policy, and recovery-receipt retention.
|
|
@@ -72,16 +73,16 @@ pm guide release --json
|
|
|
72
73
|
|
|
73
74
|
## Guide Topic Map
|
|
74
75
|
|
|
75
|
-
| Optional `pm guide` topic | Primary docs
|
|
76
|
-
|
|
77
|
-
| `quickstart`
|
|
78
|
-
| `commands`
|
|
79
|
-
| `workflows`
|
|
80
|
-
| `sdk`
|
|
81
|
-
| `extensions`, `packages`
|
|
82
|
-
| `skills`
|
|
83
|
-
| `harnesses`
|
|
84
|
-
| `release`
|
|
76
|
+
| Optional `pm guide` topic | Primary docs |
|
|
77
|
+
| ------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
78
|
+
| `quickstart` | [Quickstart](QUICKSTART.md), [Command Reference](COMMANDS.md) |
|
|
79
|
+
| `commands` | [Command Reference](COMMANDS.md), [Configuration](CONFIGURATION.md) |
|
|
80
|
+
| `workflows` | [Agent Guide](AGENT_GUIDE.md), [Testing](TESTING.md) |
|
|
81
|
+
| `sdk` | [SDK](SDK.md), [Architecture](ARCHITECTURE.md) |
|
|
82
|
+
| `extensions`, `packages` | [Packages and Extensions](EXTENSIONS.md), [starter extension](examples/starter-extension/README.md) |
|
|
83
|
+
| `skills` | [Agent Guide](AGENT_GUIDE.md) plus `.agents/skills/*` |
|
|
84
|
+
| `harnesses` | [Agent Guide](AGENT_GUIDE.md) plus `.agents/skills/HARNESS_COMPATIBILITY.md` |
|
|
85
|
+
| `release` | [Releasing](RELEASING.md), [CHANGELOG](../CHANGELOG.md) |
|
|
85
86
|
|
|
86
87
|
Community files:
|
|
87
88
|
|
package/docs/RELEASING.md
CHANGED
|
@@ -20,7 +20,8 @@ Tracked documentation work: [pm-u9d0](../.agents/pm/epics/pm-u9d0.toon),
|
|
|
20
20
|
[pm-4s24d2](../.agents/pm/issues/pm-4s24d2.toon),
|
|
21
21
|
[pm-39cqqx](../.agents/pm/tasks/pm-39cqqx.toon), stable peer compatibility
|
|
22
22
|
[pm-csuce0](../.agents/pm/issues/pm-csuce0.toon), and artifact budgets
|
|
23
|
-
[pm-998juj](../.agents/pm/tasks/pm-998juj.toon)
|
|
23
|
+
[pm-998juj](../.agents/pm/tasks/pm-998juj.toon), plus exact-tag recovery
|
|
24
|
+
[pm-lwnifd](../.agents/pm/issues/pm-lwnifd.toon).
|
|
24
25
|
|
|
25
26
|
## Version Policy
|
|
26
27
|
|
|
@@ -66,7 +67,7 @@ pnpm version:check
|
|
|
66
67
|
Policy:
|
|
67
68
|
|
|
68
69
|
- release only when commits exist after the latest release tag
|
|
69
|
-
- ignore
|
|
70
|
+
- ignore tracker-governance-only commits for publish eligibility: `.agents/pm/**` and the mechanically generated `CHANGELOG.md` projection do not create a package release by themselves, while any product, test, documentation, workflow, or other changed path remains release-relevant
|
|
70
71
|
- create at most one production tag and npm version per UTC day; if no tag was
|
|
71
72
|
created, a non-`github-actions[bot]` closure of the exact bot-created
|
|
72
73
|
`Auto Release blocked` issue on the same UTC day triggers one preparation
|
|
@@ -103,7 +104,7 @@ The pipeline performs:
|
|
|
103
104
|
2. a single `YYYY.M.D` version bump; ordinal targets and the removed
|
|
104
105
|
`--allow-same-day-release` override fail closed
|
|
105
106
|
3. latest `pm-changelog` install and main changelog refresh through package-owned full-history generation; the release pipeline passes `--release-version` with `--all-release-tags` so the pending release section matches post-tag CI checks
|
|
106
|
-
4. strict gates (
|
|
107
|
+
4. build, clone-local merge-driver installation, then the remaining strict gates (typecheck, docs/skills freshness, coverage, static quality, compatibility, security, smoke checks, reliability gate); this ordering makes the checkout-owned CLI available before bootstrap, matches CI, and prevents fresh-clone tracker measurements from observing undeclared merge-driver repairs
|
|
107
108
|
5. release note generation from changelog + pm evidence
|
|
108
109
|
6. commit and tag creation (plus optional push)
|
|
109
110
|
|
|
@@ -232,11 +233,14 @@ git push origin v<version>
|
|
|
232
233
|
`.github/workflows/release.yml` runs on `v*.*.*` tags and handles:
|
|
233
234
|
|
|
234
235
|
- full-history checkout
|
|
235
|
-
- manual `workflow_dispatch` by tag for recovery
|
|
236
|
+
- manual `workflow_dispatch` by tag for recovery. An authenticated exact-version probe keeps already-published access recovery on the reviewed dispatch-time `main` source; when the immutable tag exists but npm publication never completed, recovery checks out that exact tagged source and retains the original version guard
|
|
236
237
|
- pnpm install with frozen lockfile
|
|
237
238
|
- version policy and tag guard
|
|
238
239
|
- secret scan
|
|
239
|
-
- build, typecheck, test, and coverage
|
|
240
|
+
- build, clone-local merge-driver installation, typecheck, test, and coverage
|
|
241
|
+
- generated changelog verification and `pm-changelog` installation before the
|
|
242
|
+
tracker-bearing static gate, so a clean checkout does not misclassify the
|
|
243
|
+
managed extension's linked files as missing
|
|
240
244
|
- static quality gate (shared complexity, duplication, dead/orphan module, file/folder hygiene, source/exported docstring coverage profile)
|
|
241
245
|
- temporary-project compatibility gate against latest published tracker data
|
|
242
246
|
- reliability threshold gate (Sentry severity threshold, bounded to a recent-activity window via `--sentry-window-days` (default `14`, `0` = unbounded) so a stale benign unresolved issue cannot block every scheduled release; `--telemetry-mode` gate policy: `off` | `best-effort` | `required`). Scheduled `auto-release.yml` failures open/update an `Auto Release blocked` GitHub issue so blocked daily releases are never silently skipped.
|
|
@@ -248,7 +252,10 @@ git push origin v<version>
|
|
|
248
252
|
- `npm publish --access public --provenance --tag latest`, skipped on retry
|
|
249
253
|
only when the exact version is anonymously visible from a fresh npm cache.
|
|
250
254
|
If the package is public but the target version is absent, the workflow
|
|
251
|
-
publishes immediately without attempting a package-access mutation.
|
|
255
|
+
publishes immediately without attempting a package-access mutation. A
|
|
256
|
+
dispatch may do so only when its source-selection preflight pinned the
|
|
257
|
+
checkout to the requested immutable tag; reviewed-main recovery continues
|
|
258
|
+
to refuse publication of a missing target. Only
|
|
252
259
|
when neither the target nor package metadata is anonymously visible does the
|
|
253
260
|
same-tag recovery path attempt to restore public package access, because a
|
|
254
261
|
hidden version can also return 404 to authenticated metadata reads. After a
|
|
@@ -272,7 +279,7 @@ git push origin v<version>
|
|
|
272
279
|
`scripts/release/verify-installed-agent-session.mjs`. Separate npm and Bun
|
|
273
280
|
install roots must contain the resolved executable, then each drives the
|
|
274
281
|
cold-start `init -> context -> create -> claim -> annotate -> files -> close
|
|
275
|
-
|
|
282
|
+
-> validate -> get -> context` loop. The structured report identifies the
|
|
276
283
|
failing step and records per-step output ceilings and estimated token cost.
|
|
277
284
|
- GitHub Release creation
|
|
278
285
|
- GitHub Release metadata verification through the same local verification script
|
|
@@ -312,32 +319,38 @@ Use the npm registry package for maintainer global updates. Do not use `npm inst
|
|
|
312
319
|
ordinal recovery version. Rerun `.github/workflows/release.yml` with
|
|
313
320
|
`workflow_dispatch` and `tag=v<version>` (or close the current bot-created
|
|
314
321
|
blocker once to trigger the guarded exact-run recovery). The workflow skips
|
|
315
|
-
duplicate npm publication for an anonymously visible version
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
immutable
|
|
322
|
+
duplicate npm publication for an anonymously visible version. Before
|
|
323
|
+
installing or running gates, dispatch performs an authenticated exact-version
|
|
324
|
+
probe. An
|
|
325
|
+
existing version keeps the reviewed dispatch-time `main` source and cannot
|
|
326
|
+
be republished. A definitive missing-version response pins the checkout to
|
|
327
|
+
the existing immutable tag, reapplies the version guard, installs the managed
|
|
328
|
+
changelog extension before tracker measurement, and permits first publication
|
|
329
|
+
only from that exact tagged source. Other registry failures stop before
|
|
330
|
+
source selection or publication.
|
|
321
331
|
- If an immutable published package contains a defect that cannot be repaired
|
|
322
332
|
by rerunning the same tag workflow, document the incident and ship the code
|
|
323
333
|
fix in the next UTC day's release.
|
|
324
|
-
- A manual exact-tag `workflow_dispatch` recovery
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
334
|
+
- A manual exact-tag `workflow_dispatch` recovery uses isolated anonymous
|
|
335
|
+
registry probes before any account-level access mutation. A visible package
|
|
336
|
+
with a missing target version proceeds directly to exact-tag publication, so
|
|
337
|
+
a publish-capable automation token is not required to change package access.
|
|
338
|
+
Access recovery is reserved for the ambiguous case where neither the package
|
|
339
|
+
nor target version is anonymously visible. An already-visible immutable
|
|
340
|
+
version is still verified and never republished. Recovery starts from the
|
|
328
341
|
dispatch-time commit SHA and fails unless the dispatch ref is the repository
|
|
329
|
-
default branch (`main`)
|
|
330
|
-
version
|
|
331
|
-
the
|
|
332
|
-
|
|
333
|
-
|
|
342
|
+
default branch (`main`). It remains on that reviewed source when the exact
|
|
343
|
+
npm version exists. When the version is definitively absent, it switches to
|
|
344
|
+
the resolved commit behind `RELEASE_TAG`, requires `package.json` to match the
|
|
345
|
+
tag, installs the clone-local merge driver and managed changelog extension,
|
|
346
|
+
and may publish that exact source after every gate passes.
|
|
334
347
|
- Record failure evidence and remediation in the release `pm` item.
|
|
335
348
|
|
|
336
349
|
### Silent skip debugging
|
|
337
350
|
|
|
338
351
|
When auto-release exits green but does not cut a version, inspect the pipeline's JSON skip `reason` from `scripts/release/run-release-pipeline.mjs` (or rerun locally with `pnpm release:pipeline:dry-run -- --json`):
|
|
339
352
|
|
|
340
|
-
- tracker-only skip family: `tracker_only_changes_since_last_tag` (all changed paths are `.agents/pm`
|
|
353
|
+
- tracker-only skip family: `tracker_only_changes_since_last_tag` (all changed paths are `.agents/pm/**` and/or the generated `CHANGELOG.md` projection; a product-visible path is the required negative control)
|
|
341
354
|
- changelog-empty skip family: `empty_generated_changelog_section_for_target_version` (generated release section exists but has no non-empty entries)
|
|
342
355
|
|
|
343
356
|
`pm-changelog` is maintained in a separate repository/package. Classifier or release-window bugs must be fixed and released there first, then consumed here via the latest npm package (`pm install npm:pm-changelog --project`) before rerunning release generation.
|
package/docs/SCRIPTING.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# CLI Scripting Contract
|
|
2
2
|
|
|
3
|
-
Tracked by [pm-psy1](../.agents/pm/tasks/pm-psy1.toon), [pm-gknu](../.agents/pm/issues/pm-gknu.toon),
|
|
3
|
+
Tracked by [pm-psy1](../.agents/pm/tasks/pm-psy1.toon), [pm-gknu](../.agents/pm/issues/pm-gknu.toon), [pm-999jh7](../.agents/pm/issues/pm-999jh7.toon), and [pm-srns](../.agents/pm/issues/pm-srns.toon).
|
|
4
4
|
|
|
5
5
|
Use this contract when composing `pm` with shells, CI runners, `jq`, or another process. Exact flags remain discoverable from `pm <command> --help --json` and `pm contracts --command <command> --flags-only --json`.
|
|
6
6
|
|
|
7
7
|
## Process Contract
|
|
8
8
|
|
|
9
|
-
| Exit | Meaning
|
|
10
|
-
|
|
11
|
-
| `0`
|
|
12
|
-
| `1`
|
|
13
|
-
| `2`
|
|
14
|
-
| `3`
|
|
15
|
-
| `4`
|
|
16
|
-
| `5`
|
|
9
|
+
| Exit | Meaning | Script response |
|
|
10
|
+
| ---- | -------------------------------------------------------------------------------- | ---------------------------------------------------- |
|
|
11
|
+
| `0` | The requested operation completed. A successful read may still return zero rows. | Parse stdout. |
|
|
12
|
+
| `1` | Runtime or unexpected failure. | Preserve stderr and stop. |
|
|
13
|
+
| `2` | Invalid flags, values, or command composition. | Correct the invocation; do not retry unchanged. |
|
|
14
|
+
| `3` | Requested tracker or resource was not found. | Correct the path or ID. |
|
|
15
|
+
| `4` | State or concurrency conflict. | Refresh live state before deciding whether to retry. |
|
|
16
|
+
| `5` | A required dependency operation failed. | Inspect the dependency evidence before retrying. |
|
|
17
17
|
|
|
18
18
|
Successful structured results are written to stdout. Diagnostics, warnings, profiles, and errors are written to stderr so `--json`, `--format ndjson`, CSV, and table stdout remain pipe-safe. Never merge stderr into stdout before parsing structured output.
|
|
19
19
|
|
|
@@ -29,6 +29,29 @@ fi
|
|
|
29
29
|
|
|
30
30
|
## Stable Structured Fields
|
|
31
31
|
|
|
32
|
+
Mutation and read envelopes are intentionally different. Single-item mutation
|
|
33
|
+
commands emit a flat receipt whose `id`, `status`, and `changed_field_count`
|
|
34
|
+
are top-level fields. Reads wrap their primary entity or rows under documented
|
|
35
|
+
keys such as `item` or `items`. Bulk mutations such as `close-many` and
|
|
36
|
+
`update-many` use collection envelopes under `rows`; consult
|
|
37
|
+
`command_output_contracts` for the exact command path. Never infer one shape
|
|
38
|
+
from another.
|
|
39
|
+
|
|
40
|
+
TypeScript package consumers should parse mutation stdout with the SDK boundary
|
|
41
|
+
helper so a wrapped or malformed result fails loudly:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { parseMutationReceipt } from "@unbrained/pm-cli/sdk/contracts";
|
|
45
|
+
|
|
46
|
+
const { id, status, changedFieldCount } = parseMutationReceipt(stdout);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`pm contracts --summary --json` keeps bootstrap discovery compact while
|
|
50
|
+
declaring every command's default token ceiling. Use `pm contracts --full
|
|
51
|
+
--json` for `command_output_contracts`, which pairs the envelope declaration
|
|
52
|
+
with TOON- and JSON-specific token ceilings for every active core or package
|
|
53
|
+
command.
|
|
54
|
+
|
|
32
55
|
JSON object field order is not an API. Consume fields by name. Read envelopes keep the stable pagination vocabulary `items`, `count`, `total`, `has_more`, and, when another page exists, `next_cursor`. The `filters` object echoes the effective query scope. Plain `pm list` and `pm search` are all-status reads and disclose `filters.status: "all"`; lifecycle-specific commands such as `pm list-open` remain explicit shortcuts.
|
|
33
56
|
|
|
34
57
|
Projection flags intentionally change row shape. Use `--fields` when a script requires an exact subset, `--brief` or `--compact` only when the documented sparse shape is sufficient, and `--full` when linked metadata is required. Check `row_contract` on generic read surfaces that expose one; do not infer omitted fields as empty values.
|
package/docs/SDK.md
CHANGED
|
@@ -30,6 +30,11 @@ content-addressed snapshots are tracked by
|
|
|
30
30
|
[pm-dkrmzv](../.agents/pm/features/pm-dkrmzv.toon); see
|
|
31
31
|
[Reproducible Workspaces and Snapshots](REPRODUCIBLE_WORKSPACES.md).
|
|
32
32
|
|
|
33
|
+
Extension migration receipts, install-source identity, and scoped preflight
|
|
34
|
+
ownership are tracked by [pm-ig5cfe](../.agents/pm/issues/pm-ig5cfe.toon),
|
|
35
|
+
[pm-495lkc](../.agents/pm/issues/pm-495lkc.toon), and
|
|
36
|
+
[pm-miy5k6](../.agents/pm/issues/pm-miy5k6.toon).
|
|
37
|
+
|
|
33
38
|
Use it for extension authoring, package authoring, command/action contract discovery, and deterministic app or CI automation. Do not import private `src/core/...` modules from external integrations or packages.
|
|
34
39
|
|
|
35
40
|
## Install
|
|
@@ -290,7 +295,8 @@ Command/action contract exports:
|
|
|
290
295
|
- Relationship graph primitives: `RelationshipKindRegistry`, `createRelationshipKindRegistry`, `assertRelationshipEdgeAllowed`, `RelationshipGraph`, `RelationshipEventLog`, `RelationshipEventStore`, `planRelationshipEventBackfill`, `buildRelationshipContext`, `buildDepsRelationshipContext`, `hierarchyAncestors`, `hierarchyDescendants`, `orderingPredecessors`, `orderingSuccessors`, `enumerateRelationshipPaths`, `auditWorkspaceRelationshipGraph`, `isOrderingRelationshipKind`, and `dependencyToRelationship` provide application-defined edge semantics, durable replay, deterministic legacy migration, bounded semantic traversal, policy-aware governance, and explainable context queries. Mutation adapters should call `assertRelationshipEdgeAllowed` with the active registry before persistence; it resolves aliases and honors custom `allowSelf` definitions while built-in self edges fail before item or history writes. `RelationshipEventLog.stream/project` and their durable-store equivalents page immutable prefixes and fold them into deterministic application state with exact version, processed-count, and as-of metadata. `RelationshipEventStore.appendBatch` validates a complete import under one cross-process lock and atomically publishes it; `skip_identical` resume mode rejects same-id semantic collisions. `RelationshipGraphAdapter`, `createRelationshipGraphSnapshot`, `syncRelationshipGraphAdapter`, `loadRelationshipGraphAdapter`, and `federateRelationshipGraphSnapshots` form the backend-neutral content-addressed projection boundary for database or remote graph packages. `MemoryRelationshipGraphAdapter`, `assertRelationshipGraphAdapterConformance`, and `createRelationshipGraphScaleFixture` give package authors a reference implementation, reusable compatibility contract, and lazy deterministic fixtures through one million nodes. See [Relationship graph semantics](RELATIONSHIP_GRAPH.md).
|
|
291
296
|
- Atomic application transactions: `commitWorkspaceTransaction` coordinates ordered, idempotent item and relationship mutations under one workspace writer lock and a durable replay journal. Interrupted work resumes from step inspection; ordinary failures append reverse-order compensations without rewriting immutable histories.
|
|
292
297
|
- Multi-branch merge primitives: `mergeItemDocuments`, `mergeHistoryStreams`, `mergeRelationshipEventStreams`, `mergeJsonDocuments`, `runMergeDriver`, `runMergeInstall`, and `runMergeReconcile` provide the same field-aware item, hash-chain-preserving history, sequence-renumbering relationship-event, key-level configuration, and audited post-merge repair-and-verify semantics as `pm merge`; `installMergeFence` and `findGitWorkspaceRoot` let custom init hosts install the same contract with explicit roots, while `buildMergeAttributePatterns`, `refreshMergeAttributeFenceIfInstalled`, and `auditMergeAttributeFence` expose fence coverage, refresh, and validation. See [Multi-Branch Merge Safety](MERGE_SAFETY.md).
|
|
293
|
-
- Dependency provenance primitives: `EXTERNAL_DEPENDENCY_SOURCE_KIND`, `isExternalDependencySourceKind`, and `normalizeDependencySeedId` let custom importers preserve cross-workspace dependency ids explicitly while retaining local prefix normalization for ordinary seeds. Newly created dependency rows also carry the effective `author`, `author_source` (`asserted` or `detected`), and a mutation `source_kind`; legacy rows remain readable without invented provenance.
|
|
298
|
+
- Dependency provenance primitives: `EXTERNAL_DEPENDENCY_SOURCE_KIND`, `EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS`, `isExternalDependencySourceKind`, and `normalizeDependencySeedId` let custom importers preserve cross-workspace dependency ids explicitly while retaining local prefix normalization for ordinary seeds. `source_kind: "external"` is the human-facing alias and persists canonically as `global`; a `blocked_by` row with that provenance is a real external predecessor, so graph governance does not require a fabricated local item or misreport `stale_lifecycle_block`. Newly created dependency rows also carry the effective `author`, `author_source` (`asserted` or `detected`), and a mutation `source_kind`; legacy rows remain readable without invented provenance. Tracked by [pm-6sc8jq](../.agents/pm/issues/pm-6sc8jq.toon).
|
|
299
|
+
- Terminal-create primitive: `CreateCommandOptions.closeReason` and `completedAt` allow importers to create an already-terminal item in the same atomic item/history transaction while preserving the source completion time separately from the local `closed_at` mutation time. The equivalent CLI flags are `--close-reason` and `--completed-at`; direct JSON documents map `close_reason` and `completed_at` to the same SDK operation. A missing governed reason returns `close_reason_required` with same-command `pm create` recovery examples. Tracked by [pm-ykdt4m](../.agents/pm/issues/pm-ykdt4m.toon) and [pm-5uclvd](../.agents/pm/issues/pm-5uclvd.toon).
|
|
294
300
|
- Compile-cache lifecycle primitive: `pruneCompileCacheGenerations` bounds pm-owned Node bytecode caches to the current package generation; embedded hosts can apply the same upgrade cleanup without importing the executable entrypoint.
|
|
295
301
|
- Typed mutation inputs (pm-x29o / GH-601): `PmCreateActionOptions`, `PmUpdateActionOptions`, and `PmCloseActionOptions` (`PmClientCloseActionOptions` on the client method) strip the permissive custom-field index signature from the executable command-option contracts, retaining their exact public keys and value types without a second hand-written shape; the free `create`/`update`/`close` functions and `PmClient` methods share those types. `PmUpdateManyActionOptions`, `PmCloseManyActionOptions`, and `OptionsFromContracts` cover flat action-contract composition. Field typos, object values, invalid scalar kinds, and MCP-only aliases on a `PmClient` command-option bag fail `tsc` under strict. Runtime-schema custom fields use the repeatable `field` option and `PmClient.run` remains the wide escape hatch. Projected list rows expose the typed `ListProjectedItemCore` fields (`row.id` is `string | undefined`, never `unknown`).
|
|
296
302
|
- Typed customization primitives on `PmClient`: `init`, `config`, `schema`, `schemaList`, `schemaShow`, `schemaAddType`, `schemaRemoveType`, `schemaAddStatus`, `schemaRemoveStatus`, `schemaAddField`, `schemaRemoveField`, `schemaListFields`, `schemaShowField`, `schemaApplyPreset`, `schemaInferTypes`, `schemaShowStatus`, `profile`, `profileList`, `profileShow`, `profileApply`, and `profileLint`
|
|
@@ -305,7 +311,7 @@ Command/action contract exports:
|
|
|
305
311
|
- Linked-test authoring primitives: `parseLinkedTestJsonEntries`, the `parseLinkedTest*` field parsers, `LINKED_TEST_PM_CONTEXT_MODE_VALUES`, `LINKED_TEST_PROTECTED_ENV_KEYS`, `classifyLinkedTestFailure`, `countFailureCategories`, and `summarizeContextPreflight` let custom hosts validate, execute, classify, and report linked tests without duplicating CLI policy.
|
|
306
312
|
- Typed plan workflow primitives on `PmClient`: `plan`, `planCreate`, `planShow`, `planAddStep`, `planUpdateStep`, `planCompleteStep`, `planBlockStep`, `planReorderStep`, `planRemoveStep`, `planLink`, `planUnlink`, `planDecision`, `planDiscovery`, `planValidation`, `planResume`, `planApprove`, and `planMaterialize`
|
|
307
313
|
- Plan contracts: `PlanSubcommand`, `PlanCommandOptions`, `PlanCommandResult`, `PlanResultPlan`, `PlanStepSummary`, `PlanShowDepth`, and `PlanTemplateName`
|
|
308
|
-
- Typed package and extension lifecycle primitives on `PmClient`: `extension`, `extensionList`, `extensionActivate`, `extensionDeactivate`, `package`, `packageList`, `packageInstall`, `packageUninstall`, `packageDoctor`, `packageManage`, `packageDescribe`, `packageReload`, `packageCatalog`, `packageActivate`, `packageDeactivate`, and `upgrade`
|
|
314
|
+
- Typed package and extension lifecycle primitives on `PmClient`: `extension`, `extensionList`, `extensionActivate`, `extensionDeactivate`, `package`, `packageList`, `packageInstall`, `packageUninstall`, `packageDoctor`, `packageManage`, `packageDescribe`, `packageReload`, `packageCatalog`, `packageActivate`, `packageDeactivate`, `packageMigrate`, and `upgrade`; one-shot `extensionMigrate` and `packageMigrate` helpers mirror those lifecycle actions.
|
|
309
315
|
- Lifecycle primitive option/result contracts: `ExtensionCommandOptions` / `ExtensionCommandResult`, `PackageCommandOptions` / `PackageCommandResult`, `UpgradeCommandOptions` / `UpgradeResult`
|
|
310
316
|
- `PM_CORE_COMMAND_NAMES`
|
|
311
317
|
- `PM_TOOL_ACTIONS`
|
|
@@ -567,18 +573,20 @@ Tracked by [pm-5t33or](../.agents/pm/features/pm-5t33or.toon),
|
|
|
567
573
|
[pm-gmdzaa](../.agents/pm/issues/pm-gmdzaa.toon), and
|
|
568
574
|
[pm-dpqa3h](../.agents/pm/chores/pm-dpqa3h.toon).
|
|
569
575
|
|
|
570
|
-
`PM_COMMAND_OUTPUT_BUDGET_CONTRACTS` declares
|
|
571
|
-
|
|
576
|
+
`PM_COMMAND_OUTPUT_BUDGET_CONTRACTS` declares generated TOON and JSON
|
|
577
|
+
estimated-token ceilings for every built-in command. Each row also carries its workload class,
|
|
572
578
|
the stable `ceil(UTF-8 bytes / 4)` estimate, whether an explicit unbounded
|
|
573
579
|
request is allowed, and the shared deterministic degradation ladder:
|
|
574
580
|
`full → compact → brief → summary → counts`. These contracts are policy data,
|
|
575
581
|
not renderer-specific code, so package authors can reuse
|
|
576
|
-
`
|
|
582
|
+
`createPmCommandOutputBudget`, `definePmCommandOutputBudget`,
|
|
583
|
+
`resolvePmCommandOutputBudget`, and
|
|
577
584
|
`estimatePmOutputTokens` in custom transports.
|
|
578
585
|
|
|
579
586
|
```ts
|
|
580
587
|
import {
|
|
581
588
|
definePmCommandOutputBudget,
|
|
589
|
+
parseMutationReceipt,
|
|
582
590
|
estimatePmOutputTokens,
|
|
583
591
|
resolvePmCommandOutputBudget,
|
|
584
592
|
} from "@unbraind/pm-cli/sdk/contracts";
|
|
@@ -587,6 +595,7 @@ const compactRead = definePmCommandOutputBudget({
|
|
|
587
595
|
command: "get",
|
|
588
596
|
budget_class: "read",
|
|
589
597
|
default_max_estimated_tokens: 800,
|
|
598
|
+
default_max_estimated_tokens_by_format: { toon: 800, json: 1200 },
|
|
590
599
|
degradation_ladder: ["compact", "summary"],
|
|
591
600
|
allows_unbounded_opt_out: false,
|
|
592
601
|
token_estimate: "ceil(utf8_bytes / 4)",
|
|
@@ -596,8 +605,21 @@ const builtIn = resolvePmCommandOutputBudget("contracts --summary");
|
|
|
596
605
|
const measured = estimatePmOutputTokens(
|
|
597
606
|
new TextEncoder().encode(JSON.stringify(result)).byteLength,
|
|
598
607
|
);
|
|
608
|
+
|
|
609
|
+
const receipt = parseMutationReceipt(mutationStdout);
|
|
610
|
+
// receipt.id and receipt.changedFieldCount are typed; wrapped read envelopes
|
|
611
|
+
// throw instead of silently producing an undefined id.
|
|
599
612
|
```
|
|
600
613
|
|
|
614
|
+
`PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS` and
|
|
615
|
+
`resolvePmCommandOutputEnvelope` declare whether the default structured result
|
|
616
|
+
is a flat mutation receipt, wrapped entity, collection, diagnostic, or stream.
|
|
617
|
+
The contracts command keeps summary bootstrap output compact and publishes
|
|
618
|
+
complete budget/envelope pairs under `command_output_contracts` only in the
|
|
619
|
+
explicit full projection. Active package commands receive deterministic
|
|
620
|
+
fallback contracts, so extension authors can discover a bounded surface before
|
|
621
|
+
they invoke it.
|
|
622
|
+
|
|
601
623
|
`pm activity` applies a compact 20-row default bound; direct SDK calls default
|
|
602
624
|
to five full rows. Results disclose `total_count`, `omitted_count`, `has_more`,
|
|
603
625
|
and `applied_bound`. An explicit `limit` remains authoritative, while
|
|
@@ -816,7 +838,8 @@ lifecycle order to mirror `hook_counts`) of every registered surface's
|
|
|
816
838
|
identifiers — command paths, hook kinds, item-type /
|
|
817
839
|
field names, migration ids, importer / exporter / provider / adapter names,
|
|
818
840
|
overridden service names and renderer formats, flag target-commands, and the
|
|
819
|
-
preflight-override count — plus scoped `
|
|
841
|
+
preflight-override count — plus scoped `preflight_ownership` command rows and
|
|
842
|
+
`renderer_ownership` rows (format,
|
|
820
843
|
normalized commands, and whether a result discriminator exists) and the
|
|
821
844
|
`capabilities` those surfaces exercise. Two
|
|
822
845
|
uses:
|
|
@@ -1053,7 +1076,10 @@ tools that need to own item state without spawning `pm`.
|
|
|
1053
1076
|
Tracked by [pm-4e12](../.agents/pm/features/pm-4e12.toon), with the VCS
|
|
1054
1077
|
acceptance story [pm-8ngt](../.agents/pm/stories/pm-8ngt.toon) and the structured
|
|
1055
1078
|
SDK adapters tracked by [pm-xm7c](../.agents/pm/features/pm-xm7c.toon) and
|
|
1056
|
-
[pm-kipd](../.agents/pm/features/pm-kipd.toon)
|
|
1079
|
+
[pm-kipd](../.agents/pm/features/pm-kipd.toon), versioned batch-local
|
|
1080
|
+
references tracked by [pm-o8z748](../.agents/pm/issues/pm-o8z748.toon), and
|
|
1081
|
+
atomic evidence-backed completion tracked by
|
|
1082
|
+
[pm-cyn0y6](../.agents/pm/issues/pm-cyn0y6.toon).
|
|
1057
1083
|
|
|
1058
1084
|
`commitWorkspaceTransaction` is the public unit-of-work primitive for domain
|
|
1059
1085
|
commands that must coordinate several SDK mutations. A plan supplies a stable
|
|
@@ -1193,12 +1219,15 @@ previously compensated retry without package-private file access.
|
|
|
1193
1219
|
For the ubiquitous "commit N item mutations atomically" case (bulk import,
|
|
1194
1220
|
bulk sync), `commitItemMutations` wraps the coordinator so callers describe
|
|
1195
1221
|
the mutations instead of hand-writing a step array. The helper wires the
|
|
1196
|
-
crash-consistency contract for you: creates use their
|
|
1222
|
+
crash-consistency contract for you: creates use their resolved stable `id` as
|
|
1197
1223
|
the idempotency key (exists-by-id inspection) and are compensated by closing
|
|
1198
1224
|
the item (or deleting it with `createCompensation: "delete"`); updates stamp a
|
|
1199
1225
|
durable history marker for applied-detection and are compensated by restoring
|
|
1200
1226
|
the captured pre-mutation version; closes treat an already-terminal target as
|
|
1201
|
-
applied and are likewise compensated by version restore
|
|
1227
|
+
applied and are likewise compensated by version restore; releases restore the
|
|
1228
|
+
prior claim when a later step fails. The journal step identity includes a
|
|
1229
|
+
canonical mutation fingerprint, so reusing a transaction id with changed
|
|
1230
|
+
payload fails before new work. A stable
|
|
1202
1231
|
`transactionId` makes interrupted batches resumable across processes and
|
|
1203
1232
|
agents.
|
|
1204
1233
|
|
|
@@ -1249,7 +1278,7 @@ each `addAc`/`removeAc` entry must be semicolon-free; unmatched removals are
|
|
|
1249
1278
|
reported as `remove_ac_unmatched:<text>` warnings rather than disappearing as
|
|
1250
1279
|
silent no-ops.
|
|
1251
1280
|
|
|
1252
|
-
`parseItemMutationBatch` is the strict JSON boundary for that primitive. It
|
|
1281
|
+
`parseItemMutationBatch` is the strict legacy JSON boundary for that primitive. It
|
|
1253
1282
|
accepts either a non-empty mutation array or `{ "mutations": [...] }`, derives
|
|
1254
1283
|
allowed option names from the exported create/update/close command contracts,
|
|
1255
1284
|
and rejects unknown row or option keys with a did-you-mean diagnostic before a
|
|
@@ -1271,6 +1300,61 @@ await commitItemMutations({
|
|
|
1271
1300
|
});
|
|
1272
1301
|
```
|
|
1273
1302
|
|
|
1303
|
+
For coherent heterogeneous specifications, use
|
|
1304
|
+
`resolveItemMutationDocument`. It accepts the legacy array or a versioned
|
|
1305
|
+
`{ schema_version: 1, mutations }` document. Create rows may declare a unique
|
|
1306
|
+
`ref`, omit `id`, and use exact `@ref` values in target ids, `parent`,
|
|
1307
|
+
`blockedBy`, and dependency `id` fields. Omitted ids are derived from the
|
|
1308
|
+
transaction id, alias, and workspace prefix; explicit ids are normalized.
|
|
1309
|
+
Malformed, duplicate, unknown, and cyclic references fail before tracker
|
|
1310
|
+
mutation. Commit the returned mutations and retain its alias-to-id receipt:
|
|
1311
|
+
|
|
1312
|
+
```ts
|
|
1313
|
+
import {
|
|
1314
|
+
commitItemMutations,
|
|
1315
|
+
resolveItemMutationDocument,
|
|
1316
|
+
} from "@unbrained/pm-cli/sdk";
|
|
1317
|
+
import path from "node:path";
|
|
1318
|
+
|
|
1319
|
+
const pmRoot = path.join(process.cwd(), ".agents", "pm");
|
|
1320
|
+
const specificationJson = JSON.stringify({
|
|
1321
|
+
schema_version: 1,
|
|
1322
|
+
mutations: [
|
|
1323
|
+
{
|
|
1324
|
+
op: "create",
|
|
1325
|
+
ref: "initiative",
|
|
1326
|
+
options: { title: "Initiative", type: "Epic" },
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
op: "create",
|
|
1330
|
+
ref: "delivery",
|
|
1331
|
+
options: {
|
|
1332
|
+
title: "Delivery",
|
|
1333
|
+
type: "Feature",
|
|
1334
|
+
parent: "@initiative",
|
|
1335
|
+
},
|
|
1336
|
+
},
|
|
1337
|
+
],
|
|
1338
|
+
});
|
|
1339
|
+
|
|
1340
|
+
const resolved = resolveItemMutationDocument(specificationJson, {
|
|
1341
|
+
transactionId: "specification-2026-08-05-001",
|
|
1342
|
+
idPrefix: "pm-",
|
|
1343
|
+
});
|
|
1344
|
+
await commitItemMutations({
|
|
1345
|
+
pmRoot,
|
|
1346
|
+
author: "specification-agent",
|
|
1347
|
+
transactionId: "specification-2026-08-05-001",
|
|
1348
|
+
mutations: resolved.mutations,
|
|
1349
|
+
});
|
|
1350
|
+
```
|
|
1351
|
+
|
|
1352
|
+
`buildItemCompletionMutations` creates the ordered evidence/update, close, and
|
|
1353
|
+
release plan for inspection. `commitItemCompletion` executes that plan through
|
|
1354
|
+
the same durable coordinator, restoring annotations, linked artifacts,
|
|
1355
|
+
lifecycle fields, and claim ownership on failure. It is the SDK primitive
|
|
1356
|
+
behind `pm item complete`.
|
|
1357
|
+
|
|
1274
1358
|
`itemDocumentToMutationOptions` is the companion full-document adapter. It
|
|
1275
1359
|
accepts either a direct `ItemDocument` or the envelope returned by
|
|
1276
1360
|
`pm get <id> --json`, strips read-only metadata, maps canonical snake-case item
|
|
@@ -1281,9 +1365,11 @@ through the public `field` escape hatch.
|
|
|
1281
1365
|
|
|
1282
1366
|
The built-in adapters stay deliberately thin:
|
|
1283
1367
|
|
|
1284
|
-
- `pm item mutate --transaction-id <stable-id> --stdin-json`
|
|
1285
|
-
commits a batch
|
|
1286
|
-
|
|
1368
|
+
- `pm item mutate --transaction-id <stable-id> --stdin-json` resolves aliases,
|
|
1369
|
+
validates, and commits a versioned batch; `--dry-run` returns the concrete
|
|
1370
|
+
graph and alias receipt without writes.
|
|
1371
|
+
- `pm item complete <id> <reason> --transaction-id <stable-id>` records linked
|
|
1372
|
+
evidence, closes, and releases a claim as one compensating transaction.
|
|
1287
1373
|
- `pm create --stdin-json` and `pm update <id> --stdin-json` accept a whole item
|
|
1288
1374
|
document. This supports the lossless `get → edit → update` agent workflow
|
|
1289
1375
|
without translating every field into argv.
|
|
@@ -1779,7 +1865,29 @@ For provider-safe schemas, use `PM_PROVIDER_TOOL_PARAMETERS_SCHEMA`. It is flat
|
|
|
1779
1865
|
| `registerSearchProvider` | `search` |
|
|
1780
1866
|
| `registerVectorStoreAdapter` | `search` |
|
|
1781
1867
|
|
|
1782
|
-
Some override surfaces are single-winner: command overrides, parser overrides,
|
|
1868
|
+
Some override surfaces are single-winner: command overrides, parser overrides,
|
|
1869
|
+
preflight overrides, and output renderers. Preflight overrides can declare
|
|
1870
|
+
static command ownership, allowing disjoint packages to compose without false
|
|
1871
|
+
collisions or unrelated callback invocations:
|
|
1872
|
+
|
|
1873
|
+
```ts
|
|
1874
|
+
const preflight = definePreflightOverride({
|
|
1875
|
+
commands: ["incident triage", "incident close"],
|
|
1876
|
+
run: (context) => ({
|
|
1877
|
+
enforce_mandatory_migration_gate:
|
|
1878
|
+
context.decision.enforce_mandatory_migration_gate,
|
|
1879
|
+
}),
|
|
1880
|
+
});
|
|
1881
|
+
|
|
1882
|
+
api.registerPreflight(preflight);
|
|
1883
|
+
```
|
|
1884
|
+
|
|
1885
|
+
Command paths are normalized. Two scoped overrides collide only when their
|
|
1886
|
+
ownership overlaps; an empty or omitted `commands` list retains legacy global
|
|
1887
|
+
behavior and collides with every other override. Activation summaries and
|
|
1888
|
+
persisted contribution inventories expose `preflight_ownership`, so doctor and
|
|
1889
|
+
static tooling can explain the decision. Keep handlers narrowly scoped and
|
|
1890
|
+
verify package combinations with:
|
|
1783
1891
|
|
|
1784
1892
|
```bash
|
|
1785
1893
|
pm package doctor --project --detail deep --trace
|