Skip to content

Full-path review (codespy review-path), implementation planner, sparse checkout fix - #60

Merged
khezen merged 7 commits into
mainfrom
full-scope
Oct 26, 2026
Merged

khezen merged 7 commits into
mainfrom
full-scope

Conversation

@khezen

@khezen khezen commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

What

codespy review-path <repo-url> [--path P] [--ref BRANCH] reviews existing code with no PR. It sparse-clones a path, presents every reviewable file as newly added, identifies all scopes under it, and runs the full pipeline. There is no PR to comment on, so the report is delivered as a new PR/MR opened by codespy:

  • branch codespy/review/<path-slug>, file .codespy/reviews/<path-slug>.md (full report)
  • the report in the PR description (lowest-severity issues are cut first to stay under the size limit, with a link to the file); every issue links to its lines at the reviewed commit
  • re-runs update the open report PR (new commit, new description, one comment); a stale branch with no open PR is reset to base
  • --no-open-pr is a dry run (stdout only)

Cost caps review.full_path.max_files (300, --max-files) and max_bytes (2 MB) count files left after all skip rules, and stop the run before any LLM call. Symlinks in the reviewed repo are never followed. make review-path REPO_URL=... [REVIEW_PATH=] [REF=] [MAX_FILES=] [OPEN_PR=false] runs it in Docker.

Implementation planner (review.plan, opt-in)

A new agent turns the review's findings into an ordered implementation plan, for both PR reviews and full-path reviews. Disabled by default (review.plan.enabled, REVIEW_PLAN_ENABLED, Action input plan-enabled).

  • Runs after the audit and gets its quality assessment and recommendation.
  • One RLM run per scope with issues, concurrently (review.max_concurrent_scopes), with filesystem, ripgrep and tree-sitter tools rooted at the scope to find the call sites and tests a fix touches. Each issue goes to the scope with the longest matching subroot (path-segment aware); issues outside every scope are planned against the repo root.
  • Plans every issue left after confidence filtering and rejected-feedback suppression; skipped with no LLM call when there are none.
  • Read-only memory: uses the run-level recall and recall_memory, writes no episode.
  • Soft-fail: a failing scope is left out; a planner failure posts the review without a plan.
  • Steps list title, files, change, verification and the issues they address.
  • Rendered as a collapsible 🛠️ Implementation Plan section after the recommendation:
    • PR/MR review body: capped at 20,000 chars (memories get what is left);
    • review-path report PR description: same cap, with a link to the full plan in the report file;
    • report file, stdout and MCP markdown: uncapped; JSON: implementation_plan field.
    • Several scopes are nested in their own collapsible sections; truncation drops trailing steps and keeps tags balanced.

Fixes that affect every review

  • Sparse checkout selected the whole repo. The pattern list started with a bare /*, which in non-cone mode matches every path, and the list was re-sorted, so ! lines landed before /* and had no effect. Patterns are now ordered cone-style (/*, !/*/, /A/, !/A/*/ …) and applied with git read-tree -mu HEAD, which also shrinks old cached clones. New patterns are written before checkout so treeless clones only fetch the new set.
  • Missing Deno → empty APPROVE. Every RLM agent soft-failed to "no findings" without the Deno sandbox. Reviews now check Deno 2.x first and stop with install guidance.

PullRequest.url keeps its existing values for PR/local reviews (it's the memory topic id); only path mode overrides it.

Not included

  • MCP review_path tool: not requested; it would skip the report PR and isn't safe under concurrent MCP calls.
  • Action (action.yml) support for review-path (the planner's Action inputs are included).

Testing

  • tests/test_full_path_review.py (62 tests): real-git sparse checkout (bare /* reproduces the bug; PR mode, path mode, Xcode bundles, narrowing a full clone), URL parsing/rejection, synthetic patches and skip rules, symlinks, caps after skips, scope resolution in path mode, report rendering/truncation, GitHub/GitLab upsert with mocks (create / update open PR / reset stale branch / cleanup only own branch), Deno preflight.
  • tests/test_implementation_plan.py (28 tests): config default and env, issue→scope grouping and path handling, gating (no LLM/MCP call when disabled or no issues), per-scope failure isolation, planner inputs (scope-relative issues, audit verdict) and repo-relative output paths, pipeline soft-fail, rendering (flat/nested, truncation within budget with balanced tags and overflow link), both reporters under the 60,000-char body limit with a huge plan, many issues and memories.
  • Full suite: 816 passed; the 23 failures and 3 errors are the same set that fails on the base commit (memory/cerebral, doc_extractor, memories, statistics, an outdated test_not_a_signature). Lint and mypy: no new errors beyond the dspy.Signature/Module subclass errors every agent has.
  • Manual: Docker image builds with review-path and Deno 2.9.5. A live clone of src/codespy/tools/git of this repo materialised only that path plus ancestor files. A first live run on peaks-com/mono opened a report PR but found nothing because Deno was missing locally, which led to the preflight fix. A full LLM run that opens a PR has not been verified end-to-end yet, and the planner has not been run against a real model.

- review-path: sparse-clone a repo path, review every file as newly added
  across all its scopes, deliver the report as a PR/MR opened by codespy
  (branch codespy/review/<slug>, .codespy/reviews/<slug>.md, report in the
  description, re-runs update the open PR). Caps review.full_path.max_files /
  max_bytes fail before any LLM call. Symlinks are never followed.
- Fix: remote reviews checked out the whole repo (bare /* sparse pattern).
  Patterns are now ordered cone-style and applied with read-tree -mu HEAD.
- Fail fast when the Deno sandbox is missing instead of reporting an empty
  APPROVE.
- make review-path runs in Docker.
New agent turns review findings into an ordered plan, one RLM run per scope with issues (filesystem/ripgrep/treesitter tools), after the audit and given its verdict. Read-only memory, soft-fail, disabled by default. Rendered as a collapsible section in PR reviews, review-path report PRs/files, stdout, MCP and JSON.
@khezen khezen changed the title Full-path review (codespy review-path) + sparse checkout fix Full-path review (codespy review-path), implementation planner, sparse checkout fix Oct 25, 2026
@khezen khezen self-assigned this Oct 26, 2026
@khezen
khezen merged commit 05ce979 into main Oct 26, 2026
6 checks passed
@khezen
khezen deleted the full-scope branch October 26, 2026 17:06
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