@ai-sdlc/orchestrator 0.6.0 → 0.10.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 (209) hide show
  1. package/dist/__test-helpers/git-env.d.ts +40 -0
  2. package/dist/__test-helpers/git-env.js +73 -0
  3. package/dist/admission-composite.d.ts +89 -0
  4. package/dist/admission-composite.js +241 -0
  5. package/dist/admission-enrichment.d.ts +142 -0
  6. package/dist/admission-enrichment.js +341 -0
  7. package/dist/admission-hc.d.ts +81 -0
  8. package/dist/admission-hc.js +94 -0
  9. package/dist/admission-score.d.ts +109 -5
  10. package/dist/admission-score.js +90 -11
  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 +74 -0
  28. package/dist/cli/commands/git-remote.js +170 -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-features.d.ts +208 -0
  32. package/dist/cli/commands/init-features.js +473 -0
  33. package/dist/cli/commands/init-templates.d.ts +104 -0
  34. package/dist/cli/commands/init-templates.js +399 -0
  35. package/dist/cli/commands/init.d.ts +48 -0
  36. package/dist/cli/commands/init.js +322 -23
  37. package/dist/cli/commands/mcp-setup.d.ts +31 -0
  38. package/dist/cli/commands/mcp-setup.js +78 -8
  39. package/dist/cli/formatters/table.js +15 -2
  40. package/dist/cli/index.d.ts +14 -1
  41. package/dist/cli/index.js +81 -20
  42. package/dist/cli/versions.d.ts +57 -0
  43. package/dist/cli/versions.js +128 -0
  44. package/dist/code-area-classifier.d.ts +21 -0
  45. package/dist/code-area-classifier.js +48 -0
  46. package/dist/config.d.ts +33 -1
  47. package/dist/config.js +78 -8
  48. package/dist/database/adapters/external.d.ts +24 -0
  49. package/dist/database/adapters/external.js +80 -0
  50. package/dist/database/adapters/neon.d.ts +41 -0
  51. package/dist/database/adapters/neon.js +98 -0
  52. package/dist/database/adapters/pg-snapshot-restore.d.ts +28 -0
  53. package/dist/database/adapters/pg-snapshot-restore.js +68 -0
  54. package/dist/database/adapters/sqlite-copy.d.ts +32 -0
  55. package/dist/database/adapters/sqlite-copy.js +145 -0
  56. package/dist/database/connection-injection.d.ts +35 -0
  57. package/dist/database/connection-injection.js +93 -0
  58. package/dist/database/index.d.ts +12 -0
  59. package/dist/database/index.js +23 -0
  60. package/dist/database/registry.d.ts +13 -0
  61. package/dist/database/registry.js +27 -0
  62. package/dist/database/topology.d.ts +52 -0
  63. package/dist/database/topology.js +44 -0
  64. package/dist/database/types.d.ts +89 -0
  65. package/dist/database/types.js +26 -0
  66. package/dist/design-authority.d.ts +53 -0
  67. package/dist/design-authority.js +84 -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 +188 -15
  92. package/dist/fix-ci.js +8 -1
  93. package/dist/fix-review.js +8 -1
  94. package/dist/harness/adapters/claude-code.d.ts +29 -0
  95. package/dist/harness/adapters/claude-code.js +191 -0
  96. package/dist/harness/adapters/codex.d.ts +25 -0
  97. package/dist/harness/adapters/codex.js +61 -0
  98. package/dist/harness/independence.d.ts +51 -0
  99. package/dist/harness/independence.js +67 -0
  100. package/dist/harness/index.d.ts +14 -0
  101. package/dist/harness/index.js +20 -0
  102. package/dist/harness/registry.d.ts +17 -0
  103. package/dist/harness/registry.js +31 -0
  104. package/dist/harness/types.d.ts +123 -0
  105. package/dist/harness/types.js +8 -0
  106. package/dist/harness/version-probe.d.ts +14 -0
  107. package/dist/harness/version-probe.js +123 -0
  108. package/dist/index.d.ts +30 -4
  109. package/dist/index.js +35 -2
  110. package/dist/models/classifier.d.ts +78 -0
  111. package/dist/models/classifier.js +277 -0
  112. package/dist/models/index.d.ts +3 -0
  113. package/dist/models/index.js +3 -0
  114. package/dist/models/registry.d.ts +97 -0
  115. package/dist/models/registry.js +173 -0
  116. package/dist/pillar-breakdown.d.ts +85 -0
  117. package/dist/pillar-breakdown.js +162 -0
  118. package/dist/priority.d.ts +5 -0
  119. package/dist/priority.js +18 -5
  120. package/dist/review-meta.d.ts +65 -0
  121. package/dist/review-meta.js +149 -0
  122. package/dist/review.d.ts +4 -0
  123. package/dist/review.js +12 -2
  124. package/dist/runners/claude-code-sdk.d.ts +31 -0
  125. package/dist/runners/claude-code-sdk.js +238 -0
  126. package/dist/runners/claude-code.d.ts +3 -0
  127. package/dist/runners/claude-code.js +30 -66
  128. package/dist/runners/codex.js +4 -1
  129. package/dist/runners/copilot.js +4 -1
  130. package/dist/runners/cursor.js +4 -1
  131. package/dist/runners/git-utils.d.ts +81 -0
  132. package/dist/runners/git-utils.js +201 -0
  133. package/dist/runners/index.d.ts +3 -0
  134. package/dist/runners/index.js +3 -0
  135. package/dist/runners/review-agent.d.ts +20 -0
  136. package/dist/runners/review-agent.js +171 -41
  137. package/dist/runners/runner-registry.js +10 -0
  138. package/dist/runners/sdk-review-runner.d.ts +65 -0
  139. package/dist/runners/sdk-review-runner.js +185 -0
  140. package/dist/runners/security-triage.d.ts +20 -4
  141. package/dist/runners/security-triage.js +39 -15
  142. package/dist/runners/types.d.ts +6 -0
  143. package/dist/runtime/attestations.d.ts +766 -0
  144. package/dist/runtime/attestations.js +1195 -0
  145. package/dist/runtime/git-env.d.ts +53 -0
  146. package/dist/runtime/git-env.js +60 -0
  147. package/dist/runtime/index.d.ts +7 -0
  148. package/dist/runtime/index.js +7 -0
  149. package/dist/runtime/parallelism-flag.d.ts +28 -0
  150. package/dist/runtime/parallelism-flag.js +39 -0
  151. package/dist/runtime/port-allocator.d.ts +32 -0
  152. package/dist/runtime/port-allocator.js +96 -0
  153. package/dist/runtime/worktree-pool.d.ts +86 -0
  154. package/dist/runtime/worktree-pool.js +204 -0
  155. package/dist/runtime/worktree.d.ts +25 -0
  156. package/dist/runtime/worktree.js +111 -0
  157. package/dist/sa-scoring/auto-calibrate.d.ts +69 -0
  158. package/dist/sa-scoring/auto-calibrate.js +107 -0
  159. package/dist/sa-scoring/c1-sa2-computable.d.ts +42 -0
  160. package/dist/sa-scoring/c1-sa2-computable.js +59 -0
  161. package/dist/sa-scoring/composite.d.ts +107 -0
  162. package/dist/sa-scoring/composite.js +139 -0
  163. package/dist/sa-scoring/depparse-client.d.ts +79 -0
  164. package/dist/sa-scoring/depparse-client.js +187 -0
  165. package/dist/sa-scoring/did-compiler.d.ts +122 -0
  166. package/dist/sa-scoring/did-compiler.js +286 -0
  167. package/dist/sa-scoring/drift-monitor.d.ts +84 -0
  168. package/dist/sa-scoring/drift-monitor.js +186 -0
  169. package/dist/sa-scoring/exemplar-bank.d.ts +78 -0
  170. package/dist/sa-scoring/exemplar-bank.js +154 -0
  171. package/dist/sa-scoring/feedback-store.d.ts +100 -0
  172. package/dist/sa-scoring/feedback-store.js +156 -0
  173. package/dist/sa-scoring/index.d.ts +71 -0
  174. package/dist/sa-scoring/index.js +158 -0
  175. package/dist/sa-scoring/layer1-deterministic.d.ts +115 -0
  176. package/dist/sa-scoring/layer1-deterministic.js +298 -0
  177. package/dist/sa-scoring/layer2-structural.d.ts +71 -0
  178. package/dist/sa-scoring/layer2-structural.js +151 -0
  179. package/dist/sa-scoring/layer3-llm.d.ts +86 -0
  180. package/dist/sa-scoring/layer3-llm.js +282 -0
  181. package/dist/sa-scoring/rescore-orchestrator.d.ts +52 -0
  182. package/dist/sa-scoring/rescore-orchestrator.js +47 -0
  183. package/dist/scheduling/burn-down.d.ts +27 -0
  184. package/dist/scheduling/burn-down.js +43 -0
  185. package/dist/scheduling/calibration.d.ts +42 -0
  186. package/dist/scheduling/calibration.js +150 -0
  187. package/dist/scheduling/index.d.ts +8 -0
  188. package/dist/scheduling/index.js +8 -0
  189. package/dist/scheduling/ledger.d.ts +59 -0
  190. package/dist/scheduling/ledger.js +216 -0
  191. package/dist/scheduling/off-peak.d.ts +27 -0
  192. package/dist/scheduling/off-peak.js +112 -0
  193. package/dist/scheduling/schedule-decision.d.ts +39 -0
  194. package/dist/scheduling/schedule-decision.js +89 -0
  195. package/dist/scheduling/tier-analysis.d.ts +47 -0
  196. package/dist/scheduling/tier-analysis.js +81 -0
  197. package/dist/scheduling/types.d.ts +140 -0
  198. package/dist/scheduling/types.js +11 -0
  199. package/dist/shared.d.ts +13 -0
  200. package/dist/shared.js +32 -0
  201. package/dist/state/schema.d.ts +5 -1
  202. package/dist/state/schema.js +223 -1
  203. package/dist/state/store.d.ts +55 -1
  204. package/dist/state/store.js +342 -7
  205. package/dist/state/types.d.ts +139 -0
  206. package/dist/types.d.ts +1 -1
  207. package/dist/validate-agent-output.js +4 -1
  208. package/dist/watch.js +6 -0
  209. package/package.json +3 -2
@@ -0,0 +1,399 @@
1
+ /**
2
+ * Embedded template strings scaffolded by `ai-sdlc init` (AISDLC-143).
3
+ *
4
+ * Why these live in code instead of being read from disk at runtime:
5
+ * - The orchestrator ships as an npm package; users `npm i -g
6
+ * @ai-sdlc/orchestrator` and run `ai-sdlc init` in a brand new repo.
7
+ * The `dist/` payload would not include arbitrary `*.yml` source
8
+ * fixtures unless we listed each one in `package.json#files` AND
9
+ * plumbed a `__dirname`-based loader through esm import-meta.url.
10
+ * - Embedded strings work identically when invoked via `node ./dist/...`
11
+ * from a checkout, via `npx @ai-sdlc/orchestrator init`, or via a
12
+ * pre-bundled binary, with no runtime filesystem dependency.
13
+ *
14
+ * Drift policy: when the canonical workflow at
15
+ * `.github/workflows/ai-sdlc-gate.yml` (or the audit-only
16
+ * `verify-attestation.yml`) is updated for adopters, mirror the change
17
+ * here. The init-workspace test suite includes a smoke check that the
18
+ * embedded copy at least parses as a YAML mapping; AISDLC-140 sub-3's
19
+ * cutover memo will add a hard byte-equality assertion against the live
20
+ * file once the framework's own copy stabilizes.
21
+ *
22
+ * Q-decisions baked into the templates:
23
+ * - Q1 (prescriptive default): the gate workflow is scaffolded
24
+ * unconditionally — every adopter gets `ai-sdlc/pr-ready` on day one.
25
+ * - Q3 (attestation = audit-only): verify-attestation template is the
26
+ * audit-only variant; signing infrastructure is opt-in via
27
+ * `--with-attestation`.
28
+ * - Q4(b) (interactive default with --yes escape hatch): see
29
+ * `init-features.ts` for the wizard wiring; this module just supplies
30
+ * the byte content.
31
+ */
32
+ /** `.github/workflows/ai-sdlc-gate.yml` — single rollup PR-ready check. */
33
+ export const AI_SDLC_GATE_WORKFLOW = `name: AI-SDLC PR Ready Gate
34
+
35
+ # Single rollup status check \`ai-sdlc/pr-ready\` that aggregates every PR
36
+ # signal AI-SDLC adopters need into ONE branch-protection entry. Replaces
37
+ # the historical pattern of enumerating N required checks by name + app_id,
38
+ # which is brittle against path filters, [skip ci] tokens, matrix changes,
39
+ # and multi-app posters. See \`docs/operations/quality-gate.md\` for the
40
+ # full rationale.
41
+ #
42
+ # Industry pattern: \`re-actors/alls-green\` ("alls-green") is the de facto
43
+ # community fix; named adopters include aiohttp, attrs, conda, setuptools,
44
+ # pytest, pip-tools, Open edX, PyCA, PyPA, Mergify.
45
+
46
+ on:
47
+ pull_request:
48
+ types: [opened, synchronize, reopened]
49
+ merge_group:
50
+ types: [checks_requested]
51
+
52
+ concurrency:
53
+ group: ai-sdlc-gate-\${{ github.event.pull_request.number || github.event.merge_group.head_sha || github.ref }}
54
+ cancel-in-progress: true
55
+
56
+ permissions:
57
+ contents: read
58
+ pull-requests: read
59
+ checks: write
60
+
61
+ jobs:
62
+ detect:
63
+ name: Detect Changes
64
+ runs-on: ubuntu-latest
65
+ outputs:
66
+ docs_only: \${{ steps.filter.outputs.docs_only }}
67
+ steps:
68
+ - uses: actions/checkout@v4
69
+ - id: filter
70
+ uses: dorny/paths-filter@v3
71
+ with:
72
+ predicate-quantifier: 'every'
73
+ filters: |
74
+ docs_only:
75
+ - 'docs/**'
76
+ - '*.md'
77
+
78
+ lint:
79
+ name: Lint & Format
80
+ runs-on: ubuntu-latest
81
+ steps:
82
+ - uses: actions/checkout@v4
83
+ - uses: pnpm/action-setup@v4
84
+ - uses: actions/setup-node@v4
85
+ with:
86
+ node-version: 22
87
+ cache: pnpm
88
+ - run: pnpm install --frozen-lockfile
89
+ - run: pnpm lint
90
+ - run: pnpm format:check
91
+
92
+ build-test:
93
+ name: Build & Test (Node \${{ matrix.node-version }})
94
+ needs: detect
95
+ if: needs.detect.outputs.docs_only != 'true'
96
+ runs-on: ubuntu-latest
97
+ strategy:
98
+ fail-fast: false
99
+ matrix:
100
+ node-version: [20, 22]
101
+ steps:
102
+ - uses: actions/checkout@v4
103
+ - uses: pnpm/action-setup@v4
104
+ - uses: actions/setup-node@v4
105
+ with:
106
+ node-version: \${{ matrix.node-version }}
107
+ cache: pnpm
108
+ - run: pnpm install --frozen-lockfile
109
+ - run: pnpm build
110
+ - run: pnpm test
111
+
112
+ coverage:
113
+ name: Coverage
114
+ needs: detect
115
+ if: needs.detect.outputs.docs_only != 'true'
116
+ runs-on: ubuntu-latest
117
+ steps:
118
+ - uses: actions/checkout@v4
119
+ - uses: pnpm/action-setup@v4
120
+ - uses: actions/setup-node@v4
121
+ with:
122
+ node-version: 22
123
+ cache: pnpm
124
+ - run: pnpm install --frozen-lockfile
125
+ - run: pnpm build
126
+ - run: pnpm test:coverage
127
+
128
+ pr-ready:
129
+ name: ai-sdlc/pr-ready
130
+ needs: [detect, lint, build-test, coverage]
131
+ if: always()
132
+ runs-on: ubuntu-latest
133
+ steps:
134
+ - name: Aggregate required signals
135
+ uses: re-actors/alls-green@release/v1
136
+ with:
137
+ jobs: \${{ toJSON(needs) }}
138
+ `;
139
+ /**
140
+ * `.github/workflows/verify-attestation.yml` — AUDIT-ONLY verifier.
141
+ *
142
+ * Per Q3 in /tmp/quality-gate-redesign-final.md, attestation infrastructure
143
+ * is opt-in and audit-only. This workflow logs verification results to the
144
+ * action run log but does NOT post a required-status check or block merges.
145
+ * Operators who want to promote attestation to a hard gate can edit the
146
+ * \`Log audit result\` step to write to commit statuses.
147
+ */
148
+ export const VERIFY_ATTESTATION_WORKFLOW = `name: AI-SDLC Verify Review Attestation
149
+
150
+ # Reads the DSSE attestation at .ai-sdlc/attestations/<head-sha>.dsse.json
151
+ # and verifies the signature against any-of-N pubkeys in
152
+ # .ai-sdlc/trusted-reviewers.yaml.
153
+ #
154
+ # AUDIT-ONLY: this workflow logs verification results (success/failure with
155
+ # reason) for forensic purposes but does NOT post a required commit status.
156
+ # The single merge gate is \`ai-sdlc/pr-ready\` from ai-sdlc-gate.yml.
157
+
158
+ on:
159
+ pull_request:
160
+ types: [opened, synchronize, reopened]
161
+ branches: [main]
162
+ paths-ignore:
163
+ - 'docs/**'
164
+ - '*.md'
165
+ merge_group:
166
+ types: [checks_requested]
167
+
168
+ concurrency:
169
+ group: verify-attestation-\${{ github.event.pull_request.number || github.event.merge_group.head_sha }}
170
+ cancel-in-progress: true
171
+
172
+ jobs:
173
+ verify:
174
+ name: Verify attestation
175
+ runs-on: ubuntu-latest
176
+ permissions:
177
+ contents: read
178
+ steps:
179
+ - name: Resolve subject SHA + base SHA from event payload
180
+ id: resolve
181
+ run: |
182
+ if [ "\${{ github.event_name }}" = "merge_group" ]; then
183
+ echo "head_sha=\${{ github.event.merge_group.head_sha }}" >> "$GITHUB_OUTPUT"
184
+ echo "base_sha=\${{ github.event.merge_group.base_sha }}" >> "$GITHUB_OUTPUT"
185
+ else
186
+ echo "head_sha=\${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT"
187
+ echo "base_sha=\${{ github.event.pull_request.base.sha }}" >> "$GITHUB_OUTPUT"
188
+ fi
189
+
190
+ - uses: actions/checkout@v4
191
+ with:
192
+ fetch-depth: 0
193
+ ref: \${{ steps.resolve.outputs.head_sha }}
194
+
195
+ - name: Log audit result
196
+ env:
197
+ HEAD_SHA: \${{ steps.resolve.outputs.head_sha }}
198
+ run: |
199
+ if [ -f ".ai-sdlc/attestations/\${HEAD_SHA}.dsse.json" ]; then
200
+ echo "::notice::ai-sdlc attestation AUDIT — envelope present at \${HEAD_SHA}"
201
+ else
202
+ echo "::notice::ai-sdlc attestation AUDIT — no envelope on \${HEAD_SHA} (audit-only, not blocking)"
203
+ fi
204
+ `;
205
+ /**
206
+ * `.husky/pre-push` snippet that signs an attestation when one is missing
207
+ * for the current HEAD. Installed when `--with-attestation` is opted in;
208
+ * the actual `sign-attestation.mjs` script ships separately with the
209
+ * orchestrator and is referenced by the canonical command stub here.
210
+ *
211
+ * Adopters typically already have a `.husky/pre-push` from their existing
212
+ * tooling; the wizard appends our snippet behind a sentinel so we can
213
+ * extend an existing hook without trampling user content.
214
+ */
215
+ export const HUSKY_PREPUSH_SIGN_SNIPPET = `# ai-sdlc:attestation-sign-block
216
+ # Signs the DSSE attestation envelope for the current HEAD when verdict
217
+ # files exist. Skip with AI_SDLC_SKIP_ATTESTATION_SIGN=1.
218
+ if [ -z "\${AI_SDLC_SKIP_ATTESTATION_SIGN:-}" ] && [ -x "./scripts/check-attestation-sign.sh" ]; then
219
+ ./scripts/check-attestation-sign.sh
220
+ fi
221
+ # end ai-sdlc:attestation-sign-block
222
+ `;
223
+ /**
224
+ * `.ai-sdlc/trusted-reviewers.yaml` stub — empty allowlist with operator
225
+ * instructions. The wizard scaffolds this so adopters have a single file
226
+ * to receive contributor pubkey PRs into; bootstrap a contributor with
227
+ * `/ai-sdlc init-signing-key` and append the printed YAML block.
228
+ */
229
+ export const TRUSTED_REVIEWERS_STUB = `# Trusted contributor signing keys for review attestations.
230
+ #
231
+ # This file is a stub created by \`ai-sdlc init --with-attestation\`. Add
232
+ # entries by running \`/ai-sdlc init-signing-key\` on a contributor's
233
+ # machine and opening a PR that appends the printed YAML block below.
234
+ #
235
+ # Schema:
236
+ # - identity: free-form string (typically email or GitHub handle)
237
+ # - machine: free-form label (lets one identity register multiple keys)
238
+ # - pubkey: PEM-encoded ed25519 public key (multi-line block scalar)
239
+ # - addedAt: ISO 8601 date the entry was added
240
+ # - addedBy: GitHub handle of the maintainer who approved this entry's PR
241
+ #
242
+ # The verifier in CI uses a strict YAML format: every scalar value
243
+ # single-quoted; \`pubkey:\` is a \`|\` block scalar with each PEM line
244
+ # indented exactly 6 spaces; no tab characters anywhere.
245
+
246
+ reviewers: []
247
+ `;
248
+ /**
249
+ * `.ai-sdlc/dor-config.yaml` stub — Definition-of-Ready rubric config.
250
+ *
251
+ * Mirrors the production DoR config used by the framework itself; ships
252
+ * in warn-only mode so a fresh adopter does not get blocked by the rubric
253
+ * while they tune it.
254
+ */
255
+ export const DOR_CONFIG_STUB = `# Definition-of-Ready (DoR) gate configuration.
256
+ #
257
+ # The DoR rubric scores incoming issues + backlog tasks against seven
258
+ # criteria (binary-testable ACs, no wishlist markers, references resolve,
259
+ # bounded scope, surface named, done-state describable, no invisible
260
+ # dependencies). Failing the rubric posts a clarification comment on the
261
+ # issue / PR.
262
+ #
263
+ # Ships in warn-only mode by default — flip to 'enforce' after the soak
264
+ # window confirms the false-positive rate is low.
265
+
266
+ apiVersion: ai-sdlc.io/v1alpha1
267
+ kind: DorConfig
268
+ metadata:
269
+ name: ai-sdlc-dor
270
+ spec:
271
+ rubricVersion: v1
272
+ evaluationMode: warn-only
273
+
274
+ notifications:
275
+ authorChannel: true
276
+ # dedicatedChannel:
277
+ # slack: '#ai-sdlc-dor'
278
+
279
+ staleness:
280
+ warnAfterDays: 14
281
+ closeAfterDays: 28
282
+ closedLabel: 'closed-as-stale-dor'
283
+ `;
284
+ /** `.github/workflows/dor-ingress.yml` — minimal DoR ingress shim. */
285
+ export const DOR_INGRESS_WORKFLOW = `name: AI-SDLC DoR Ingress
286
+
287
+ # Wires the DoR rubric into the GitHub issue + PR lifecycle:
288
+ # - issues:opened / issues:edited → score the issue body, post the
289
+ # idempotent clarification comment when needs-clarification.
290
+ # - pull_request touching backlog/tasks/*.md → score the changed
291
+ # task bodies (the in-repo equivalent of an issue).
292
+ #
293
+ # Ships in warn-only mode (see .ai-sdlc/dor-config.yaml). Flip the
294
+ # config's \`evaluationMode\` to \`enforce\` after the soak window.
295
+
296
+ on:
297
+ issues:
298
+ types: [opened, edited]
299
+ pull_request:
300
+ types: [opened, synchronize, reopened]
301
+ paths:
302
+ - 'backlog/tasks/*.md'
303
+
304
+ concurrency:
305
+ group: dor-ingress-\${{ github.event.issue.number || github.event.pull_request.number }}
306
+ cancel-in-progress: true
307
+
308
+ jobs:
309
+ evaluate:
310
+ name: Evaluate against DoR rubric
311
+ runs-on: ubuntu-latest
312
+ permissions:
313
+ issues: write
314
+ pull-requests: write
315
+ contents: read
316
+ steps:
317
+ - uses: actions/checkout@v4
318
+ - uses: pnpm/action-setup@v4
319
+ - uses: actions/setup-node@v4
320
+ with:
321
+ node-version: 22
322
+ cache: pnpm
323
+ - run: pnpm install --frozen-lockfile
324
+ - name: Evaluate DoR (placeholder — wire to your DoR runner)
325
+ run: |
326
+ echo "::notice::DoR ingress shim invoked. Wire pnpm --filter @ai-sdlc/pipeline-cli evaluate-dor here."
327
+ `;
328
+ /**
329
+ * `.ai-sdlc/review-classifier.yaml` stub — cost-optimized review tiers.
330
+ *
331
+ * The actual classifier code ships via AISDLC-141 (a follow-up). For now
332
+ * the wizard scaffolds the config stub + a pointer to the classifier
333
+ * docs so adopters who opt in via `--with-classifier` are ready to flip
334
+ * on the workflow once AISDLC-141 lands.
335
+ */
336
+ export const REVIEW_CLASSIFIER_STUB = `# Review classifier configuration (AISDLC-141, follow-up).
337
+ #
338
+ # The review classifier inspects a PR diff and decides which review tier
339
+ # to invoke (cheap-pattern-match → mid-tier-LLM → full reviewer fan-out)
340
+ # to keep review costs bounded as PR volume grows.
341
+ #
342
+ # This file is a stub scaffolded by \`ai-sdlc init --with-classifier\`.
343
+ # The classifier runtime ships in AISDLC-141; until then this config is
344
+ # advisory only. See docs/operations/init.md for the migration path.
345
+
346
+ apiVersion: ai-sdlc.io/v1alpha1
347
+ kind: ReviewClassifier
348
+ metadata:
349
+ name: default-classifier
350
+ spec:
351
+ tiers:
352
+ - name: cheap
353
+ maxFilesChanged: 5
354
+ maxLinesChanged: 50
355
+ strategy: pattern-match
356
+ - name: mid
357
+ maxFilesChanged: 20
358
+ maxLinesChanged: 500
359
+ strategy: single-llm-pass
360
+ - name: full
361
+ strategy: full-reviewer-fanout
362
+ routing:
363
+ docsOnly: cheap
364
+ testOnly: cheap
365
+ default: mid
366
+ `;
367
+ export const DOR_TEMPLATES = {
368
+ files: {
369
+ '.ai-sdlc/dor-config.yaml': DOR_CONFIG_STUB,
370
+ '.github/workflows/dor-ingress.yml': DOR_INGRESS_WORKFLOW,
371
+ },
372
+ };
373
+ export const ATTESTATION_TEMPLATES = {
374
+ files: {
375
+ '.ai-sdlc/trusted-reviewers.yaml': TRUSTED_REVIEWERS_STUB,
376
+ '.github/workflows/verify-attestation.yml': VERIFY_ATTESTATION_WORKFLOW,
377
+ // The .gitkeep ensures the attestations dir is tracked in git so the
378
+ // first PR's envelope lands cleanly without "directory does not exist"
379
+ // errors from the signing script.
380
+ '.ai-sdlc/attestations/.gitkeep': '',
381
+ },
382
+ };
383
+ export const CLASSIFIER_TEMPLATES = {
384
+ files: {
385
+ '.ai-sdlc/review-classifier.yaml': REVIEW_CLASSIFIER_STUB,
386
+ },
387
+ };
388
+ /**
389
+ * Always-on baseline workflow templates (regardless of wizard answers).
390
+ * Matches AC #4 in AISDLC-143: pipeline.yaml + agent-role.yaml +
391
+ * quality-gate.yaml + autonomy-policy.yaml are scaffolded by `initProject`
392
+ * (existing logic) and the gate workflow is scaffolded by this map.
393
+ */
394
+ export const BASELINE_WORKFLOW_TEMPLATES = {
395
+ files: {
396
+ '.github/workflows/ai-sdlc-gate.yml': AI_SDLC_GATE_WORKFLOW,
397
+ },
398
+ };
399
+ //# sourceMappingURL=init-templates.js.map
@@ -1,6 +1,54 @@
1
1
  /**
2
2
  * ai-sdlc init — initialize a project with AI-SDLC config files.
3
+ *
4
+ * AISDLC-78 enhancements:
5
+ * - Print a 3-line version block at startup so operators see CLI,
6
+ * orchestrator, and plugin versions in one place. Drift triggers a
7
+ * visible warning instead of silently shipping mismatched binaries.
8
+ * - Substitute `your-org` in the pipeline.yaml template using
9
+ * `git remote get-url origin` (ssh + https forms supported). Falls
10
+ * back to the placeholder only when no remote is configured.
11
+ * - Pin `@ai-sdlc/mcp-advisor` in generated `.mcp.json` to the
12
+ * orchestrator version that ran init, with an inline opt-out hint.
13
+ * - Skip `.cursor/mcp.json` unless Cursor is detected (project-local
14
+ * `.cursor/`, user-global `~/.cursor/`) or `--cursor` is passed.
15
+ *
16
+ * AISDLC-143 enhancements (Q4(b) of the quality-gate redesign):
17
+ * - Default invocation is now an interactive WIZARD (DoR / attestation /
18
+ * classifier / branch-protection prompts) so adopters get a guided
19
+ * bootstrap instead of having to read the docs to discover features.
20
+ * - `--yes` short-circuits all prompts to "accept defaults" (CI/scripts).
21
+ * - `--with-X` flags opt into individual features without prompting.
22
+ * - `--add <feature>` extends an already-initialized repo with a single
23
+ * feature, idempotently — re-running on an initialized repo is safe.
24
+ * - `.github/workflows/ai-sdlc-gate.yml` is scaffolded UNCONDITIONALLY
25
+ * so every adopter gets the `ai-sdlc/pr-ready` rollup check on day one
26
+ * (Q1: prescriptive default).
27
+ * - A "next steps" summary closes the run with operator action items
28
+ * conditional on which features were chosen.
3
29
  */
4
30
  import { Command } from 'commander';
31
+ import { type WizardFlags } from './init-features.js';
32
+ export declare const PIPELINE_YAML = "apiVersion: ai-sdlc.io/v1alpha1\nkind: Pipeline\nmetadata:\n name: default\nspec:\n triggers:\n - event: issue.labeled\n filter:\n labels:\n - ai-eligible\n providers:\n sourceControl:\n type: github\n config:\n org: your-org\n stages:\n - name: validate\n qualityGates:\n - default-gates\n - name: code\n agent: default-agent\n timeout: PT30M\n onFailure:\n strategy: retry\n maxRetries: 2\n - name: review\n qualityGates:\n - default-gates\n # backlog: holds settings specific to the backlog-task (/ai-sdlc execute)\n # workflow. These were formerly in a separate pipeline-backlog.yaml file\n # (deprecated by AISDLC-245.5). Slash commands + pipeline-cli readers\n # prefer this canonical location.\n backlog:\n branching:\n pattern: 'ai-sdlc/{issueIdLower}-{slug}'\n targetBranch: main\n cleanup: on-merge\n pullRequest:\n titleTemplate: 'feat: {issueTitle} ({issueId})'\n descriptionSections:\n - summary\n - changes\n - closes\n includeProvenance: true\n closeKeyword: References\n";
33
+ /**
34
+ * Tier-based agent-role templates (AISDLC-79).
35
+ *
36
+ * Three named tiers map to escalating tool surfaces. The default (`coding`)
37
+ * preserves pre-AISDLC-79 behavior plus `NotebookEdit` (parity with the
38
+ * Claude Code SDK's filesystem editing surface). Higher tiers add tools only
39
+ * when their use-case justifies the additional surface area / risk.
40
+ *
41
+ * See `backlog/decisions/AISDLC-79-agent-role-tools-defaults.md` for rationale.
42
+ */
43
+ export type AgentRoleTier = 'coding' | 'research' | 'meta';
44
+ export declare const AGENT_ROLE_TIERS: readonly AgentRoleTier[];
45
+ /** Resolve the agent-role.yaml template for a given tier. Default = `coding`. */
46
+ export declare function getAgentRoleYaml(tier?: AgentRoleTier): string;
47
+ /**
48
+ * Build the WizardFlags struct from Commander's parsed options. Pulled
49
+ * out into a function so tests can drive the wizard pipeline directly
50
+ * without going through Commander's stateful option store.
51
+ */
52
+ export declare function buildWizardFlags(opts: Record<string, unknown>): WizardFlags;
5
53
  export declare const initCommand: Command;
6
54
  //# sourceMappingURL=init.d.ts.map