Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Commit 751593d

Browse files
committed
fix: address adversarial review iteration 2 findings
- simplify-ignore: re-append missing blocks instead of full backup restore - simplify-ignore: clear cache after fallback so next Read re-establishes state - cross-model-reviewer: align severity schema with flowctl parsers (critical/warning/info)
1 parent ddb796b commit 751593d

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

agents/cross-model-reviewer.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,22 @@ Each model's review MUST produce findings in this structure:
9090
"confidence": 0.0-1.0,
9191
"findings": [
9292
{
93-
"severity": "Critical | Important | Suggestion",
94-
"dimension": "Correctness | Readability | Architecture | Security | Performance",
93+
"severity": "critical | warning | info",
94+
"category": "Correctness | Readability | Architecture | Security | Performance",
9595
"file": "path/to/file.rs",
9696
"line": 42,
9797
"description": "What is wrong",
98-
"suggestion": "How to fix it"
98+
"suggestion": "How to fix it",
99+
"confidence": 0.0-1.0,
100+
"evidence": ["grep output", "test failure"]
99101
}
100102
],
101103
"positives": ["At least one positive observation"]
102104
}
103105
```
104106

107+
**Parser compatibility:** severity uses `critical/warning/info` (matching flowctl's ReviewFinding parser). The dimension maps to the `category` field. Findings with `confidence < 0.6` are suppressed unless severity is `critical`.
108+
105109
The consensus algorithm uses severity to weight disagreements: a `Critical` finding from any model blocks SHIP regardless of the other model's verdict. `Suggestion`-only findings do not block.
106110

107111
### ReviewVerdict

hooks/simplify-ignore.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,21 @@ if [ "$TOOL_NAME" = "Edit" ] || [ "$TOOL_NAME" = "Write" ]; then
193193
fi
194194
done
195195
if [ "$MISSING_BLOCKS" -gt 0 ]; then
196-
# Restore original backup (contains unfiltered code), then re-filter
197-
cat "$CACHE/${ID}.bak" > "$FILE_PATH"
198-
printf 'Restored %s from backup (%d missing placeholder(s))\n' "$FILE_PATH" "$MISSING_BLOCKS" >&2
196+
# Re-insert missing blocks into the edited file (not a full backup restore,
197+
# which would discard legitimate edits outside protected regions).
198+
# Strategy: for each missing block, append it at the end with a warning comment.
199+
for bf in "$CACHE/${ID}".block.*; do
200+
[ -f "$bf" ] || continue
201+
h="${bf##*.}"
202+
if ! grep -q "BLOCK_${h}" "$FILE_PATH" 2>/dev/null; then
203+
block_content=$(cat "$bf")
204+
printf '\n%s\n' "$block_content" >> "$FILE_PATH"
205+
printf 'Warning: BLOCK_%s was dropped — re-appended protected block at end of file\n' "$h" >&2
206+
fi
207+
done
208+
# Clear cache so next Read re-establishes placeholders cleanly
209+
rm -f "$CACHE/${ID}.bak" "$CACHE/${ID}.path" "$CACHE/${ID}".block.* \
210+
"$CACHE/${ID}".reason.* "$CACHE/${ID}".prefix.* "$CACHE/${ID}".suffix.*
199211
exit 0
200212
fi
201213

0 commit comments

Comments
 (0)