@unbrained/pm-cli 2026.8.7 → 2026.8.9
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 +54 -0
- package/dist/cli/main.js +4 -3
- package/dist/cli/register-annotations.d.ts +11 -0
- package/dist/cli/register-annotations.js +195 -0
- package/dist/cli/register-history-author.js +7 -30
- package/dist/cli/register-mutation.js +25 -206
- package/dist/cli/runtime-compatibility-boundary.d.ts +17 -0
- package/dist/cli/runtime-compatibility-boundary.js +43 -0
- package/dist/cli-bundle/bundle-manifest.json +158 -694
- package/dist/cli-bundle/chunks/chunk-2DTCZXSD.js +13 -0
- package/dist/cli-bundle/chunks/chunk-5JO6R4BS.js +3 -0
- package/dist/cli-bundle/chunks/chunk-5KN4DZYV.js +194 -0
- package/dist/cli-bundle/chunks/chunk-EF43KODO.js +2 -0
- package/dist/cli-bundle/chunks/chunk-GMX5YOI3.js +77 -0
- package/dist/cli-bundle/chunks/chunk-HUV2Z7IS.js +28 -0
- package/dist/cli-bundle/chunks/chunk-MHBVCUF2.js +2 -0
- package/dist/cli-bundle/chunks/chunk-PYO5GZU6.js +5 -0
- package/dist/cli-bundle/chunks/chunk-QWRRFYK3.js +2 -0
- package/dist/cli-bundle/chunks/chunk-RJC7TPF4.js +8 -0
- package/dist/cli-bundle/chunks/chunk-YC3UF2IO.js +2068 -0
- package/dist/cli-bundle/chunks/{register-list-query-FJZCJ67O.js → register-list-query-BUE7PTCU.js} +8 -8
- package/dist/cli-bundle/chunks/register-mutation-FC3XLVIK.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-YH2WAOXU.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-UQDTNTLJ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-2VVP5RAA.js +153 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4VJQTS3P.js → chunk-3GSFUDAI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3WVHTUAW.js +5 -0
- package/dist/cli-bundle/focused-chunks/chunk-4H6MVCK3.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-73JUDYXT.js → chunk-54TZJ4BM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5NK5TJ5D.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-HNL6IFGS.js → chunk-6DO4YQWZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-73FIJONU.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TIKDBG4D.js → chunk-C3GCHDSQ.js} +29 -27
- package/dist/cli-bundle/focused-chunks/chunk-JGRSQZJT.js +18 -0
- package/dist/cli-bundle/focused-chunks/{chunk-YZEZAPJK.js → chunk-KNEHLPBF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-MRWVJ3ZG.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-NL57J7BZ.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-NBJKQP4S.js → chunk-P6BBIQRG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-QHRTT7WT.js → chunk-PZAGVQNN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QDAO3XEK.js +14 -0
- package/dist/cli-bundle/focused-chunks/chunk-T4IGQCSY.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-U46GQJNY.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-RPNYG5MO.js → chunk-VRXJSGIT.js} +6 -6
- package/dist/cli-bundle/focused-chunks/{chunk-R2LEMEV5.js → chunk-XC2ZW3CJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZG54B4XG.js +2 -0
- 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 +38 -38
- 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 +2 -1
- package/dist/cli.js +14 -4
- package/dist/core/diagnostics/remediation.js +12 -2
- package/dist/core/history/history.js +13 -4
- package/dist/core/item/actionability.d.ts +7 -1
- package/dist/core/item/actionability.js +71 -15
- package/dist/core/output/output.js +9 -2
- package/dist/core/sentry/helpers.d.ts +10 -0
- package/dist/core/sentry/helpers.js +59 -4
- package/dist/core/shared/author.d.ts +25 -0
- package/dist/core/shared/author.js +114 -9
- package/dist/core/shared/constants.d.ts +2 -0
- package/dist/core/shared/constants.js +4 -2
- package/dist/sdk/actionability.d.ts +1 -1
- package/dist/sdk/actionability.js +3 -3
- package/dist/sdk/annotations.d.ts +40 -0
- package/dist/sdk/annotations.js +61 -9
- package/dist/sdk/author-attribution.d.ts +12 -0
- package/dist/sdk/author-attribution.js +73 -11
- package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +118 -0
- package/dist/sdk/cli-contracts/command-exit-contracts.js +152 -0
- package/dist/sdk/cli-contracts/completeness.js +5 -3
- package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +19 -0
- package/dist/sdk/cli-contracts/runtime-contracts.js +44 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +15 -2
- package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +6 -3
- package/dist/sdk/comments.d.ts +7 -0
- package/dist/sdk/comments.js +2 -2
- package/dist/sdk/completion.js +9 -5
- package/dist/sdk/contracts.d.ts +1 -0
- package/dist/sdk/contracts.js +3 -2
- package/dist/sdk/core-governance.d.ts +1 -1
- package/dist/sdk/core-governance.js +3 -3
- package/dist/sdk/dependencies.d.ts +2 -0
- package/dist/sdk/dependencies.js +7 -6
- package/dist/sdk/environment/host-environment-errors.d.ts +27 -0
- package/dist/sdk/environment/host-environment-errors.js +124 -0
- package/dist/sdk/environment/project-runtime-compatibility.d.ts +65 -0
- package/dist/sdk/environment/project-runtime-compatibility.js +385 -0
- package/dist/sdk/environment/source-context.d.ts +23 -0
- package/dist/sdk/environment/source-context.js +29 -0
- package/dist/sdk/error-code-catalog.d.ts +6 -0
- package/dist/sdk/error-code-catalog.js +62 -8
- package/dist/sdk/extension/bundled-catalog.js +19 -6
- package/dist/sdk/generated-error-code-catalog.js +665 -3
- package/dist/sdk/governance/health.d.ts +11 -3
- package/dist/sdk/governance/health.js +32 -13
- package/dist/sdk/governance/provenance-health.d.ts +26 -0
- package/dist/sdk/governance/provenance-health.js +139 -0
- package/dist/sdk/governance/validate.js +13 -8
- package/dist/sdk/governance.d.ts +1 -0
- package/dist/sdk/governance.js +3 -2
- package/dist/sdk/graph/assembly.d.ts +4 -0
- package/dist/sdk/graph/assembly.js +22 -2
- package/dist/sdk/graph/run.d.ts +2 -0
- package/dist/sdk/graph/run.js +3 -2
- package/dist/sdk/index.d.ts +7 -3
- package/dist/sdk/index.js +9 -5
- package/dist/sdk/learnings.d.ts +15 -0
- package/dist/sdk/learnings.js +2 -2
- package/dist/sdk/lifecycle/close-many.d.ts +6 -1
- package/dist/sdk/lifecycle/close-many.js +43 -5
- package/dist/sdk/lifecycle/close.js +13 -8
- package/dist/sdk/lifecycle/create.js +6 -12
- package/dist/sdk/lifecycle/plan.js +6 -3
- package/dist/sdk/lifecycle/update-many.d.ts +2 -1
- package/dist/sdk/lifecycle/update-many.js +29 -5
- package/dist/sdk/lifecycle/update.js +6 -20
- package/dist/sdk/merge/driver.d.ts +2 -1
- package/dist/sdk/merge/driver.js +7 -4
- package/dist/sdk/merge/index.d.ts +1 -1
- package/dist/sdk/merge/index.js +3 -3
- package/dist/sdk/merge/install.d.ts +21 -0
- package/dist/sdk/merge/install.js +51 -21
- package/dist/sdk/merge/receipts.d.ts +14 -1
- package/dist/sdk/merge/receipts.js +36 -8
- package/dist/sdk/merge/reconcile.js +21 -4
- package/dist/sdk/merge/three-way.d.ts +6 -2
- package/dist/sdk/merge/three-way.js +24 -10
- package/dist/sdk/notes.d.ts +7 -0
- package/dist/sdk/notes.js +2 -2
- package/dist/sdk/query/get.d.ts +11 -0
- package/dist/sdk/query/get.js +37 -3
- package/dist/sdk/read-output-contracts.d.ts +1 -1
- package/dist/sdk/read-output-contracts.js +103 -5
- package/dist/sdk/relationship-kinds/contract.d.ts +48 -0
- package/dist/sdk/relationship-kinds/contract.js +22 -0
- package/dist/sdk/relationships.d.ts +6 -41
- package/dist/sdk/relationships.js +12 -126
- package/dist/sdk/runtime-primitives.d.ts +1 -1
- package/dist/sdk/runtime-primitives.js +3 -3
- package/dist/sdk/runtime.d.ts +1 -1
- package/dist/sdk/runtime.js +9 -25
- package/dist/sdk/similarity.d.ts +5 -0
- package/dist/sdk/similarity.js +40 -10
- package/dist/sdk/structured-mutations.js +5 -2
- package/dist/sdk/test/execution.js +4 -2
- package/dist/sdk/test/linked-command-detection.d.ts +2 -7
- package/dist/sdk/test/linked-command-detection.js +22 -9
- package/dist/sdk/test/parsers.js +5 -2
- package/dist/sdk/workspace-snapshot.d.ts +9 -0
- package/dist/sdk/workspace-snapshot.js +48 -16
- package/docs/AGENT_GUIDE.md +2 -1
- package/docs/AGENT_RUNTIME_PRIMITIVES.md +11 -4
- package/docs/COMMANDS.md +19 -1
- package/docs/DEPENDENCY_KIND_CONTRACT.md +29 -0
- package/docs/ITEM_READ_PROJECTIONS.md +26 -0
- package/docs/MERGE_SAFETY.md +10 -3
- package/docs/README.md +1 -0
- package/docs/RELATIONSHIP_GRAPH.md +1 -1
- package/docs/RELEASING.md +27 -2
- package/docs/SCRIPTING.md +27 -1
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +35 -2
- package/docs/SDK_CONTEXT_INTEGRITY.md +81 -0
- package/docs/SDK_RUNTIME_BOUNDARIES.md +58 -0
- package/docs/SELF_DESCRIBING_CONTEXT_CONTRACTS.md +13 -0
- package/docs/SENTRY_CONTRACT_EPOCHS.md +20 -0
- package/docs/TESTING.md +17 -0
- package/docs/agent-task-token-baseline.json +2 -2
- package/marketplace.json +2 -2
- package/package.json +5 -3
- 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 +756 -57
- package/dist/cli-bundle/chunks/append-7BXBFDGD.js +0 -2
- package/dist/cli-bundle/chunks/chunk-2AXF3VSK.js +0 -2
- package/dist/cli-bundle/chunks/chunk-2XS43CCV.js +0 -2
- package/dist/cli-bundle/chunks/chunk-3A6KWB72.js +0 -8
- package/dist/cli-bundle/chunks/chunk-3ISTDB42.js +0 -8
- package/dist/cli-bundle/chunks/chunk-4MTI7XOV.js +0 -5
- package/dist/cli-bundle/chunks/chunk-6BX5UDCN.js +0 -3
- package/dist/cli-bundle/chunks/chunk-6QPO7KLR.js +0 -2
- package/dist/cli-bundle/chunks/chunk-7MXHZHSQ.js +0 -5
- package/dist/cli-bundle/chunks/chunk-7ZPMJW4U.js +0 -2
- package/dist/cli-bundle/chunks/chunk-A6KGKEWT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-AGYNSNCI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-B4H7FEFH.js +0 -5
- package/dist/cli-bundle/chunks/chunk-B4KLBBMN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-BXCSXK4J.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CALJHNBL.js +0 -23
- package/dist/cli-bundle/chunks/chunk-CFIGP5LY.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CHOQ2VAW.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CS6MRHG7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CUGNQQKH.js +0 -2
- package/dist/cli-bundle/chunks/chunk-D4FPS43D.js +0 -164
- package/dist/cli-bundle/chunks/chunk-E2ZSLTOP.js +0 -2
- package/dist/cli-bundle/chunks/chunk-FB7G2HY2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-H5Y5YE6A.js +0 -2
- package/dist/cli-bundle/chunks/chunk-H5Y6UV6E.js +0 -2
- package/dist/cli-bundle/chunks/chunk-H7KGWPDF.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HFSD77TQ.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HX2GTA6L.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J2IEKAVR.js +0 -2
- package/dist/cli-bundle/chunks/chunk-JC6FKIFM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-K44PYFXH.js +0 -2
- package/dist/cli-bundle/chunks/chunk-K4KGEEBT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KFLK5TRH.js +0 -21
- package/dist/cli-bundle/chunks/chunk-KL6IEBV2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KWQZDZSS.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KZ4X3DGU.js +0 -3
- package/dist/cli-bundle/chunks/chunk-LD77HJMQ.js +0 -13
- package/dist/cli-bundle/chunks/chunk-LEPJJ6QC.js +0 -2
- package/dist/cli-bundle/chunks/chunk-ME2JJ4LA.js +0 -3
- package/dist/cli-bundle/chunks/chunk-NE5VRDAI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NFLJ3FHD.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NG6OXIBR.js +0 -19
- package/dist/cli-bundle/chunks/chunk-NYIGHWQY.js +0 -8
- package/dist/cli-bundle/chunks/chunk-NZ75GNSA.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PCJWJNC2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PD3225AM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PDEGKG7P.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PIE5HBNA.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PW2H7YJR.js +0 -56
- package/dist/cli-bundle/chunks/chunk-RSIC5OPE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TPKN3S7S.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TPXAXTCO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-UFWUJO4V.js +0 -2
- package/dist/cli-bundle/chunks/chunk-UQLZQVFW.js +0 -55
- package/dist/cli-bundle/chunks/chunk-VT3Z5G7D.js +0 -2
- package/dist/cli-bundle/chunks/chunk-WOD3WWUN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-WSJEIGJF.js +0 -3
- package/dist/cli-bundle/chunks/chunk-WYNUU7ZW.js +0 -2008
- package/dist/cli-bundle/chunks/chunk-YGPNCCXZ.js +0 -2
- package/dist/cli-bundle/chunks/close-CMY3BAUG.js +0 -2
- package/dist/cli-bundle/chunks/close-many-SA4XZCTK.js +0 -2
- package/dist/cli-bundle/chunks/comments-EZ556ZD3.js +0 -2
- package/dist/cli-bundle/chunks/copy-ZSGPA52X.js +0 -2
- package/dist/cli-bundle/chunks/create-I5DVV4YG.js +0 -2
- package/dist/cli-bundle/chunks/delete-RL3JACSW.js +0 -2
- package/dist/cli-bundle/chunks/deps-S7UBCECS.js +0 -2
- package/dist/cli-bundle/chunks/docs-ZZNVBBYO.js +0 -2
- package/dist/cli-bundle/chunks/files-27C337VT.js +0 -2
- package/dist/cli-bundle/chunks/focus-5Z2SG7LU.js +0 -2
- package/dist/cli-bundle/chunks/history-compact-HJQK67CZ.js +0 -2
- package/dist/cli-bundle/chunks/history-redact-PWC6PDWA.js +0 -2
- package/dist/cli-bundle/chunks/history-repair-N3CY4WBF.js +0 -2
- package/dist/cli-bundle/chunks/learnings-4FH23XDT.js +0 -2
- package/dist/cli-bundle/chunks/profile-5Y5XXH5N.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-YGYPW3BL.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-WMDSUMQF.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-DL7FFABC.js +0 -2
- package/dist/cli-bundle/chunks/restore-6KYBV5BY.js +0 -2
- package/dist/cli-bundle/chunks/schema-EQGKBYXJ.js +0 -2
- package/dist/cli-bundle/chunks/update-QVTYOD6I.js +0 -2
- package/dist/cli-bundle/chunks/update-many-DJSBU525.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2ECLECMK.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-3K4XV2BF.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-4EX25PXM.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-CIXVQPB7.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-DLTS3IHM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-DQ6FKGL3.js +0 -14
- package/dist/cli-bundle/focused-chunks/chunk-JLG2C4EQ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-MHMTKV5V.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-MOTJFQ3F.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-RW5IYD4J.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-VZFU2R4M.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZJIMJHDB.js +0 -2
|
@@ -45,13 +45,13 @@ export interface RunHealthOptions {
|
|
|
45
45
|
strictDirectories?: boolean;
|
|
46
46
|
/** Treat absent clone-local merge drivers as a required health failure instead of an advisory. */
|
|
47
47
|
requireMergeDrivers?: boolean;
|
|
48
|
-
/**
|
|
48
|
+
/** Preserve the legacy compact check projection while keeping diagnostics read-only. */
|
|
49
49
|
checkOnly?: boolean;
|
|
50
50
|
/** Value that configures or reports check telemetry for this contract. */
|
|
51
51
|
checkTelemetry?: boolean;
|
|
52
|
-
/**
|
|
52
|
+
/** Explicitly document that vector refresh is disabled. */
|
|
53
53
|
noRefresh?: boolean;
|
|
54
|
-
/**
|
|
54
|
+
/** Opt in to the only mutating health operation: refreshing stale vectors. */
|
|
55
55
|
refreshVectors?: boolean;
|
|
56
56
|
/** Value that configures or reports verbose stale items for this contract. */
|
|
57
57
|
verboseStaleItems?: boolean;
|
|
@@ -70,6 +70,12 @@ export interface RunHealthOptions {
|
|
|
70
70
|
/** Value that configures or reports summary for this contract. */
|
|
71
71
|
summary?: boolean;
|
|
72
72
|
}
|
|
73
|
+
interface VectorRefreshPolicy {
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
checkOnly: boolean;
|
|
76
|
+
noRefresh: boolean;
|
|
77
|
+
refreshVectors: boolean;
|
|
78
|
+
}
|
|
73
79
|
interface MigrationStatusEntry {
|
|
74
80
|
layer: "global" | "project";
|
|
75
81
|
name: string;
|
|
@@ -163,6 +169,7 @@ declare function probeTelemetryEndpointHealth(endpoint: string): Promise<{
|
|
|
163
169
|
error?: string;
|
|
164
170
|
}>;
|
|
165
171
|
declare function buildVectorizationProviderDetails(settings: PmSettings, snapshot: VectorizationRuntimeSnapshot): Record<string, unknown>;
|
|
172
|
+
declare function resolveVectorRefreshPolicy(options: RunHealthOptions): VectorRefreshPolicy;
|
|
166
173
|
interface HealthSkipPolicy {
|
|
167
174
|
summaryMode: boolean;
|
|
168
175
|
skipIntegrity: boolean;
|
|
@@ -196,6 +203,7 @@ export declare const _testOnlyHealthCommand: {
|
|
|
196
203
|
resolveActionableUnknownAuthorEventCount: (authorAttribution: HistoryAuthorAttributionScan) => number;
|
|
197
204
|
resolveHealthSkipPolicy: typeof resolveHealthSkipPolicy;
|
|
198
205
|
resolveUnknownAuthorEventCount: (authorAttribution: HistoryAuthorAttributionScan) => number;
|
|
206
|
+
resolveVectorRefreshPolicy: typeof resolveVectorRefreshPolicy;
|
|
199
207
|
selectStaleItemDetail: typeof selectStaleItemDetail;
|
|
200
208
|
summarizeHealthCheckDetails: typeof summarizeHealthCheckDetails;
|
|
201
209
|
summarizeExtensionList: typeof summarizeExtensionList;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm health command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="97e1ed14-cd36-5910-b829-4619af6080e1")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
|
|
@@ -35,12 +35,13 @@ import { readSettingsWithMetadata } from "../../core/store/settings.js";
|
|
|
35
35
|
import { buildRemediationMap } from "../../core/diagnostics/remediation.js";
|
|
36
36
|
import { scanHistoryAuthorAttribution, } from "../author-attribution.js";
|
|
37
37
|
import { readManagedExtensionState } from "../extension.js";
|
|
38
|
+
import { scanProvenanceResolverHealth } from "./provenance-health.js";
|
|
38
39
|
import { applyStoredExtensionMigrationState } from "../extension/migrations.js";
|
|
39
40
|
import { buildCapabilityContractMetadata, buildRegistrationCollisionRemediation, collectUnknownCapabilityGuidance, } from "../extension/doctor.js";
|
|
40
41
|
import { scanStaleInProgressItems, } from "./stale-work.js";
|
|
41
42
|
import { scanTrackedRuntimeCache } from "./tracked-runtime-cache.js";
|
|
42
43
|
import { auditMergeDriverConfiguration, findGitWorkspaceRoot, } from "../merge/install.js";
|
|
43
|
-
import { listMergeReceipts } from "../merge/receipts.js";
|
|
44
|
+
import { listMergeReceipts, partitionMergeReceipts, } from "../merge/receipts.js";
|
|
44
45
|
const PM_TELEMETRY_SOURCE_CONTEXT_SET = new Set(PM_TELEMETRY_SOURCE_CONTEXT_VALUES);
|
|
45
46
|
const STALE_VECTORIZATION_SUMMARY_LIMIT = 25;
|
|
46
47
|
const BRIEF_HEALTH_DETAIL_LIMIT = 8;
|
|
@@ -58,6 +59,7 @@ function isAdvisoryHealthWarning(warning, requireMergeDrivers = false) {
|
|
|
58
59
|
return (warning.startsWith("telemetry_") ||
|
|
59
60
|
warning.startsWith("history_stream_over_compact_threshold:") ||
|
|
60
61
|
warning.startsWith("stale_in_progress_items:") ||
|
|
62
|
+
warning.startsWith("provenance_resolver_zero_success:") ||
|
|
61
63
|
(!requireMergeDrivers &&
|
|
62
64
|
warning.startsWith("merge_driver_configuration_missing:")));
|
|
63
65
|
}
|
|
@@ -318,7 +320,10 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
|
|
|
318
320
|
const mergeDriverAudit = gitWorkspaceRoot === null
|
|
319
321
|
? null
|
|
320
322
|
: await auditMergeDriverConfiguration(gitWorkspaceRoot);
|
|
321
|
-
const pendingMergeReceipts = gitWorkspaceRoot === null
|
|
323
|
+
const pendingMergeReceipts = gitWorkspaceRoot === null
|
|
324
|
+
? []
|
|
325
|
+
: await listMergeReceipts(gitWorkspaceRoot, { includeLossless: true });
|
|
326
|
+
const { pendingDecisions: pendingMergeDecisions, lossless: losslessMergeReceipts, } = partitionMergeReceipts(pendingMergeReceipts);
|
|
322
327
|
const mergeDriverInstallationMissing = mergeDriverAudit?.status === "missing" &&
|
|
323
328
|
mergeDriverAudit.missing_keys.length === 5 &&
|
|
324
329
|
mergeDriverAudit.drifted_keys.length === 0;
|
|
@@ -343,8 +348,8 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
|
|
|
343
348
|
`merge_driver_configuration_${mergeDriverInstallationMissing ? "missing" : "drift"}:${mergeDriverAudit.missing_keys.length + mergeDriverAudit.drifted_keys.length}`,
|
|
344
349
|
]
|
|
345
350
|
: []),
|
|
346
|
-
...(
|
|
347
|
-
? [`merge_decisions_unreviewed:${
|
|
351
|
+
...(pendingMergeDecisions.length > 0
|
|
352
|
+
? [`merge_decisions_unreviewed:${pendingMergeDecisions.length}`]
|
|
348
353
|
: []),
|
|
349
354
|
];
|
|
350
355
|
const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
@@ -369,7 +374,8 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
|
|
|
369
374
|
? 0
|
|
370
375
|
: mergeDriverAudit.missing_keys.length +
|
|
371
376
|
mergeDriverAudit.drifted_keys.length,
|
|
372
|
-
pending_merge_decisions:
|
|
377
|
+
pending_merge_decisions: pendingMergeDecisions.length,
|
|
378
|
+
lossless_merge_receipts: losslessMergeReceipts.length,
|
|
373
379
|
},
|
|
374
380
|
item_unreadable: itemScan.unreadable,
|
|
375
381
|
item_conflict_markers: itemScan.conflictMarkers,
|
|
@@ -392,7 +398,10 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
|
|
|
392
398
|
required: requireMergeDrivers,
|
|
393
399
|
},
|
|
394
400
|
pending_merge_decision_items: [
|
|
395
|
-
...new Set(
|
|
401
|
+
...new Set(pendingMergeDecisions.map((receipt) => receipt.item_id)),
|
|
402
|
+
].sort((left, right) => left.localeCompare(right)),
|
|
403
|
+
lossless_merge_receipt_items: [
|
|
404
|
+
...new Set(losslessMergeReceipts.map((receipt) => receipt.item_id)),
|
|
396
405
|
].sort((left, right) => left.localeCompare(right)),
|
|
397
406
|
},
|
|
398
407
|
},
|
|
@@ -1549,7 +1558,6 @@ function validateSettingsValues(settings) {
|
|
|
1549
1558
|
}
|
|
1550
1559
|
function resolveVectorRefreshPolicy(options) {
|
|
1551
1560
|
const checkOnly = options.checkOnly === true;
|
|
1552
|
-
const noRefresh = options.noRefresh === true || checkOnly;
|
|
1553
1561
|
const refreshVectors = options.refreshVectors === true;
|
|
1554
1562
|
if (refreshVectors && checkOnly) {
|
|
1555
1563
|
throw new PmCliError("--check-only cannot be combined with --refresh-vectors", EXIT_CODE.USAGE);
|
|
@@ -1558,9 +1566,9 @@ function resolveVectorRefreshPolicy(options) {
|
|
|
1558
1566
|
throw new PmCliError("--no-refresh cannot be combined with --refresh-vectors", EXIT_CODE.USAGE);
|
|
1559
1567
|
}
|
|
1560
1568
|
return {
|
|
1561
|
-
enabled: refreshVectors
|
|
1569
|
+
enabled: refreshVectors,
|
|
1562
1570
|
checkOnly,
|
|
1563
|
-
noRefresh,
|
|
1571
|
+
noRefresh: !refreshVectors,
|
|
1564
1572
|
refreshVectors,
|
|
1565
1573
|
};
|
|
1566
1574
|
}
|
|
@@ -1694,7 +1702,7 @@ const resolveUnknownAuthorEventCount = (authorAttribution) => authorAttribution.
|
|
|
1694
1702
|
/** Preserve actionable-author semantics for current and legacy scan payloads. */
|
|
1695
1703
|
const resolveActionableUnknownAuthorEventCount = (authorAttribution) => authorAttribution.actionable_unknown_event_count ??
|
|
1696
1704
|
resolveUnknownAuthorEventCount(authorAttribution);
|
|
1697
|
-
function buildStorageHealthCheck(items, settings, historySummary, authorAttribution, staleInProgress) {
|
|
1705
|
+
function buildStorageHealthCheck(items, settings, historySummary, authorAttribution, staleInProgress, provenanceResolverOutcomes) {
|
|
1698
1706
|
const unknownAuthorEventCount = resolveUnknownAuthorEventCount(authorAttribution);
|
|
1699
1707
|
const actionableUnknownAuthorEventCount = resolveActionableUnknownAuthorEventCount(authorAttribution);
|
|
1700
1708
|
const hasAuthorEvents = unknownAuthorEventCount > 0;
|
|
@@ -1727,6 +1735,9 @@ function buildStorageHealthCheck(items, settings, historySummary, authorAttribut
|
|
|
1727
1735
|
...(hasStaleInProgressItems
|
|
1728
1736
|
? { stale_in_progress: staleInProgress }
|
|
1729
1737
|
: {}),
|
|
1738
|
+
...(provenanceResolverOutcomes.length > 0
|
|
1739
|
+
? { provenance_resolver_outcomes: provenanceResolverOutcomes }
|
|
1740
|
+
: {}),
|
|
1730
1741
|
...(historySummary.max_entries !== null
|
|
1731
1742
|
? {
|
|
1732
1743
|
compact_policy: {
|
|
@@ -1757,6 +1768,7 @@ function collectHealthWarnings(params) {
|
|
|
1757
1768
|
...params.historySummary.warnings,
|
|
1758
1769
|
...params.authorAttributionWarnings,
|
|
1759
1770
|
...params.staleInProgressWarnings,
|
|
1771
|
+
...params.provenanceWarnings,
|
|
1760
1772
|
...params.locksCheck.warnings,
|
|
1761
1773
|
...params.integrityCheck.warnings,
|
|
1762
1774
|
...params.historyDriftCheck.warnings,
|
|
@@ -1780,6 +1792,7 @@ function buildHealthRemediationSources(params) {
|
|
|
1780
1792
|
...params.historySummary.over_threshold.map((id) => `history_stream_over_compact_threshold:${id}`),
|
|
1781
1793
|
...params.authorAttributionWarnings,
|
|
1782
1794
|
...params.staleInProgressWarnings,
|
|
1795
|
+
...params.provenanceWarnings,
|
|
1783
1796
|
],
|
|
1784
1797
|
locks: params.locksCheck.warnings,
|
|
1785
1798
|
integrity: params.integrityCheck.warnings,
|
|
@@ -1866,6 +1879,9 @@ export async function runHealth(global, options = {}) {
|
|
|
1866
1879
|
in_progress_status: settings.schema.workflow.in_progress_status,
|
|
1867
1880
|
threshold_hours: settings.mutation_guard.stale_in_progress_hours,
|
|
1868
1881
|
}));
|
|
1882
|
+
const provenanceResolverHealth = await scanProvenanceResolverHealth(pmRoot);
|
|
1883
|
+
const provenanceResolverOutcomes = provenanceResolverHealth.outcomes;
|
|
1884
|
+
const provenanceWarnings = provenanceResolverHealth.warnings;
|
|
1869
1885
|
const locksCheck = await buildLocksCheck(pmRoot);
|
|
1870
1886
|
const integrityCheck = skipPolicy.skipIntegrity
|
|
1871
1887
|
? buildSkippedHealthCheck("integrity")
|
|
@@ -1882,7 +1898,7 @@ export async function runHealth(global, options = {}) {
|
|
|
1882
1898
|
buildSettingsValuesHealthCheck(settingWarnings),
|
|
1883
1899
|
telemetryCheck.check,
|
|
1884
1900
|
extensionCheck.check,
|
|
1885
|
-
buildStorageHealthCheck(items, settings, historySummary, authorAttribution, staleInProgress.scan),
|
|
1901
|
+
buildStorageHealthCheck(items, settings, historySummary, authorAttribution, staleInProgress.scan, provenanceResolverOutcomes),
|
|
1886
1902
|
locksCheck.check,
|
|
1887
1903
|
integrityCheck.check,
|
|
1888
1904
|
historyDriftCheck.check,
|
|
@@ -1899,6 +1915,7 @@ export async function runHealth(global, options = {}) {
|
|
|
1899
1915
|
historySummary,
|
|
1900
1916
|
authorAttributionWarnings,
|
|
1901
1917
|
staleInProgressWarnings: staleInProgress.warnings,
|
|
1918
|
+
provenanceWarnings,
|
|
1902
1919
|
locksCheck,
|
|
1903
1920
|
integrityCheck,
|
|
1904
1921
|
historyDriftCheck,
|
|
@@ -1915,6 +1932,7 @@ export async function runHealth(global, options = {}) {
|
|
|
1915
1932
|
historySummary,
|
|
1916
1933
|
authorAttributionWarnings,
|
|
1917
1934
|
staleInProgressWarnings: staleInProgress.warnings,
|
|
1935
|
+
provenanceWarnings,
|
|
1918
1936
|
locksCheck,
|
|
1919
1937
|
integrityCheck,
|
|
1920
1938
|
historyDriftCheck,
|
|
@@ -1955,6 +1973,7 @@ export const _testOnlyHealthCommand = {
|
|
|
1955
1973
|
resolveActionableUnknownAuthorEventCount,
|
|
1956
1974
|
resolveHealthSkipPolicy,
|
|
1957
1975
|
resolveUnknownAuthorEventCount,
|
|
1976
|
+
resolveVectorRefreshPolicy,
|
|
1958
1977
|
selectStaleItemDetail,
|
|
1959
1978
|
summarizeHealthCheckDetails,
|
|
1960
1979
|
summarizeExtensionList,
|
|
@@ -1964,4 +1983,4 @@ export const _testOnlyHealthCommand = {
|
|
|
1964
1983
|
warningCode,
|
|
1965
1984
|
};
|
|
1966
1985
|
//# sourceMappingURL=health.js.map
|
|
1967
|
-
//# debugId=
|
|
1986
|
+
//# debugId=97e1ed14-cd36-5910-b829-4619af6080e1
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Aggregated resolver attempts for one harness provenance dimension. */
|
|
2
|
+
export interface ProvenanceResolverHealthOutcome {
|
|
3
|
+
/** Detected harness namespace. */
|
|
4
|
+
harness: string;
|
|
5
|
+
/** Provenance dimension resolved by the bounded resolver. */
|
|
6
|
+
dimension: string;
|
|
7
|
+
/** Built-in resolver name. */
|
|
8
|
+
resolver: string;
|
|
9
|
+
/** Events on which the resolver was actually attempted. */
|
|
10
|
+
attempts: number;
|
|
11
|
+
/** Attempted events that produced a bounded value. */
|
|
12
|
+
successes: number;
|
|
13
|
+
}
|
|
14
|
+
/** Bounded provenance health result suitable for `pm health` adapters. */
|
|
15
|
+
export interface ProvenanceResolverHealthScan {
|
|
16
|
+
/** Stable resolver outcome aggregates. */
|
|
17
|
+
outcomes: ProvenanceResolverHealthOutcome[];
|
|
18
|
+
/** Advisory warnings for attempted resolvers with no success. */
|
|
19
|
+
warnings: string[];
|
|
20
|
+
/** Number of nonblank history events inspected. */
|
|
21
|
+
events_read: number;
|
|
22
|
+
/** Whether an event or byte ceiling omitted history input. */
|
|
23
|
+
truncated: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** Scan immutable history without failing over malformed streams owned by integrity checks. */
|
|
26
|
+
export declare function scanProvenanceResolverHealth(pmRoot: string, eventLimit?: number): Promise<ProvenanceResolverHealthScan>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/governance/provenance-health
|
|
3
|
+
*
|
|
4
|
+
* Reads bounded, privacy-safe provenance resolver outcomes for health checks.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="68d4d540-a878-57f1-b2ae-00b111f94b43")}catch(e){}}();
|
|
8
|
+
import fs from "node:fs/promises";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
const DEFAULT_PROVENANCE_HISTORY_BYTE_LIMIT = 8_388_608;
|
|
11
|
+
function isRecord(value) {
|
|
12
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13
|
+
}
|
|
14
|
+
async function listHistoryFiles(pmRoot) {
|
|
15
|
+
try {
|
|
16
|
+
return (await fs.readdir(path.join(pmRoot, "history")))
|
|
17
|
+
.filter((file) => file.endsWith(".jsonl"))
|
|
18
|
+
.sort();
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function readHistoryFile(pmRoot, file, byteLimit) {
|
|
25
|
+
let handle;
|
|
26
|
+
try {
|
|
27
|
+
handle = await fs.open(path.join(pmRoot, "history", file), "r");
|
|
28
|
+
const size = (await handle.stat()).size;
|
|
29
|
+
const length = Math.min(size, Math.max(0, byteLimit));
|
|
30
|
+
const buffer = Buffer.alloc(length);
|
|
31
|
+
const { bytesRead } = await handle.read(buffer, 0, length, 0);
|
|
32
|
+
const decoded = buffer.subarray(0, bytesRead).toString("utf8");
|
|
33
|
+
const complete = bytesRead >= size;
|
|
34
|
+
const finalNewline = decoded.lastIndexOf("\n");
|
|
35
|
+
let content = decoded;
|
|
36
|
+
if (!complete) {
|
|
37
|
+
content = finalNewline === -1 ? "" : decoded.slice(0, finalNewline + 1);
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
content,
|
|
41
|
+
bytesRead,
|
|
42
|
+
complete,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
await handle?.close();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function parseHistoryEntry(line) {
|
|
53
|
+
try {
|
|
54
|
+
const value = JSON.parse(line);
|
|
55
|
+
return isRecord(value) ? value : null;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function collectResolverOutcomes(entry, aggregates) {
|
|
62
|
+
if (!isRecord(entry.context))
|
|
63
|
+
return;
|
|
64
|
+
const outcomes = entry.context.agent_provenance_outcomes;
|
|
65
|
+
if (!isRecord(outcomes) || typeof entry.agent_harness !== "string")
|
|
66
|
+
return;
|
|
67
|
+
for (const [dimension, rawOutcome] of Object.entries(outcomes)) {
|
|
68
|
+
if (!isRecord(rawOutcome) || typeof rawOutcome.resolver !== "string") {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (rawOutcome.status !== "resolved" && rawOutcome.status !== "failed") {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const key = `${entry.agent_harness}\0${dimension}\0${rawOutcome.resolver}`;
|
|
75
|
+
const aggregate = aggregates.get(key) ?? {
|
|
76
|
+
harness: entry.agent_harness,
|
|
77
|
+
dimension,
|
|
78
|
+
resolver: rawOutcome.resolver,
|
|
79
|
+
attempts: 0,
|
|
80
|
+
successes: 0,
|
|
81
|
+
};
|
|
82
|
+
aggregate.attempts += 1;
|
|
83
|
+
if (rawOutcome.status === "resolved")
|
|
84
|
+
aggregate.successes += 1;
|
|
85
|
+
aggregates.set(key, aggregate);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function collectHistoryContent(content, aggregates, eventLimit, initialEventsRead) {
|
|
89
|
+
let eventsRead = initialEventsRead;
|
|
90
|
+
for (const line of content.split("\n")) {
|
|
91
|
+
if (line.trim().length === 0)
|
|
92
|
+
continue;
|
|
93
|
+
if (eventsRead >= eventLimit)
|
|
94
|
+
return { eventsRead, truncated: true };
|
|
95
|
+
eventsRead += 1;
|
|
96
|
+
const entry = parseHistoryEntry(line);
|
|
97
|
+
if (entry)
|
|
98
|
+
collectResolverOutcomes(entry, aggregates);
|
|
99
|
+
}
|
|
100
|
+
return { eventsRead, truncated: false };
|
|
101
|
+
}
|
|
102
|
+
/** Scan immutable history without failing over malformed streams owned by integrity checks. */
|
|
103
|
+
export async function scanProvenanceResolverHealth(pmRoot, eventLimit = 10_000) {
|
|
104
|
+
const aggregates = new Map();
|
|
105
|
+
let eventsRead = 0;
|
|
106
|
+
let bytesRead = 0;
|
|
107
|
+
let truncated = false;
|
|
108
|
+
for (const file of await listHistoryFiles(pmRoot)) {
|
|
109
|
+
const history = await readHistoryFile(pmRoot, file, Math.max(0, DEFAULT_PROVENANCE_HISTORY_BYTE_LIMIT - bytesRead));
|
|
110
|
+
if (history === null)
|
|
111
|
+
continue;
|
|
112
|
+
bytesRead += history.bytesRead;
|
|
113
|
+
const collected = collectHistoryContent(history.content, aggregates, eventLimit, eventsRead);
|
|
114
|
+
eventsRead = collected.eventsRead;
|
|
115
|
+
if (collected.truncated) {
|
|
116
|
+
truncated = true;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
if (!history.complete) {
|
|
120
|
+
truncated = true;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const outcomes = [...aggregates.values()].sort((left, right) => left.harness.localeCompare(right.harness) ||
|
|
125
|
+
left.dimension.localeCompare(right.dimension) ||
|
|
126
|
+
left.resolver.localeCompare(right.resolver));
|
|
127
|
+
return {
|
|
128
|
+
outcomes,
|
|
129
|
+
warnings: truncated
|
|
130
|
+
? []
|
|
131
|
+
: outcomes
|
|
132
|
+
.filter((outcome) => outcome.attempts > 0 && outcome.successes === 0)
|
|
133
|
+
.map((outcome) => `provenance_resolver_zero_success:${outcome.harness}:${outcome.dimension}:${outcome.resolver}:${String(outcome.attempts)}`),
|
|
134
|
+
events_read: eventsRead,
|
|
135
|
+
truncated,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=provenance-health.js.map
|
|
139
|
+
//# debugId=68d4d540-a878-57f1-b2ae-00b111f94b43
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm validate command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f4fe9337-9b1c-590f-9071-d685559bb7b9")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import { realpathSync } from "node:fs";
|
|
10
10
|
import { execFile } from "node:child_process";
|
|
@@ -35,7 +35,7 @@ import { buildMissingLinkedPathRows, summarizeMissingLinkedPathRows, } from "../
|
|
|
35
35
|
import { assertProjectionModeChoice, } from "../output-projection.js";
|
|
36
36
|
import { collectDanglingDependencyReferences } from "../graph/assembly.js";
|
|
37
37
|
import { auditMergeAttributeFence, auditMergeDriverConfiguration, findGitWorkspaceRoot, resolveProjectMergeTypeFolders, } from "../merge/install.js";
|
|
38
|
-
import { listMergeReceipts } from "../merge/receipts.js";
|
|
38
|
+
import { listMergeReceipts, partitionMergeReceipts, } from "../merge/receipts.js";
|
|
39
39
|
import { scanStorageIntegrity } from "./storage-integrity.js";
|
|
40
40
|
import { scanTrackedRuntimeCache } from "./tracked-runtime-cache.js";
|
|
41
41
|
import { scanHistoryAuthorAttribution } from "../author-attribution.js";
|
|
@@ -2100,9 +2100,10 @@ async function buildStorageIntegrityCheck(pmRoot, items, typeToFolder, settings)
|
|
|
2100
2100
|
}
|
|
2101
2101
|
const pendingMergeReceipts = gitWorkspaceRoot === null
|
|
2102
2102
|
? []
|
|
2103
|
-
: await listMergeReceipts(gitWorkspaceRoot);
|
|
2104
|
-
|
|
2105
|
-
|
|
2103
|
+
: await listMergeReceipts(gitWorkspaceRoot, { includeLossless: true });
|
|
2104
|
+
const { pendingDecisions: pendingMergeDecisions, lossless: losslessMergeReceipts, } = partitionMergeReceipts(pendingMergeReceipts);
|
|
2105
|
+
if (pendingMergeDecisions.length > 0) {
|
|
2106
|
+
warnings.push(`validate_merge_decisions_unreviewed:${pendingMergeDecisions.length}`);
|
|
2106
2107
|
}
|
|
2107
2108
|
return {
|
|
2108
2109
|
check: {
|
|
@@ -2115,9 +2116,13 @@ async function buildStorageIntegrityCheck(pmRoot, items, typeToFolder, settings)
|
|
|
2115
2116
|
...scan,
|
|
2116
2117
|
merge_fence: fenceAudit,
|
|
2117
2118
|
merge_driver_configuration: mergeDriverAudit,
|
|
2118
|
-
pending_merge_decision_count:
|
|
2119
|
+
pending_merge_decision_count: pendingMergeDecisions.length,
|
|
2119
2120
|
pending_merge_decision_items: [
|
|
2120
|
-
...new Set(
|
|
2121
|
+
...new Set(pendingMergeDecisions.map((receipt) => receipt.item_id)),
|
|
2122
|
+
].sort((left, right) => left.localeCompare(right)),
|
|
2123
|
+
lossless_merge_receipt_count: losslessMergeReceipts.length,
|
|
2124
|
+
lossless_merge_receipt_items: [
|
|
2125
|
+
...new Set(losslessMergeReceipts.map((receipt) => receipt.item_id)),
|
|
2121
2126
|
].sort((left, right) => left.localeCompare(right)),
|
|
2122
2127
|
tracked_runtime_cache: {
|
|
2123
2128
|
tracker_relative_root: trackedRuntimeCache.tracker_relative_root,
|
|
@@ -2332,4 +2337,4 @@ export async function runValidate(options, global, services = {}) {
|
|
|
2332
2337
|
}
|
|
2333
2338
|
/* c8 ignore stop */
|
|
2334
2339
|
//# sourceMappingURL=validate.js.map
|
|
2335
|
-
//# debugId=
|
|
2340
|
+
//# debugId=f4fe9337-9b1c-590f-9071-d685559bb7b9
|
package/dist/sdk/governance.d.ts
CHANGED
|
@@ -12,4 +12,5 @@ export { runUpgrade, type UpgradeCliResult, type UpgradeCommandOptions, type Upg
|
|
|
12
12
|
export * from "./governance/validate.js";
|
|
13
13
|
export * from "./author-attribution.js";
|
|
14
14
|
export * from "./mutation-guard.js";
|
|
15
|
+
export * from "./governance/provenance-health.js";
|
|
15
16
|
export * from "./similarity.js";
|
package/dist/sdk/governance.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides validation, health, integrity, and mutation-policy primitives.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8e8c2de1-7bff-57c6-8e71-9c27e9e76eaa")}catch(e){}}();
|
|
8
8
|
export * from "./governance/gc.js";
|
|
9
9
|
export * from "./governance/health.js";
|
|
10
10
|
export { runReindex, } from "./governance/reindex.js";
|
|
@@ -14,6 +14,7 @@ export { runUpgrade, } from "./governance/upgrade.js";
|
|
|
14
14
|
export * from "./governance/validate.js";
|
|
15
15
|
export * from "./author-attribution.js";
|
|
16
16
|
export * from "./mutation-guard.js";
|
|
17
|
+
export * from "./governance/provenance-health.js";
|
|
17
18
|
export * from "./similarity.js";
|
|
18
19
|
//# sourceMappingURL=governance.js.map
|
|
19
|
-
//# debugId=
|
|
20
|
+
//# debugId=8e8c2de1-7bff-57c6-8e71-9c27e9e76eaa
|
|
@@ -127,7 +127,11 @@ export interface WorkspaceRelationshipAssembly {
|
|
|
127
127
|
dangling: DanglingDependencyReferenceSummary;
|
|
128
128
|
/** Raw same-identity duplicated dependency rows found before graph dedup. */
|
|
129
129
|
duplicateRows: DuplicateDependencyRow[];
|
|
130
|
+
/** Raw legacy alias rows grouped by accepted spelling before graph canonicalization. */
|
|
131
|
+
legacyAliasCounts: Record<string, number>;
|
|
130
132
|
}
|
|
133
|
+
/** Count raw dependency rows that use a registered compatibility alias instead of its canonical kind. */
|
|
134
|
+
export declare function collectLegacyDependencyAliasCounts(items: readonly DependencyReferenceHolder[], registry?: RelationshipKindRegistry): Record<string, number>;
|
|
131
135
|
/**
|
|
132
136
|
* Build the shared workspace relationship graph including missing placeholder
|
|
133
137
|
* nodes. One assembly serves every bounded query in an invocation — dependency
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="62ec8e0e-658e-5a32-b458-439d5ffd1229")}catch(e){}}();
|
|
3
3
|
import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
|
|
4
4
|
import { RelationshipGraph, createRelationshipKindRegistry, } from "../relationships.js";
|
|
5
5
|
import { isExternalDependencySourceKind } from "../dependency-provenance.js";
|
|
@@ -191,6 +191,25 @@ export function collectExternalDependencyTargetIds(items) {
|
|
|
191
191
|
}
|
|
192
192
|
return [...targets.values()].sort((left, right) => left.localeCompare(right));
|
|
193
193
|
}
|
|
194
|
+
/** Count raw dependency rows that use a registered compatibility alias instead of its canonical kind. */
|
|
195
|
+
export function collectLegacyDependencyAliasCounts(items, registry = resolveWorkspaceRelationshipKindRegistry()) {
|
|
196
|
+
const counts = {};
|
|
197
|
+
for (const item of items) {
|
|
198
|
+
for (const dependency of item.dependencies ?? []) {
|
|
199
|
+
if (typeof dependency !== "object" || dependency === null)
|
|
200
|
+
continue;
|
|
201
|
+
const rawKind = dependency.kind;
|
|
202
|
+
if (typeof rawKind !== "string")
|
|
203
|
+
continue;
|
|
204
|
+
const normalized = rawKind.trim().toLowerCase().replaceAll("-", "_");
|
|
205
|
+
const definition = registry.resolve(rawKind);
|
|
206
|
+
if (definition && normalized !== definition.kind) {
|
|
207
|
+
counts[normalized] = (counts[normalized] ?? 0) + 1;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return Object.fromEntries(Object.entries(counts).sort(([left], [right]) => left.localeCompare(right)));
|
|
212
|
+
}
|
|
194
213
|
/**
|
|
195
214
|
* Build the shared workspace relationship graph including missing placeholder
|
|
196
215
|
* nodes. One assembly serves every bounded query in an invocation — dependency
|
|
@@ -277,7 +296,8 @@ export function assembleWorkspaceRelationshipGraph(items, isTerminal, registry)
|
|
|
277
296
|
missingIdSet: new Set(missingIds.map((id) => id.toLowerCase())),
|
|
278
297
|
dangling,
|
|
279
298
|
duplicateRows: collectDuplicateDependencyRows(safeItems, isTerminal),
|
|
299
|
+
legacyAliasCounts: collectLegacyDependencyAliasCounts(safeItems, relationshipRegistry),
|
|
280
300
|
};
|
|
281
301
|
}
|
|
282
302
|
//# sourceMappingURL=assembly.js.map
|
|
283
|
-
//# debugId=
|
|
303
|
+
//# debugId=62ec8e0e-658e-5a32-b458-439d5ffd1229
|
package/dist/sdk/graph/run.d.ts
CHANGED
|
@@ -194,6 +194,8 @@ export interface GraphAuditResult {
|
|
|
194
194
|
affected_subjects_by_code: Record<string, number>;
|
|
195
195
|
/** Structural coverage metrics computed during the audit. */
|
|
196
196
|
profile: RelationshipAuditReport["profile"];
|
|
197
|
+
/** Stored legacy relationship aliases grouped by spelling; canonical graph counts remain in profile. */
|
|
198
|
+
legacy_alias_counts?: Record<string, number>;
|
|
197
199
|
/** Ordered findings with bounded evidence samples; absent with summary. */
|
|
198
200
|
findings?: RelationshipAuditReport["findings"];
|
|
199
201
|
/** Signed change since the persisted census baseline; absent when no baseline exists. */
|
package/dist/sdk/graph/run.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* queries in long-lived hosts are answered from the memoized snapshot.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
14
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ba8e7432-539e-55d3-b105-689db55d26b2")}catch(e){}}();
|
|
15
15
|
import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
|
|
16
16
|
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
17
17
|
import { isTerminalStatus } from "../../core/item/status.js";
|
|
@@ -291,6 +291,7 @@ function runGraphAudit(invocation, isTerminal) {
|
|
|
291
291
|
affected_subjects_by_severity: affectedBySeverity,
|
|
292
292
|
affected_subjects_by_code: affectedByCode,
|
|
293
293
|
profile: report.profile,
|
|
294
|
+
legacy_alias_counts: invocation.assembly.legacyAliasCounts,
|
|
294
295
|
...(invocation.summary ? {} : { findings: report.findings }),
|
|
295
296
|
};
|
|
296
297
|
}
|
|
@@ -713,4 +714,4 @@ export async function runGraph(subcommandRaw, id, target, options, global) {
|
|
|
713
714
|
return attachGraphProjection(value, invocation.summary, "result_rows");
|
|
714
715
|
}
|
|
715
716
|
//# sourceMappingURL=run.js.map
|
|
716
|
-
//# debugId=
|
|
717
|
+
//# debugId=ba8e7432-539e-55d3-b105-689db55d26b2
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
export { PM_COMMAND_VISIBILITY_CONTRACTS, PM_MCP_PROMPT_CONTRACTS, PM_MCP_RESOURCE_CONTRACTS, PM_MCP_TOOL_COMMAND_CONTRACTS, listPmCommandsForTier, listPmMcpToolsForProfile, renderPmCommandVisibilityMarkdown, resolvePmCommandVisibilityTier, } from "./agent-capability-contracts.js";
|
|
7
7
|
export * from "./agent-session-context.js";
|
|
8
8
|
export type { PmCommandVisibilityContract, PmCommandVisibilityTier, PmMcpPromptArgumentContract, PmMcpPromptContract, PmMcpResourceContract, PmMcpToolProfile, } from "./agent-capability-contracts.js";
|
|
9
|
-
export { isErrnoError, limitAnnotationEntries, parseAnnotationTextInput, readAnnotationEntries, resolveAnnotationInput, resolveAnnotationIndex, runAnnotationCommand, wrapOwnershipConflict, type AnnotationCommandConfig, type AnnotationCommandOptions, type AnnotationCommandResult, type AnnotationEntry, type AnnotationInput, type AnnotationSourceOptions, type OwnershipConflictGuidance, } from "./annotations.js";
|
|
10
|
-
export { acknowledgeUnknownAuthorHistoryEvents, inspectHistoryAuthorStream, scanHistoryAuthorAttribution, type AcknowledgeUnknownAuthorEventsOptions, type HistoryAuthorAttributionScan, type UnknownAuthorHistoryEvent, } from "./author-attribution.js";
|
|
9
|
+
export { isErrnoError, limitAnnotationEntries, parseAnnotationTextInput, readAnnotationEntries, normalizeAnnotationTransportOptions, resolveAnnotationInput, resolveAnnotationIndex, runAnnotationCommand, wrapOwnershipConflict, type AnnotationCommandConfig, type AnnotationCommandOptions, type AnnotationCommandResult, type AnnotationEntry, type AnnotationInput, type AnnotationHistoryRestoration, type AnnotationMutationReceipt, type AnnotationOmissionReceipt, type AnnotationSourceOptions, type OwnershipConflictGuidance, } from "./annotations.js";
|
|
10
|
+
export { acknowledgeUnknownAuthorHistoryEvents, acknowledgeUnknownAuthorHistoryEventsFromTransport, inspectHistoryAuthorStream, parseUnknownAuthorHistoryEventCoordinates, resolveUnknownAuthorAcknowledgmentSelector, scanHistoryAuthorAttribution, type AcknowledgeUnknownAuthorEventsOptions, type HistoryAuthorAttributionScan, type UnknownAuthorHistoryEvent, } from "./author-attribution.js";
|
|
11
11
|
export { BUILTIN_CORPUS_SHAPES, PM_CORPUS_SHAPE_SCHEMA, buildCorpusShapeItemPlan, createCorpusShapeMeasurement, defineCorpusShape, listBuiltinCorpusShapes, measureCorpusShapePlan, resolveBuiltinCorpusShape, type BuiltinCorpusShapeName, type CorpusShape, type CorpusShapeEdgeWeight, type CorpusShapeItemPlan, type CorpusShapeMeasurement, type CorpusShapeProfile, } from "./corpus-shape.js";
|
|
12
12
|
export * from "./core-governance.js";
|
|
13
13
|
export { createPmCliProgram } from "./cli-program.js";
|
|
@@ -29,7 +29,7 @@ export { runEvent, runMeet, runRemind, type MeetingEventShortcutOptions, type Re
|
|
|
29
29
|
export { createExtensionCommandSdk } from "./extension-command-context.js";
|
|
30
30
|
export { isRuntimeRecord } from "./runtime-input.js";
|
|
31
31
|
export { resolveStartTaskInProgressStatus } from "./start-task-status.js";
|
|
32
|
-
export { auditMergeAttributeFence, buildMergeAttributePatterns, findGitWorkspaceRoot, installMergeFence, refreshMergeAttributeFenceIfInstalled, resolveProjectMergeTypeFolders, runMergeInstall, type MergeFenceAuditResult, type MergeFenceRefreshOutcome, type MergeInstallOptions, type MergeInstallResult, } from "./merge/install.js";
|
|
32
|
+
export { auditMergeAttributeFence, buildMergeAttributePatterns, findGitWorkspaceRoot, installMergeFence, refreshMergeAttributeFenceIfInstalled, resolveMergeInstallContext, resolveProjectMergeTypeFolders, runMergeInstall, type MergeFenceAuditResult, type MergeFenceRefreshOutcome, type MergeInstallOptions, type MergeInstallContextResolution, type MergeInstallResult, } from "./merge/install.js";
|
|
33
33
|
export { deriveSchemaEvolutionMigrationId, formatSchemaEvolutionMigrationHuman, planSchemaEvolutionMigration, runSchemaEvolutionMigration, type PlanSchemaEvolutionMigrationOptions, type SchemaEvolutionFieldChange, type SchemaEvolutionItemPlan, type SchemaEvolutionMigrationPlan, } from "./schema-migration.js";
|
|
34
34
|
export { runWithActiveExtensions, type ActiveExtensionScopeOptions, } from "./runtime.js";
|
|
35
35
|
export { applyInvocationAuthorOverride } from "./invocation-author.js";
|
|
@@ -52,6 +52,10 @@ export { ACTIVITY_FLAG_CONTRACTS, ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, AG
|
|
|
52
52
|
export type { CliFlagContract, OptionsFromContracts, PmActionSchemaContract, PmActionToolInputSchemaOptions, PmToolCustomFieldCollision, PmBulkMutationControlOptions, PmBulkMutationFilterOptions, PmCloseActionOptions, PmCloseManyActionOptions, PmCreateActionOptions, PmMutationAttributionOptions, PmOptionScalar, PmCommandOutputBudgetContract, PmOutputBudgetClass, PmOutputDegradationStep, PmUpdateActionOptions, PmUpdateManyActionOptions, PmExtensionCapabilityContract, PmExtensionPolicyModeContract, PmExtensionPolicySurfaceContract, PmExtensionSandboxProfileContract, PmExtensionServiceNameContract, PmExtensionTrustModeContract, PmToolAction, SdkCliActionParameterCoverage, SdkCliCompletenessContractSource, SdkCliParameterCoverageEntry, SdkCliParameterDisposition, ToolOptionFlagContract, } from "./cli-contracts.js";
|
|
53
53
|
export * from "./compose.js";
|
|
54
54
|
export * from "./compile-cache.js";
|
|
55
|
+
export * from "./environment/project-runtime-compatibility.js";
|
|
56
|
+
export * from "./environment/source-context.js";
|
|
57
|
+
export * from "./environment/host-environment-errors.js";
|
|
58
|
+
export * from "./cli-contracts/command-exit-contracts.js";
|
|
55
59
|
export * from "./context-relevance.js";
|
|
56
60
|
export * from "./context-intent-contracts.js";
|
|
57
61
|
export * from "./context-intent-runtime.js";
|