Repository navigation
Fix #179: Migrate legacy .autocoder projects and scaffold allowed_commands.yaml - #292
Open
zwanski-start wants to merge 1 commit into
Open
zwanski-start wants to merge 1 commit into
zwanski-start wants to merge 1 commit into
Conversation
…allowed_commands.yaml - migrate_project_layout now merges .autocoder/ into an existing .autoforge/ instead of silently skipping the migration when the new directory already exists (leaving both effectively empty/unused). - Add migration v2 that creates .autoforge/allowed_commands.yaml for existing projects that never received the template. - Run the layout migration before scaffolding when registering an existing folder (UI + CLI), so legacy files aren't shadowed by fresh scaffolding. - Only stamp the migration version on genuinely new projects, so registering an existing project doesn't skip pending prompt migrations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
🔍 QA report: ✅ PassedTester: Barbara (cubefarm agent, in a fresh session) · Round: 1 · Author: Ada Registering a legacy AutoCoder project (via POST /api/projects or start.py) now moves .autocoder/ prompts and features.db into .autoforge/, also merges into an existing .autoforge/, and creates .autoforge/allowed_commands.yaml through a new v2 migration. I confirmed this end to end on the real server, and also on a project registered with master's code (the state the issue describes), where the agent-start migration completed the move. ruff, the new tests and the security tests pass. The 21 pytest failures and 25 mypy errors are the same as on master.
🧪 Commands run
No browser screenshots were taken in this round. Posted by cubefarm · merges automatically once GitHub's checks pass |
cabana8471-arch
pushed a commit
to cabana8471-arch/autoforge
that referenced
this pull request
Nov 8, 2026
…allowed_commands.yaml Adaptations: autocoder_config._get_config_path now uses project_config._get_config_path's order (.autoforge/config.json, then legacy .autocoder/config.json, new files in .autoforge/), so both modules read one file; docs (FORK_README, git_workflow docstring) updated. start.py conflict resolved (my-features import layout). New test_autocoder_config_path.py. Migration (prompt version 1 -> 2) verified on a copy of a real legacy project: .autocoder/allowed_commands.yaml merged into the existing .autoforge/ byte-identical, root prompts/ and DBs moved, idempotent on re-run, pre-migration code still runs and serves the features. Integrates AutoForgeAI#292 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeH26pcsqoxPb3CDs8g1VN
cabana8471-arch
added a commit
to cabana8471-arch/autoforge
that referenced
this pull request
Nov 8, 2026
migrate_project_layout runs in the AutoForge process, outside the agent's sandbox. A .autocoder/ that the agent turned into a symlink (node -e, or a committed symlink restored by git) made the new merge step (AutoForgeAI#292) move the link target's files into .autoforge/; reproduced with a symlink to a directory holding a key file. A symlinked prompts/ was copied the same way (copytree follows links), and root DBs/settings files were followed too. Every step now skips symlinks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeH26pcsqoxPb3CDs8g1VN
cabana8471-arch
pushed a commit
to cabana8471-arch/autoforge
that referenced
this pull request
Nov 8, 2026
Adaptations: the prompt migration lands as v3 (_migrate_v2_to_v3, CURRENT_MIGRATION_VERSION = 3) after AutoForgeAI#292's v2. Fixed a non-idempotent replacement (the testing-prompt note was appended again on every run, since its new text starts with the old one) and skip symlinked prompt files. New test_prompt_migrations.py: v3 converges pre-v3 template wording on the current templates, second run changes nothing, custom prompts untouched, validation/ + .gitignore entry created, v1 chain and new-project stamp; v2 idempotency and untouched prompts. Integrates AutoForgeAI#289 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeH26pcsqoxPb3CDs8g1VN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #179
Problem
Opening an existing AutoCoder-era project left
.autoforge/and.autocoder/effectively empty, and.autoforge/allowed_commands.yamlwas never created:migrate_project_layoutonly renamed.autocoder/→.autoforge/when.autoforge/did not exist. If anything had already created.autoforge/(e.g. registering the folder in the UI, which scaffolds before migrating), the legacy dir was never migrated.allowed_commands.yamlis only copied inscaffold_project_prompts(new projects). No migration created it for existing projects.scaffold_project_promptsalways stamped the current migration version, so registering an existing folder skipped its pending migrations.Changes
autoforge_paths.py: when both dirs exist, merge.autocoder/entries into.autoforge/(existing.autoforge/entries win), then remove.autocoder/if it's empty.prompts.py: new_ensure_allowed_commands_filehelper (shared with scaffolding) and migration v2 that creates.autoforge/allowed_commands.yamlfor existing projects. It runs on agent start viamigrate_project_to_current.CURRENT_MIGRATION_VERSIONgoes from 1 to 2.prompts.py: only stamp the migration version when the prompts were freshly created from templates.server/routers/projects.pyandstart.py: runmigrate_project_layoutbefore scaffolding when registering a project folder.Verification
test_project_migration.py(7 tests): rename, merge into an existing.autoforge/, conflict handling, v2 creates or keeps the allowlist, new-project scaffold, and an existing-project scaffold that doesn't skip migrations.ruff check .passes.mypy .reports no new errors (the 26 existing errors are all in files this PR doesn't touch).test_security.py,test_security_integration.pyandtest_client.pypass.Assumptions
GET /api/projects/{name}. A GET shouldn't move databases around, and the assistant DB may be open at that point..autoforge/copy wins and the legacy copy stays in.autocoder/..autocoder/allowed_commands.yamldoesn't get a new template, becausesecurity.pystill reads that path.🤖 Generated with Claude Code