@unbrained/pm-cli 2026.8.9 → 2026.8.11
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 +142 -80
- package/dist/cli/commander-usage.js +94 -17
- package/dist/cli/error-guidance.d.ts +10 -0
- package/dist/cli/error-guidance.js +76 -25
- package/dist/cli/help-json-payload.js +51 -16
- package/dist/cli/main.js +11 -6
- package/dist/cli/register-assurance.d.ts +8 -0
- package/dist/cli/register-assurance.js +52 -0
- package/dist/cli/register-files-lookup.js +14 -3
- package/dist/cli/register-mutation.js +30 -9
- package/dist/cli/register-operations.js +16 -11
- package/dist/cli-bundle/bundle-manifest.json +163 -163
- package/dist/cli-bundle/chunks/{chunk-RJC7TPF4.js → chunk-2OOU2AFH.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-2RA2YTHJ.js +33 -0
- package/dist/cli-bundle/chunks/chunk-A2SJGHSI.js +3 -0
- package/dist/cli-bundle/chunks/chunk-DSKYD4LG.js +13 -0
- package/dist/cli-bundle/chunks/chunk-HC3GM6YY.js +194 -0
- package/dist/cli-bundle/chunks/chunk-IUNRVDAI.js +2 -0
- package/dist/cli-bundle/chunks/chunk-W7CPZGSB.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-YC3UF2IO.js → chunk-WMEZHCFI.js} +66 -60
- package/dist/cli-bundle/chunks/{chunk-GMX5YOI3.js → chunk-ZU34C3LH.js} +48 -48
- package/dist/cli-bundle/chunks/chunk-ZXOC6HG5.js +5 -0
- package/dist/cli-bundle/chunks/{register-list-query-BUE7PTCU.js → register-list-query-HAUXVUPY.js} +8 -8
- package/dist/cli-bundle/chunks/register-mutation-7Y5U7ABT.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-EQX3DLAZ.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-UQDTNTLJ.js → register-setup-NOCOOWQY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-KNEHLPBF.js → chunk-23FTGO3W.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6DO4YQWZ.js → chunk-2DL3MRTD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3AYKXMYX.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-4AHEC74N.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-MRWVJ3ZG.js → chunk-4H5IA6AV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-4SV3ZKG3.js +16 -0
- package/dist/cli-bundle/focused-chunks/chunk-55BIB6DV.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-6JW6Z2P5.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-BKPIY34S.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-D4PIWE6D.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-DPO7TEFX.js +31 -0
- package/dist/cli-bundle/focused-chunks/{chunk-3WVHTUAW.js → chunk-E3KCL7AY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-ERAAFLPS.js +153 -0
- package/dist/cli-bundle/focused-chunks/chunk-F6E4JZKG.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-FPSYO5ZG.js +18 -0
- package/dist/cli-bundle/focused-chunks/{chunk-73FIJONU.js → chunk-J5EKAIVD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-KDH5OX3D.js +4 -0
- package/dist/cli-bundle/focused-chunks/chunk-OJ3LVVIS.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-TL5M2PAY.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-UDAZWT25.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-VABB4L5Y.js +17 -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 +41 -39
- 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 -2
- package/dist/core/diagnostics/remediation.js +9 -9
- package/dist/core/fs/fs-utils.d.ts +10 -0
- package/dist/core/fs/fs-utils.js +16 -4
- package/dist/core/item/item-format.js +3 -32
- package/dist/core/schema/fields-file.d.ts +1 -2
- package/dist/core/schema/fields-file.js +4 -11
- package/dist/core/schema/runtime-schema.js +3 -10
- package/dist/core/schema/status-defs-file.d.ts +1 -2
- package/dist/core/schema/status-defs-file.js +4 -32
- package/dist/core/schema/status-token.d.ts +2 -0
- package/dist/core/schema/status-token.js +32 -0
- package/dist/core/schema/type-workflows.d.ts +1 -2
- package/dist/core/schema/type-workflows.js +4 -11
- package/dist/core/session/session-state.d.ts +47 -0
- package/dist/core/session/session-state.js +207 -6
- package/dist/core/shared/author.d.ts +8 -2
- package/dist/core/shared/author.js +85 -52
- package/dist/core/shared/errors.d.ts +12 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/text-normalization.d.ts +1 -1
- package/dist/core/shared/text-normalization.js +2 -2
- package/dist/sdk/agent/command-recovery.d.ts +4 -0
- package/dist/sdk/agent/command-recovery.js +52 -0
- package/dist/sdk/agent/command-suggestions.d.ts +4 -0
- package/dist/sdk/agent/command-suggestions.js +67 -0
- package/dist/sdk/agent/create-option-policy.d.ts +12 -0
- package/dist/sdk/agent/create-option-policy.js +32 -0
- package/dist/sdk/agent/item-addressing.d.ts +19 -0
- package/dist/sdk/agent/item-addressing.js +208 -0
- package/dist/sdk/agent/refusal-reachability.d.ts +40 -0
- package/dist/sdk/agent/refusal-reachability.js +72 -0
- package/dist/sdk/agent/subcommand-recovery.d.ts +40 -0
- package/dist/sdk/agent/subcommand-recovery.js +84 -0
- package/dist/sdk/cli-bootstrap.d.ts +9 -1
- package/dist/sdk/cli-bootstrap.js +25 -10
- package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -4
- package/dist/sdk/cli-contracts/completeness.js +13 -3
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +3 -2
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +77 -21
- package/dist/sdk/cli-contracts/registration-helpers.js +10 -2
- package/dist/sdk/cli-contracts/runtime-contracts.js +6 -3
- package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +513 -0
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +251 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +6 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js +4 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +96 -4
- package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
- package/dist/sdk/cli-contracts/tool-schema.js +49 -6
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +3 -3
- package/dist/sdk/completion.js +9 -3
- package/dist/sdk/config.js +9 -3
- package/dist/sdk/context/semantic-session-attribution.d.ts +32 -0
- package/dist/sdk/context/semantic-session-attribution.js +83 -0
- package/dist/sdk/context-intent-runtime.js +8 -5
- package/dist/sdk/context-signal-store.d.ts +34 -0
- package/dist/sdk/context-signal-store.js +24 -2
- package/dist/sdk/core-governance.d.ts +3 -1
- package/dist/sdk/core-governance.js +5 -3
- package/dist/sdk/core.d.ts +1 -1
- package/dist/sdk/core.js +2 -2
- package/dist/sdk/dependency-flag-validation.d.ts +15 -1
- package/dist/sdk/dependency-flag-validation.js +54 -2
- package/dist/sdk/error-code-catalog.d.ts +13 -0
- package/dist/sdk/error-code-catalog.js +35 -2
- package/dist/sdk/extension.js +18 -17
- package/dist/sdk/files.d.ts +11 -0
- package/dist/sdk/files.js +82 -24
- package/dist/sdk/generated-error-code-catalog.js +104 -13
- package/dist/sdk/governance/assurance-action-contracts.d.ts +7 -0
- package/dist/sdk/governance/assurance-action-contracts.js +5 -0
- package/dist/sdk/governance/assurance-action.d.ts +70 -0
- package/dist/sdk/governance/assurance-action.js +198 -0
- package/dist/sdk/governance/assurance-limits.d.ts +7 -0
- package/dist/sdk/governance/assurance-limits.js +11 -0
- package/dist/sdk/governance/assurance-runtime.d.ts +20 -0
- package/dist/sdk/governance/assurance-runtime.js +131 -0
- package/dist/sdk/governance/assurance.d.ts +432 -0
- package/dist/sdk/governance/assurance.js +689 -0
- package/dist/sdk/governance/health.js +14 -7
- package/dist/sdk/governance/provenance-health.d.ts +13 -0
- package/dist/sdk/governance/provenance-health.js +63 -17
- package/dist/sdk/governance/validate-item-reader.d.ts +13 -0
- package/dist/sdk/governance/validate-item-reader.js +18 -0
- package/dist/sdk/governance/validate.d.ts +2 -2
- package/dist/sdk/governance/validate.js +15 -6
- package/dist/sdk/graph/run.js +8 -3
- package/dist/sdk/index.d.ts +10 -1
- package/dist/sdk/index.js +12 -3
- package/dist/sdk/lifecycle/claim.js +18 -3
- package/dist/sdk/lifecycle/close.js +17 -14
- package/dist/sdk/lifecycle/create.d.ts +2 -0
- package/dist/sdk/lifecycle/create.js +62 -9
- package/dist/sdk/lifecycle/focus.js +13 -3
- package/dist/sdk/lifecycle/plan.js +8 -3
- package/dist/sdk/lifecycle/update-many.js +39 -27
- package/dist/sdk/lifecycle/update.d.ts +6 -1
- package/dist/sdk/lifecycle/update.js +47 -10
- package/dist/sdk/merge/index.d.ts +1 -1
- package/dist/sdk/merge/index.js +3 -3
- package/dist/sdk/merge/install.d.ts +4 -0
- package/dist/sdk/merge/install.js +28 -16
- package/dist/sdk/merge/receipts.d.ts +3 -0
- package/dist/sdk/merge/receipts.js +81 -17
- package/dist/sdk/output-projection.js +24 -4
- package/dist/sdk/provenance.d.ts +38 -0
- package/dist/sdk/provenance.js +64 -2
- package/dist/sdk/query/context.d.ts +2 -0
- package/dist/sdk/query/context.js +24 -10
- package/dist/sdk/query/light-metadata.d.ts +3 -0
- package/dist/sdk/query/light-metadata.js +19 -0
- package/dist/sdk/runtime-extended-actions.js +22 -5
- package/dist/sdk/runtime-primitives.d.ts +2 -0
- package/dist/sdk/runtime-primitives.js +4 -2
- package/dist/sdk/runtime.d.ts +8 -1
- package/dist/sdk/runtime.js +37 -28
- package/dist/sdk/schema-migration.js +7 -9
- package/dist/sdk/similarity-scoring.d.ts +1 -2
- package/dist/sdk/similarity-scoring.js +4 -16
- package/dist/sdk/telemetry.js +7 -4
- package/dist/sdk/traceability/runtime-files-lookup.d.ts +8 -0
- package/dist/sdk/traceability/runtime-files-lookup.js +33 -0
- package/dist/sdk/traceability/source-traceability.d.ts +102 -0
- package/dist/sdk/traceability/source-traceability.js +293 -0
- package/dist/sdk/workspace-snapshot.d.ts +4 -0
- package/dist/sdk/workspace-snapshot.js +24 -11
- package/dist/types.d.ts +8 -2
- package/dist/types.js +2 -2
- package/docs/AGENT_GUIDE.md +3 -1
- package/docs/ASSURANCE.md +132 -0
- package/docs/COMMANDS.md +8 -5
- package/docs/MERGE_SAFETY.md +7 -5
- package/docs/README.md +3 -5
- package/docs/READ_OUTPUT_CONTRACTS.md +2 -2
- package/docs/RELEASING.md +9 -5
- package/docs/SDK.md +44 -8
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +43 -6
- package/docs/SDK_CONTEXT.md +97 -0
- package/docs/SDK_CONTEXT_INTEGRITY.md +18 -3
- package/docs/SDK_EVIDENCE_TRACEABILITY.md +39 -1
- package/docs/SDK_RUNTIME_BOUNDARIES.md +36 -1
- package/docs/TESTING.md +12 -9
- package/docs/agent-task-token-baseline.json +2 -2
- package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -0
- package/marketplace.json +2 -2
- package/package.json +7 -6
- 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/extensions/templates/index.ts +9 -3
- 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 +1028 -48
- package/dist/cli-bundle/chunks/chunk-2DTCZXSD.js +0 -13
- package/dist/cli-bundle/chunks/chunk-5JO6R4BS.js +0 -3
- package/dist/cli-bundle/chunks/chunk-5KN4DZYV.js +0 -194
- package/dist/cli-bundle/chunks/chunk-EF43KODO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HUV2Z7IS.js +0 -28
- package/dist/cli-bundle/chunks/chunk-MHBVCUF2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PYO5GZU6.js +0 -5
- package/dist/cli-bundle/chunks/register-mutation-FC3XLVIK.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-YH2WAOXU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2VVP5RAA.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-3GSFUDAI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4H6MVCK3.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-54TZJ4BM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5NK5TJ5D.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-C3GCHDSQ.js +0 -31
- package/dist/cli-bundle/focused-chunks/chunk-JGRSQZJT.js +0 -18
- package/dist/cli-bundle/focused-chunks/chunk-NL57J7BZ.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-P6BBIQRG.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-PZAGVQNN.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-QDAO3XEK.js +0 -14
- package/dist/cli-bundle/focused-chunks/chunk-T4IGQCSY.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-U46GQJNY.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-VRXJSGIT.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-XC2ZW3CJ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZG54B4XG.js +0 -2
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
/** Current serialized assurance registry format. */
|
|
2
|
+
export declare const ASSURANCE_DOCUMENT_VERSION: 1;
|
|
3
|
+
/** Supported lifecycle points that can evaluate a gate. */
|
|
4
|
+
export declare const ASSURANCE_GATE_TRIGGERS: readonly ["pre-commit", "pre-push", "pre-merge", "ci", "pre-release", "post-release", "scheduled", "on-claim", "on-close"];
|
|
5
|
+
/** Gate lifecycle trigger. */
|
|
6
|
+
export type AssuranceGateTrigger = (typeof ASSURANCE_GATE_TRIGGERS)[number];
|
|
7
|
+
/** Assertion enforcement strength. */
|
|
8
|
+
export type AssuranceEnforcement = "block" | "warn" | "observe";
|
|
9
|
+
/** Assertion lifetime after its owning work item becomes terminal. */
|
|
10
|
+
export type AssuranceLifetime = "hold" | "retire";
|
|
11
|
+
/** Numeric or labelled-set value produced by a measurement. */
|
|
12
|
+
export type AssuranceValue = number | string[];
|
|
13
|
+
/** Minimal dependency row used by built-in relationship measurements. */
|
|
14
|
+
export interface AssuranceDependencyRecord {
|
|
15
|
+
/** Target item id. */
|
|
16
|
+
id: string;
|
|
17
|
+
/** Typed relationship kind. */
|
|
18
|
+
kind: string;
|
|
19
|
+
}
|
|
20
|
+
/** Minimal item projection consumed by built-in measurement sources. */
|
|
21
|
+
export interface AssuranceItemRecord {
|
|
22
|
+
/** Stable item id. */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Lifecycle status. */
|
|
25
|
+
status: string;
|
|
26
|
+
/** Item type. */
|
|
27
|
+
type: string;
|
|
28
|
+
/** Optional tags. */
|
|
29
|
+
tags?: string[];
|
|
30
|
+
/** Optional priority. */
|
|
31
|
+
priority?: string | number;
|
|
32
|
+
/** Typed relationships. */
|
|
33
|
+
dependencies?: AssuranceDependencyRecord[];
|
|
34
|
+
/** Linked files. */
|
|
35
|
+
files?: Array<Record<string, unknown>>;
|
|
36
|
+
/** Linked tests. */
|
|
37
|
+
tests?: Array<Record<string, unknown>>;
|
|
38
|
+
/** Linked docs. */
|
|
39
|
+
docs?: Array<Record<string, unknown>>;
|
|
40
|
+
/** Extension-owned metadata remains filterable. */
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
}
|
|
43
|
+
/** Minimal immutable-history row consumed by history measurements. */
|
|
44
|
+
export interface AssuranceHistoryRecord {
|
|
45
|
+
/** Mutation operation. */
|
|
46
|
+
op: string;
|
|
47
|
+
/** Mutation author. */
|
|
48
|
+
author: string;
|
|
49
|
+
/** Optional detected harness. */
|
|
50
|
+
agent_harness?: string;
|
|
51
|
+
/** Optional detected model. */
|
|
52
|
+
agent_model?: string;
|
|
53
|
+
/** Extensible history metadata. */
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
}
|
|
56
|
+
/** Item-population measurement source. */
|
|
57
|
+
export interface AssuranceItemsSource {
|
|
58
|
+
/** Source discriminant. */
|
|
59
|
+
kind: "items";
|
|
60
|
+
/** Allowed statuses. */
|
|
61
|
+
statuses?: string[];
|
|
62
|
+
/** Allowed item types. */
|
|
63
|
+
types?: string[];
|
|
64
|
+
/** Tags that must all be present. */
|
|
65
|
+
tags?: string[];
|
|
66
|
+
/** Optional metadata field. */
|
|
67
|
+
field?: string;
|
|
68
|
+
/** Required exact value for field. */
|
|
69
|
+
equals?: string | number | boolean | null;
|
|
70
|
+
}
|
|
71
|
+
/** Typed relationship-count source. */
|
|
72
|
+
export interface AssuranceDependencyKindSource {
|
|
73
|
+
/** Source discriminant. */
|
|
74
|
+
kind: "dependency_kind";
|
|
75
|
+
/** Relationship kind to count. */
|
|
76
|
+
dependency_kind: string;
|
|
77
|
+
}
|
|
78
|
+
/** Graph-analytics source delegated to a host adapter. */
|
|
79
|
+
export interface AssuranceGraphSource {
|
|
80
|
+
/** Source discriminant. */
|
|
81
|
+
kind: "graph";
|
|
82
|
+
/** Graph analytic to execute. */
|
|
83
|
+
operation: string;
|
|
84
|
+
/** Numeric or labelled-set field to select. */
|
|
85
|
+
field: string;
|
|
86
|
+
/** Optional analytic arguments. */
|
|
87
|
+
parameters?: Record<string, string | number | boolean>;
|
|
88
|
+
}
|
|
89
|
+
/** Validator source delegated to a host adapter. */
|
|
90
|
+
export interface AssuranceValidateSource {
|
|
91
|
+
/** Source discriminant. */
|
|
92
|
+
kind: "validate";
|
|
93
|
+
/** Stable validator check id. */
|
|
94
|
+
check: string;
|
|
95
|
+
/** Numeric field within the check result. */
|
|
96
|
+
field: string;
|
|
97
|
+
}
|
|
98
|
+
/** Health-check source delegated to a host adapter. */
|
|
99
|
+
export interface AssuranceHealthSource {
|
|
100
|
+
/** Source discriminant. */
|
|
101
|
+
kind: "health";
|
|
102
|
+
/** Stable health check id. */
|
|
103
|
+
check: string;
|
|
104
|
+
/** Numeric field within the check result. */
|
|
105
|
+
field: string;
|
|
106
|
+
}
|
|
107
|
+
/** Immutable-history population source. */
|
|
108
|
+
export interface AssuranceHistorySource {
|
|
109
|
+
/** Source discriminant. */
|
|
110
|
+
kind: "history";
|
|
111
|
+
/** Optional operation filter. */
|
|
112
|
+
op?: string;
|
|
113
|
+
/** Optional author filter. */
|
|
114
|
+
author?: string;
|
|
115
|
+
/** Optional harness filter. */
|
|
116
|
+
harness?: string;
|
|
117
|
+
/** Optional model filter. */
|
|
118
|
+
model?: string;
|
|
119
|
+
}
|
|
120
|
+
/** Linked evidence population source. */
|
|
121
|
+
export interface AssuranceLinksSource {
|
|
122
|
+
/** Source discriminant. */
|
|
123
|
+
kind: "links";
|
|
124
|
+
/** Evidence collection to inspect. */
|
|
125
|
+
link: "files" | "tests" | "docs";
|
|
126
|
+
/** Count items with or without at least one link. */
|
|
127
|
+
state: "present" | "missing";
|
|
128
|
+
}
|
|
129
|
+
/** Extension- or host-contributed measurement source. */
|
|
130
|
+
export interface AssuranceProviderSource {
|
|
131
|
+
/** Source discriminant. */
|
|
132
|
+
kind: "provider";
|
|
133
|
+
/** Stable provider id. */
|
|
134
|
+
provider: string;
|
|
135
|
+
/** Provider-owned measurement key. */
|
|
136
|
+
key: string;
|
|
137
|
+
/** Provider-owned JSON-compatible parameters. */
|
|
138
|
+
parameters?: Record<string, string | number | boolean | null>;
|
|
139
|
+
}
|
|
140
|
+
/** Reference to another measurement inside a derived expression. */
|
|
141
|
+
export interface AssuranceMeasurementReference {
|
|
142
|
+
/** Referenced measurement id. */
|
|
143
|
+
measurement: string;
|
|
144
|
+
}
|
|
145
|
+
/** Literal numeric term inside a derived expression. */
|
|
146
|
+
export interface AssuranceLiteralExpression {
|
|
147
|
+
/** Literal number. */
|
|
148
|
+
literal: number;
|
|
149
|
+
}
|
|
150
|
+
/** Arithmetic expression over measurement references and literals. */
|
|
151
|
+
export interface AssuranceArithmeticExpression {
|
|
152
|
+
/** Deterministic arithmetic operation. */
|
|
153
|
+
operator: "add" | "subtract" | "multiply" | "divide" | "min" | "max";
|
|
154
|
+
/** Ordered operands. */
|
|
155
|
+
operands: AssuranceDerivedExpression[];
|
|
156
|
+
}
|
|
157
|
+
/** Recursive derived-measurement expression. */
|
|
158
|
+
export type AssuranceDerivedExpression = AssuranceMeasurementReference | AssuranceLiteralExpression | AssuranceArithmeticExpression;
|
|
159
|
+
/** Derived arithmetic source. */
|
|
160
|
+
export interface AssuranceDerivedSource {
|
|
161
|
+
/** Source discriminant. */
|
|
162
|
+
kind: "derived";
|
|
163
|
+
/** Arithmetic expression. */
|
|
164
|
+
expression: AssuranceDerivedExpression;
|
|
165
|
+
}
|
|
166
|
+
/** Complete measurement source vocabulary. */
|
|
167
|
+
export type AssuranceMeasurementSource = AssuranceItemsSource | AssuranceDependencyKindSource | AssuranceGraphSource | AssuranceValidateSource | AssuranceHealthSource | AssuranceHistorySource | AssuranceLinksSource | AssuranceProviderSource | AssuranceDerivedSource;
|
|
168
|
+
/** Persisted measurement declaration. */
|
|
169
|
+
export interface AssuranceMeasurementDefinition {
|
|
170
|
+
/** Stable registry id. */
|
|
171
|
+
id: string;
|
|
172
|
+
/** Optional intent description. */
|
|
173
|
+
description?: string;
|
|
174
|
+
/** Measurement source. */
|
|
175
|
+
source: AssuranceMeasurementSource;
|
|
176
|
+
/** Maximum abstract compute units accepted for one evaluation. */
|
|
177
|
+
max_cost?: number;
|
|
178
|
+
}
|
|
179
|
+
/** Explicit population scope asserted by a bound. */
|
|
180
|
+
export type AssuranceScope = {
|
|
181
|
+
kind: "all";
|
|
182
|
+
} | {
|
|
183
|
+
kind: "active";
|
|
184
|
+
} | {
|
|
185
|
+
/** Scope discriminant. */
|
|
186
|
+
kind: "filter";
|
|
187
|
+
/** Saved measurement whose population defines the scope. */
|
|
188
|
+
measurement_id: string;
|
|
189
|
+
};
|
|
190
|
+
/** One assertion negative-control case. */
|
|
191
|
+
export interface AssuranceNegativeControlCase {
|
|
192
|
+
/** Synthetic observation. */
|
|
193
|
+
observed: AssuranceValue;
|
|
194
|
+
/** Expected comparator result. */
|
|
195
|
+
expected: "pass" | "fail";
|
|
196
|
+
}
|
|
197
|
+
/** Required negative-control suite proving a bound can both pass and fail. */
|
|
198
|
+
export interface AssuranceNegativeControl {
|
|
199
|
+
/** Synthetic comparator cases. */
|
|
200
|
+
cases: AssuranceNegativeControlCase[];
|
|
201
|
+
}
|
|
202
|
+
/** Persisted assertion declaration. Exactly one polarity field is valid. */
|
|
203
|
+
export interface AssuranceAssertionDefinition {
|
|
204
|
+
/** Stable registry id. */
|
|
205
|
+
id: string;
|
|
206
|
+
/** Registry key of the observation constrained by this guarantee. */
|
|
207
|
+
measurement_id: string;
|
|
208
|
+
/** pm item that owns this guarantee. */
|
|
209
|
+
owner_item_id: string;
|
|
210
|
+
/** Explicit asserted population scope. */
|
|
211
|
+
scope: AssuranceScope;
|
|
212
|
+
/** Maximum permitted value. */
|
|
213
|
+
ceiling?: number;
|
|
214
|
+
/** Minimum permitted value. */
|
|
215
|
+
floor?: number;
|
|
216
|
+
/** Exact permitted scalar or labelled set. */
|
|
217
|
+
equals?: AssuranceValue;
|
|
218
|
+
/** Require numeric zero. */
|
|
219
|
+
zero?: true;
|
|
220
|
+
/** Require no decrease from the numeric baseline. */
|
|
221
|
+
monotone_nondecreasing?: number;
|
|
222
|
+
/** Require no increase from the numeric baseline. */
|
|
223
|
+
monotone_nonincreasing?: number;
|
|
224
|
+
/** Require the observed labelled set to be a subset. */
|
|
225
|
+
subset_of?: string[];
|
|
226
|
+
/** Behavior after owner termination. */
|
|
227
|
+
lifetime?: AssuranceLifetime;
|
|
228
|
+
/** Required explanation when lifetime retires. */
|
|
229
|
+
retire_reason?: string;
|
|
230
|
+
/** Enforcement strength. */
|
|
231
|
+
enforcement: AssuranceEnforcement;
|
|
232
|
+
/** Required proof that the comparator distinguishes good and bad values. */
|
|
233
|
+
negative_control: AssuranceNegativeControl;
|
|
234
|
+
/** Decision item authorizing a loosening update. */
|
|
235
|
+
authorization_decision?: string;
|
|
236
|
+
}
|
|
237
|
+
/** Persisted gate declaration. */
|
|
238
|
+
export interface AssuranceGateDefinition {
|
|
239
|
+
/** Stable registry id. */
|
|
240
|
+
id: string;
|
|
241
|
+
/** Assertion ids evaluated by this gate. */
|
|
242
|
+
assertion_ids: string[];
|
|
243
|
+
/** Lifecycle triggers allowed to run it. */
|
|
244
|
+
triggers: AssuranceGateTrigger[];
|
|
245
|
+
/** Optional description. */
|
|
246
|
+
description?: string;
|
|
247
|
+
}
|
|
248
|
+
/** Complete persisted assurance registry. */
|
|
249
|
+
export interface AssuranceDocument {
|
|
250
|
+
/** Storage format version. */
|
|
251
|
+
version: typeof ASSURANCE_DOCUMENT_VERSION;
|
|
252
|
+
/** Measurement declarations. */
|
|
253
|
+
measurements: AssuranceMeasurementDefinition[];
|
|
254
|
+
/** Assertion declarations. */
|
|
255
|
+
assertions: AssuranceAssertionDefinition[];
|
|
256
|
+
/** Gate declarations. */
|
|
257
|
+
gates: AssuranceGateDefinition[];
|
|
258
|
+
}
|
|
259
|
+
/** Host adapter result for graph, validate, health, or provider sources. */
|
|
260
|
+
export interface AssuranceExternalMeasurementResult {
|
|
261
|
+
/** Observed value. */
|
|
262
|
+
value: AssuranceValue;
|
|
263
|
+
/** Population denominator. */
|
|
264
|
+
population_size: number;
|
|
265
|
+
/** Abstract compute units charged by the adapter. */
|
|
266
|
+
cost: number;
|
|
267
|
+
/** Optional contributors that moved the value. */
|
|
268
|
+
contributors?: string[];
|
|
269
|
+
}
|
|
270
|
+
/** SDK evaluation inputs supplied by a host. */
|
|
271
|
+
export interface AssuranceEvaluationContext {
|
|
272
|
+
/** Commit, tree, snapshot, or workspace identity being judged. */
|
|
273
|
+
tree_id: string;
|
|
274
|
+
/** Item rows for built-in sources. */
|
|
275
|
+
items: AssuranceItemRecord[];
|
|
276
|
+
/** Immutable history rows for built-in history sources. */
|
|
277
|
+
history: AssuranceHistoryRecord[];
|
|
278
|
+
/** Status ids that make an assertion owner terminal. */
|
|
279
|
+
terminal_statuses?: string[];
|
|
280
|
+
/** External source adapter. Implementations must enforce an appropriate timeout. */
|
|
281
|
+
external: (source: AssuranceGraphSource | AssuranceValidateSource | AssuranceHealthSource | AssuranceProviderSource) => Promise<AssuranceExternalMeasurementResult>;
|
|
282
|
+
}
|
|
283
|
+
/** Compute receipt for one measurement. */
|
|
284
|
+
export interface AssuranceMeasurementCost {
|
|
285
|
+
/** Total abstract units. */
|
|
286
|
+
units: number;
|
|
287
|
+
/** Item rows scanned. */
|
|
288
|
+
items_scanned: number;
|
|
289
|
+
/** History rows scanned. */
|
|
290
|
+
history_entries: number;
|
|
291
|
+
/** External provider calls. */
|
|
292
|
+
provider_calls: number;
|
|
293
|
+
/** Wall-clock duration. */
|
|
294
|
+
duration_ms: number;
|
|
295
|
+
}
|
|
296
|
+
/** Evaluated measurement receipt. */
|
|
297
|
+
export interface AssuranceMeasurementResult {
|
|
298
|
+
/** Measurement id. */
|
|
299
|
+
id: string;
|
|
300
|
+
/** Observed value. */
|
|
301
|
+
value: AssuranceValue;
|
|
302
|
+
/** Population denominator. */
|
|
303
|
+
population_size: number;
|
|
304
|
+
/** Compute receipt. */
|
|
305
|
+
cost: AssuranceMeasurementCost;
|
|
306
|
+
/** Optional contributors. */
|
|
307
|
+
contributors: string[];
|
|
308
|
+
}
|
|
309
|
+
/** Structured assertion bound. */
|
|
310
|
+
export interface AssuranceBound {
|
|
311
|
+
/** Comparator applied to the observed value and declared bound. */
|
|
312
|
+
polarity: "ceiling" | "floor" | "equals" | "zero" | "monotone_nondecreasing" | "monotone_nonincreasing" | "subset_of";
|
|
313
|
+
/** Declared bound value. */
|
|
314
|
+
value: AssuranceValue;
|
|
315
|
+
}
|
|
316
|
+
/** One assertion row inside a gate verdict. */
|
|
317
|
+
export interface AssuranceAssertionVerdict {
|
|
318
|
+
/** Stable guarantee key that produced this evaluation row. */
|
|
319
|
+
assertion_id: string;
|
|
320
|
+
/** Stable observation key used to obtain the evaluated value. */
|
|
321
|
+
measurement_id: string;
|
|
322
|
+
/** Explicit scope. */
|
|
323
|
+
scope: AssuranceScope;
|
|
324
|
+
/** Population denominator. */
|
|
325
|
+
population_size: number;
|
|
326
|
+
/** Numeric or labelled-set value captured for the judged population. */
|
|
327
|
+
observed: AssuranceValue;
|
|
328
|
+
/** Structured bound. */
|
|
329
|
+
bound: AssuranceBound;
|
|
330
|
+
/** Signed numeric distance when applicable. */
|
|
331
|
+
distance: number | null;
|
|
332
|
+
/** Assertion result. */
|
|
333
|
+
verdict: "pass" | "fail" | "retired";
|
|
334
|
+
/** Enforcement strength. */
|
|
335
|
+
enforcement: AssuranceEnforcement;
|
|
336
|
+
/** Whether negative controls proved the comparator. */
|
|
337
|
+
negative_control_proven: boolean;
|
|
338
|
+
/** Compute receipt. */
|
|
339
|
+
cost: AssuranceMeasurementCost;
|
|
340
|
+
/** Optional contributors. */
|
|
341
|
+
contributors: string[];
|
|
342
|
+
}
|
|
343
|
+
/** Complete gate verdict shared by every presentation and execution surface. */
|
|
344
|
+
export interface AssuranceGateVerdict {
|
|
345
|
+
/** Stable lifecycle-policy key that produced this verdict. */
|
|
346
|
+
gate_id: string;
|
|
347
|
+
/** Judged tree identity. */
|
|
348
|
+
tree_id: string;
|
|
349
|
+
/** Evaluation trigger. */
|
|
350
|
+
trigger: AssuranceGateTrigger;
|
|
351
|
+
/** Whether history persistence was intentionally skipped. */
|
|
352
|
+
dry_run: boolean;
|
|
353
|
+
/** ISO timestamp. */
|
|
354
|
+
evaluated_at: string;
|
|
355
|
+
/** Overall result. */
|
|
356
|
+
verdict: "pass" | "warn" | "block";
|
|
357
|
+
/** Stable process exit code. */
|
|
358
|
+
exit_code: 0 | 1;
|
|
359
|
+
/** Per-assertion receipts. */
|
|
360
|
+
assertions: AssuranceAssertionVerdict[];
|
|
361
|
+
/** Aggregate compute receipt. */
|
|
362
|
+
cost: AssuranceMeasurementCost;
|
|
363
|
+
}
|
|
364
|
+
/** Mutation attribution accepted by registry and verdict writes. */
|
|
365
|
+
export interface AssuranceMutationOptions {
|
|
366
|
+
/** Explicit author override; normal callers omit it for harness detection. */
|
|
367
|
+
author?: string;
|
|
368
|
+
/** Optional audited rationale. */
|
|
369
|
+
message?: string;
|
|
370
|
+
/** Decision item ids the caller has verified as authorization. */
|
|
371
|
+
authorized_decision_ids?: string[];
|
|
372
|
+
}
|
|
373
|
+
/** Declaration collection kind. */
|
|
374
|
+
export type AssuranceDeclarationKind = "measurement" | "assertion" | "gate";
|
|
375
|
+
/** Declaration union accepted by persistence helpers. */
|
|
376
|
+
export type AssuranceDeclaration = AssuranceMeasurementDefinition | AssuranceAssertionDefinition | AssuranceGateDefinition;
|
|
377
|
+
/** Registry mutation receipt. */
|
|
378
|
+
export interface AssuranceMutationReceipt {
|
|
379
|
+
/** Whether serialized state changed. */
|
|
380
|
+
changed: boolean;
|
|
381
|
+
/** Mutation outcome. */
|
|
382
|
+
action: "created" | "updated" | "removed";
|
|
383
|
+
/** Declaration kind. */
|
|
384
|
+
kind: AssuranceDeclarationKind;
|
|
385
|
+
/** Declaration id. */
|
|
386
|
+
id: string;
|
|
387
|
+
}
|
|
388
|
+
/** Return true when an assertion update weakens scope, bound, lifetime, or enforcement. */
|
|
389
|
+
export declare function assuranceAssertionUpdateIsLoosening(before: AssuranceAssertionDefinition, after: AssuranceAssertionDefinition): boolean;
|
|
390
|
+
/** Validate and return one measurement declaration. */
|
|
391
|
+
export declare function validateMeasurementDefinition(definition: AssuranceMeasurementDefinition): AssuranceMeasurementDefinition;
|
|
392
|
+
/** Validate and return one assertion declaration. */
|
|
393
|
+
export declare function validateAssertionDefinition(definition: AssuranceAssertionDefinition): AssuranceAssertionDefinition;
|
|
394
|
+
/** Validate and return one gate declaration. */
|
|
395
|
+
export declare function validateGateDefinition(definition: AssuranceGateDefinition): AssuranceGateDefinition;
|
|
396
|
+
/** Validate registry references, uniqueness, and declaration-local contracts. */
|
|
397
|
+
export declare function validateAssuranceDocument(document: AssuranceDocument): AssuranceDocument;
|
|
398
|
+
/** Create an empty, valid assurance registry. */
|
|
399
|
+
export declare function createEmptyAssuranceDocument(): AssuranceDocument;
|
|
400
|
+
/** Evaluate one measurement with cycle detection and a complete cost receipt. */
|
|
401
|
+
export declare function evaluateMeasurement(definition: AssuranceMeasurementDefinition, context: AssuranceEvaluationContext, definitions?: AssuranceMeasurementDefinition[]): Promise<AssuranceMeasurementResult>;
|
|
402
|
+
/** Evaluate one assertion against a precomputed measurement receipt. */
|
|
403
|
+
export declare function evaluateAssuranceAssertion(definition: AssuranceAssertionDefinition, measurement: AssuranceMeasurementResult, options?: {
|
|
404
|
+
owner_terminal?: boolean;
|
|
405
|
+
}): AssuranceAssertionVerdict;
|
|
406
|
+
/** Evaluate a named gate into one presentation-independent verdict document. */
|
|
407
|
+
export declare function evaluateAssuranceGate(gateId: string, document: AssuranceDocument, context: AssuranceEvaluationContext, options: {
|
|
408
|
+
trigger: AssuranceGateTrigger; /** Skip persistence in the caller. */
|
|
409
|
+
dry_run?: boolean;
|
|
410
|
+
}): Promise<AssuranceGateVerdict>;
|
|
411
|
+
/** Read all declarations of one kind with a stable row selector receipt. */
|
|
412
|
+
export declare function listAssuranceDeclarations(pmRoot: string, kind: AssuranceDeclarationKind): Promise<{
|
|
413
|
+
items: AssuranceDeclaration[];
|
|
414
|
+
count: number;
|
|
415
|
+
row_contract: {
|
|
416
|
+
row_keys: ["items"];
|
|
417
|
+
jq_selector: ".items[]";
|
|
418
|
+
};
|
|
419
|
+
}>;
|
|
420
|
+
/** Read one named declaration or fail loudly. */
|
|
421
|
+
export declare function getAssuranceDeclaration(pmRoot: string, kind: AssuranceDeclarationKind, id: string): Promise<AssuranceDeclaration>;
|
|
422
|
+
/** Create or update one declaration through audited singleton persistence. */
|
|
423
|
+
export declare function putAssuranceDeclaration(pmRoot: string, kind: AssuranceDeclarationKind, definition: AssuranceDeclaration, options?: AssuranceMutationOptions): Promise<AssuranceMutationReceipt>;
|
|
424
|
+
/** Remove an unreferenced declaration through audited singleton persistence. */
|
|
425
|
+
export declare function removeAssuranceDeclaration(pmRoot: string, kind: AssuranceDeclarationKind, id: string, options?: AssuranceMutationOptions): Promise<AssuranceMutationReceipt>;
|
|
426
|
+
/** Append one immutable gate verdict without changing registry state. */
|
|
427
|
+
export declare function recordAssuranceVerdict(pmRoot: string, verdict: AssuranceGateVerdict, options?: AssuranceMutationOptions): Promise<void>;
|
|
428
|
+
/** Query durable assurance verdicts from the verified workspace stream. */
|
|
429
|
+
export declare function listAssuranceVerdicts(pmRoot: string, options?: {
|
|
430
|
+
/** Optional gate filter. */ gate_id?: string;
|
|
431
|
+
/** Maximum newest matching verdicts returned. */ limit?: number;
|
|
432
|
+
}): Promise<AssuranceGateVerdict[]>;
|