Skip to content

refactor: drop phase dimension, drive pipeline by modules - #171

Open
404MaximWang wants to merge 2 commits into
fmagent-project:mainfrom
404MaximWang:feat/remove-phase-v2
Open

refactor: drop phase dimension, drive pipeline by modules#171
404MaximWang wants to merge 2 commits into
fmagent-project:mainfrom
404MaximWang:feat/remove-phase-v2

Conversation

@404MaximWang

Copy link
Copy Markdown

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

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/generate_batch_prompts.py Outdated
project = modules_json["project"]
exts = modules_json.get("file_extensions", [])
try:
from src.extract import EXT_TO_LANG

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit fee0ae6.

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.
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