@ai-sdlc/orchestrator 0.5.0 → 0.9.0

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.
Files changed (227) hide show
  1. package/dist/action-enforcement.d.ts +26 -0
  2. package/dist/action-enforcement.js +70 -0
  3. package/dist/admission-composite.d.ts +67 -0
  4. package/dist/admission-composite.js +158 -0
  5. package/dist/admission-enrichment.d.ts +142 -0
  6. package/dist/admission-enrichment.js +331 -0
  7. package/dist/admission-hc.d.ts +62 -0
  8. package/dist/admission-hc.js +83 -0
  9. package/dist/admission-score.d.ts +148 -0
  10. package/dist/admission-score.js +237 -0
  11. package/dist/analysis/analyzer.js +3 -2
  12. package/dist/analysis/convention-detector.d.ts +85 -2
  13. package/dist/analysis/convention-detector.js +375 -70
  14. package/dist/analysis/diff-analyzer.d.ts +33 -0
  15. package/dist/analysis/diff-analyzer.js +122 -0
  16. package/dist/analysis/hotspot-analyzer.js +3 -1
  17. package/dist/analysis/index.d.ts +2 -1
  18. package/dist/analysis/index.js +2 -1
  19. package/dist/artifacts/index.d.ts +65 -0
  20. package/dist/artifacts/index.js +142 -0
  21. package/dist/backlog-adapter.d.ts +121 -0
  22. package/dist/backlog-adapter.js +438 -0
  23. package/dist/calibration.d.ts +43 -0
  24. package/dist/calibration.js +76 -0
  25. package/dist/cli/commands/agents.d.ts +24 -0
  26. package/dist/cli/commands/agents.js +66 -1
  27. package/dist/cli/commands/git-remote.d.ts +49 -0
  28. package/dist/cli/commands/git-remote.js +91 -0
  29. package/dist/cli/commands/health.d.ts +4 -0
  30. package/dist/cli/commands/health.js +13 -1
  31. package/dist/cli/commands/init.d.ts +26 -0
  32. package/dist/cli/commands/init.js +164 -22
  33. package/dist/cli/commands/mcp-setup.d.ts +31 -0
  34. package/dist/cli/commands/mcp-setup.js +78 -8
  35. package/dist/cli/formatters/table.js +15 -2
  36. package/dist/cli/index.d.ts +14 -1
  37. package/dist/cli/index.js +81 -20
  38. package/dist/cli/versions.d.ts +57 -0
  39. package/dist/cli/versions.js +128 -0
  40. package/dist/code-area-classifier.d.ts +21 -0
  41. package/dist/code-area-classifier.js +48 -0
  42. package/dist/config.d.ts +33 -1
  43. package/dist/config.js +78 -8
  44. package/dist/cycle-utils.d.ts +51 -0
  45. package/dist/cycle-utils.js +77 -0
  46. package/dist/database/adapters/external.d.ts +24 -0
  47. package/dist/database/adapters/external.js +80 -0
  48. package/dist/database/adapters/neon.d.ts +41 -0
  49. package/dist/database/adapters/neon.js +98 -0
  50. package/dist/database/adapters/pg-snapshot-restore.d.ts +28 -0
  51. package/dist/database/adapters/pg-snapshot-restore.js +68 -0
  52. package/dist/database/adapters/sqlite-copy.d.ts +32 -0
  53. package/dist/database/adapters/sqlite-copy.js +145 -0
  54. package/dist/database/connection-injection.d.ts +35 -0
  55. package/dist/database/connection-injection.js +93 -0
  56. package/dist/database/index.d.ts +12 -0
  57. package/dist/database/index.js +23 -0
  58. package/dist/database/registry.d.ts +13 -0
  59. package/dist/database/registry.js +27 -0
  60. package/dist/database/topology.d.ts +52 -0
  61. package/dist/database/topology.js +44 -0
  62. package/dist/database/types.d.ts +89 -0
  63. package/dist/database/types.js +26 -0
  64. package/dist/defaults.d.ts +5 -0
  65. package/dist/defaults.js +5 -0
  66. package/dist/design-authority.d.ts +40 -0
  67. package/dist/design-authority.js +71 -0
  68. package/dist/design-lookahead.d.ts +64 -0
  69. package/dist/design-lookahead.js +86 -0
  70. package/dist/design-quality-trend.d.ts +87 -0
  71. package/dist/design-quality-trend.js +190 -0
  72. package/dist/design-system-context.d.ts +46 -0
  73. package/dist/design-system-context.js +80 -0
  74. package/dist/design-system-correction-loop.d.ts +64 -0
  75. package/dist/design-system-correction-loop.js +128 -0
  76. package/dist/design-system-metrics.d.ts +61 -0
  77. package/dist/design-system-metrics.js +104 -0
  78. package/dist/design-system-stewardship.d.ts +22 -0
  79. package/dist/design-system-stewardship.js +85 -0
  80. package/dist/design-system-validation.d.ts +37 -0
  81. package/dist/design-system-validation.js +88 -0
  82. package/dist/dispatch/index.d.ts +4 -0
  83. package/dist/dispatch/index.js +4 -0
  84. package/dist/dispatch/merge-gate.d.ts +46 -0
  85. package/dist/dispatch/merge-gate.js +90 -0
  86. package/dist/dispatch/requeue.d.ts +57 -0
  87. package/dist/dispatch/requeue.js +131 -0
  88. package/dist/dispatch/worker-pool.d.ts +62 -0
  89. package/dist/dispatch/worker-pool.js +60 -0
  90. package/dist/execute.d.ts +40 -0
  91. package/dist/execute.js +295 -30
  92. package/dist/fix-ci.js +40 -3
  93. package/dist/fix-review.d.ts +66 -0
  94. package/dist/fix-review.js +448 -0
  95. package/dist/harness/adapters/claude-code.d.ts +29 -0
  96. package/dist/harness/adapters/claude-code.js +191 -0
  97. package/dist/harness/adapters/codex.d.ts +25 -0
  98. package/dist/harness/adapters/codex.js +61 -0
  99. package/dist/harness/independence.d.ts +51 -0
  100. package/dist/harness/independence.js +67 -0
  101. package/dist/harness/index.d.ts +14 -0
  102. package/dist/harness/index.js +20 -0
  103. package/dist/harness/registry.d.ts +17 -0
  104. package/dist/harness/registry.js +31 -0
  105. package/dist/harness/types.d.ts +123 -0
  106. package/dist/harness/types.js +8 -0
  107. package/dist/harness/version-probe.d.ts +14 -0
  108. package/dist/harness/version-probe.js +123 -0
  109. package/dist/index.d.ts +39 -5
  110. package/dist/index.js +48 -3
  111. package/dist/models/classifier.d.ts +76 -0
  112. package/dist/models/classifier.js +221 -0
  113. package/dist/models/index.d.ts +3 -0
  114. package/dist/models/index.js +3 -0
  115. package/dist/models/registry.d.ts +97 -0
  116. package/dist/models/registry.js +173 -0
  117. package/dist/pillar-breakdown.d.ts +63 -0
  118. package/dist/pillar-breakdown.js +153 -0
  119. package/dist/pipeline-cycle-detector.d.ts +70 -0
  120. package/dist/pipeline-cycle-detector.js +111 -0
  121. package/dist/priority.d.ts +7 -76
  122. package/dist/priority.js +18 -5
  123. package/dist/review-meta.d.ts +65 -0
  124. package/dist/review-meta.js +149 -0
  125. package/dist/review.d.ts +35 -0
  126. package/dist/review.js +84 -0
  127. package/dist/runners/claude-code-sdk.d.ts +31 -0
  128. package/dist/runners/claude-code-sdk.js +238 -0
  129. package/dist/runners/claude-code.d.ts +3 -0
  130. package/dist/runners/claude-code.js +319 -73
  131. package/dist/runners/codex.js +4 -1
  132. package/dist/runners/copilot.js +4 -1
  133. package/dist/runners/cursor.js +4 -1
  134. package/dist/runners/git-utils.d.ts +81 -0
  135. package/dist/runners/git-utils.js +201 -0
  136. package/dist/runners/index.d.ts +5 -1
  137. package/dist/runners/index.js +4 -0
  138. package/dist/runners/review-agent.d.ts +67 -0
  139. package/dist/runners/review-agent.js +350 -0
  140. package/dist/runners/runner-registry.js +10 -0
  141. package/dist/runners/sdk-review-runner.d.ts +65 -0
  142. package/dist/runners/sdk-review-runner.js +185 -0
  143. package/dist/runners/security-triage.d.ts +20 -4
  144. package/dist/runners/security-triage.js +42 -14
  145. package/dist/runners/types.d.ts +25 -0
  146. package/dist/runtime/attestations.d.ts +274 -0
  147. package/dist/runtime/attestations.js +460 -0
  148. package/dist/runtime/git-env.d.ts +53 -0
  149. package/dist/runtime/git-env.js +60 -0
  150. package/dist/runtime/index.d.ts +7 -0
  151. package/dist/runtime/index.js +7 -0
  152. package/dist/runtime/parallelism-flag.d.ts +10 -0
  153. package/dist/runtime/parallelism-flag.js +18 -0
  154. package/dist/runtime/port-allocator.d.ts +21 -0
  155. package/dist/runtime/port-allocator.js +66 -0
  156. package/dist/runtime/worktree-pool.d.ts +86 -0
  157. package/dist/runtime/worktree-pool.js +204 -0
  158. package/dist/runtime/worktree.d.ts +25 -0
  159. package/dist/runtime/worktree.js +111 -0
  160. package/dist/sa-scoring/auto-calibrate.d.ts +69 -0
  161. package/dist/sa-scoring/auto-calibrate.js +107 -0
  162. package/dist/sa-scoring/c1-sa2-computable.d.ts +42 -0
  163. package/dist/sa-scoring/c1-sa2-computable.js +59 -0
  164. package/dist/sa-scoring/composite.d.ts +107 -0
  165. package/dist/sa-scoring/composite.js +139 -0
  166. package/dist/sa-scoring/depparse-client.d.ts +79 -0
  167. package/dist/sa-scoring/depparse-client.js +187 -0
  168. package/dist/sa-scoring/did-compiler.d.ts +122 -0
  169. package/dist/sa-scoring/did-compiler.js +286 -0
  170. package/dist/sa-scoring/drift-monitor.d.ts +84 -0
  171. package/dist/sa-scoring/drift-monitor.js +186 -0
  172. package/dist/sa-scoring/exemplar-bank.d.ts +78 -0
  173. package/dist/sa-scoring/exemplar-bank.js +154 -0
  174. package/dist/sa-scoring/feedback-store.d.ts +100 -0
  175. package/dist/sa-scoring/feedback-store.js +156 -0
  176. package/dist/sa-scoring/index.d.ts +71 -0
  177. package/dist/sa-scoring/index.js +158 -0
  178. package/dist/sa-scoring/layer1-deterministic.d.ts +115 -0
  179. package/dist/sa-scoring/layer1-deterministic.js +298 -0
  180. package/dist/sa-scoring/layer2-structural.d.ts +71 -0
  181. package/dist/sa-scoring/layer2-structural.js +151 -0
  182. package/dist/sa-scoring/layer3-llm.d.ts +86 -0
  183. package/dist/sa-scoring/layer3-llm.js +282 -0
  184. package/dist/sa-scoring/rescore-orchestrator.d.ts +52 -0
  185. package/dist/sa-scoring/rescore-orchestrator.js +47 -0
  186. package/dist/scheduling/burn-down.d.ts +27 -0
  187. package/dist/scheduling/burn-down.js +43 -0
  188. package/dist/scheduling/calibration.d.ts +42 -0
  189. package/dist/scheduling/calibration.js +150 -0
  190. package/dist/scheduling/index.d.ts +8 -0
  191. package/dist/scheduling/index.js +8 -0
  192. package/dist/scheduling/ledger.d.ts +59 -0
  193. package/dist/scheduling/ledger.js +216 -0
  194. package/dist/scheduling/off-peak.d.ts +27 -0
  195. package/dist/scheduling/off-peak.js +112 -0
  196. package/dist/scheduling/schedule-decision.d.ts +39 -0
  197. package/dist/scheduling/schedule-decision.js +89 -0
  198. package/dist/scheduling/tier-analysis.d.ts +47 -0
  199. package/dist/scheduling/tier-analysis.js +81 -0
  200. package/dist/scheduling/types.d.ts +140 -0
  201. package/dist/scheduling/types.js +11 -0
  202. package/dist/shared.d.ts +13 -0
  203. package/dist/shared.js +32 -0
  204. package/dist/state/index.d.ts +1 -1
  205. package/dist/state/schema.d.ts +6 -1
  206. package/dist/state/schema.js +276 -1
  207. package/dist/state/store.d.ts +71 -1
  208. package/dist/state/store.js +464 -7
  209. package/dist/state/types.d.ts +174 -0
  210. package/dist/types.d.ts +1 -1
  211. package/dist/validate-agent-output.js +4 -1
  212. package/dist/watch.js +6 -0
  213. package/dist/workflow-patterns/artifact-writer.d.ts +16 -0
  214. package/dist/workflow-patterns/artifact-writer.js +34 -0
  215. package/dist/workflow-patterns/classifiers.d.ts +10 -0
  216. package/dist/workflow-patterns/classifiers.js +72 -0
  217. package/dist/workflow-patterns/detector.d.ts +27 -0
  218. package/dist/workflow-patterns/detector.js +186 -0
  219. package/dist/workflow-patterns/index.d.ts +8 -0
  220. package/dist/workflow-patterns/index.js +7 -0
  221. package/dist/workflow-patterns/proposal-generator.d.ts +15 -0
  222. package/dist/workflow-patterns/proposal-generator.js +183 -0
  223. package/dist/workflow-patterns/telemetry-ingest.d.ts +27 -0
  224. package/dist/workflow-patterns/telemetry-ingest.js +103 -0
  225. package/dist/workflow-patterns/types.d.ts +61 -0
  226. package/dist/workflow-patterns/types.js +11 -0
  227. package/package.json +2 -2
@@ -0,0 +1,274 @@
1
+ /**
2
+ * Cryptographic review attestations (AISDLC-74).
3
+ *
4
+ * `/ai-sdlc execute` runs three reviewer subagents (code/test/security) locally
5
+ * before pushing. CI then re-ran the same reviewers via `Post Review Results` —
6
+ * burning tokens on duplicate work.
7
+ *
8
+ * This module provides the primitives `/ai-sdlc execute` and the
9
+ * `verify-attestation.yml` workflow share to skip CI review when a valid local
10
+ * attestation exists. The shape is a DSSE envelope (in-toto / SLSA pattern)
11
+ * carrying a versioned predicate that commits to the commit SHA, diff hash,
12
+ * policy hash, and reviewer agent file hashes — so CI can reject envelopes
13
+ * after force-push, after a policy edit, or after a reviewer agent change.
14
+ *
15
+ * ## Threat model (in-scope)
16
+ *
17
+ * - Lazy contributor faking attestation → signature mismatch
18
+ * - Copy-pasted attestation from another PR → subject digest mismatch
19
+ * - Replay after diff changed (force-push) → diffHash mismatch
20
+ * - Attestation issued before a policy edit → policyHash mismatch
21
+ * - Stale reviewer-agent attestation → agentFileHash mismatch
22
+ * - Schema drift / forward-compat smuggling → schemaVersion enforcement
23
+ *
24
+ * Out of scope: compromised dev machine, compromised CI runner, collusion.
25
+ *
26
+ * ## Why ed25519 + Node's built-in crypto (no Sigstore)
27
+ *
28
+ * The keys are project-controlled, committed in `.ai-sdlc/trusted-reviewers.yaml`,
29
+ * and small (32-byte). Sigstore would add Fulcio + Rekor + transparency log
30
+ * infrastructure for no benefit at this scale. ed25519 is what `ssh-keygen
31
+ * -t ed25519` and `git commit -S` already use; Node's `crypto.sign(null, ...)`
32
+ * supports it natively.
33
+ */
34
+ /**
35
+ * The currently-accepted predicate schema versions. CI rejects any envelope
36
+ * whose `payload.schemaVersion` is not in this allowlist — this is the
37
+ * forward-compatibility hatch (we add a new version here when we change the
38
+ * predicate shape, and CI keeps accepting v1 until we explicitly remove it).
39
+ *
40
+ * Exported so the `verify-attestation` workflow can `import`/inline it.
41
+ */
42
+ export declare const ACCEPTED_SCHEMA_VERSIONS: readonly ["v1"];
43
+ export type SchemaVersion = (typeof ACCEPTED_SCHEMA_VERSIONS)[number];
44
+ /**
45
+ * The DSSE PAE payload type for our predicate. DSSE spec mandates a payload
46
+ * type URI — we use a project-controlled vendor URI rather than the
47
+ * in-toto Statement format (which would force us to shape the predicate
48
+ * around `_type` + `subject` at the envelope layer instead of the predicate).
49
+ */
50
+ export declare const DSSE_PAYLOAD_TYPE = "application/vnd.ai-sdlc.attestation+json";
51
+ /** SHA-1 commit digest (40 hex chars) for the subject of an attestation. */
52
+ export interface SubjectDigest {
53
+ /** sha1 of the git commit being attested (40 hex chars). */
54
+ sha1: string;
55
+ }
56
+ /** A single reviewer's contribution to the predicate. */
57
+ export interface ReviewerEntry {
58
+ /** Agent identifier — matches the `name` field of the agent .md file. */
59
+ agentId: string;
60
+ /** sha256 of the reviewer agent's `.md` file at the time of review. */
61
+ agentFileHash: string;
62
+ /** Harness used for the review (e.g. `codex`, `claude-code`). */
63
+ harness: string;
64
+ /** Verdict — true if the reviewer approved, false otherwise. */
65
+ approved: boolean;
66
+ /**
67
+ * Findings counts by severity. We commit to *counts only* (not the full
68
+ * verdict JSON) to keep attestations small (~1-2KB). The full verdicts
69
+ * live in the PR body for human review; CI doesn't need them.
70
+ */
71
+ findings: {
72
+ critical: number;
73
+ major: number;
74
+ minor: number;
75
+ suggestion: number;
76
+ };
77
+ }
78
+ /** The signed payload — what the predicate actually attests. */
79
+ export interface AttestationPredicate {
80
+ /** Schema version — mandatory, enforced at verify time. */
81
+ schemaVersion: SchemaVersion;
82
+ /** The commit being attested. */
83
+ subject: {
84
+ digest: SubjectDigest;
85
+ };
86
+ /** sha256 of `git diff origin/main...HEAD` at attestation time. */
87
+ diffHash: string;
88
+ /** sha256 of `.ai-sdlc/review-policy.md` at attestation time. */
89
+ policyHash: string;
90
+ /** Reviewer entries — typically 3 (code/test/security). */
91
+ reviewers: ReviewerEntry[];
92
+ /** Plugin version from `ai-sdlc-plugin/plugin.json`. */
93
+ pluginVersion: string;
94
+ /** Iteration count — how many dev rounds the work went through. */
95
+ iterationCount: number;
96
+ /**
97
+ * Free-form harness note — empty string when independence was enforced,
98
+ * `'⚠ INDEPENDENCE NOT ENFORCED (codex unavailable, fell back to ...)'`
99
+ * when not. Surfaced in PR body so the reviewer-of-the-reviewer sees it.
100
+ */
101
+ harnessNote: string;
102
+ /** ISO 8601 timestamp at signing. */
103
+ signedAt: string;
104
+ }
105
+ /**
106
+ * DSSE envelope (https://github.com/secure-systems-lab/dsse).
107
+ *
108
+ * `payload` is base64-encoded JSON of the predicate. `signatures[]` lets us
109
+ * carry multi-sig if we ever need it (today: 1 signer = the dev who ran
110
+ * `/ai-sdlc execute`).
111
+ */
112
+ export interface DsseEnvelope {
113
+ payloadType: typeof DSSE_PAYLOAD_TYPE;
114
+ /** base64-encoded JSON of the predicate. */
115
+ payload: string;
116
+ signatures: DsseSignature[];
117
+ }
118
+ export interface DsseSignature {
119
+ /**
120
+ * Identifier of the public key that produced this signature. Used to
121
+ * look up the trusted-reviewer entry. Free-form — typically `<identity>:
122
+ * <machine>` (e.g. `dominique@reliablegenius.io:laptop-2025`).
123
+ */
124
+ keyid: string;
125
+ /** base64-encoded raw ed25519 signature (64 bytes → 88 chars b64). */
126
+ sig: string;
127
+ }
128
+ /** Trusted-reviewers.yaml entry shape. */
129
+ export interface TrustedReviewer {
130
+ /** Free-form contributor identifier (typically email or GitHub handle). */
131
+ identity: string;
132
+ /** Free-form machine label — lets one identity register multiple keys. */
133
+ machine: string;
134
+ /** PEM-encoded ed25519 public key. */
135
+ pubkey: string;
136
+ /** ISO 8601 date the entry was added. */
137
+ addedAt: string;
138
+ /** GitHub handle of the reviewer who approved the entry's PR. */
139
+ addedBy: string;
140
+ }
141
+ /** Result of verifying an attestation. */
142
+ export type VerifyResult = {
143
+ valid: true;
144
+ predicate: AttestationPredicate;
145
+ trustedReviewer: TrustedReviewer;
146
+ } | {
147
+ valid: false;
148
+ reason: string;
149
+ };
150
+ /**
151
+ * Validate a parsed predicate against the v1 schema regex patterns.
152
+ *
153
+ * Returns `null` when the predicate is shape-valid; otherwise returns
154
+ * a static failure reason that does NOT embed any user-controlled
155
+ * value (just the field path). This is the load-bearing property:
156
+ * the malicious value never reaches the `reason` string, so it can't
157
+ * propagate to GITHUB_OUTPUT or commit-status descriptions.
158
+ */
159
+ export declare function validatePredicateShape(parsed: unknown): string | null;
160
+ /**
161
+ * The set of reviewer agent IDs the verifier expects to see in every
162
+ * attestation. Exported so callers (verify-attestation.mjs) can
163
+ * cross-check that all three reviewers are present + match.
164
+ *
165
+ * Frozen to discourage callers from mutating it.
166
+ */
167
+ export declare const REQUIRED_REVIEWER_AGENT_IDS: readonly string[];
168
+ /** Inputs for building an attestation predicate. */
169
+ export interface BuildPredicateInputs {
170
+ commitSha: string;
171
+ diff: string | Buffer;
172
+ policy: string | Buffer;
173
+ reviewers: Array<{
174
+ agentId: string;
175
+ agentFileContent: string | Buffer;
176
+ harness: string;
177
+ approved: boolean;
178
+ findings: ReviewerEntry['findings'];
179
+ }>;
180
+ pluginVersion: string;
181
+ iterationCount: number;
182
+ harnessNote: string;
183
+ /** Override `signedAt` for deterministic tests. */
184
+ signedAt?: string;
185
+ }
186
+ /**
187
+ * Compute a sha256 hex digest. Single source of truth for the hashing
188
+ * algorithm — every predicate field that ends in `Hash` flows through here.
189
+ */
190
+ export declare function sha256Hex(input: string | Buffer): string;
191
+ /** Compute a sha1 hex digest (used for git commit SHAs in the subject). */
192
+ export declare function sha1Hex(input: string | Buffer): string;
193
+ /**
194
+ * Build the predicate payload from raw inputs. Pure function — no I/O,
195
+ * no signing. The caller (`/ai-sdlc execute` Step 10) reads files and git
196
+ * output, then hands them here.
197
+ */
198
+ export declare function buildPredicate(inputs: BuildPredicateInputs): AttestationPredicate;
199
+ /**
200
+ * DSSE Pre-Authentication Encoding. Per the spec
201
+ * (https://github.com/secure-systems-lab/dsse/blob/master/protocol.md):
202
+ *
203
+ * PAE(type, body) = "DSSEv1" SP LEN(type) SP type SP LEN(body) SP body
204
+ *
205
+ * Lengths are decimal ASCII byte-counts of the UTF-8 encoding. Signing the
206
+ * PAE — not the raw payload — is what gives DSSE its domain separation:
207
+ * a signature over a payload of one `payloadType` cannot be replayed onto
208
+ * a payload of a different type.
209
+ */
210
+ export declare function paeEncode(payloadType: string, payload: Buffer): Buffer;
211
+ /** Generate a fresh ed25519 keypair as PEM strings (for `/ai-sdlc init-signing-key`). */
212
+ export declare function generateSigningKeyPair(): {
213
+ privateKeyPem: string;
214
+ publicKeyPem: string;
215
+ };
216
+ /** Sign options. `keyid` is required — verifiers use it to look up the pubkey. */
217
+ export interface SignOptions {
218
+ predicate: AttestationPredicate;
219
+ privateKeyPem: string;
220
+ keyid: string;
221
+ }
222
+ /**
223
+ * Sign a predicate, producing a DSSE envelope.
224
+ *
225
+ * Throws if `predicate.schemaVersion` is not in `ACCEPTED_SCHEMA_VERSIONS` —
226
+ * we don't want to issue an envelope that we'd reject ourselves.
227
+ */
228
+ export declare function signAttestation(opts: SignOptions): DsseEnvelope;
229
+ /** Verify options. `expected` lets the caller bind verification to a specific PR state. */
230
+ export interface VerifyOptions {
231
+ envelope: DsseEnvelope;
232
+ /**
233
+ * Trusted reviewers from `.ai-sdlc/trusted-reviewers.yaml`. The verifier
234
+ * tries each pubkey against each signature ("any-of-N") and accepts on
235
+ * the first match.
236
+ */
237
+ trustedReviewers: TrustedReviewer[];
238
+ /**
239
+ * What the predicate's `subject.digest.sha1`, `diffHash`, `policyHash`,
240
+ * and `reviewers[].agentFileHash` MUST equal. Mismatch = invalid.
241
+ *
242
+ * `expectedAgentFileHashes` is a map from agentId to its sha256 — we
243
+ * tolerate the predicate listing fewer or more reviewers than the map,
244
+ * but every reviewer entry whose agentId IS in the map must hash-match.
245
+ */
246
+ expected: {
247
+ commitSha: string;
248
+ diffHash: string;
249
+ policyHash: string;
250
+ expectedAgentFileHashes: Record<string, string>;
251
+ };
252
+ /**
253
+ * Override the accepted-schema-versions allowlist (for tests). Defaults
254
+ * to `ACCEPTED_SCHEMA_VERSIONS`.
255
+ */
256
+ acceptedSchemaVersions?: readonly string[];
257
+ }
258
+ /**
259
+ * Verify a DSSE envelope. Returns a discriminated union — `{ valid: true }`
260
+ * with the parsed predicate + matched trusted reviewer, or `{ valid: false }`
261
+ * with a single human-readable reason string.
262
+ *
263
+ * The reason string is what gets posted to the commit status
264
+ * (`ai-sdlc/attestation: invalid (<reason>)`), so keep it short and specific.
265
+ */
266
+ export declare function verifyAttestation(opts: VerifyOptions): VerifyResult;
267
+ /**
268
+ * Validate the shape of a parsed `.ai-sdlc/trusted-reviewers.yaml` document.
269
+ * Throws on malformed input with a specific reason. Acceptance criterion #4.
270
+ *
271
+ * Accepts the parsed YAML (as `unknown`) and returns the typed array.
272
+ */
273
+ export declare function validateTrustedReviewers(parsed: unknown): TrustedReviewer[];
274
+ //# sourceMappingURL=attestations.d.ts.map