feat: enhance repair#137
Conversation
Greptile SummaryThis PR enhances the privacy repair pipeline by adding an
Confidence Score: 5/5Safe to merge — the changes are prompt engineering and a schema field addition; no data loss or broken contracts introduced. All production code paths are exercised by existing tests, the schema change is backward-compatible (default_factory=list), and the removed dead code was cleanly excised with matching test deletions. No logic errors were found in the active code paths. No files require special attention beyond the minor schema and test gaps noted in the inline comments. Important Files Changed
Sequence DiagramsequenceDiagram
participant Row as Input Row
participant RE as _render_privacy_reanswer_prompt
participant LLM1 as Reanswer LLM
participant PA as PrivacyAnswerItemSchema
participant LIT as _leaked_items_text
participant RP as _render_repair_prompt
participant LLM2 as Repair LLM
Row->>RE: COL_PRIVACY_QA + COL_REWRITTEN_TEXT
RE->>RE: Build skeleton with evidence field
RE->>LLM1: Prompt with answer_template
LLM1-->>PA: answer, confidence, reason, evidence quotes
PA->>LIT: privacy_answers with evidence
LIT->>LIT: Format leaked items and append Evidence quotes
LIT-->>RP: formatted leaked_items_text
Row->>RP: COL_TEXT, COL_REWRITTEN_TEXT, COL_LEAKAGE_MASS, etc.
RP->>RP: Render prompt with adversarial_goal and inference_rules
RP->>LLM2: Repair prompt without replacement_map or protection_decisions
LLM2-->>Row: COL_REWRITTEN_TEXT_NEXT
Reviews (3): Last reviewed commit: "fix: update tests for repair" | Re-trigger Greptile |
lipikaramaswamy
left a comment
There was a problem hiding this comment.
Btw the failing test jobs seem expected from the current diff, since this PR removes repair prompt sections/helpers that the existing repair tests still assert on. If we do truly want to remove those sections, then the tests will need an update too. But let's discuss
lipikaramaswamy
left a comment
There was a problem hiding this comment.
LGTM 🚢
Focusing repair on residual inference issues instead of carrying forward all first-pass rewrite guidance makes sense, and the tighter privacy-evaluation approach seems well justified 👍
Changes include: