refactor: drop phase dimension, drive pipeline by modules - #171
refactor: drop phase dimension, drive pipeline by modules#171404MaximWang wants to merge 2 commits into
Conversation
Replace the phase-based two-level pipeline (phases.json, --phase, --one-phase) with a flat module-driven flow built on the metadata sidecar architecture: - manifests (source_files.json/modules.json) drive extraction, layering and batch prompt generation; topdown layers are computed on the global call graph - spec generation/verification iterates global layers, tracks specs readiness per attempt, and exits(1) when the final attempt leaves functions unspecced - backend is injectable end-to-end (backend or DEFAULT_BACKEND) so the mock backend can drive every stage in tests - incremental scope selects modules by index, keeps changed modules/functions, and injects pass-3 changed functions into the relevant scope - generated domain context is injected into verification prompts - delete md/workflow_generate_phases.md - docs: OPENCODE_SETUP_MODEL plans modules, not phases
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f6e8c54f7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| project = modules_json["project"] | ||
| exts = modules_json.get("file_extensions", []) | ||
| try: | ||
| from src.extract import EXT_TO_LANG |
There was a problem hiding this comment.
Avoid importing the target project's src.extract
When Stage 6 runs the copied fm_agent/spec_prompts/generate_batch_prompts.py with cwd=proj_dir, this import resolves against the analyzed project, not FM-Agent. Projects that already have a src/extract.py or a src package with import-time dependencies can crash batch prompt generation or supply the wrong EXT_TO_LANG before any specs are generated; the standalone script should rely on the manifest data or a local extension map instead of importing src from the target repo.
Useful? React with 👍 / 👎.
Stage 6 runs the copied fm_agent/spec_prompts/generate_batch_prompts.py as a subprocess inside the analyzed project. Importing src.extract there can resolve against the target project's own src package — crashing on its import-time dependencies or silently supplying a wrong EXT_TO_LANG. Use a local extension->language map instead (kept in sync with src/extract.py), matching the existing standalone copies in this script.
Replace the phase-based two-level pipeline (phases.json, --phase, --one-phase) with a flat module-driven flow built on the metadata sidecar architecture: