Skip to content

Pr/agent layer integration#17

Open
gvanica wants to merge 38 commits intomainfrom
pr/agent-layer-integration
Open

Pr/agent layer integration#17
gvanica wants to merge 38 commits intomainfrom
pr/agent-layer-integration

Conversation

@gvanica
Copy link
Copy Markdown
Collaborator

@gvanica gvanica commented Apr 15, 2026

Summary

  • New MergeAgent (agents/migration/merge_agent.py): Pure-logic agent that
    encapsulates file discovery, infrastructure filtering, import-graph analysis,
    topological sorting, and file merging. Previously this logic lived only in
    examples/demo/step3_merge.py.
  • New VerificationAgent (agents/migration/verification_agent.py): Scores
    conversion quality with AST-based completeness and optional LLM-based correctness
    checks. Previously in examples/demo/step5_verify.py.
  • New verification_tool.py (tools/verification_tool.py): Standalone ADK tool
    exposing verification for use by ADK agents.
  • Updated PrimaryAgent.run(): Directory path now uses MergeAgent to
    merge+filter before converting, instead of processing files independently.
    Single-file path unchanged.
  • Updated migration_tool.py: Handles the new model+utils output format and
    auto-runs verification scorecard after conversion.
  • Updated adk_agents.py: Registers verify_conversion_tool on both
    migration_agent and evaluation_agent.
  • Simplified demo scripts: step3_merge.py (~600→120 lines) and
    step5_verify.py (~350→180 lines) are now thin wrappers around the agent layer.
  • Updated docs: ARCHITECTURE.md and README.md reflect the full pipeline
    (Clone → Index → Merge → Convert → Verify).

RAG corpus files (generic and targeted) are excluded from this PR.

Test plan

  • Verify MergeAgent.run() produces correct merged output on a sample repo
  • Verify VerificationAgent.verify() returns correct completeness scores
  • Run step3_merge.py end-to-end on a cloned demo repo
  • Run step4_convert.py (uses updated PrimaryAgent directory path)
  • Run step5_verify.py end-to-end
  • Test convert_code tool via PrimaryAgent on both file and directory inputs
  • Verify single-file conversion path is unaffected

Base: main | Compare: pr/agent-layer-integration

gvanica added 30 commits April 2, 2026 21:30
Merge from main, with maxKernel changes
- Replace monolithic convert_multimodal.py with 3 separate scripts:
  step1_clone_repo.py, step2_populate_rag.py, step3_convert.py
- Add config.py for shared paths and setup
- Update README with setup and demo instructions
- step3_merge.py: scans repo for nn.Module files using AST, merges into one
- step4_convert.py: converts the merged file (renamed from step3_convert.py)
- No hardcoded file lists — model files discovered automatically
- Updated README and Quick Start with 4-step flow
step1 now takes an optional URL argument so the demo pipeline can
convert any PyTorch repo, not just the hardcoded Multimodal-Transformer.
config.py derives REPO_URL/REPO_DIR from the MAXCODE_REPO_URL env var,
falling back to the original default.
…ercomputer/accelerator-agents into improve-migration-quality

# Conflicts:
#	MaxCode/agents/migration/primary_agent.py
gvanica added 8 commits April 13, 2026 11:30
Move merge and verification logic from demo scripts into reusable
agents so PrimaryAgent.run(repo_dir) handles the full pipeline
(merge -> convert -> verify) end-to-end.

New files:
- agents/migration/merge_agent.py: MergeAgent with file discovery,
  filtering, import graph analysis, and merging (pure logic, no LLM)
- agents/migration/verification_agent.py: VerificationAgent with
  AST-based completeness + optional LLM-based correctness scoring
- tools/verification_tool.py: standalone ADK tool for quality checks

Modified:
- primary_agent.py: directory path now uses MergeAgent instead of
  per-file processing; caches merge result for downstream use
- migration_tool.py: handles model+utils output format, auto-runs
  verification scorecard after conversion
- adk_agents.py: registers verify_conversion_tool on both agents
- step3_merge.py: simplified to thin wrapper around MergeAgent
- step5_verify.py: simplified to thin wrapper around VerificationAgent
- ARCHITECTURE.md, README.md: updated pipeline documentation
Exclude generic and targeted RAG source files from the agent layer
integration PR to keep the diff focused on code changes.
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