This document is the canonical reference for what JunieOrchestrator does. If code, README, or tests disagree with this document, the code/tests/README must be changed to match THIS document.
JunieOrchestrator MUST NEVER operate in-place in the user’s current git repository.
“In-place” means any of the following happening to the repo you are currently standing in when you invoke the CLI:
- creating or switching branches
- modifying files
- writing orchestration artifacts (
confirmation.md,steps_to_complete_the_task.md,junie_output_iter_*.txt,.junie_state.json)
This is forbidden.
Given a natural-language task, JunieOrchestrator:
- Creates a dedicated task working directory under
--base-dir(default:junie-tasks/). - Performs a dedicated checkout into that directory (typically
git clone). - Creates and checks out a task branch inside the dedicated checkout.
- Runs the Junie + GPT review loop inside the dedicated checkout.
JunieOrchestrator needs a clone source (repo_url). It must be determined as follows:
- If
--repois provided:
- Use it as the clone source.
- If
--repois omitted AND the current directory is inside a git repository:
- Auto-detect the current repo root and use it as the clone source.
- IMPORTANT: this is still a dedicated checkout (clone/copy). No in-place operations.
- If
--repois omitted AND the current directory is NOT inside a git repository:
- Prompt the user for the clone source.
- All orchestration work happens under a new folder:
<base-dir>/<task-slug>/. - The clone happens into that folder.
- Branch creation/checkouts happen only inside that cloned folder.
Implementations SHOULD include at least one of:
- a hard check that refuses to run if the selected work directory equals the current repo root
- a warning if
repo_urlresolves to the same path as the current directory, clarifying it is used only as clone source
The test suite MUST include a test verifying:
- Running with no
--repofrom inside a git repo does NOT call any “in-place” setup. - It instead creates a work dir and clones from the detected repo.
- Supporting any “in-place mode” is explicitly not a feature.
- Convenience auto-detection exists only to avoid typing
--repo, not to reuse the current working tree.