Skip to content

feat: Phase 5 — repo-markdown destination + git context (CLI check/repair) - #5

Merged
YoniRaviv merged 20 commits into
mainfrom
feat/phase-5-destination
Jun 12, 2026
Merged

YoniRaviv merged 20 commits into
mainfrom
feat/phase-5-destination

Conversation

@YoniRaviv

Copy link
Copy Markdown
Owner

Summary

Phase 5 wires the verifier/repairer (previously eval-only) into the real docpulse check / docpulse repair CLI, sourcing change intent from git, and turns verdicts + repairs into an honest CI exit code, a human report, and a dry-run companion-PR plan. Live git push / gh pr create are deferred to Phase 6.

New modules

  • pipeline.py — CI-agnostic orchestrator: diff → suspects → verify → (repair) → RunResult, with the stale-index warning and per-suspect bundle seeding.
  • context/ — ContextProvider protocol + GitContext (PR env vars → commit-message fallback → ticket IDs).
  • destinations/ — Destination protocol + RepoMarkdownDestination: bottom-up section replacement, flag-tier comment, and the dry-run companion-PR FixPlan (branch/commit/PR-body + emitted gh/git commands), confidence-routed via Phase 4's route().
  • report/summary.py — compute_exit_code + render_summary.
  • command_runner.py — single shared injectable subprocess runner.

Changed

  • diffing/git_diff.py — default three-dot base...head (merge-base) with --two-dot opt-in and auto-fallback when no common ancestor.
  • cli.py — check now verifies + reports (exit 1 on drift); --suspects-only preserves the keyless suspect list; new repair command prints unified diffs + the dry-run PR plan, --write applies edits locally.

Locked decisions honored

  • Two modes (check/repair); --suspects-only keyless path.
  • Dry-run only — no push/PR this phase.
  • Exit 1 iff a verdict is stale with confidence ≥ flag_threshold; unverified never fails; exit 2 = tool/setup error.
  • Three-dot diff default.

Deferred items closed: RunResult.exit_code construction, stale-index warning, two-dot→three-dot, standalone repair --base.

Executed subagent-driven (per-task spec + quality review + a final integrated review). The review loop caught real bugs in plan-prescribed code: a splitlines() round-trip bug that silently deleted blank separators between doc sections (file-mutating core), a ticket-regex false-positive (UTF-8), a duplicated command-runner, and a render_summary "fixed" over-count (counted validation-failed repairs). All fixed.

Test Plan

  • uv run pytest -q → 179 passed (from 137 baseline; +42 Phase 5 tests)
  • uv run ruff check → clean
  • Final integrated review: boundary rule holds (no gh/GitHub outside cli.py+destinations/), exit-code paths audited, replace_sections round-trips real multi-section docs, end-to-end section-id wiring consistent
  • Live GitHub end-to-end run — Phase 6 manual gate (real push/PR not implemented here)

🤖 Generated with Claude Code

YoniRaviv and others added 20 commits June 11, 2026 19:11
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eshold

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…arators

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ummary

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…; cover flag_comment edge cases

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…y-run)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…6 TODOs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…un PR plan

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pairs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…/json-string from OSS models)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@YoniRaviv
YoniRaviv merged commit 008a3ab into main Jun 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant