Skip to content

Commit 999f526

Browse files
committed
refactor(lfg): align workflow review vocabulary to P0-P3 + confidence anchors
The lfg workflow reimplements review inline with its own severity (blocker/high/medium/low) and confidence (low/medium/high) scales, forking from the canonical ce-code-review model that the ce-* persona reviewers it dispatches natively emit. Map both to P0-P3 and the 0/25/50/75/100 confidence anchors so the workflow speaks the plugin's review vocabulary and the personas aren't forced through a lossy remap. Vocabulary only: dedup, severity-gated autofix, and the report-then-apply architecture are unchanged.
1 parent 36db308 commit 999f526

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

.claude/workflows/lfg.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Work — ce-work: execute the plan.
2323
* Code Review — ce-code-review: persona reviewers per dimension, deduped by
2424
* file:line, adversarially verified; severity gate.
25-
* Autofix — apply confirmed blocker/high/medium findings (defer low to PR).
25+
* Autofix — apply confirmed P0/P1/P2 findings (defer P3 to PR).
2626
* Re-review — re-review the fix diff for regressions the fixes introduced.
2727
* Simplify — ce-simplify-code: behavior-preserving cleanup.
2828
* Test — suite/build/lint + ce-test-browser (web) / simulator (iOS).
@@ -63,7 +63,7 @@ export const meta = {
6363
{ title: 'Doc Review', detail: 'ce-doc-review — adversarially stress-test the plan (fatal -> abort)' },
6464
{ title: 'Work', detail: 'ce-work executes the plan with the Doc Review concerns in view' },
6565
{ title: 'Code Review', detail: 'ce-code-review — persona reviewers per dimension, dedup by file:line, adversarially verify, severity gate' },
66-
{ title: 'Autofix', detail: 'Apply confirmed blocker/high/medium findings; defer low to the PR' },
66+
{ title: 'Autofix', detail: 'Apply confirmed P0/P1/P2 findings; defer P3 to the PR' },
6767
{ title: 'Re-review', detail: 'Re-review the fix diff for regressions the fixes introduced; fix them' },
6868
{ title: 'Simplify', detail: 'ce-simplify-code — behavior-preserving cleanup of the corrected code' },
6969
{ title: 'Test', detail: 'Suite/build/lint + ce-test-browser (web) / simulator (iOS)' },
@@ -141,7 +141,7 @@ const PLANCHECK_SCHEMA = {
141141
type: 'array',
142142
items: {
143143
type: 'object',
144-
properties: { issue: { type: 'string' }, severity: { type: 'string', enum: ['blocker', 'high', 'medium', 'low'] } },
144+
properties: { issue: { type: 'string' }, severity: { type: 'string', enum: ['P0', 'P1', 'P2', 'P3'] } },
145145
required: ['issue', 'severity'],
146146
},
147147
},
@@ -175,7 +175,7 @@ const FINDINGS_SCHEMA = {
175175
title: { type: 'string' },
176176
file: { type: 'string' },
177177
line: { type: ['integer', 'null'] },
178-
severity: { type: 'string', enum: ['blocker', 'high', 'medium', 'low'] },
178+
severity: { type: 'string', enum: ['P0', 'P1', 'P2', 'P3'], description: 'P0 critical, P1 high, P2 moderate, P3 low — the ce-code-review severity scale' },
179179
rationale: { type: 'string' },
180180
suggestedFix: { type: 'string' },
181181
},
@@ -190,7 +190,7 @@ const VERDICT_SCHEMA = {
190190
type: 'object',
191191
properties: {
192192
isReal: { type: 'boolean', description: 'True only if the finding can be confirmed from the actual code' },
193-
confidence: { type: 'string', enum: ['low', 'medium', 'high'] },
193+
confidence: { type: 'integer', enum: [0, 25, 50, 75, 100], description: 'Confidence anchor in the isReal verdict (ce-code-review scale): 0/25/50/75/100' },
194194
reasoning: { type: 'string' },
195195
},
196196
required: ['isReal', 'reasoning'],
@@ -240,7 +240,7 @@ const DOGFOOD_SCHEMA = {
240240
type: 'array',
241241
items: {
242242
type: 'object',
243-
properties: { title: { type: 'string' }, severity: { type: 'string', enum: ['blocker', 'high', 'medium', 'low'] } },
243+
properties: { title: { type: 'string' }, severity: { type: 'string', enum: ['P0', 'P1', 'P2', 'P3'] } },
244244
required: ['title'],
245245
},
246246
},
@@ -292,8 +292,8 @@ const NON_INTERACTIVE = 'Run NON-INTERACTIVELY: do NOT call AskUserQuestion or a
292292
// Helpers (no Date.now/Math.random — those are unavailable in workflow scripts).
293293
// ---------------------------------------------------------------------------
294294

295-
const SEVERITY_RANK = { blocker: 3, high: 2, medium: 1, low: 0 }
296-
const AUTO_FIX_SEVERITIES = ['blocker', 'high', 'medium']
295+
const SEVERITY_RANK = { P0: 3, P1: 2, P2: 1, P3: 0 }
296+
const AUTO_FIX_SEVERITIES = ['P0', 'P1', 'P2']
297297

298298
// Worktree-isolation instruction prepended to every mutating phase. Assigned in
299299
// the Worktree phase; empty (no-op) when worktree creation fails or is skipped.
@@ -571,7 +571,7 @@ const { raw: rawFindings, confirmed } = await reviewAndVerify(DIMENSIONS, review
571571

572572
const toFix = confirmed.filter(f => AUTO_FIX_SEVERITIES.includes(f.severity))
573573
const deferredNits = confirmed.filter(f => !AUTO_FIX_SEVERITIES.includes(f.severity))
574-
log(`${rawFindings.length} raw -> ${confirmed.length} confirmed — ${toFix.length} to fix, ${deferredNits.length} low deferred to PR`)
574+
log(`${rawFindings.length} raw -> ${confirmed.length} confirmed — ${toFix.length} to fix, ${deferredNits.length} P3 deferred to PR`)
575575

576576
// ---------------------------------------------------------------------------
577577
// Autofix. Apply auto-fixable confirmed findings; record skipped + nits.
@@ -588,8 +588,8 @@ if (toFix.length) {
588588
} else {
589589
log('No auto-fixable findings — skipping Autofix.')
590590
}
591-
// Low-severity confirmed findings ride along as residual so they surface on the PR.
592-
fix.residual = (fix.residual || []).concat(deferredNits.map(f => ({ title: `[${f.severity}] ${f.title}`, reason: f.rationale || 'deferred low-severity finding' })))
591+
// P3 (deferred) confirmed findings ride along as residual so they surface on the PR.
592+
fix.residual = (fix.residual || []).concat(deferredNits.map(f => ({ title: `[${f.severity}] ${f.title}`, reason: f.rationale || 'deferred P3 finding' })))
593593

594594
// ---------------------------------------------------------------------------
595595
// Re-review. The fixes themselves can introduce regressions. Re-review the fix

0 commit comments

Comments
 (0)