feat: add adversarial editing pass with typed cut classifications#18
feat: add adversarial editing pass with typed cut classifications#18
Conversation
|
❌ Changes Requested - Merge Conflict Merge ConflictThis PR has merge conflicts with main that could not be automatically resolved. The Conflicting files:
These are complex conflicts requiring understanding of the webapp template structure. The Doctor role should handle the rebase to integrate the pipeline code with the existing webapp setup. Code Review (for after conflicts are resolved)The implementation quality is strong — well-structured, well-tested, clean TypeScript. Specific observations: Strengths
Minor Notes
PR Description
VerdictThe code is ready to approve once merge conflicts are resolved. No code changes needed — just the rebase integration. |
Implement the adversarial edit module for the revision pipeline that asks the LLM to identify passages to remove rather than improve. Each proposed cut is classified (OVER-EXPLAIN, REDUNDANT, FAT, TELL, STRUCTURAL, GENERIC) and presented as a reviewable suggestion with accept/reject status. Includes response parser, cut distribution tracker, cut application logic, markdown report formatter, and 21 unit tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4c8aa76 to
40606b7
Compare
|
🔀 Automatically rebased branch to resolve merge conflicts. Proceeding with code evaluation. |
|
❌ Changes Requested Evaluating this PR per user request. Critical Issues1. Destructive
|
|
Closing stale PR from previous attempt. Shepherd re-running issue #5 in merge mode. |
Summary
Implements the adversarial editing technique for the revision pipeline: instead of asking "how to improve," ask "what to cut." Each proposed cut is classified by type and presented as a reviewable suggestion.
Changes
src/pipeline/types.ts— Core types:ProposedCut,CutType,AdversarialEditConfig,AdversarialEditResult,CutDistributionsrc/pipeline/adversarial-edit.ts— Main module: prompt builder, response parser, Claude API caller, cut applicator, report formattersrc/pipeline/index.ts— Public API exportssrc/pipeline/__tests__/adversarial-edit.test.ts— 21 unit tests covering parser, distribution, cut application, and report formattingtsconfig.json— TypeScript configuration for the projectpackage.json— Updated scripts to use vitest and tscAcceptance Criteria Verification
adversarialEdit()sends prompt requesting configurabletargetCuts(default 15) passagesCutTypeunion type enforces exactly: OVER-EXPLAIN, REDUNDANT, FAT, TELL, STRUCTURAL, GENERICPASSAGE: """..."""blocks; tested with 6 sample cutsProposedCuthas `status: "pending"computeDistribution()returnsRecord<CutType, number>;formatReport()shows percentagesPipelineStagetype includes"adversarial-edit"between review and revision; module is independently importableTest Plan
npx vitest run— 21 tests passing (parser, distribution, cut application, report formatting)npx tsc --noEmit— Clean type check, no errorsCloses #5(removed: wrong issue)Closes #15(removed: wrong issue)