Skip to content

feat: RepoDiagnoser — clone & analyse any public Git repo via CLI or Python API#92

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/update-repodiagnoser-implementation
Closed

feat: RepoDiagnoser — clone & analyse any public Git repo via CLI or Python API#92
Copilot wants to merge 2 commits into
mainfrom
copilot/update-repodiagnoser-implementation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

Implements the RepoDiagnoser tool as specified, composing existing toolkit primitives rather than reimplementing them. Also fixes a pre-existing syntax error in cli.py that made the file unparseable.

New package: tools/repo_diagnoser/

  • diagnoser.pyRepoDiagnoser class with clone_repo(), analyze(), and diagnose() (clone + analyze in one call). Reuses:
    • toolkit/oe/hasher.hash_file() for per-file SHA-256
    • toolkit/oe/merkle.MerkleTree for fingerprint + inclusion proofs
    • minimal_ai_ide/repository_scanner.RepositoryScanner for structural scan
  • cli_diagnose.py — standalone entry point (python -m tools.repo_diagnoser.cli_diagnose)
  • README.md — usage docs and integration table
from tools.repo_diagnoser import RepoDiagnoser

result = RepoDiagnoser().diagnose("https://github.com/owner/repo")
print(result["merkle_root"])                        # integrity fingerprint
proof = result["tree"].get_inclusion_proof("README.md")
result["tree"].export_proofs_jsonl(Path("proofs.jsonl"))

cli.pydiagnose subcommand

Adds cmd_diagnose and wires it into main() alongside existing subcommands. Follows the --apply dry-run-by-default pattern. Accepts --url or --local (mutually exclusive), --depth, --ref, --clone-dir, --out-proofs, --json.

# dry-run (no clone)
python cli.py diagnose --url https://github.com/owner/repo

# clone, analyse, export proofs
python cli.py diagnose --url https://github.com/owner/repo --depth 0 --ref main \
    --out-proofs proofs.jsonl --apply

cli.py — pre-existing syntax fixes

The file had two main() bodies merged together with a missing """ opening a bare text block and orphaned argparse.ArgumentParser() kwargs floating in the function body — both causing SyntaxError. Fixed and unified the dispatch to cover all 9 subcommands.

.github/copilot-instructions.md

New file telling Copilot agent mode about the repo's tooling, the diagnose command, and coding conventions (dry-run contract, no bare except, reuse toolkit primitives).

Copilot AI and others added 2 commits April 4, 2026 08:44
@devin-ai-integration
Copy link
Copy Markdown
Contributor

Closing as stale (Stage D housekeeping).

This Copilot draft has been open without progress and is superseded by:

If the underlying work here is still wanted, re-open a fresh PR rebased on current main; the old branches have substantial drift and CI has moved on. Closing now so the open-PR list reflects reality.

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.

2 participants