@mstar-harness/opencode 2.0.4 → 2.0.6

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/CHANGELOG.md CHANGED
@@ -6,6 +6,27 @@ The monorepo root [CHANGELOG.md](../../CHANGELOG.md) summarizes cross-surface re
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.0.6] - 2026-08-10
10
+
11
+ ### Harness
12
+
13
+ - Added a **host-agnostic full-flow goal rule** in `mstar-host`: any host exposing a `/goal` command (Codex Goal Mode, omp, future code agents) must set the goal to running the **complete flow to its end** — whether advancing an iteration (start → per-plan cycles → close → PR delivery → merge-ready loop) or non-iteration work (specify → clarify → plan → tasks → implement → plan QC tri + QA gate → Done) — never a sub-stage goal.
14
+ - Removed the Codex-specific `references/codex-plan-goal-mode-bridge.md`; goal text rules now live host-agnostically in `mstar-host` SKILL.md, and Codex Plan Mode reads `references/_shared/plan-mode-bridge-core.md` directly.
15
+
16
+ - Version alignment with harness **2.0.6** (no OpenCode package API change).
17
+
18
+ See root [CHANGELOG.md](../../CHANGELOG.md) **2.0.6**.
19
+
20
+ ## [2.0.5] - 2026-08-10
21
+
22
+ ### Harness
23
+
24
+ - `/iteration-start`: accepts an optional `direction` hint (constrains §2 candidates, seeds §3 grill-me — start stays interactive) and a `pause` flag; auto-continues into Phase 2→5 (execute → close → PR → merge-ready) after Phase 1 lock + integration branch, by default. `/iteration-drive` remains standalone for re-entry/resume on an already-locked iteration. Updated `iteration-loop` vs-commands table, README/README_CN command tables + workflow diagrams, OpenCode package quick start; added routing eval `iteration-start-auto-continue-phase2`.
25
+
26
+ - Version alignment with harness **2.0.5** (no OpenCode package API change).
27
+
28
+ See root [CHANGELOG.md](../../CHANGELOG.md) **2.0.5**.
29
+
9
30
  ## [2.0.4] - 2026-08-09
10
31
 
11
32
  ### Bundled harness skills (`harness-skills/` at publish)
package/README.md CHANGED
@@ -46,7 +46,7 @@ The plugin registers a non-blocking `tool.execute.before` lint for the `task` to
46
46
 
47
47
  1. Install the plugin (above).
48
48
  2. In OpenCode, start with the **Project Manager** agent (`project-manager`).
49
- 3. For a full iteration: run **`/iteration-start`** then **`/iteration-drive`**, or one-shot **`/iteration-loop`** (autonomous Phase 1→5).
49
+ 3. For a full iteration: run **`/iteration-start`** (Phase 1 grill-me → auto-continues Phase 2→5; add `pause` to stop after Phase 1), or one-shot **`/iteration-loop`** (autonomous Phase 1→5). Use **`/iteration-drive`** to resume an interrupted iteration.
50
50
 
51
51
  Entry skill: **`mstar-harness-core`** (loaded before other `mstar-*` skills).
52
52
 
@@ -11,9 +11,8 @@ Run a **full** Morning Star iteration with minimal human intervention. **Done =
11
11
  **vs other commands:**
12
12
 
13
13
  | Command | Scope |
14
- |---------|--------|
15
- | `iteration-start` | Phase 1 only; **grill-me** with user |
16
- | `iteration-drive` | Phase 2→5 on an already locked iteration |
14
+ | `iteration-start` | Phase 1 (**grill-me** with user) → **auto-continue** Phase 2→5(`pause` 止于 Phase 1) |
15
+ | `iteration-drive` | Phase 2→5 re-entry / resume on an already locked iteration |
17
16
  | **`iteration-loop`** | Phase 1→5 end-to-end; **autonomous** direction lock |
18
17
 
19
18
  Phase gate SSOT → **`mstar-iteration`** §1–§5. This command is a **consumer**; it does not redefine skill semantics.
@@ -1,12 +1,25 @@
1
1
  ---
2
2
  name: iteration-start
3
- description: Start a new harness iteration — research, grill-me, compass/plans, Review & Edit chain (long-lived {SPECS_DIR}/ + {ITERATION_DIR}/<id>/ package; compound promotes package at close only), PM lock, integration branch.
3
+ description: "Start a new harness iteration — optional direction hint, research, grill-me, compass/plans, Review & Edit chain (long-lived {SPECS_DIR}/ + {ITERATION_DIR}/<id>/ package; compound promotes package at close only), PM lock, integration branch; then auto-continue Phase 2→5 (execute → close → PR → merge-ready) unless `pause` arg given."
4
4
  agent: project-manager
5
5
  ---
6
6
 
7
7
  # Start Iteration
8
8
 
9
- Start a new Morning Star harness iteration. **Not Done until the Review & Edit chain runs via dispatched roles and PM lock — not when compass files are first written.**
9
+ Start a new Morning Star harness iteration. **Phase 1 is not complete until the Review & Edit chain runs via dispatched roles and PM lock — not when compass files are first written.** By default, after Phase 1 lock + integration branch, **auto-continue into Phase 2→5** (execute → close → PR → merge-ready); pass **`pause`** to stop after Phase 1 and resume later with `/iteration-drive`.
10
+
11
+ ## Args
12
+
13
+ ```text
14
+ /iteration-start [direction] [pause]
15
+ ```
16
+
17
+ | Arg | Meaning | Default |
18
+ |-----|---------|---------|
19
+ | `direction` | Iteration direction hint — constrains §2 candidates and seeds §3 grill-me; **not** a lock (start stays interactive) | Research → grill-me converges with user |
20
+ | `pause` | Stop after Phase 1 (lock + integration branch); run `/iteration-drive` later to resume | **Auto-continue** into Phase 2→5 |
21
+
22
+ **Parse**: if any token is exactly `pause` (case-insensitive), treat as the `pause` flag; the remaining tokens (joined) are the `direction` hint. `/iteration-start pause` = pause with empty direction.
10
23
 
11
24
  ## PM invariants(本命令全程有效 — 读完再动手)
12
25
 
@@ -20,10 +33,12 @@ Start a new Morning Star harness iteration. **Not Done until the Review & Edit c
20
33
 
21
34
  派发细则 → **`mstar-dispatch-gates`**(specialist review-and-edit dispatch)+ **`mstar-host`**(宿主 invoke 能力)。**不得**在 PM 线程加载其他 role reference 代劳。
22
35
 
23
- **完成定义**:compass `status: locked` + 三角色 invoke 已返回 + pre-commit checklist 全 `[x]` — 不是初稿落盘。
36
+ **Phase 1 完成定义**:compass `status: locked` + 三角色 invoke 已返回 + pre-commit checklist 全 `[x]` — 不是初稿落盘。**Command Done**(§7 auto-continue)= Phase 5 §5.5 exit checklist 全 `[x]`(同 `iteration-drive`);`pause` 时 = Phase 1 完成。
24
37
 
25
38
  Detailed workflow → **`mstar-iteration` § Phase 1**;per-plan Prepare gates → **`mstar-phase-gates`**(specify → clarify → plan)。
26
39
 
40
+ **Phase 2–5 auto-continue(§7)invariants** → **`iteration-drive`**「PM invariants」表(不写产品代码 / 不 inline 大包 / 每 Assignment 1 invoke / Phase 3→4→5 顺序 / Phase 5 dispatch 改代码)。
41
+
27
42
  ## Path split(HARD — 路由)
28
43
 
29
44
  | 宿主上下文 | 走哪条 |
@@ -31,6 +46,8 @@ Detailed workflow → **`mstar-iteration` § Phase 1**;per-plan Prepare gates
31
46
  | **Cursor Plan mode**(CreatePlan / Plan 会话活跃) | §0 Boot → **§P** — **先**空白 CreatePlan,再 **feedback-driven** 自主改同一份 plan;grill-me **仅**在用户明确结束反馈后、仍有阻塞疑问时;**Build 前不执行** Review 链 / commit / integration 分支 |
32
47
  | **其它**(Agent、OpenCode、非 Plan) | §0 Boot → §1–§6(Research → Explore → grill-me → Write → Review → branch) |
33
48
 
49
+ **Both paths converge at §6**(integration branch)。Default → §7 auto-continue Phase 2→5;`pause` → command ends at §6。
50
+
34
51
  ## 0. Boot
35
52
 
36
53
  1. `mstar-harness-core`
@@ -58,11 +75,9 @@ Command-unique 补充(bridge 未枚举):
58
75
 
59
76
  Survey structured harness dirs(`{HARNESS_DIR}/status.json`、`{ITERATION_DIR}/`、`{KNOWLEDGE_DIR}/`、`{SPECS_DIR}/`)+ glob for planning artifacts(`**/roadmap*.md`、`**/deferred*.md`、`**/features*.md`、`**/backlog*.md`、`**/TODO*.md`、`**/*.plan.md`);read matches with iteration-level / deferred-scope information;read `STRATEGY.md`(if exists)。Prioritize deferred / incomplete items from prior iterations。
60
77
 
61
- **Optional — codebase audit**: if a prior `/codebase-audit` run exists under `{PLAN_DIR}/audit-<date>/`, read its findings index as evidence-grounded direction candidates for §2(not mandatory;one source among many)。
62
-
63
78
  ## 2. Explore Directions
64
79
 
65
- Scope **2–4** candidates targeting **product completeness**(default to deferred items from previous iterations;allow substantive refactoring where it accelerates product maturity)。**非 Plan 路径**(Plan mode 已由 §P 处理)。
80
+ Scope **2–4** candidates targeting **product completeness**(default to deferred items from previous iterations;allow substantive refactoring where it accelerates product maturity)。**If `direction` arg given** — narrow candidates to that hint (still scope 2–4 unless the hint is explicitly singular); record the hint in grill-me context。**非 Plan 路径**(Plan mode 已由 §P 处理)。
66
81
 
67
82
  ## 3. Lock Direction — bundled `grill-me`
68
83
 
@@ -72,7 +87,7 @@ Scope **2–4** candidates targeting **product completeness**(default to defer
72
87
 
73
88
  This command bundles a **non-`mstar-*`** skill at `skills/grill-me/SKILL.md`. **Only this command step**(及 §P.3.5 deferred grill)references it — **do not** load it from `mstar-harness-core` or other `mstar-*` skills.
74
89
 
75
- **Before this step:** Read `skills/grill-me/SKILL.md`. Run **grill-me** to stress-test candidate directions with the user: walk through trade-offs, converge on a **single iteration direction** with shared understanding, document locked direction + success criteria + non-goals。Confirm delivery branch policy(`iteration_base_branch`、`target_branch`)per **`mstar-iteration` §1.2** — **Do not default to `main` / `master` just because those names exist.**
90
+ **Before this step:** Read `skills/grill-me/SKILL.md`. Run **grill-me** to stress-test candidate directions with the user: walk through trade-offs, converge on a **single iteration direction** with shared understanding, document locked direction + success criteria + non-goals。**If `direction` arg given** — seed grill-me with it as the recommended direction (still interactive: user may correct/refine; the hint does **not** skip grill-me)。Confirm delivery branch policy(`iteration_base_branch`、`target_branch`)per **`mstar-iteration` §1.2** — **Do not default to `main` / `master` just because those names exist.**
76
91
 
77
92
  ## 4. Write Compass & Plans
78
93
 
@@ -130,6 +145,34 @@ git checkout -b <spec_integration_branch> <iteration_base_branch>
130
145
  - Register `iteration_base_branch`, `spec_integration_branch`, and `target_branch` in compass frontmatter **and** `{HARNESS_DIR}/status.json` root `metadata`
131
146
  - Commit all documents to the integration branch and push to remote
132
147
 
133
- **Phase 2 note**:control worktree + `execution_lease` 门控在 Phase 2 入口(`iteration-drive` / `iteration-loop`)——见 **`mstar-iteration/references/phase-2-worktree-lease.md`**。
134
-
135
148
  **STOP** if `iteration_base_branch` or `target_branch` is missing. Ask the user or derive only from an already documented project/iteration policy; never silently substitute `main`.
149
+
150
+ ---
151
+
152
+ ## 7. Phase 2–5: Execute → close → PR → merge-ready(auto-continue)
153
+
154
+ **`pause` arg → command ends here.** Phase 1 locked + integration branch pushed;run `/iteration-drive` later to resume。
155
+
156
+ **Default(no `pause`)→ auto-continue** into Phase 2→5。
157
+
158
+ ### Phase 2 boot(load before delegating)
159
+
160
+ 1. `mstar-iteration` → **§ Phase 2–5**(§2 Autonomous Execute、§3 close、§4 PR、§5 merge-ready)
161
+ 2. **`mstar-sdd`** — before first implement dispatch(per-task loop SSOT)
162
+ 3. `mstar-review-qc` — before first QC dispatch
163
+ 4. `mstar-compound` — before Phase 3 §3.2
164
+ 5. `mstar-branch-worktree` + **`mstar-iteration/references/phase-2-worktree-lease.md`** — control worktree + lease(§2.0 #5 未 waive)
165
+
166
+ ### Delegate to `iteration-drive` Phase 2→5
167
+
168
+ Execute **`iteration-drive`** Phase 2–5 exactly:Phase 2 → **`mstar-iteration` §2**(§2.0 五道闸 → §2.6 push 纪律;SDD per-task;QC tri N=3 + QA)、Phase 3 → **§3** + `references/phase-3-iteration-close.md`、Phase 4/5 → **§4–§5** + `references/phase-4-5-pr-delivery.md`、Phase 5 helper discovery → `mstar-iteration/references/phase5-helper-discovery.md`。
169
+
170
+ **Continuous execution(HARD)**:自 Phase 2 进入至 Phase 5 §5.5 exit,PM **连续编排**(**`mstar-iteration` §2.6**),进度汇报后下一条必须是 dispatch 或下一 phase 步骤,不向用户例行 yes/no check-in。合法 STOP 仅限:branch metadata 缺失、真冲突 / secrets / 不可逆范围缺口、Phase 5 多轮仍无法 merge-ready、用户本轮显式打断。
171
+
172
+ **Assignment preflight**:同 §5(每次 implement/QC/QA 派发前校验;`mstar-harness` bin 未安装时静默跳过)。
173
+
174
+ **Done = Phase 5 §5.5 exit checklist 全 `[x]`**(同 `iteration-drive`)。
175
+
176
+ **Then** report: iteration id, direction lock summary, plans completed, compound summary, PR link, merge-ready evidence(CI snapshot + review resolution + Greptile if applicable)。
177
+
178
+ PR merge itself may remain manual unless user authorized auto-merge.
@@ -29,10 +29,10 @@ Detect from **session tool shapes and available commands** — not from plugin m
29
29
  |--------|------|-----------|
30
30
  | **`subagent_type`** param on the Task tool (plus **CreatePlan**/**SwitchMode** when Plan mode is active) | `cursor` | `references/cursor.md`; Plan mode also `references/cursor-plan-mode-bridge.md` |
31
31
  | **`question`** tool, or **`task`** tool with **`subagent`** (singular) — no `tasks[]` batch | `opencode` | `references/opencode.md` |
32
- | **`task`** tool with **`agent`** / **`tasks[]`** batch, **`ask`**, **`hub`** | `omp` | `references/omp.md`; Plan mode also `references/omp-plan-mode-bridge.md` |
32
+ | **`task`** tool with **`agent`** / **`tasks[]`** batch, **`ask`**, **`hub`** (omp also exposes `/goal`; goal rule is host-agnostic per below) | `omp` | `references/omp.md`; Plan mode also `references/omp-plan-mode-bridge.md` |
33
33
  | **`Agent`** / **`AskUserQuestion`** / **`EnterPlanMode`** + **`AgentSwarm`** (Kimi-only) | `kimi` | `references/kimi.md`; Plan mode also `references/kimi-plan-mode-bridge.md` |
34
34
  | **`Agent`** / **`AskUserQuestion`** / **`EnterPlanMode`** / **`TodoWrite`**, **no `AgentSwarm`** | `zcode` | `references/zcode.md`; Plan mode also `references/zcode-plan-mode-bridge.md` |
35
- | `/plan`, `/goal` slash commands; **Goal tools**; `functions.*` / `codex_app.*` tool namespaces; `tool_search`; Browser plugin tools | `codex` | `references/codex.md`; Plan/Goal mode also `references/codex-plan-goal-mode-bridge.md` |
35
+ | `/plan`, `/goal` slash commands; **Goal tools**; `functions.*` / `codex_app.*` tool namespaces; `tool_search`; Browser plugin tools | `codex` | `references/codex.md`; Plan mode also `references/_shared/plan-mode-bridge-core.md` |
36
36
  | Still ambiguous | - | Read sections in **`cursor.md`**, **`opencode.md`**, **`codex.md`**, **`kimi.md`**, **`zcode.md`**, and **`omp.md`** that match tools you have; **`mstar-harness-core` wins** on conflict |
37
37
 
38
38
  Order matters: check `cursor` → `opencode` → `omp` → `kimi` → `zcode` → `codex`. `subagent_type` (Cursor) vs `subagent` (OpenCode) vs `agent`/`tasks[]` (omp) is the sharpest split among the Task-based hosts.
@@ -43,6 +43,15 @@ Order matters: check `cursor` → `opencode` → `omp` → `kimi` → `zcode`
43
43
 
44
44
  When PM dispatches **N >= 2** concurrent assignees (QC tri-review, dual-track implement, etc.) and the host exposes actual invoke / Task / subagent tools, read **`references/parallel-dispatch.md`** in the dispatch round (shared with `mstar-dispatch-gates`). Without a callable invoke tool when dispatch is required → **`Blocked`**; Assignment Markdown alone is not dispatch.
45
45
 
46
+ ## `/goal` directive (host-agnostic)
47
+
48
+ **Applicability is by capability, not host identity**: any host that exposes a `/goal` command (currently Codex Goal Mode and omp; other code agents may add it later) attaches a persistent objective to the thread. Rule — **always set the goal to running the complete flow to the end**, never a sub-stage:
49
+
50
+ - **Advancing an iteration**: set the goal to **complete the entire iteration flow** (`iteration-start → per-plan cycles → iteration-close → PR delivery → PR merge-ready loop`). Do not set a sub-stage goal (e.g. "finish Phase 1 only").
51
+ - **Advancing non-iteration work** (single plan / hotfix / one-off task): set the goal to **complete the entire per-plan flow** (`specify → clarify → plan → tasks → implement → plan QC tri + QA gate → Done`). Do not set a sub-stage goal (e.g. "write the plan" or "implement one task").
52
+
53
+ Goal text is a session-level objective only: `{HARNESS_DIR}` / `{PLAN_DIR}` / `status.json` remain SSOT, and goal completion is **not** harness Done. Mirror goal success criteria into the SSOT plan; when the goal changes, update goal text and the SSOT in the same round.
54
+
46
55
  ## Resolve loaded skill root
47
56
 
48
57
  Docs name assets as skill **`<name>`** → `scripts/…` / `references/…`. **Resolve the loaded skill directory first** — do **not** open `skills/<name>/…` from a consumer app cwd (that layout exists in the harness source / plugin package only).
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Load order**: Read **`mstar-harness-core`** first, then **`mstar-host`** and the host reference + this bridge. When plan management is required, also read **`mstar-plan-conventions`** and **`mstar-plan-artifacts`** before creating or claiming any durable plan state. Path symbols `{HARNESS_DIR}`, `{PLAN_DIR}`, `{SPECS_DIR}` are defined in `mstar-plan-conventions`. On conflict, **`mstar-harness-core`** wins.
4
4
 
5
- Each per-host bridge (`cursor-plan-mode-bridge.md`, `codex-plan-goal-mode-bridge.md`, `kimi-plan-mode-bridge.md`, `zcode-plan-mode-bridge.md`, `omp-plan-mode-bridge.md`) loads this core and adds its host-specific plan UX (plan tooling, approval gate, todo UI, command surfaces).
5
+ Each per-host bridge (`cursor-plan-mode-bridge.md`, `kimi-plan-mode-bridge.md`, `zcode-plan-mode-bridge.md`, `omp-plan-mode-bridge.md`) loads this core and adds its host-specific plan UX (plan tooling, approval gate, todo UI, command surfaces). Codex Plan Mode reads this core directly via `references/codex.md` (no per-host codex plan bridge; the `/goal` rule is host-agnostic in `mstar-host` SKILL.md).
6
6
 
7
7
  ## Dual-write SSOT rule
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Load when **`mstar-host`** detection resolves **codex** (Codex app/CLI session, `/plan` / `/goal` slash commands, Goal tools, or Codex tool namespaces such as `functions.*`, `codex_app.*`, `tool_search`, `image_gen`, or Browser plugin tools).
4
4
 
5
- Plan / Goal Mode: read **`codex-plan-goal-mode-bridge.md`** when Codex Plan Mode (`/plan`) or Goal Mode (`/goal`, goal tools, or goal progress controls) is active. Codex session plans, UI todos, and goal text are not durable harness SSOT.
5
+ Plan Mode: read **`references/_shared/plan-mode-bridge-core.md`** when Codex Plan Mode (`/plan`) is active. Goal Mode (`/goal`, goal tools, or goal progress controls) follows the host-agnostic **`/goal`** rule in `mstar-host` SKILL.md — applicability is by the `/goal` command, not host identity. Codex session plans, UI todos, and goal text are not durable harness SSOT.
6
6
 
7
7
  Parallel PM dispatch: read **`parallel-dispatch.md`** only when Codex exposes an actual multi-agent / Task-style invocation tool. If no callable invoke tool exists, Assignment Markdown is coordination text only; do **not** claim subagent dispatch.
8
8
 
@@ -19,7 +19,7 @@ Parallel PM dispatch: read **`parallel-dispatch.md`** only when Codex exposes an
19
19
 
20
20
  1. Read `mstar-harness-core`.
21
21
  2. Read `mstar-host` and this Codex reference.
22
- 3. If Plan Mode or Goal Mode is active, read `codex-plan-goal-mode-bridge.md`.
22
+ 3. If Plan Mode is active, read `references/_shared/plan-mode-bridge-core.md`; Goal Mode follows the `/goal` rule in `mstar-host` SKILL.md.
23
23
  4. Load `mstar-roles` and the active role reference.
24
24
  5. Load topic skills on demand per the role reference.
25
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/opencode",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "Morning Star harness OpenCode plugin — skills bootstrap + engine-backed runtime hooks (status lint, dispatch validation, Enforcement: hard gates).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,6 +36,6 @@
36
36
  "access": "public"
37
37
  },
38
38
  "devDependencies": {
39
- "@mstar-harness/engine": "2.0.4"
39
+ "@mstar-harness/engine": "2.0.6"
40
40
  }
41
41
  }
@@ -1,98 +0,0 @@
1
- # Codex Plan / Goal Mode x Harness Bridge
2
-
3
- > **Load order**: Read **`mstar-harness-core`** first, then **`mstar-host`** and **`references/codex.md`**, then **`references/_shared/plan-mode-bridge-core.md`** (shared contract) + this bridge. When plan management is required, also read **`mstar-plan-conventions`** and **`mstar-plan-artifacts`** before creating or claiming any durable plan state. On conflict, **`mstar-harness-core`** wins.
4
-
5
- **Shared contract** (dual-write SSOT rule + priority, bootstrap init, Build resume contract, bootstrap todos, implement done-gate, Phase 1 gate, shared anti-patterns) → **`references/_shared/plan-mode-bridge-core.md`**. This bridge covers Codex **Plan Mode** (`/plan`) and **Goal Mode** (`/goal`) specifics only.
6
-
7
- ## Purpose
8
-
9
- Codex **Plan Mode** (`/plan`) and **Goal Mode** (`/goal`) are host collaboration surfaces:
10
-
11
- - **Plan Mode** helps shape a plan inside the active Codex conversation.
12
- - **Goal Mode** attaches a persistent objective and success criteria to the active thread.
13
-
14
- Morning Star durable state still lives under **`{HARNESS_DIR}`** (default `.mstar/`, legacy `.agents/`). This reference prevents Codex session plans, UI todos, goal text, or goal completion from replacing the harness SSOT.
15
-
16
- ## Priority (hard)
17
-
18
- 1–3 → core (user explicit → `AGENTS.md`/`CLAUDE.md` → **`{HARNESS_DIR}` / `{PLAN_DIR}` / `status.json`** harness SSOT).
19
-
20
- 4. Codex Goal Mode objective / progress controls
21
- 5. Codex Plan Mode output, `update_plan`, UI todos, chat summaries
22
-
23
- **NEVER** cite only a Codex goal, session plan, UI todo, or chat summary in Assignment **Plan Path**, **Context Loaded**, or Completion Report when `{PLAN_DIR}/<plan-id>-<name>.md` should exist.
24
-
25
- ## When this applies
26
-
27
- - Codex Plan Mode is active (`/plan`, Plan collaboration mode, or host guidance says planning-only).
28
- - Codex Goal Mode is active (`/goal`, host goal controls, or goal tools such as `create_goal`, `get_goal`, `update_goal`).
29
- - Morning Star plugin or `/pm` is in use under Codex.
30
-
31
- ## Codex Plan Mode
32
-
33
- Use Plan Mode to clarify, inspect, compare approaches, and draft the harness plan. Do **not** treat Plan Mode output as a durable artifact.
34
-
35
- Bootstrap before implementation or PM dispatch (discover `{HARNESS_DIR}` / `{PLAN_DIR}`, ensure `status.json`, register a `plans[]` row, write `{PLAN_DIR}/<plan-id>-<name>.md` with task checkboxes + roadmap; use the SSOT plan path in Assignment and Completion Report evidence) → core.
36
-
37
- Allowed in Plan Mode: exploration, clarify questions, spec/plan drafting, `.mstar/` initialization, SSOT plan/status edits, PM routing decisions.
38
-
39
- Not allowed by default in Plan Mode: product implementation, test implementation, QC execution, QA execution, deployment, or ops changes. Switch to normal execution or dispatch through an actual callable subagent/multi-agent tool first.
40
-
41
- ## Codex Goal Mode
42
-
43
- Goal text is useful as the top-level objective and success criteria, but it is **not** a Morning Star plan, status ledger, PM Assignment, QC report, or QA Done authority.
44
-
45
- When starting or receiving a Goal Mode objective:
46
-
47
- 1. If the goal is implementation-sized or long-running, create or update the harness SSOT (`status.json` + `{PLAN_DIR}` plan) before implementation.
48
- 2. Mirror the goal's success criteria into the SSOT plan as acceptance / verification criteria.
49
- 3. If the goal changes, update both Goal Mode text/progress and the SSOT plan/status in the same coordination round.
50
- 4. If the goal conflicts with the SSOT, pause or report **Blocked** until PM/user resolves scope.
51
-
52
- ### Goal completion gate
53
-
54
- Only mark a Codex goal complete when all applicable harness gates are satisfied:
55
-
56
- - Required plan checkboxes are complete in `{PLAN_DIR}`.
57
- - `status.json` reflects the current lifecycle state.
58
- - Required commits exist on the authorized branch.
59
- - Verification evidence is recorded.
60
- - QC/QA authority has passed when the plan requires InReview / Done gates.
61
-
62
- If the host asks to complete a goal but harness Done authority is missing, report **Blocked** and list the missing artifacts or gate decisions. Do not call a goal-completion tool as a substitute for PM/QC/QA evidence.
63
-
64
- ## Resume / compaction
65
-
66
- Codex can resume threads and compact context. On resume, before editing product code:
67
-
68
- 1. Reload `mstar-harness-core` -> `mstar-host` -> `references/codex.md` -> this bridge.
69
- 2. If Goal Mode is active, read the current goal and compare it with `{HARNESS_DIR}/status.json` and the active SSOT plan.
70
- 3. Treat `.mstar/` as durable truth over chat summaries or UI todos.
71
- 4. If the active role or Assignment is missing, resume as PM for coordination and dispatch only.
72
-
73
- ## `/pm` under Codex Plan / Goal Mode
74
-
75
- When `/pm` runs under Plan or Goal Mode:
76
-
77
- - `/pm` is still the force entry into Morning Star PM behavior.
78
- - Prepare phase (`specify -> clarify -> plan`) still applies unless the task qualifies for a documented hotfix path.
79
- - Goal Mode can hold the high-level objective, but PM must still write Assignment with `Execute as`, `Delegation`, branch policy, SSOT `Plan Path`, and evidence requirements.
80
- - Without an actual callable subagent/multi-agent tool, Assignment Markdown is coordination text only; execute serially in-session or report Blocked for rerouting.
81
-
82
- ## Anti-patterns
83
-
84
- | Anti-pattern | Fix |
85
- |--------------|-----|
86
- | `/plan` output only, no `{HARNESS_DIR}` files | Write SSOT plan + `status.json` entry before implementation |
87
- | `update_plan` todo done, no commit/evidence | Commit or record required evidence before completion |
88
- | Goal objective treated as Done authority | Check harness plan/status/QC/QA gates first |
89
- | Goal changed but `.mstar/` still has old scope | Update Goal Mode and SSOT in the same round |
90
- | Resume starts coding from chat summary | Reload harness context and SSOT plan/status first |
91
- | Assignment Plan Path points at Codex transcript/goal | Use `{PLAN_DIR}/...` path |
92
-
93
- ## Related skills
94
-
95
- - `mstar-plan-conventions` - discover `{HARNESS_DIR}`, `{PLAN_DIR}`, legacy layouts
96
- - `mstar-plan-artifacts` - `status.json`, plan checkboxes, reports, residuals
97
- - `mstar-phase-gates` - Prepare / Execute and Done authority
98
- - `mstar-dispatch-gates` - Assignment, Delegation, anti-recursion