@unbrained/pm-cli 2026.5.18 → 2026.5.27
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/CHANGELOG.md +953 -472
- package/README.md +4 -11
- package/dist/cli/bootstrap-args.d.ts +18 -1
- package/dist/cli/bootstrap-args.js +143 -3
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +147 -10
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/annotation-command.d.ts +49 -0
- package/dist/cli/commands/annotation-command.js +135 -0
- package/dist/cli/commands/annotation-command.js.map +1 -0
- package/dist/cli/commands/append.js +5 -8
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/calendar.js +3 -6
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/claim.js +15 -24
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js +63 -10
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments.d.ts +5 -0
- package/dist/cli/commands/comments.js +27 -117
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.d.ts +2 -2
- package/dist/cli/commands/completion.js +203 -63
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +1 -1
- package/dist/cli/commands/config.js +82 -4
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.js +4 -10
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.js +168 -36
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +53 -313
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +7 -4
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/delete.d.ts +3 -0
- package/dist/cli/commands/delete.js +11 -9
- package/dist/cli/commands/delete.js.map +1 -1
- package/dist/cli/commands/docs.d.ts +2 -12
- package/dist/cli/commands/docs.js +8 -316
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/event-validation-messages.d.ts +3 -0
- package/dist/cli/commands/event-validation-messages.js +44 -0
- package/dist/cli/commands/event-validation-messages.js.map +1 -0
- package/dist/cli/commands/extension/bundled-catalog.d.ts +14 -0
- package/dist/cli/commands/extension/bundled-catalog.js +268 -0
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -0
- package/dist/cli/commands/extension/doctor.d.ts +31 -0
- package/dist/cli/commands/extension/doctor.js +345 -0
- package/dist/cli/commands/extension/doctor.js.map +1 -0
- package/dist/cli/commands/extension/install-sources.d.ts +37 -0
- package/dist/cli/commands/extension/install-sources.js +384 -0
- package/dist/cli/commands/extension/install-sources.js.map +1 -0
- package/dist/cli/commands/extension/managed-state.d.ts +48 -0
- package/dist/cli/commands/extension/managed-state.js +172 -0
- package/dist/cli/commands/extension/managed-state.js.map +1 -0
- package/dist/cli/commands/extension/scaffold.d.ts +14 -0
- package/dist/cli/commands/extension/scaffold.js +169 -0
- package/dist/cli/commands/extension/scaffold.js.map +1 -0
- package/dist/cli/commands/extension/shared.d.ts +14 -0
- package/dist/cli/commands/extension/shared.js +106 -0
- package/dist/cli/commands/extension/shared.js.map +1 -0
- package/dist/cli/commands/extension.d.ts +37 -68
- package/dist/cli/commands/extension.js +157 -1319
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.d.ts +1 -12
- package/dist/cli/commands/files.js +14 -318
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/gc.js +17 -4
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +3 -2
- package/dist/cli/commands/get.js +52 -9
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +10 -0
- package/dist/cli/commands/health.js +269 -76
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +8 -0
- package/dist/cli/commands/history-redact.js +35 -113
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.d.ts +33 -0
- package/dist/cli/commands/history-repair.js +172 -0
- package/dist/cli/commands/history-repair.js.map +1 -0
- package/dist/cli/commands/history.d.ts +4 -4
- package/dist/cli/commands/history.js +10 -88
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +3 -1
- package/dist/cli/commands/index.js +5 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +28 -0
- package/dist/cli/commands/init.js +23 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +20 -119
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/legacy-none-tokens.d.ts +3 -0
- package/dist/cli/commands/legacy-none-tokens.js +39 -0
- package/dist/cli/commands/legacy-none-tokens.js.map +1 -0
- package/dist/cli/commands/linked-artifacts.d.ts +96 -0
- package/dist/cli/commands/linked-artifacts.js +335 -0
- package/dist/cli/commands/linked-artifacts.js.map +1 -0
- package/dist/cli/commands/linked-test-entry.d.ts +3 -0
- package/dist/cli/commands/linked-test-entry.js +62 -0
- package/dist/cli/commands/linked-test-entry.js.map +1 -0
- package/dist/cli/commands/linked-test-parsers.d.ts +28 -0
- package/dist/cli/commands/linked-test-parsers.js +192 -0
- package/dist/cli/commands/linked-test-parsers.js.map +1 -0
- package/dist/cli/commands/list.js +49 -24
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/normalize.js +4 -3
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/notes.js +20 -119
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +3 -0
- package/dist/cli/commands/plan.js +184 -22
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/recurrence-parsers.d.ts +26 -0
- package/dist/cli/commands/recurrence-parsers.js +98 -0
- package/dist/cli/commands/recurrence-parsers.js.map +1 -0
- package/dist/cli/commands/restore.js +24 -56
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +31 -0
- package/dist/cli/commands/schema.js +98 -0
- package/dist/cli/commands/schema.js.map +1 -0
- package/dist/cli/commands/search.js +154 -42
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/templates.d.ts +4 -0
- package/dist/cli/commands/templates.js +89 -17
- package/dist/cli/commands/templates.js.map +1 -1
- package/dist/cli/commands/test/linked-command-detection.d.ts +37 -0
- package/dist/cli/commands/test/linked-command-detection.js +200 -0
- package/dist/cli/commands/test/linked-command-detection.js.map +1 -0
- package/dist/cli/commands/test-all.js +4 -8
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +2 -2
- package/dist/cli/commands/test.js +12 -357
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +6 -9
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.js +167 -401
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +3 -1
- package/dist/cli/commands/validate.js +23 -71
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +1 -0
- package/dist/cli/error-guidance.js +100 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +0 -1
- package/dist/cli/extension-command-help.js +2 -13
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.d.ts +1 -0
- package/dist/cli/extension-command-options.js +106 -7
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.d.ts +0 -1
- package/dist/cli/help-content.js +13 -9
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.d.ts +1 -0
- package/dist/cli/help-json-payload.js +33 -3
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.d.ts +11 -0
- package/dist/cli/main.js +109 -55
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +5 -2
- package/dist/cli/register-list-query.js +254 -192
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.d.ts +1 -1
- package/dist/cli/register-mutation.js +247 -64
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +17 -12
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +33 -16
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +0 -2
- package/dist/cli/registration-helpers.js +14 -40
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli.js +25 -4
- package/dist/cli.js.map +1 -1
- package/dist/core/config/positional-value.d.ts +44 -0
- package/dist/core/config/positional-value.js +109 -0
- package/dist/core/config/positional-value.js.map +1 -0
- package/dist/core/extensions/extension-capability-aliases.d.ts +14 -0
- package/dist/core/extensions/extension-capability-aliases.js +159 -0
- package/dist/core/extensions/extension-capability-aliases.js.map +1 -0
- package/dist/core/extensions/extension-hook-runtime.d.ts +13 -0
- package/dist/core/extensions/extension-hook-runtime.js +414 -0
- package/dist/core/extensions/extension-hook-runtime.js.map +1 -0
- package/dist/core/extensions/extension-policy.d.ts +69 -0
- package/dist/core/extensions/extension-policy.js +481 -0
- package/dist/core/extensions/extension-policy.js.map +1 -0
- package/dist/core/extensions/extension-registries.d.ts +8 -0
- package/dist/core/extensions/extension-registries.js +52 -0
- package/dist/core/extensions/extension-registries.js.map +1 -0
- package/dist/core/extensions/extension-runtime-helpers.d.ts +6 -0
- package/dist/core/extensions/extension-runtime-helpers.js +29 -0
- package/dist/core/extensions/extension-runtime-helpers.js.map +1 -0
- package/dist/core/extensions/extension-types.d.ts +13 -39
- package/dist/core/extensions/extension-types.js +34 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +7 -1
- package/dist/core/extensions/index.js +11 -14
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +4 -22
- package/dist/core/extensions/loader.js +23 -1146
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/fs/path-utils.d.ts +1 -0
- package/dist/core/fs/path-utils.js +12 -0
- package/dist/core/fs/path-utils.js.map +1 -0
- package/dist/core/history/drift-scan.d.ts +22 -0
- package/dist/core/history/drift-scan.js +149 -0
- package/dist/core/history/drift-scan.js.map +1 -0
- package/dist/core/history/history-rewrite.d.ts +43 -0
- package/dist/core/history/history-rewrite.js +48 -0
- package/dist/core/history/history-rewrite.js.map +1 -0
- package/dist/core/history/history.js +5 -4
- package/dist/core/history/history.js.map +1 -1
- package/dist/core/history/replay.d.ts +82 -0
- package/dist/core/history/replay.js +250 -0
- package/dist/core/history/replay.js.map +1 -0
- package/dist/core/item/item-format.js +11 -8
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/item-record.d.ts +19 -0
- package/dist/core/item/item-record.js +24 -0
- package/dist/core/item/item-record.js.map +1 -0
- package/dist/core/item/item-type-definition.d.ts +52 -0
- package/dist/core/item/item-type-definition.js +123 -0
- package/dist/core/item/item-type-definition.js.map +1 -0
- package/dist/core/item/parse.js +3 -2
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/item/priority.d.ts +23 -0
- package/dist/core/item/priority.js +55 -0
- package/dist/core/item/priority.js.map +1 -0
- package/dist/core/item/status.d.ts +14 -1
- package/dist/core/item/status.js +22 -2
- package/dist/core/item/status.js.map +1 -1
- package/dist/core/item/toon-decode.d.ts +19 -0
- package/dist/core/item/toon-decode.js +69 -0
- package/dist/core/item/toon-decode.js.map +1 -0
- package/dist/core/item/type-registry.js +13 -84
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/output/mutation-projection.d.ts +31 -0
- package/dist/core/output/mutation-projection.js +103 -0
- package/dist/core/output/mutation-projection.js.map +1 -0
- package/dist/core/output/output.d.ts +2 -0
- package/dist/core/output/output.js +5 -3
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/packages/manifest.js +3 -9
- package/dist/core/packages/manifest.js.map +1 -1
- package/dist/core/schema/item-types-file.d.ts +85 -0
- package/dist/core/schema/item-types-file.js +243 -0
- package/dist/core/schema/item-types-file.js.map +1 -0
- package/dist/core/schema/runtime-schema.d.ts +2 -1
- package/dist/core/schema/runtime-schema.js +17 -45
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +3 -3
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.js +46 -9
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/helpers.d.ts +1 -1
- package/dist/core/sentry/helpers.js +20 -3
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/shared/author.d.ts +1 -0
- package/dist/core/shared/author.js +9 -0
- package/dist/core/shared/author.js.map +1 -0
- package/dist/core/shared/command-types.d.ts +1 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/core/shared/constants.d.ts +10 -1
- package/dist/core/shared/constants.js +56 -58
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/lazy-module.d.ts +1 -0
- package/dist/core/shared/lazy-module.js +11 -0
- package/dist/core/shared/lazy-module.js.map +1 -0
- package/dist/core/shared/option-alias-visibility.d.ts +44 -0
- package/dist/core/shared/option-alias-visibility.js +76 -0
- package/dist/core/shared/option-alias-visibility.js.map +1 -0
- package/dist/core/shared/primitives.d.ts +23 -0
- package/dist/core/shared/primitives.js +39 -2
- package/dist/core/shared/primitives.js.map +1 -1
- package/dist/core/shared/text-normalization.d.ts +0 -1
- package/dist/core/shared/text-normalization.js +2 -5
- package/dist/core/shared/text-normalization.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +16 -2
- package/dist/core/store/front-matter-cache.js +99 -33
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-store.d.ts +2 -0
- package/dist/core/store/item-store.js +76 -110
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +106 -0
- package/dist/core/store/settings-validator.js +279 -0
- package/dist/core/store/settings-validator.js.map +1 -0
- package/dist/core/store/settings.js +6 -343
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.js +5 -3
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.js +138 -39
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +20 -0
- package/dist/sdk/cli-contracts/enum-contracts.js +156 -0
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +14 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js +243 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -0
- package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +11 -0
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +901 -0
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -0
- package/dist/sdk/cli-contracts.d.ts +18 -33
- package/dist/sdk/cli-contracts.js +96 -1238
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/package-import-adapters.d.ts +74 -0
- package/dist/sdk/package-import-adapters.js +186 -0
- package/dist/sdk/package-import-adapters.js.map +1 -0
- package/dist/sdk/package-runtime-options.d.ts +26 -0
- package/dist/sdk/package-runtime-options.js +71 -0
- package/dist/sdk/package-runtime-options.js.map +1 -0
- package/dist/sdk/runtime.d.ts +27 -1
- package/dist/sdk/runtime.js +48 -3
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.js +10 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +13 -11
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +5 -28
- package/docs/CODEX_PLUGIN.md +5 -5
- package/docs/COMMANDS.md +58 -9
- package/docs/CONFIGURATION.md +16 -1
- package/docs/EXTENSIONS.md +4 -63
- package/docs/RELEASING.md +12 -8
- package/docs/SDK.md +11 -2
- package/marketplace.json +7 -3
- package/package.json +18 -14
- package/packages/pm-beads/extensions/beads/index.js +2 -49
- package/packages/pm-beads/extensions/beads/index.ts +2 -54
- package/packages/pm-beads/extensions/beads/runtime-loader.js +86 -0
- package/packages/pm-beads/extensions/beads/runtime-loader.ts +88 -0
- package/packages/pm-beads/extensions/beads/runtime.js +26 -115
- package/packages/pm-beads/extensions/beads/runtime.ts +33 -132
- package/packages/pm-calendar/README.md +3 -1
- package/packages/pm-calendar/extensions/calendar/index.js +66 -2
- package/packages/pm-calendar/extensions/calendar/index.ts +71 -2
- package/packages/pm-calendar/extensions/calendar/runtime.js +1 -0
- package/packages/pm-calendar/extensions/calendar/runtime.ts +1 -0
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +14 -41
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +25 -41
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +10 -50
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +17 -50
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +8 -40
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +10 -40
- package/packages/pm-search-advanced/README.md +8 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +75 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +74 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +58 -33
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +60 -33
- package/packages/pm-templates/extensions/templates/runtime.js +11 -202
- package/packages/pm-templates/extensions/templates/runtime.ts +38 -230
- package/packages/pm-todos/extensions/todos/index.js +3 -50
- package/packages/pm-todos/extensions/todos/index.ts +3 -55
- package/packages/pm-todos/extensions/todos/runtime-loader.js +86 -0
- package/packages/pm-todos/extensions/todos/runtime-loader.ts +88 -0
- package/packages/pm-todos/extensions/todos/runtime.js +24 -117
- package/packages/pm-todos/extensions/todos/runtime.ts +32 -129
- package/plugins/pm-claude/README.md +2 -2
- package/plugins/pm-claude/commands/pm-planner.md +1 -15
- package/plugins/pm-claude/scripts/pm-mcp-server.mjs +5 -2
- package/plugins/pm-claude/skills/pm-planner/SKILL.md +3 -21
- package/plugins/pm-codex/scripts/pm-mcp-server.mjs +15 -6
- package/plugins/pm-codex/skills/pm-native/SKILL.md +1 -13
- package/PRD.md +0 -1734
- package/dist/core/output/command-aware.d.ts +0 -1
- package/dist/core/output/command-aware.js +0 -397
- package/dist/core/output/command-aware.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GlobalOptions } from "../../core/shared/command-types.js";
|
|
2
2
|
type ValidateCheckName = "metadata" | "resolution" | "lifecycle" | "files" | "command_references" | "history_drift";
|
|
3
|
-
type ValidateStatus = "ok" | "warn";
|
|
3
|
+
type ValidateStatus = "ok" | "warn" | "error";
|
|
4
4
|
export interface ValidateCommandOptions {
|
|
5
5
|
checkMetadata?: boolean;
|
|
6
6
|
checkResolution?: boolean;
|
|
@@ -10,6 +10,7 @@ export interface ValidateCommandOptions {
|
|
|
10
10
|
checkFiles?: boolean;
|
|
11
11
|
includePmInternals?: boolean;
|
|
12
12
|
verboseFileLists?: boolean;
|
|
13
|
+
verboseDiagnostics?: boolean;
|
|
13
14
|
checkHistoryDrift?: boolean;
|
|
14
15
|
checkCommandReferences?: boolean;
|
|
15
16
|
scanMode?: string;
|
|
@@ -22,6 +23,7 @@ export interface ValidateCheck {
|
|
|
22
23
|
}
|
|
23
24
|
export interface ValidateResult {
|
|
24
25
|
ok: boolean;
|
|
26
|
+
has_warnings: boolean;
|
|
25
27
|
checks: ValidateCheck[];
|
|
26
28
|
warnings: string[];
|
|
27
29
|
generated_at: string;
|
|
@@ -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]="9884a203-9cc7-581e-a8e1-fd43052be74d")}catch(e){}}();
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import { realpathSync } from "node:fs";
|
|
5
5
|
import { execFile } from "node:child_process";
|
|
@@ -7,7 +7,7 @@ import path from "node:path";
|
|
|
7
7
|
import { promisify } from "node:util";
|
|
8
8
|
import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
|
|
9
9
|
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
10
|
-
import {
|
|
10
|
+
import { scanHistoryDrift } from "../../core/history/drift-scan.js";
|
|
11
11
|
import { normalizeStatusInput } from "../../core/item/status.js";
|
|
12
12
|
import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
|
|
13
13
|
import { resolveRuntimeStatusRegistry } from "../../core/schema/runtime-schema.js";
|
|
@@ -16,9 +16,8 @@ import { PmCliError } from "../../core/shared/errors.js";
|
|
|
16
16
|
import { toNonEmptyStringOrUndefined } from "../../core/shared/primitives.js";
|
|
17
17
|
import { nowIso } from "../../core/shared/time.js";
|
|
18
18
|
import { listAllFrontMatterWithBody } from "../../core/store/item-store.js";
|
|
19
|
-
import {
|
|
19
|
+
import { getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
|
|
20
20
|
import { readSettings } from "../../core/store/settings.js";
|
|
21
|
-
import { verifyHistoryChain } from "./history.js";
|
|
22
21
|
import { extractReferencedPmItemIdsFromCommand } from "./test.js";
|
|
23
22
|
const FILE_SCAN_DIRECTORIES = ["src", "tests", "docs"];
|
|
24
23
|
const FILE_SCAN_ROOT_FILES = [
|
|
@@ -110,6 +109,7 @@ const METADATA_TRUNCATED_KEY_BY_FIELD = {
|
|
|
110
109
|
};
|
|
111
110
|
const GIT_LS_FILES_MAX_BUFFER = 32 * 1024 * 1024;
|
|
112
111
|
const FILE_LIST_SUMMARY_LIMIT = 40;
|
|
112
|
+
const DIAGNOSTIC_LIST_SUMMARY_LIMIT = 40;
|
|
113
113
|
const execFileAsync = promisify(execFile);
|
|
114
114
|
function normalizeRelativePath(value) {
|
|
115
115
|
return value.replaceAll("\\", "/").replace(/^\.\/+/, "").replace(/^\/+/, "");
|
|
@@ -446,7 +446,7 @@ async function collectProjectFileCandidates(workspaceRoot, scanMode) {
|
|
|
446
446
|
candidateScanned: defaultCandidates.length,
|
|
447
447
|
};
|
|
448
448
|
}
|
|
449
|
-
function summarizeList(values, limit =
|
|
449
|
+
function summarizeList(values, limit = DIAGNOSTIC_LIST_SUMMARY_LIMIT) {
|
|
450
450
|
/* c8 ignore start -- truncation behavior only surfaces with very large synthetic datasets. */
|
|
451
451
|
if (values.length <= limit) {
|
|
452
452
|
return { values, truncated: false };
|
|
@@ -518,7 +518,7 @@ function resolveRequestedChecks(options) {
|
|
|
518
518
|
}
|
|
519
519
|
return requested;
|
|
520
520
|
}
|
|
521
|
-
function buildMetadataCheck(items, metadataPolicy, statusRegistry) {
|
|
521
|
+
function buildMetadataCheck(items, metadataPolicy, statusRegistry, verboseDiagnostics) {
|
|
522
522
|
const missingByField = Object.fromEntries(SUPPORTED_METADATA_REQUIRED_FIELDS.map((field) => [field, []]));
|
|
523
523
|
for (const item of items) {
|
|
524
524
|
for (const field of SUPPORTED_METADATA_REQUIRED_FIELDS) {
|
|
@@ -561,7 +561,7 @@ function buildMetadataCheck(items, metadataPolicy, statusRegistry) {
|
|
|
561
561
|
if (missingByField[field].length === 0) {
|
|
562
562
|
continue;
|
|
563
563
|
}
|
|
564
|
-
const summarized = summarizeList(missingByField[field]);
|
|
564
|
+
const summarized = summarizeList(missingByField[field], verboseDiagnostics ? missingByField[field].length : DIAGNOSTIC_LIST_SUMMARY_LIMIT);
|
|
565
565
|
details[METADATA_ITEM_IDS_KEY_BY_FIELD[field]] = summarized.values;
|
|
566
566
|
details[METADATA_TRUNCATED_KEY_BY_FIELD[field]] = summarized.truncated;
|
|
567
567
|
}
|
|
@@ -574,7 +574,7 @@ function buildMetadataCheck(items, metadataPolicy, statusRegistry) {
|
|
|
574
574
|
warnings: warningTokens,
|
|
575
575
|
};
|
|
576
576
|
}
|
|
577
|
-
function buildResolutionCheck(items, statusRegistry) {
|
|
577
|
+
function buildResolutionCheck(items, statusRegistry, verboseDiagnostics) {
|
|
578
578
|
const terminalDoneStatuses = new Set(statusRegistry.terminal_done_statuses);
|
|
579
579
|
terminalDoneStatuses.add(statusRegistry.close_status);
|
|
580
580
|
const closedItems = items.filter((item) => terminalDoneStatuses.has(normalizeStatusForRegistry(item.status, statusRegistry)));
|
|
@@ -590,9 +590,10 @@ function buildResolutionCheck(items, statusRegistry) {
|
|
|
590
590
|
});
|
|
591
591
|
}
|
|
592
592
|
const warnings = missingResolutionRows.length > 0 ? [`validate_resolution_missing_fields:${missingResolutionRows.length}`] : [];
|
|
593
|
-
const
|
|
593
|
+
const diagnosticLimit = verboseDiagnostics ? Number.POSITIVE_INFINITY : DIAGNOSTIC_LIST_SUMMARY_LIMIT;
|
|
594
|
+
const summarizedRows = summarizeList(missingResolutionRows.map((row) => `${row.id}:${row.missing_fields.join(",")}`), diagnosticLimit);
|
|
594
595
|
const remediationHints = missingResolutionRows.map((row) => buildResolutionRemediationCommand(row));
|
|
595
|
-
const summarizedHints = summarizeList(remediationHints);
|
|
596
|
+
const summarizedHints = summarizeList(remediationHints, diagnosticLimit);
|
|
596
597
|
return {
|
|
597
598
|
check: {
|
|
598
599
|
name: "resolution",
|
|
@@ -822,7 +823,11 @@ function buildLifecycleCheck(items, includeStaleBlockers, dependencyCycleSeverit
|
|
|
822
823
|
return {
|
|
823
824
|
check: {
|
|
824
825
|
name: "lifecycle",
|
|
825
|
-
status:
|
|
826
|
+
status: dependencyCycleDiagnostics.cycle_count > 0 && dependencyCycleSeverity === "error"
|
|
827
|
+
? "error"
|
|
828
|
+
: warnings.length === 0
|
|
829
|
+
? "ok"
|
|
830
|
+
: "warn",
|
|
826
831
|
details: {
|
|
827
832
|
checked_active_items: activeItems.length,
|
|
828
833
|
active_closure_like_metadata_items: closureLikeRows.length,
|
|
@@ -961,62 +966,7 @@ async function buildFilesCheck(items, workspaceRoot, pmRoot, fileScanMode, inclu
|
|
|
961
966
|
};
|
|
962
967
|
}
|
|
963
968
|
async function buildHistoryDriftCheck(pmRoot, items) {
|
|
964
|
-
const missingStreams =
|
|
965
|
-
const unreadableStreams = [];
|
|
966
|
-
const hashMismatches = [];
|
|
967
|
-
const chainMismatches = [];
|
|
968
|
-
for (const item of items) {
|
|
969
|
-
const historyPath = getHistoryPath(pmRoot, item.id);
|
|
970
|
-
let latestAfterHash = null;
|
|
971
|
-
try {
|
|
972
|
-
const raw = await fs.readFile(historyPath, "utf8");
|
|
973
|
-
if (raw.trim().length === 0) {
|
|
974
|
-
missingStreams.push(item.id);
|
|
975
|
-
continue;
|
|
976
|
-
}
|
|
977
|
-
const entries = [];
|
|
978
|
-
for (const line of raw.split(/\r?\n/)) {
|
|
979
|
-
const trimmed = line.trim();
|
|
980
|
-
if (trimmed.length === 0) {
|
|
981
|
-
continue;
|
|
982
|
-
}
|
|
983
|
-
const parsed = JSON.parse(trimmed);
|
|
984
|
-
if (typeof parsed.after_hash !== "string" || parsed.after_hash.trim().length === 0) {
|
|
985
|
-
throw new Error("missing after_hash");
|
|
986
|
-
}
|
|
987
|
-
entries.push(parsed);
|
|
988
|
-
latestAfterHash = parsed.after_hash;
|
|
989
|
-
}
|
|
990
|
-
const chainVerification = verifyHistoryChain(entries);
|
|
991
|
-
if (!chainVerification.ok) {
|
|
992
|
-
chainMismatches.push(item.id);
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
catch (error) {
|
|
996
|
-
if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
|
|
997
|
-
missingStreams.push(item.id);
|
|
998
|
-
}
|
|
999
|
-
else {
|
|
1000
|
-
unreadableStreams.push(item.id);
|
|
1001
|
-
}
|
|
1002
|
-
continue;
|
|
1003
|
-
}
|
|
1004
|
-
/* c8 ignore start -- defensive guard for future history schema changes. */
|
|
1005
|
-
if (!latestAfterHash) {
|
|
1006
|
-
missingStreams.push(item.id);
|
|
1007
|
-
continue;
|
|
1008
|
-
}
|
|
1009
|
-
/* c8 ignore stop */
|
|
1010
|
-
const { body, ...frontMatter } = item;
|
|
1011
|
-
const currentHash = hashDocument({
|
|
1012
|
-
metadata: frontMatter,
|
|
1013
|
-
body,
|
|
1014
|
-
});
|
|
1015
|
-
if (currentHash !== latestAfterHash) {
|
|
1016
|
-
hashMismatches.push(item.id);
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
const driftedItems = [...new Set([...missingStreams, ...unreadableStreams, ...hashMismatches, ...chainMismatches])].sort((a, b) => a.localeCompare(b));
|
|
969
|
+
const { missingStreams, unreadableStreams, hashMismatches, chainMismatches, driftedItems } = await scanHistoryDrift(pmRoot, items);
|
|
1020
970
|
const warnings = [];
|
|
1021
971
|
if (missingStreams.length > 0) {
|
|
1022
972
|
warnings.push(`validate_history_drift_missing_streams:${missingStreams.length}`);
|
|
@@ -1132,12 +1082,12 @@ export async function runValidate(options, global) {
|
|
|
1132
1082
|
const checks = [];
|
|
1133
1083
|
const warnings = [...new Set(itemReadWarnings)];
|
|
1134
1084
|
if (requestedChecks.has("metadata")) {
|
|
1135
|
-
const metadataCheck = buildMetadataCheck(items, metadataPolicy, statusRegistry);
|
|
1085
|
+
const metadataCheck = buildMetadataCheck(items, metadataPolicy, statusRegistry, Boolean(options.verboseDiagnostics));
|
|
1136
1086
|
checks.push(metadataCheck.check);
|
|
1137
1087
|
warnings.push(...metadataCheck.warnings);
|
|
1138
1088
|
}
|
|
1139
1089
|
if (requestedChecks.has("resolution")) {
|
|
1140
|
-
const resolutionCheck = buildResolutionCheck(items, statusRegistry);
|
|
1090
|
+
const resolutionCheck = buildResolutionCheck(items, statusRegistry, Boolean(options.verboseDiagnostics));
|
|
1141
1091
|
checks.push(resolutionCheck.check);
|
|
1142
1092
|
warnings.push(...resolutionCheck.warnings);
|
|
1143
1093
|
}
|
|
@@ -1162,12 +1112,14 @@ export async function runValidate(options, global) {
|
|
|
1162
1112
|
warnings.push(...historyDriftCheck.warnings);
|
|
1163
1113
|
}
|
|
1164
1114
|
const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
1115
|
+
const hasErrors = checks.some((check) => check.status === "error");
|
|
1165
1116
|
return {
|
|
1166
|
-
ok:
|
|
1117
|
+
ok: !hasErrors,
|
|
1118
|
+
has_warnings: normalizedWarnings.length > 0,
|
|
1167
1119
|
checks,
|
|
1168
1120
|
warnings: normalizedWarnings,
|
|
1169
1121
|
generated_at: nowIso(),
|
|
1170
1122
|
};
|
|
1171
1123
|
}
|
|
1172
1124
|
//# sourceMappingURL=validate.js.map
|
|
1173
|
-
//# debugId=
|
|
1125
|
+
//# debugId=9884a203-9cc7-581e-a8e1-fd43052be74d
|