@opellen/opengoal 1.1.0-rc.1 → 1.1.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -86,6 +86,7 @@ milestone: M<N> # optional — the ROADMAP milestone this goal implem
|
|
|
86
86
|
scope: [<dir>, <dir>] # optional — code areas this goal expects to touch
|
|
87
87
|
base: <branch> # worktree goals only — the branch the worktree was forked from
|
|
88
88
|
worktree: .opengoal/worktrees/<goal-slug> # worktree goals only
|
|
89
|
+
branch: goal/<goal-slug> # worktree goals only — the worktree's own branch
|
|
89
90
|
---
|
|
90
91
|
```
|
|
91
92
|
|
|
@@ -108,6 +109,7 @@ Used by `init`, `archive`, `land`, and `/$CommandPrefix:scout`. Decide once per
|
|
|
108
109
|
- `<main-root>` = the first `worktree` line of `git worktree list --porcelain`.
|
|
109
110
|
- This session is **inside a worktree** when `git rev-parse --show-toplevel` lies under `<main-root>/.opengoal/worktrees/`. GOAL.md's `worktree:` field confirms it but is not required — a goal started by hand in such a directory still counts.
|
|
110
111
|
- Otherwise this session is in the **main checkout**.
|
|
112
|
+
- A worktree goal's branch is the `branch:` field of its GOAL.md (archived GOAL.md once archived); when the field is absent, assume `goal/<id>`.
|
|
111
113
|
|
|
112
114
|
### init (active goal present)
|
|
113
115
|
|
|
@@ -140,12 +142,14 @@ Then:
|
|
|
140
142
|
Run from the main checkout. Only the main checkout may create worktrees — (this session is inside a worktree per `### Worktree Detection`) => stop: `"Worktrees are created from the main checkout. Run /$CommandPrefix:goal init there."`
|
|
141
143
|
|
|
142
144
|
1. Derive `<new-id>` the way `init` derives `id` (kebab-case English slug of the description). (`.opengoal/worktrees/<new-id>/` exists, branch `goal/<new-id>` exists, `$DocsDir/suspended/<new-id>/` exists, or `<new-id>` equals the active goal's `id`) => refuse and ask for a different description.
|
|
143
|
-
2. Preflight: `git status --porcelain -- $DocsDir` on the main checkout
|
|
145
|
+
2. Preflight: run `git status --porcelain -- $DocsDir` on the main checkout. (it prints files) => list them and say: `"These uncommitted docs will not be visible in the new worktree until they are committed here and merged in. Continue?"` — a genuine fork, since only the user knows whether the new goal needs them. (continue) => go on; (no) => stop with the active goal unchanged. A worktree is a checkout of HEAD; the new GOAL.md is written fresh, so the gap is limited to shared docs such as CONTEXT.md or ROADMAP.md.
|
|
144
146
|
3. Record `<base>` = the branch currently checked out in the main checkout (`git rev-parse --abbrev-ref HEAD`); (`.gitignore` lacks a line covering `.opengoal/`) => append `.opengoal/` to `.gitignore` and say so.
|
|
145
147
|
4. `git worktree add .opengoal/worktrees/<new-id> -b goal/<new-id>`.
|
|
146
148
|
5. In the new worktree, delete the copied goal-owned documents: `$DocsDir/GOAL.md`, `$DocsDir/DESIGN.md`, `$DocsDir/PLAN.md`, `$DocsDir/CHECKPOINT.md` (whichever exist). They belong to the goal still running in the main checkout; `archive`'s worktree closing steps make these deletions merge-neutral.
|
|
147
|
-
6. Write the new goal's GOAL.md at `.opengoal/worktrees/<new-id>/$DocsDir/GOAL.md` using the format above, including `base: <base
|
|
148
|
-
7.
|
|
149
|
+
6. Write the new goal's GOAL.md at `.opengoal/worktrees/<new-id>/$DocsDir/GOAL.md` using the format above, including `base: <base>`, `worktree: .opengoal/worktrees/<new-id>` and `branch: goal/<new-id>`, plus `milestone:` / `scope:` per `init` step 4.
|
|
150
|
+
7. Move this session into the worktree, then report. The user should never have to open another window to reach the goal they just created.
|
|
151
|
+
- (the platform can move a running session's working directory — Claude Code: the `EnterWorktree` tool with `path` set to the worktree's absolute path (choosing option 1 is the explicit worktree request that tool requires); Codex CLI: `/cd <absolute path>`) => do it. This session is now the goal session; the main checkout and its active goal are untouched. Report: `"Created worktree [.opengoal/worktrees/<new-id>/](.opengoal/worktrees/<new-id>/) on branch goal/<new-id>. This session now works in it — run /$CommandPrefix:scout to continue. Goal <id> in the main checkout is unchanged."`
|
|
152
|
+
- (the platform cannot move a running session — Gemini CLI has no such command; in Antigravity, prefer its own "New Worktree" conversation mode over this procedure) => Report: `"Created worktree [.opengoal/worktrees/<new-id>/](.opengoal/worktrees/<new-id>/) on branch goal/<new-id> with its GOAL.md. Open a session in that directory and run /$CommandPrefix:scout. Goal <id> here is unchanged."` The directory is the contract; a session opened there sees the root install through ancestor lookup.
|
|
149
153
|
|
|
150
154
|
## breakdown
|
|
151
155
|
|
|
@@ -458,7 +462,8 @@ Usage: `/$CommandPrefix:goal land [<id>]`
|
|
|
458
462
|
- (conflict) => `git -C <main-root> merge --abort`, then stop with `"Merge of goal/<id> conflicts in: <files>. Aborted; <base> is unchanged. Resolve by hand or land another worktree first."` Per Constraints, do not resolve hunks yourself.
|
|
459
463
|
4. Cleanup:
|
|
460
464
|
- (run from the main checkout) => `git worktree remove .opengoal/worktrees/<id>` and `git branch -d goal/<id>`; the step 5 report then ends with `" Worktree and branch removed."`
|
|
461
|
-
- (run from inside the worktree) =>
|
|
465
|
+
- (run from inside the worktree, the platform can move the session back to the main checkout — Claude Code: `ExitWorktree` with `action: keep`; Codex CLI: `/cd <main-root>`) => leave the worktree first, then remove the worktree and branch exactly as from the main checkout; the step 5 report then ends with `" Worktree and branch removed; this session is back in the main checkout."`
|
|
466
|
+
- (run from inside the worktree, the platform cannot move the session) => skip — a session cannot remove its own directory. The step 5 report then ends with `" Cleanup of this worktree is offered by the next /$CommandPrefix:scout in the main checkout."`
|
|
462
467
|
5. Report: `"Landed goal <id> into <base> (<N> commits)."` plus the cleanup sentence from step 4, then one closer:
|
|
463
468
|
- (another merge-ready worktree remains) => `" Next: /$CommandPrefix:goal land <next-id>."`
|
|
464
469
|
- (peer goals remain under `$DocsDir/suspended/`) => `" Resume a parked goal with /$CommandPrefix:goal resume."`
|
|
@@ -41,7 +41,7 @@ tags: [workflow, opengoal, scout]
|
|
|
41
41
|
- (inside a worktree) => this session owns one goal; report only this worktree's docs and do not enumerate the other worktrees — the main checkout's state is another session's concern. Classify this worktree alone with the list below so Tier 0 can still suggest `land` here
|
|
42
42
|
- (main checkout, `.opengoal/worktrees/` absent or empty) => nothing to list
|
|
43
43
|
- (main checkout, worktrees present) => classify each `.opengoal/worktrees/<id>/` with the list below
|
|
44
|
-
Classification inputs per worktree: `$DocsDir/GOAL.md` front-matter and task checkboxes, the `CHECKPOINT.md` summary if present, `git status --porcelain` there, and `git log <base
|
|
44
|
+
Classification inputs per worktree: `$DocsDir/GOAL.md` front-matter and task checkboxes, the `CHECKPOINT.md` summary if present, `git status --porcelain` there, and `git log <base>..<branch> --oneline` (`<base>` and `<branch>` from the GOAL.md or archived GOAL.md front-matter; fall back to the main checkout's branch and `goal/<id>`). Evaluate the states in this order and take the first that matches:
|
|
45
45
|
1. **in progress** — GOAL.md present; report done/total and the checkpoint line
|
|
46
46
|
2. **merge-ready** — GOAL.md absent, status clean, branch ahead of `<base>`
|
|
47
47
|
3. **cleanup-pending** — GOAL.md absent, branch already contained in `<base>` (`git merge-base --is-ancestor goal/<id> <base>` succeeds), directory still present
|