cohorte 1.3.3 → 1.4.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.
- package/CHANGELOG.md +133 -0
- package/README.md +4 -7
- package/bin/cli.js +49 -4
- package/core/agents/implementer.template.md +10 -5
- package/core/agents/profile-reader.md +22 -0
- package/core/commands/doctor.md +8 -4
- package/core/hooks/gate.py +21 -6
- package/core/templates/agent-handoff.md +7 -2
- package/core/templates/review-feedback.md +7 -4
- package/core/templates/spec.template.md +5 -2
- package/core/templates/steps/init-pipeline/04-write-render.md +2 -1
- package/core/workflows/audit.js +88 -7
- package/core/workflows/refactor.js +85 -9
- package/core/workflows/review.js +132 -11
- package/dashboard/README.md +22 -5
- package/dashboard/dist/assets/index-AFQnlfjO.css +1 -0
- package/dashboard/dist/assets/{index-BxgA_mz1.js → index-DLBzciIC.js} +12 -11
- package/dashboard/dist/index.html +2 -2
- package/dashboard/server/doctor.js +68 -20
- package/dashboard/server/fleet.js +19 -5
- package/dashboard/server/index.js +79 -7
- package/dashboard/server/metrics.js +16 -4
- package/dashboard/server/versions.js +28 -6
- package/dashboard/server/yaml.js +4 -1
- package/install.ps1 +4 -0
- package/install.sh +19 -1
- package/package.json +5 -2
- package/profile/SCHEMA.md +23 -26
- package/scripts/kanban-move.sh +34 -20
- package/scripts/metrics/collect.mjs +495 -0
- package/scripts/metrics/prices.json +39 -0
- package/scripts/new-feature.sh.template +3 -1
- package/scripts/preflight.sh +16 -3
- package/scripts/remove-feature.sh.template +2 -1
- package/scripts/telemetry-send.sh +15 -1
- package/scripts/test-dashboard.mjs +362 -0
- package/scripts/test-gate.mjs +273 -0
- package/scripts/test-metrics.mjs +135 -0
- package/scripts/test-workflows.mjs +321 -0
- package/scripts/validate-core.mjs +51 -1
- package/core/commands/cycle.md +0 -54
- package/core/workflows/cycle.js +0 -407
- package/dashboard/dist/assets/index-Cj0SpgEY.css +0 -1
package/core/workflows/cycle.js
DELETED
|
@@ -1,407 +0,0 @@
|
|
|
1
|
-
// cohorte — the FULL dev cycle as one deterministic workflow (opt-in):
|
|
2
|
-
// contract → build → [preflight → smoke ∥ review(+cross-check) → fix]* → done.
|
|
3
|
-
//
|
|
4
|
-
// Invoke with args = {feature: "<feature_id>", maxRounds?: 3} in the feature's
|
|
5
|
-
// checkout (main checkout on the feature branch, or its worktree).
|
|
6
|
-
//
|
|
7
|
-
// The contract with the human: a workflow can NEVER ask a question mid-run, so
|
|
8
|
-
// everything decisional is moved to the edges —
|
|
9
|
-
// · UPSTREAM: the spec must be frozen and self-sufficient (design links in the
|
|
10
|
-
// front-matter, complete §5 contract). A readiness gate checks this FIRST
|
|
11
|
-
// and aborts with the list of gaps as `questions` before spending anything.
|
|
12
|
-
// A well-run /brainstorm + /spec IS the answer sheet — the sharper it is,
|
|
13
|
-
// the further the cycle runs with an empty questions array.
|
|
14
|
-
// · DOWNSTREAM: the loop runs review→fix→review until ZERO open findings and
|
|
15
|
-
// a PASS smoke (bounded by maxRounds + the token budget). Even a finding
|
|
16
|
-
// that implies a CONTRACT change stays inside the loop: a lead-equivalent
|
|
17
|
-
// agent re-authors spec §5 + the contract file (exactly what /fix does
|
|
18
|
-
// conversationally — implementers still never touch it), the affected
|
|
19
|
-
// surfaces re-dispatch, and the loop continues. Only what is genuinely
|
|
20
|
-
// human comes back at the END, in the result's `questions` array (spec
|
|
21
|
-
// ambiguities the readiness gate flagged, a hit round-cap/budget) — ready
|
|
22
|
-
// to feed a follow-up fix/review loop if you decide to keep going.
|
|
23
|
-
// /ship stays out on purpose: it is the outward-facing, irreversible gate and
|
|
24
|
-
// keeps its human confirmation. A SHIP exit ticks the DoD + stamps the
|
|
25
|
-
// freshness gate, so `/ship <id>` right after is a straight shot.
|
|
26
|
-
//
|
|
27
|
-
// Loop economics: smoke and review run CONCURRENTLY each round (both observe,
|
|
28
|
-
// neither edits); fix rounds re-dispatch only the surfaces owning findings;
|
|
29
|
-
// the loop is bounded by maxRounds AND by the session token budget if one is
|
|
30
|
-
// set. Disk state stays pipeline-coherent: reports staged to specs/reports/,
|
|
31
|
-
// unresolved findings appended to the spec's ## Remediation — a conversational
|
|
32
|
-
// /fix can always pick up where the workflow stopped.
|
|
33
|
-
|
|
34
|
-
export const meta = {
|
|
35
|
-
name: 'cohorte-cycle',
|
|
36
|
-
description: 'Full cohorte dev cycle: contract, parallel build, then bounded smoke∥review→fix rounds; deferred questions in the output, never mid-run',
|
|
37
|
-
whenToUse: 'Only when the human explicitly asks to run the full dev-cycle workflow on a FROZEN spec. args = {feature: "<feature_id>", maxRounds?: 3}.',
|
|
38
|
-
phases: [
|
|
39
|
-
{ title: 'Profile', detail: 'PIPELINE.md → JSON via profile-reader', model: 'haiku' },
|
|
40
|
-
{ title: 'Ready', detail: 'spec frozen + self-sufficient, or abort with the gaps', model: 'haiku' },
|
|
41
|
-
{ title: 'Contract', detail: 'author the frozen contract from spec §5' },
|
|
42
|
-
{ title: 'Build', detail: 'one implementer per surface, parallel' },
|
|
43
|
-
{ title: 'Verify', detail: 'per round: preflight → smoke ∥ review + cross-check' },
|
|
44
|
-
{ title: 'Fix', detail: 'per round: re-dispatch only the surfaces with findings' },
|
|
45
|
-
{ title: 'Close', detail: 'reports, Remediation/DoD, freshness stamp, metrics', model: 'haiku' },
|
|
46
|
-
],
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const feature = typeof args === 'string' ? args.trim() : args && args.feature
|
|
50
|
-
if (!feature) throw new Error('cohorte-cycle needs args = {feature: "<feature_id>"}')
|
|
51
|
-
// Runaway protection, not a target — the loop's real exit is 0 findings + PASS.
|
|
52
|
-
const MAX_ROUNDS = Math.max(1, (args && args.maxRounds) || 5)
|
|
53
|
-
|
|
54
|
-
const questions = [] // every deferred human decision ends up here — emitted at the END
|
|
55
|
-
const contractChanges = [] // contract re-authorings the loop performed (info, not questions)
|
|
56
|
-
|
|
57
|
-
const PROFILE = { type: 'object', additionalProperties: true }
|
|
58
|
-
const READY = {
|
|
59
|
-
type: 'object', required: ['frozen', 'gaps', 'designLinks'], additionalProperties: false,
|
|
60
|
-
properties: {
|
|
61
|
-
frozen: { type: 'boolean', description: 'front-matter status is frozen or in-review' },
|
|
62
|
-
gaps: { type: 'array', items: { type: 'string' }, description: 'anything the cycle would have had to ask about' },
|
|
63
|
-
designLinks: { type: 'string', description: 'the design_files links, comma-joined, or "none"' },
|
|
64
|
-
},
|
|
65
|
-
}
|
|
66
|
-
const PREFLIGHT = {
|
|
67
|
-
type: 'object', required: ['pass'], additionalProperties: false,
|
|
68
|
-
properties: { pass: { type: 'boolean' }, tail: { type: 'string' } },
|
|
69
|
-
}
|
|
70
|
-
const STAGE = {
|
|
71
|
-
type: 'object', required: ['surfaces'], additionalProperties: false,
|
|
72
|
-
properties: {
|
|
73
|
-
surfaces: {
|
|
74
|
-
type: 'array',
|
|
75
|
-
items: {
|
|
76
|
-
type: 'object', required: ['key', 'diff', 'files'], additionalProperties: false,
|
|
77
|
-
properties: {
|
|
78
|
-
key: { type: 'string' }, diff: { type: 'string' },
|
|
79
|
-
files: { type: 'array', items: { type: 'string' } },
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
}
|
|
85
|
-
const FINDING = {
|
|
86
|
-
type: 'object', required: ['severity', 'file', 'line', 'kind', 'problem', 'fix'],
|
|
87
|
-
additionalProperties: false,
|
|
88
|
-
properties: {
|
|
89
|
-
severity: { enum: ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW'] },
|
|
90
|
-
file: { type: 'string' }, line: { type: 'integer' },
|
|
91
|
-
kind: { enum: ['spec-violation', 'quality', 'security'] },
|
|
92
|
-
problem: { type: 'string' }, fix: { type: 'string' },
|
|
93
|
-
},
|
|
94
|
-
}
|
|
95
|
-
const REPORT = {
|
|
96
|
-
type: 'object', required: ['verdict', 'findings'], additionalProperties: false,
|
|
97
|
-
properties: {
|
|
98
|
-
verdict: { enum: ['SHIP', 'REVISE', 'BLOCK'] },
|
|
99
|
-
findings: { type: 'array', maxItems: 20, items: FINDING },
|
|
100
|
-
overflow: { type: 'integer' },
|
|
101
|
-
},
|
|
102
|
-
}
|
|
103
|
-
const VERDICT = {
|
|
104
|
-
type: 'object', required: ['refuted', 'reason'], additionalProperties: false,
|
|
105
|
-
properties: { refuted: { type: 'boolean' }, reason: { type: 'string' } },
|
|
106
|
-
}
|
|
107
|
-
const SMOKE = {
|
|
108
|
-
type: 'object', required: ['pass', 'failures'], additionalProperties: false,
|
|
109
|
-
properties: {
|
|
110
|
-
pass: { type: 'boolean' },
|
|
111
|
-
failures: {
|
|
112
|
-
type: 'array', maxItems: 10,
|
|
113
|
-
items: { type: 'string', description: '❌ <flow/endpoint> · expected <x> got <y> · file hint if known' },
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// ── Phase 0 — profile ────────────────────────────────────────────────────────
|
|
119
|
-
phase('Profile')
|
|
120
|
-
const profile = await agent(
|
|
121
|
-
'Return this project\'s PIPELINE.md `yaml pipeline-profile` block as JSON, per your instructions.',
|
|
122
|
-
{ agentType: 'profile-reader', label: 'profile', schema: PROFILE, effort: 'low' },
|
|
123
|
-
)
|
|
124
|
-
if (!profile || profile.error) {
|
|
125
|
-
return { outcome: 'ABORTED', questions: [`profile unreadable: ${(profile && profile.error) || 'no return'} — run /init-pipeline or /doctor`] }
|
|
126
|
-
}
|
|
127
|
-
const surfaces = Array.isArray(profile.surfaces) ? profile.surfaces : []
|
|
128
|
-
const byKey = Object.fromEntries(surfaces.map(s => [s.key, s]))
|
|
129
|
-
const cmds = profile.commands || {}
|
|
130
|
-
const base = (profile.vcs && profile.vcs.default_branch) || 'main'
|
|
131
|
-
const contract = profile.contract || {}
|
|
132
|
-
const contractFile = contract.enabled ? `${contract.path}/${feature}.${contract.ext || 'ts'}` : ''
|
|
133
|
-
const quiet = (q, full) => (q && !String(q).startsWith('<') ? q : full ? `${full} 2>&1 | tail -40` : '')
|
|
134
|
-
const checks = [cmds.typecheck, quiet(cmds.lint_quiet, cmds.lint), quiet(cmds.test_quiet, cmds.test)]
|
|
135
|
-
.filter(c => c && !String(c).startsWith('<'))
|
|
136
|
-
|
|
137
|
-
// ── Phase 1 — readiness gate: the spec must pre-answer everything ───────────
|
|
138
|
-
phase('Ready')
|
|
139
|
-
const ready = await agent(
|
|
140
|
-
`Readiness check for the cohorte full-cycle workflow on spec specs/${feature}.md — the run can ask ` +
|
|
141
|
-
'NOTHING mid-flight, so list every gap a lead would normally have to ask about. Read the spec ' +
|
|
142
|
-
'(front-matter + §5 contract + per-surface tasks + §9 acceptance) and report:\n' +
|
|
143
|
-
'- frozen: front-matter status is `frozen` or `in-review`\n' +
|
|
144
|
-
'- gaps: e.g. status draft/missing; §5 contract absent or with open placeholders/TODOs; a surface\'s ' +
|
|
145
|
-
'tasks empty while §5 clearly implies work there; `design_files` empty while a uses_design surface ' +
|
|
146
|
-
`has tasks (uses_design surfaces: ${surfaces.filter(s => s.uses_design).map(s => s.key).join(', ') || 'none'}); ` +
|
|
147
|
-
'open `## Remediation` items that imply a contract change\n' +
|
|
148
|
-
'- designLinks: the design_files links comma-joined, or "none"',
|
|
149
|
-
{ model: 'haiku', label: 'ready', schema: READY, effort: 'low' },
|
|
150
|
-
)
|
|
151
|
-
if (!ready || !ready.frozen) {
|
|
152
|
-
return {
|
|
153
|
-
outcome: 'NOT-READY',
|
|
154
|
-
questions: ((ready && ready.gaps) || ['spec unreadable']).concat(
|
|
155
|
-
['freeze the spec first: /spec (the cycle only runs on a frozen, self-sufficient spec)']),
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
questions.push(...(ready.gaps || [])) // non-blocking gaps ride along as deferred questions
|
|
159
|
-
const designLinks = ready.designLinks || 'none'
|
|
160
|
-
|
|
161
|
-
// ── Phase 2 — author the contract (lead-equivalent, the single sync channel) ─
|
|
162
|
-
if (contract.enabled) {
|
|
163
|
-
phase('Contract')
|
|
164
|
-
const c = await agent(
|
|
165
|
-
`Author the frozen contract for cohorte feature ${feature}, acting as the lead (/build §2): from ` +
|
|
166
|
-
`spec specs/${feature}.md §5, write/update ${contractFile} in the profile's mechanism ` +
|
|
167
|
-
`(${contract.mechanism})${contract.index ? `, exported from ${contract.index}` : ''}. ` +
|
|
168
|
-
'Postcondition: the file exists and typechecks. Implementers import it read-only. ' +
|
|
169
|
-
'Return one line: what you wrote, or what blocked you.',
|
|
170
|
-
{ label: 'contract' },
|
|
171
|
-
)
|
|
172
|
-
if (c == null) return { outcome: 'ABORTED', questions: questions.concat(['contract authoring failed — run /build manually']) }
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// ── Phase 3 — build: one implementer per surface, parallel ───────────────────
|
|
176
|
-
phase('Build')
|
|
177
|
-
const buildPrompt = s =>
|
|
178
|
-
`Implement the **${s.key}** surface for feature \`${feature}\`. Read \`PIPELINE.md\` first. ` +
|
|
179
|
-
`Spec: \`specs/${feature}.md\`. Contract: \`${contractFile || 'none — spec §5 prose is the contract'}\` ` +
|
|
180
|
-
'(import read-only). Work test-first. Touch only `' + s.path + '`. Need the current state of your ' +
|
|
181
|
-
`tree? Compute it yourself: \`git diff ${base} -- ${s.path}\`. Return the handoff in the format ` +
|
|
182
|
-
`your agent instructions define. Design files: ${s.uses_design ? designLinks : 'none'}. ` +
|
|
183
|
-
'Open Remediation items for YOUR surface (`none` ⇒ first build, implement the spec\'s tasks for ' +
|
|
184
|
-
'your surface): none'
|
|
185
|
-
const handoffs = await parallel(surfaces.map(s => () =>
|
|
186
|
-
agent(buildPrompt(s), { agentType: s.agent, label: `build:${s.key}`, phase: 'Build' })
|
|
187
|
-
// agent() resolves to null (never throws) when a subagent dies — wrapping
|
|
188
|
-
// unconditionally would hide every death from the `dead` check below.
|
|
189
|
-
.then(h => (h == null ? null : { key: s.key, handoff: h }))))
|
|
190
|
-
const built = handoffs.filter(Boolean)
|
|
191
|
-
const dead = surfaces.filter(s => !built.some(b => b.key === s.key)).map(s => s.key)
|
|
192
|
-
if (dead.length) questions.push(`implementer(s) died during build: ${dead.join(', ')} — inspect and re-run /build if their surface matters`)
|
|
193
|
-
|
|
194
|
-
// ── helpers for the verify/fix rounds ────────────────────────────────────────
|
|
195
|
-
const surfaceOf = file => {
|
|
196
|
-
for (const s of surfaces) if (file && String(file).startsWith(String(s.path))) return s.key
|
|
197
|
-
return null
|
|
198
|
-
}
|
|
199
|
-
const itemLine = f => `- [ ] ${f.severity} · ${f.file}:${f.line} · ${f.kind} · ${f.fix}`
|
|
200
|
-
const runPreflight = () => agent(
|
|
201
|
-
`Run the cohorte deterministic pre-flight for feature ${feature} in ONE Bash call:\n` +
|
|
202
|
-
`<core>/pipeline/scripts/preflight.sh specs/reports/${feature}.preflight.txt ` +
|
|
203
|
-
checks.map(c => JSON.stringify(c)).join(' ') + '\n' +
|
|
204
|
-
'(<core> = .claude if .claude/pipeline/scripts/preflight.sh exists, else ~/.claude; script absent ⇒ ' +
|
|
205
|
-
'run the quoted commands yourself into the same file, stopping at the first failure.) ' +
|
|
206
|
-
'pass=true only on fully green; on failure put the raw last 40 lines in tail, verbatim.',
|
|
207
|
-
{ model: 'haiku', label: 'preflight', phase: 'Verify', schema: PREFLIGHT, effort: 'low' },
|
|
208
|
-
)
|
|
209
|
-
|
|
210
|
-
let verdict = null
|
|
211
|
-
let smokePass = false
|
|
212
|
-
let smokeFails = [] // last round's smoke failures — Close reports the real count
|
|
213
|
-
let open = [] // findings still open, each {severity,file,line,kind,problem,fix,src}
|
|
214
|
-
let rounds = 0
|
|
215
|
-
let preflightRed = false // did the LAST round end on a red preflight (open/verdict then stale)?
|
|
216
|
-
|
|
217
|
-
// ── Phases 4/5 — bounded verify → fix rounds ────────────────────────────────
|
|
218
|
-
while (rounds < MAX_ROUNDS && (!budget.total || budget.remaining() > 30000)) {
|
|
219
|
-
rounds++
|
|
220
|
-
log(`Round ${rounds}/${MAX_ROUNDS}`)
|
|
221
|
-
phase('Verify')
|
|
222
|
-
|
|
223
|
-
// 4a. preflight — mechanical red short-circuits straight to a fix round
|
|
224
|
-
const pre = await runPreflight()
|
|
225
|
-
preflightRed = !pre || !pre.pass
|
|
226
|
-
if (preflightRed) {
|
|
227
|
-
const tail = (pre && pre.tail) || ''
|
|
228
|
-
const hit = new Set(surfaces.filter(s => tail.includes(String(s.path))).map(s => s.key))
|
|
229
|
-
const targets = hit.size ? [...hit] : built.map(b => b.key)
|
|
230
|
-
log(`Preflight red — mechanical fix round on: ${targets.join(', ')}`)
|
|
231
|
-
phase('Fix')
|
|
232
|
-
await parallel(targets.filter(k => byKey[k]).map(k => () => agent(
|
|
233
|
-
`Fix loop for feature \`${feature}\` on your surface (**${k}**). Read \`PIPELINE.md\` first. ` +
|
|
234
|
-
`Contract: \`${contractFile || 'spec §5'}\` (read-only). Touch only \`${byKey[k].path}\`. ` +
|
|
235
|
-
'The mechanical gates (typecheck/lint/tests) are RED. Raw failure tail below — fix exactly ' +
|
|
236
|
-
'what concerns your tree, then rerun your quiet commands until green. Failures:\n' + tail,
|
|
237
|
-
{ agentType: byKey[k].agent, label: `fix:${k}`, phase: 'Fix' })))
|
|
238
|
-
continue
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// 4b. stage the diff once for the reviewers
|
|
242
|
-
const staged = await agent(
|
|
243
|
-
`Stage review inputs for cohorte feature ${feature}. Diff base: ${base}. Surfaces: ` +
|
|
244
|
-
surfaces.map(s => `${s.key} → ${s.path}`).join(' · ') + '.\n' +
|
|
245
|
-
`1. git diff ${base} --stat > specs/reports/${feature}.stat.txt (never print it). ` +
|
|
246
|
-
'2. Group changed paths by surface prefix (unowned paths = shared remainder → most relevant surface). ' +
|
|
247
|
-
`3. Per touched surface only: git diff ${base} -- <path> [remainder] > specs/reports/${feature}.<key>.diff. ` +
|
|
248
|
-
'4. Return the touched surfaces (empty array if no diff).',
|
|
249
|
-
{ model: 'haiku', label: 'stage-diff', phase: 'Verify', schema: STAGE, effort: 'low' },
|
|
250
|
-
)
|
|
251
|
-
const touched = (staged && staged.surfaces) || []
|
|
252
|
-
if (!touched.length) { questions.push(`no diff against ${base} after build — wrong branch/checkout?`); break }
|
|
253
|
-
|
|
254
|
-
// 4c. smoke ∥ review(+cross-check) — both observe, neither edits: run together
|
|
255
|
-
const [smoke, reviewed] = await parallel([
|
|
256
|
-
() => agent(
|
|
257
|
-
'Smoke-test one feature, per your agent instructions (bring it up, exercise the contract + §8 UI ' +
|
|
258
|
-
'flows, stage the full SMOKE REPORT, tear down; return the capped shape — pass + max 10 one-line ' +
|
|
259
|
-
`failures with a file hint when you have one). — Variable slots: feature ${feature} · spec: ` +
|
|
260
|
-
`specs/${feature}.md · contract: ${contractFile || 'spec §5'} · report: specs/reports/${feature}.smoke.md · ` +
|
|
261
|
-
'checkout: the current working directory (already the feature checkout) · ports/db: the profile/slot defaults',
|
|
262
|
-
{ agentType: 'smoke', label: 'smoke', phase: 'Verify', schema: SMOKE }),
|
|
263
|
-
() => pipeline(
|
|
264
|
-
touched,
|
|
265
|
-
s => agent(
|
|
266
|
-
'Review one feature surface against its frozen spec, per your agent instructions (staged diff ' +
|
|
267
|
-
'FIRST; capped shape — max 20 one-line findings, no code excerpts). — Variable slots: ' +
|
|
268
|
-
`feature ${feature} · scope: the ${s.key} surface only · spec: specs/${feature}.md · ` +
|
|
269
|
-
`staged diff: ${s.diff} · changed files: ${s.files.join(', ')}`,
|
|
270
|
-
{ agentType: 'review', label: `review:${s.key}`, phase: 'Verify', schema: REPORT }),
|
|
271
|
-
async (report, s) => {
|
|
272
|
-
if (!report) return null
|
|
273
|
-
const hard = report.findings.filter(f => f.severity === 'CRITICAL' || f.kind === 'security')
|
|
274
|
-
const rest = report.findings.filter(f => !hard.includes(f))
|
|
275
|
-
if (!hard.length) return { key: s.key, kept: rest }
|
|
276
|
-
const votes = await parallel(hard.map(f => () => agent(
|
|
277
|
-
'Adversarially verify ONE review finding — REFUTE it if you can (code, guard, test, or spec ' +
|
|
278
|
-
'shows it does not hold); uncertain ⇒ refuted=false. — Finding: ' +
|
|
279
|
-
`[${f.severity}/${f.kind}] ${f.file}:${f.line} — ${f.problem} (fix: ${f.fix}). ` +
|
|
280
|
-
`Feature ${feature} · spec: specs/${feature}.md · staged diff: ${s.diff}`,
|
|
281
|
-
{ agentType: 'review', label: `verify:${s.key}`, phase: 'Verify', schema: VERDICT },
|
|
282
|
-
).then(v => ({ f, refuted: !!(v && v.refuted) }))))
|
|
283
|
-
return { key: s.key, kept: rest.concat(votes.filter(Boolean).filter(v => !v.refuted).map(v => v.f)) }
|
|
284
|
-
},
|
|
285
|
-
),
|
|
286
|
-
])
|
|
287
|
-
|
|
288
|
-
smokePass = !!(smoke && smoke.pass)
|
|
289
|
-
smokeFails = (smoke && smoke.failures) || []
|
|
290
|
-
open = (reviewed || []).filter(Boolean).flatMap(r => r.kept.map(f => ({ ...f, src: r.key })))
|
|
291
|
-
verdict = open.some(f => f.kind === 'security') ? 'BLOCK'
|
|
292
|
-
: open.length ? 'REVISE' : 'SHIP'
|
|
293
|
-
log(`Round ${rounds}: review ${verdict} (${open.length} finding(s)) · smoke ${smokePass ? 'PASS' : `FAIL:${smokeFails.length}`}`)
|
|
294
|
-
|
|
295
|
-
// The loop's contract is ZERO open findings + PASS — a SHIP verdict alone
|
|
296
|
-
// (which older revisions granted despite HIGH/MEDIUM leftovers) is not enough.
|
|
297
|
-
if (!open.length && smokePass) break
|
|
298
|
-
if (rounds >= MAX_ROUNDS) break
|
|
299
|
-
|
|
300
|
-
// 5. fix round. Contract-impacting findings stay INSIDE the loop: a
|
|
301
|
-
// lead-equivalent agent re-authors spec §5 + the contract file (implementers
|
|
302
|
-
// still never touch it — same division of labor as conversational /fix §1),
|
|
303
|
-
// and the surfaces it names re-dispatch against the updated shapes.
|
|
304
|
-
phase('Fix')
|
|
305
|
-
const contractFindings = contractFile
|
|
306
|
-
? open.filter(f => String(f.file).startsWith(String(contract.path))) : []
|
|
307
|
-
let rippleSurfaces = []
|
|
308
|
-
if (contractFindings.length) {
|
|
309
|
-
const cf = await agent(
|
|
310
|
-
`Act as the cohorte lead on a contract change for feature ${feature} (exactly /fix §1's contract ` +
|
|
311
|
-
`check): the findings below show the frozen contract is wrong. Update spec specs/${feature}.md §5 ` +
|
|
312
|
-
`accordingly, then re-author ${contractFile} (mechanism: ${contract.mechanism}` +
|
|
313
|
-
`${contract.index ? `, exported from ${contract.index}` : ''}) until it typechecks. Findings:\n` +
|
|
314
|
-
contractFindings.map(f => `- ${f.file}:${f.line} — ${f.problem} (fix: ${f.fix})`).join('\n') + '\n' +
|
|
315
|
-
'Return ONE line: `<what changed> || <comma-separated surface keys that consume the changed shapes>` ' +
|
|
316
|
-
`(surfaces: ${surfaces.map(s => s.key).join(', ')}; when in doubt list them all).`,
|
|
317
|
-
{ label: 'contract-fix', phase: 'Fix' },
|
|
318
|
-
)
|
|
319
|
-
const [what, keys] = String(cf || '').split('||').map(x => x && x.trim())
|
|
320
|
-
contractChanges.push(what || 'contract re-authored (agent gave no summary)')
|
|
321
|
-
rippleSurfaces = (keys ? keys.split(',').map(k => k.trim()) : surfaces.map(s => s.key))
|
|
322
|
-
.filter(k => byKey[k])
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
// Group the remaining findings by owning surface; smoke failures ride with
|
|
326
|
-
// the surface their file hint maps to, else the surface with most findings.
|
|
327
|
-
const perSurface = {}
|
|
328
|
-
for (const k of rippleSurfaces) {
|
|
329
|
-
(perSurface[k] = perSurface[k] || []).push(
|
|
330
|
-
`- [ ] CRITICAL · ${contractFile} · spec-violation · the contract was RE-AUTHORED this round (${contractChanges[contractChanges.length - 1]}) — re-read it and realign your surface's implementation + tests`)
|
|
331
|
-
}
|
|
332
|
-
for (const f of open.filter(f => !contractFindings.includes(f))) {
|
|
333
|
-
const k = surfaceOf(f.file) || f.src
|
|
334
|
-
if (byKey[k]) (perSurface[k] = perSurface[k] || []).push(itemLine(f))
|
|
335
|
-
}
|
|
336
|
-
const fallbackKey = Object.keys(perSurface).sort((a, b) => perSurface[b].length - perSurface[a].length)[0]
|
|
337
|
-
|| (built[0] && built[0].key)
|
|
338
|
-
for (const line of smokeFails) {
|
|
339
|
-
const k = surfaceOf((line.match(/[\w./-]+\.\w{1,4}/) || [])[0]) || fallbackKey
|
|
340
|
-
if (byKey[k]) (perSurface[k] = perSurface[k] || []).push(`- [ ] HIGH · runtime · smoke failure · ${line}`)
|
|
341
|
-
}
|
|
342
|
-
if (!Object.keys(perSurface).length) { questions.push('open findings map to no surface — run /fix manually'); break }
|
|
343
|
-
await parallel(Object.entries(perSurface).map(([k, items]) => () => agent(
|
|
344
|
-
`Fix loop for feature \`${feature}\` on your surface (**${k}**). Read \`PIPELINE.md\` first. ` +
|
|
345
|
-
`Contract: \`${contractFile || 'spec §5'}\` (read-only — report mismatches, never edit it). Touch only ` +
|
|
346
|
-
`\`${byKey[k].path}\`. Need your tree's current state? \`git diff ${base} -- ${byKey[k].path}\`. ` +
|
|
347
|
-
'Fix exactly the open items below (self-contained — read only the files they name), then rerun your ' +
|
|
348
|
-
'quiet commands until green. Return the handoff your agent instructions define. Design files: ' +
|
|
349
|
-
`${byKey[k].uses_design ? designLinks : 'none'}. Open items for YOUR surface:\n` + items.join('\n'),
|
|
350
|
-
{ agentType: byKey[k].agent, label: `fix:${k}`, phase: 'Fix' })))
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
if (preflightRed) {
|
|
354
|
-
questions.push('the last round ended on a RED preflight — the reported verdict/findings are from the previous round and may already be fixed; rerun /review after the mechanical fixes land')
|
|
355
|
-
}
|
|
356
|
-
if (rounds >= MAX_ROUNDS && !(verdict === 'SHIP' && smokePass)) {
|
|
357
|
-
questions.push(`round cap (${MAX_ROUNDS}) reached with ${open.length} finding(s) open — rerun the cycle (maxRounds higher) or continue with /fix ${feature} + /review`)
|
|
358
|
-
}
|
|
359
|
-
if (budget.total && budget.remaining() <= 30000 && !(verdict === 'SHIP' && smokePass)) {
|
|
360
|
-
questions.push('token budget nearly spent — cycle stopped early; rerun the cycle or continue conversationally')
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// ── Phase 6 — close: reports, spec bookkeeping, freshness stamp, metrics ────
|
|
364
|
-
phase('Close')
|
|
365
|
-
const success = verdict === 'SHIP' && smokePass
|
|
366
|
-
const findingLine = f => `- **[${f.severity}]** \`${f.file}:${f.line}\` · ${f.kind} · ${f.problem} → **Fix:** ${f.fix}`
|
|
367
|
-
const reportBody = [
|
|
368
|
-
'# REVIEW REPORT', `feature_id: ${feature} · merged by cohorte-cycle workflow (round ${rounds})`, '',
|
|
369
|
-
`Verdict: ${verdict || 'NOT-REACHED'} · smoke: ${smokePass ? 'PASS' : 'FAIL'}`, '', '## Findings', '',
|
|
370
|
-
open.length ? open.map(findingLine).join('\n') : 'None.',
|
|
371
|
-
].join('\n')
|
|
372
|
-
await agent(
|
|
373
|
-
`Close a cohorte cycle run for feature ${feature}, mechanically:\n` +
|
|
374
|
-
`1. Write EXACTLY this to specs/reports/${feature}.md (overwrite):\n<<<REPORT\n${reportBody}\nREPORT\n` +
|
|
375
|
-
(success
|
|
376
|
-
? `2. In specs/${feature}.md tick the DoD boxes the cycle verified (spec conformance + copy language — ` +
|
|
377
|
-
'review SHIP; tests/lint/typecheck — green preflight; runtime flows — smoke PASS); leave anything ' +
|
|
378
|
-
'unverified unticked. 3. Stamp the freshness gate in the spec front-matter, exactly as /review §3 ' +
|
|
379
|
-
`does: BASE=$(git merge-base ${base} HEAD); reviewed_base: $BASE; reviewed_digest: ` +
|
|
380
|
-
`$(git diff $BASE -- . ':(exclude)specs/' | sha256sum | cut -c1-16).\n` :
|
|
381
|
-
`2. Append the open findings to specs/${feature}.md \`## Remediation\` under a subheading ` +
|
|
382
|
-
`\`### cohorte-cycle round ${rounds}\`, one \`- [ ]\` line each (so a conversational /fix picks them ` +
|
|
383
|
-
'up):\n' + (open.map(itemLine).join('\n') || '(none — see questions in the workflow result)') + '\n' +
|
|
384
|
-
`Set the front-matter status: in-review.\n`) +
|
|
385
|
-
`4. Append ONE metrics line to $(dirname "$(git rev-parse --git-common-dir)")/.claude/pipeline-metrics.jsonl: ` +
|
|
386
|
-
`{"ts":"<ISO now>","feature":"${feature}","phase":"cycle","seconds":0,"surfaces":{"rounds":"${rounds}","verdict":"${verdict || 'none'}:${open.length}","smoke":"${smokePass ? 'PASS' : 'FAIL'}"}}\n` +
|
|
387
|
-
'5. Chain the opt-in usage pings (all funnel phases this run executed, 0 seconds each): ' +
|
|
388
|
-
`<core>/pipeline/scripts/telemetry-send.sh build "${feature}" 0 "${built.map(() => 'ok').join(',') || 'error'}" || true; ` +
|
|
389
|
-
`<core>/pipeline/scripts/telemetry-send.sh smoke "${feature}" 0 "${smokePass ? 'PASS' : 'FAIL:' + smokeFails.length}" || true; ` +
|
|
390
|
-
`<core>/pipeline/scripts/telemetry-send.sh review "${feature}" 0 "${verdict || 'none'}:${open.length}" || true\n` +
|
|
391
|
-
'Return the single word: done.',
|
|
392
|
-
{ model: 'haiku', label: 'close', effort: 'low' },
|
|
393
|
-
)
|
|
394
|
-
|
|
395
|
-
return {
|
|
396
|
-
outcome: success ? 'SHIP-READY' : 'STOPPED',
|
|
397
|
-
rounds,
|
|
398
|
-
verdict: verdict || 'not reached',
|
|
399
|
-
smoke: smokePass ? 'PASS' : 'FAIL',
|
|
400
|
-
contractChanges, // re-authorings the loop performed itself — review them in the diff
|
|
401
|
-
openFindings: open.slice(0, 10).map(f => `[${f.severity}] ${f.file}:${f.line} — ${f.problem}`),
|
|
402
|
-
questions, // everything deferred to you — empty when /brainstorm + /spec did their job
|
|
403
|
-
report: `specs/reports/${feature}.md`,
|
|
404
|
-
next: success
|
|
405
|
-
? `/ship ${feature} — DoD ticked + freshness stamped, ship is a straight shot (human confirm stays)`
|
|
406
|
-
: `answer the questions, then rerun the cycle — or continue with /fix ${feature} + /review (Remediation is up to date)`,
|
|
407
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--bg: #0e0f13;--panel: #16181f;--panel-2: #1c1f28;--border: #262a35;--text: #e6e8ee;--muted: #8b90a0;--accent: #6ea8fe;--ok: #3fb950;--warn: #d9a441;--bad: #f85149;--dev: #a371f7;--mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:var(--mono);font-size:14px}.app{min-height:100vh}.topbar{display:flex;align-items:center;justify-content:space-between;padding:12px 20px;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:20;background:#0e0f13e6;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}.brand{font-weight:600;letter-spacing:.2px;display:flex;align-items:center;gap:8px}.dot{width:9px;height:9px;border-radius:50%;background:var(--accent);box-shadow:0 0 10px var(--accent)}.muted{color:var(--muted)}.small{font-size:12px}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:16px;padding:20px;max-width:1100px;margin:0 auto}@media(max-width:720px){.grid{grid-template-columns:1fr}}.panel{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:16px 18px}.panel h2{margin:0 0 12px;font-size:13px;text-transform:uppercase;letter-spacing:1px;color:var(--muted)}.panel.placeholder{opacity:.7}.panel.error{grid-column:1 / -1;border-color:var(--bad);color:var(--bad)}.panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.panel-head h2{margin:0}.badge{font-size:11px;padding:3px 9px;border-radius:999px;border:1px solid var(--border);white-space:nowrap}.badge.ok{color:var(--ok);border-color:color-mix(in srgb,var(--ok) 40%,transparent);background:color-mix(in srgb,var(--ok) 12%,transparent)}.badge.warn{color:var(--warn);border-color:color-mix(in srgb,var(--warn) 40%,transparent);background:color-mix(in srgb,var(--warn) 12%,transparent)}.badge.bad{color:var(--bad);border-color:color-mix(in srgb,var(--bad) 40%,transparent);background:color-mix(in srgb,var(--bad) 12%,transparent)}.badge.dev{color:var(--dev);border-color:color-mix(in srgb,var(--dev) 40%,transparent);background:color-mix(in srgb,var(--dev) 12%,transparent)}.badge.neutral{color:var(--muted)}.rows{display:flex;flex-direction:column;gap:2px}.row{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-bottom:1px dashed var(--border)}.row:last-child{border-bottom:none}.row-label{color:var(--muted)}.row-value{text-align:right}.row-value.strong{font-weight:600}.row-value.mono{font-family:var(--mono);font-size:12px}.actions{display:flex;align-items:center;gap:10px;margin-top:16px}.fresh-hint{margin:14px 0 0;padding-top:12px;border-top:1px dashed var(--border)}.fresh-hint strong{color:var(--accent)}button{font-family:var(--mono);font-size:13px;padding:7px 12px;border-radius:8px;border:1px solid var(--border);background:var(--panel-2);color:var(--text);cursor:pointer}button:disabled{opacity:.4;cursor:not-allowed}button.primary{background:color-mix(in srgb,var(--accent) 22%,var(--panel-2));border-color:color-mix(in srgb,var(--accent) 40%,transparent)}button.ghost{background:transparent}button:not(:disabled):hover{border-color:var(--accent)}.topbar-right{display:flex;align-items:center;gap:12px}.span2{grid-column:span 2}@media(max-width:720px){.span2{grid-column:1 / -1}}.summary{display:flex;gap:6px;flex-wrap:wrap}.checks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}.check{display:flex;gap:10px;padding:9px 0;border-bottom:1px solid var(--border)}.check:last-child{border-bottom:none}.check.skip{opacity:.55}.check-icon{flex:none;width:20px;height:20px;border-radius:6px;display:grid;place-items:center;font-size:12px;font-weight:700;margin-top:1px}.check-icon.ok{color:var(--ok);background:color-mix(in srgb,var(--ok) 15%,transparent)}.check-icon.warn{color:var(--warn);background:color-mix(in srgb,var(--warn) 15%,transparent)}.check-icon.bad{color:var(--bad);background:color-mix(in srgb,var(--bad) 15%,transparent)}.check-icon.skip{color:var(--muted);background:var(--panel-2)}.check-body{flex:1;min-width:0}.check-line{display:flex;gap:10px;justify-content:space-between;flex-wrap:wrap}.check-label{font-weight:600}.check-detail{color:var(--muted);text-align:right}.check-fix{margin-top:4px;font-size:12px;color:var(--muted)}.check-fix code{color:var(--accent);background:var(--panel-2);padding:1px 6px;border-radius:5px}.surfaces{display:flex;flex-direction:column;gap:10px}.surface{border:1px solid var(--border);border-radius:9px;padding:10px 12px;background:var(--panel-2)}.surface-top{display:flex;align-items:center;gap:8px}.surface-key{font-weight:600}.surface-meta{display:flex;justify-content:space-between;gap:10px;margin-top:4px;font-size:12px}.surface-tools{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}.tool{font-size:11px;color:var(--muted);border:1px solid var(--border);border-radius:5px;padding:1px 6px}.chip{font-size:11px;padding:1px 8px;border-radius:999px;border:1px solid var(--border)}.chip.design{color:var(--dev);border-color:color-mix(in srgb,var(--dev) 40%,transparent)}.chip.model-sonnet{color:var(--accent)}.chip.model-haiku{color:var(--ok)}.chip.model-inherit{color:var(--warn)}.fleet{max-width:1100px;margin:0 auto;padding:20px}.core-banner{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;background:linear-gradient(180deg,var(--panel-2),var(--panel));border:1px solid var(--border);border-radius:12px;padding:14px 18px;margin-bottom:20px}.cb-left{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.cb-title{text-transform:uppercase;letter-spacing:1px;font-size:12px;color:var(--muted)}.cb-version{font-weight:600;font-size:15px}.cb-actions{display:flex;gap:8px}.fleet-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px;flex-wrap:wrap}.fleet-head h2{margin:0;font-size:14px;display:flex;align-items:center;gap:8px}.add-wrap{flex:1;max-width:560px}.add-form{display:flex;gap:8px}.path-input{flex:1;font-family:var(--mono);font-size:13px;padding:7px 12px;background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:8px}.path-input:focus{outline:none;border-color:var(--accent)}.path-input.invalid{border-color:var(--bad)}.add-error{margin-top:6px;font-size:12px;color:var(--bad);word-break:break-word}.fleet-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}.project-card{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:14px 16px;cursor:pointer;transition:border-color .12s,transform .12s}.project-card:hover{border-color:var(--accent);transform:translateY(-1px)}.project-card.gone{opacity:.6;cursor:default}.pc-head{display:flex;align-items:center;justify-content:space-between}.pc-name{font-weight:600}.pc-path{margin:2px 0 10px}.pc-badges{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}.pc-health{display:flex;align-items:center;gap:5px}.pc-counts{margin-left:auto}.icon-btn{border:none;background:transparent;color:var(--muted);padding:2px 6px;border-radius:6px;font-size:13px}.icon-btn:hover{color:var(--bad);background:var(--panel-2)}.pill{font-size:11px;min-width:20px;text-align:center;padding:1px 7px;border-radius:999px;font-weight:600}.pill.ok{color:var(--ok);background:color-mix(in srgb,var(--ok) 14%,transparent)}.pill.warn{color:var(--warn);background:color-mix(in srgb,var(--warn) 14%,transparent)}.pill.bad{color:var(--bad);background:color-mix(in srgb,var(--bad) 14%,transparent)}.pill.neutral{color:var(--muted);background:var(--panel-2)}.detail-crumb{grid-column:1 / -1;margin-bottom:-4px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.detail-tools{display:flex;gap:8px;flex-wrap:wrap}.tool-btn{font-size:12px;padding:5px 10px;border:1px solid color-mix(in srgb,var(--accent) 35%,var(--border));color:var(--accent);background:transparent}.tool-btn:hover{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,transparent)}.confirm-text p{margin:0 0 8px;font-size:13px;line-height:1.6}.confirm-text code{background:var(--panel-2);padding:1px 5px;border-radius:4px;color:var(--accent)}.warn-line{color:var(--warn)!important;background:color-mix(in srgb,var(--warn) 10%,transparent);border-radius:8px;padding:8px 10px}.warn-line code{color:var(--text)!important}.danger-ghost{background:transparent;border:1px solid color-mix(in srgb,var(--bad) 40%,var(--border));color:var(--bad);font-size:12px;padding:5px 10px}.danger-ghost:hover{background:color-mix(in srgb,var(--bad) 12%,transparent);border-color:var(--bad)}button.danger{background:color-mix(in srgb,var(--bad) 20%,var(--panel-2));border-color:color-mix(in srgb,var(--bad) 45%,transparent);color:#ffd7d3}button.danger:hover{border-color:var(--bad)}.reset-list{margin:8px 0;padding-left:18px;font-size:13px;line-height:1.7}.reset-list code{color:var(--accent)}.reset-note{font-size:12.5px;color:var(--muted);background:var(--panel-2);border-radius:8px;padding:10px 12px}.reset-note code{color:var(--text)}.reset-check{display:flex;align-items:center;gap:8px;margin:12px 0 0;font-size:13px}.reset-check code{color:var(--accent)}.board-scroll{max-height:500px;overflow:auto}.board{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.col{background:var(--bg);border:1px solid var(--border);border-radius:9px;padding:8px;min-width:140px}.col-head{display:flex;justify-content:space-between;font-size:11px;text-transform:uppercase;letter-spacing:.6px;color:var(--muted);padding:2px 4px 8px;position:sticky;top:0;background:var(--bg);z-index:1}.col-shipped{opacity:.85}.col-other{border-color:color-mix(in srgb,var(--warn) 40%,var(--border))}.spec-card{background:var(--panel-2);border:1px solid var(--border);border-radius:7px;padding:8px 9px;margin-bottom:7px}.spec-card.bad{border-color:color-mix(in srgb,var(--warn) 45%,transparent)}.spec-title{font-size:13px;font-weight:600}.spec-meta,.spec-branch{margin-top:3px}@media(max-width:640px){.board{grid-template-columns:repeat(2,1fr)}}.kanban-board{display:flex;gap:10px}.kanban-col{flex:0 0 210px;background:var(--bg);border:1px solid var(--border);border-radius:9px;padding:8px}.kanban-col.empty{opacity:.5}.kanban-card{background:var(--panel-2);border:1px solid var(--border);border-radius:7px;padding:8px 9px;margin-bottom:7px}.kanban-card.done{opacity:.6}.kanban-card.done .kc-text{text-decoration:line-through}.kc-text{font-size:12.5px;line-height:1.4}.kc-tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}.kc-tag{font-size:10px;color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,transparent);border-radius:4px;padding:1px 5px}.kc-pr{font-size:10px;border-radius:4px;padding:1px 5px;text-decoration:none;border:1px solid var(--border);color:var(--muted)}a.kc-pr:hover{filter:brightness(1.25)}.kc-pr.state-open{color:var(--ok);border-color:color-mix(in srgb,var(--ok) 40%,transparent);background:color-mix(in srgb,var(--ok) 12%,transparent)}.kc-pr.state-merged{color:var(--dev);border-color:color-mix(in srgb,var(--dev) 40%,transparent);background:color-mix(in srgb,var(--dev) 12%,transparent)}.kc-pr.state-closed{color:var(--bad);border-color:color-mix(in srgb,var(--bad) 40%,transparent);background:color-mix(in srgb,var(--bad) 12%,transparent)}.kc-pr.draft{color:var(--muted);border-color:var(--border);background:var(--panel-2)}.kc-status{font-size:10px;margin-top:5px;color:var(--muted);text-transform:capitalize}.kc-status.state-open{color:var(--ok)}.kc-status.state-merged{color:var(--dev)}.kc-status.state-closed{color:var(--bad)}.metrics-list{display:flex;flex-direction:column;gap:12px}.metric-feature{background:var(--bg);border:1px solid var(--border);border-radius:9px;padding:10px 12px}.mf-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:8px}.mf-name{font-weight:600}.mf-badges{display:flex;gap:6px;flex-wrap:wrap}.phase-bars{display:flex;flex-direction:column;gap:4px}.phase-row{display:grid;grid-template-columns:56px 1fr 90px;align-items:center;gap:10px}.phase-label{color:var(--muted);font-size:12px}.phase-track{height:12px;border-radius:4px;background:var(--panel-2);overflow:hidden}.phase-fill{display:block;height:100%;min-width:2px;border-radius:4px;background:color-mix(in srgb,var(--accent) 65%,var(--panel-2))}.phase-value{text-align:right;white-space:nowrap}.surface-table{width:100%;border-collapse:collapse;margin-top:10px;font-size:12px}.surface-table th{text-align:left;color:var(--muted);font-weight:400;text-transform:uppercase;letter-spacing:.6px;font-size:10px;padding:4px 8px 6px 0;border-bottom:1px dashed var(--border)}.surface-table td{padding:5px 8px 5px 0;border-bottom:1px dashed var(--border)}.surface-table tr:last-child td{border-bottom:none}.st-key{font-weight:600}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:grid;place-items:center;z-index:50;padding:20px}.modal{background:var(--panel);border:1px solid var(--border);border-radius:12px;width:min(720px,100%);max-height:80vh;display:flex;flex-direction:column;padding:18px}.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.modal-head h3{margin:0;font-size:15px}.modal-actions{display:flex;gap:8px;margin-top:14px}.cmd{background:#000;color:var(--accent);padding:10px 12px;border-radius:8px;font-size:13px;overflow-x:auto}.run-log{background:#000;color:#d6d9e0;padding:12px;border-radius:8px;font-size:12.5px;line-height:1.5;overflow:auto;white-space:pre-wrap;word-break:break-word;flex:1;min-height:200px;max-height:55vh;margin:0}.picker{max-height:74vh}.picker-path{background:var(--panel-2);border:1px solid var(--border);border-radius:7px;padding:7px 10px;margin-bottom:10px;word-break:break-all}.picker-list{flex:1;overflow:auto;border:1px solid var(--border);border-radius:8px;padding:6px;min-height:220px;max-height:48vh}.picker-row{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:transparent;border:none;border-radius:6px;padding:7px 9px;color:var(--text);font-size:13px}.picker-row:hover{background:var(--panel-2);border-color:transparent}.picker-row.up{color:var(--muted)}.picker-icon{color:var(--muted);width:14px}.picker-row .badge.small{font-size:10px;padding:0 6px;margin-left:auto}.picker-empty{padding:12px}.add-form .ghost[type=button]{white-space:nowrap}
|