refactor(code-review): defer finding IDs until consolidation

This commit is contained in:
Alex Verkhovsky 2026-01-04 05:33:21 -08:00
parent b8eeb78cff
commit 5fcdae02b5
3 changed files with 43 additions and 61 deletions

View File

@ -43,15 +43,14 @@ Review `{git_discrepancies}` and create findings:
| Discrepancy Type | Severity | | Discrepancy Type | Severity |
| --- | --- | | --- | --- |
| Files changed but not in story File List | MEDIUM | | Files changed but not in story File List | Medium |
| Story lists files but no git changes | HIGH | | Story lists files but no git changes | High |
| Uncommitted changes not documented | MEDIUM | | Uncommitted changes not documented | Medium |
For each discrepancy, add to `{context_aware_findings}`: For each discrepancy, add to `{context_aware_findings}` (no IDs yet - assigned after merge):
``` ```
{ {
id: "CAF-{n}",
source: "git-discrepancy", source: "git-discrepancy",
severity: "...", severity: "...",
description: "...", description: "...",
@ -66,15 +65,14 @@ For EACH AC in `{acceptance_criteria}`:
1. Read the AC requirement 1. Read the AC requirement
2. Search implementation files in `{comprehensive_file_list}` for evidence 2. Search implementation files in `{comprehensive_file_list}` for evidence
3. Determine status: IMPLEMENTED, PARTIAL, or MISSING 3. Determine status: IMPLEMENTED, PARTIAL, or MISSING
4. If PARTIAL or MISSING → add HIGH severity finding 4. If PARTIAL or MISSING → add High severity finding
Add to `{context_aware_findings}`: Add to `{context_aware_findings}`:
``` ```
{ {
id: "CAF-{n}",
source: "ac-validation", source: "ac-validation",
severity: "HIGH", severity: "High",
description: "AC {id} not fully implemented: {details}", description: "AC {id} not fully implemented: {details}",
evidence: "Expected: {ac}, Found: {what_was_found}" evidence: "Expected: {ac}, Found: {what_was_found}"
} }
@ -86,16 +84,15 @@ For EACH task marked [x] in `{tasks_with_status}`:
1. Read the task description 1. Read the task description
2. Search files for evidence it was actually done 2. Search files for evidence it was actually done
3. **CRITICAL**: If marked [x] but NOT DONE → CRITICAL finding 3. **Critical**: If marked [x] but NOT DONE → Critical finding
4. Record specific proof (file:line) if done 4. Record specific proof (file:line) if done
Add to `{context_aware_findings}` if false: Add to `{context_aware_findings}` if false:
``` ```
{ {
id: "CAF-{n}",
source: "task-audit", source: "task-audit",
severity: "CRITICAL", severity: "Critical",
description: "Task marked complete but not implemented: {task}", description: "Task marked complete but not implemented: {task}",
evidence: "Searched: {files}, Found: no evidence of {expected}" evidence: "Searched: {files}, Found: no evidence of {expected}"
} }
@ -137,10 +134,10 @@ Present context-aware findings:
**Phase 1: Context-Aware Review Complete** **Phase 1: Context-Aware Review Complete**
**Findings:** {count} **Findings:** {count}
- CRITICAL: {count} - Critical: {count}
- HIGH: {count} - High: {count}
- MEDIUM: {count} - Medium: {count}
- LOW: {count} - Low: {count}
Proceeding to Phase 2: Adversarial Review... Proceeding to Phase 2: Adversarial Review...
``` ```

View File

@ -93,12 +93,11 @@ Capture findings from adversarial review.
Evaluate severity (Critical, High, Medium, Low) and validity (Real, Noise, Undecided). Evaluate severity (Critical, High, Medium, Low) and validity (Real, Noise, Undecided).
Create `{asymmetric_findings}` list: Add each finding to `{asymmetric_findings}` (no IDs yet - assigned after merge):
``` ```
{ {
id: "AAF-{n}", source: "adversarial",
source: "adversarial-review",
severity: "...", severity: "...",
validity: "...", validity: "...",
description: "...", description: "...",
@ -115,15 +114,15 @@ Present adversarial findings:
**Reviewer Context:** Pure diff review (no story knowledge) **Reviewer Context:** Pure diff review (no story knowledge)
**Findings:** {count} **Findings:** {count}
- CRITICAL: {count} - Critical: {count}
- HIGH: {count} - High: {count}
- MEDIUM: {count} - Medium: {count}
- LOW: {count} - Low: {count}
**Validity Assessment:** **Validity Assessment:**
- Real issues: {count} - Real: {count}
- Noise/false positives: {count} - Noise: {count}
- Needs judgment: {count} - Undecided: {count}
Proceeding to findings consolidation... Proceeding to findings consolidation...
``` ```

View File

@ -57,53 +57,39 @@ Keep the MORE DETAILED version:
- If adversarial finding has better technical detail → keep that - If adversarial finding has better technical detail → keep that
- When in doubt, keep context-aware (has more context) - When in doubt, keep context-aware (has more context)
Mark duplicates as merged: Note which findings were merged (for transparency in the summary).
```
{
id: "CF-{n}",
merged_from: ["CAF-3", "AAF-2"],
kept_version: "CAF-3",
reason: "Context-aware version includes AC reference"
}
```
### 3. Normalize Severity ### 3. Normalize Severity
Apply consistent severity scale: Apply consistent severity scale (Critical, High, Medium, Low).
| Severity | Icon | Criteria |
| --- | --- | --- |
| CRITICAL | RED | Security vuln, data loss, tasks marked done but not, broken core functionality |
| HIGH | ORANGE | Missing AC implementation, logic errors, missing critical error handling |
| MEDIUM | YELLOW | Performance issues, incomplete features, documentation gaps |
| LOW | GREEN | Code style, minor improvements, suggestions |
### 4. Filter Noise ### 4. Filter Noise
Review adversarial findings marked as NOISE: Review adversarial findings marked as Noise:
- If clearly false positive (e.g., style preference, not actual issue) → exclude - If clearly false positive (e.g., style preference, not actual issue) → exclude
- If questionable → keep with UNDECIDED validity - If questionable → keep with Undecided validity
- If context reveals it's actually valid → upgrade to REAL - If context reveals it's actually valid → upgrade to Real
**Do NOT filter:** **Do NOT filter:**
- Any CRITICAL or HIGH severity - Any Critical or High severity
- Any context-aware findings (they have story context) - Any context-aware findings (they have story context)
### 5. Create Consolidated Table ### 5. Sort and Number Findings
Sort by severity (Critical → High → Medium → Low), then assign IDs: F1, F2, F3, etc.
Build `{consolidated_findings}`: Build `{consolidated_findings}`:
```markdown ```markdown
| ID | Severity | Source | Description | Location | | ID | Severity | Source | Description | Location |
|----|----------|--------|-------------|----------| |----|----------|--------|-------------|----------|
| CF-1 | CRITICAL | task-audit | Task 3 marked [x] but not implemented | src/auth.ts | | F1 | Critical | task-audit | Task 3 marked [x] but not implemented | src/auth.ts |
| CF-2 | HIGH | ac-validation | AC2 partially implemented | src/api/*.ts | | F2 | High | ac-validation | AC2 partially implemented | src/api/*.ts |
| CF-3 | HIGH | adversarial | Missing error handling in API calls | src/api/client.ts:45 | | F3 | High | adversarial | Missing error handling in API calls | src/api/client.ts:45 |
| CF-4 | MEDIUM | git-discrepancy | File changed but not in story | src/utils.ts | | F4 | Medium | git-discrepancy | File changed but not in story | src/utils.ts |
| CF-5 | LOW | adversarial | Magic number should be constant | src/config.ts:12 | | F5 | Low | adversarial | Magic number should be constant | src/config.ts:12 |
``` ```
### 6. Present Consolidated Findings ### 6. Present Consolidated Findings
@ -115,10 +101,10 @@ Build `{consolidated_findings}`:
**Summary:** **Summary:**
- Total findings: {count} - Total findings: {count}
- CRITICAL: {count} - Critical: {count}
- HIGH: {count} - High: {count}
- MEDIUM: {count} - Medium: {count}
- LOW: {count} - Low: {count}
**Deduplication:** {merged_count} duplicate findings merged **Deduplication:** {merged_count} duplicate findings merged
@ -126,16 +112,16 @@ Build `{consolidated_findings}`:
## Findings by Severity ## Findings by Severity
### CRITICAL (Must Fix) ### Critical (Must Fix)
{list critical findings with full details} {list critical findings with full details}
### HIGH (Should Fix) ### High (Should Fix)
{list high findings with full details} {list high findings with full details}
### MEDIUM (Consider Fixing) ### Medium (Consider Fixing)
{list medium findings} {list medium findings}
### LOW (Nice to Fix) ### Low (Nice to Fix)
{list low findings} {list low findings}
--- ---