greprag 5.65.2 → 5.65.4

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.
Files changed (66) hide show
  1. package/dist/codex-chip-hooks.js +2 -2
  2. package/dist/codex-chip-hooks.js.map +1 -1
  3. package/dist/commands/agent-doctrine-file.d.ts +27 -9
  4. package/dist/commands/agent-doctrine-file.js +74 -47
  5. package/dist/commands/agent-doctrine-file.js.map +1 -1
  6. package/dist/commands/agents.d.ts +2 -2
  7. package/dist/commands/agents.js +167 -48
  8. package/dist/commands/agents.js.map +1 -1
  9. package/dist/commands/codex-chip/command.js +4 -2
  10. package/dist/commands/codex-chip/command.js.map +1 -1
  11. package/dist/commands/codex-chip/goals.d.ts +3 -3
  12. package/dist/commands/codex-chip/goals.js +3 -3
  13. package/dist/commands/codex-chip/goals.js.map +1 -1
  14. package/dist/commands/codex-chip/help.d.ts +1 -1
  15. package/dist/commands/codex-chip/help.js +4 -3
  16. package/dist/commands/codex-chip/help.js.map +1 -1
  17. package/dist/commands/codex-chip/model.d.ts +6 -2
  18. package/dist/commands/codex-chip/model.js +12 -2
  19. package/dist/commands/codex-chip/model.js.map +1 -1
  20. package/dist/commands/codex-chip/native.js +2 -2
  21. package/dist/commands/codex-chip/native.js.map +1 -1
  22. package/dist/commands/codex-chip/prompt.js +8 -4
  23. package/dist/commands/codex-chip/prompt.js.map +1 -1
  24. package/dist/commands/codex-chip/selection.d.ts +5 -4
  25. package/dist/commands/codex-chip/selection.js +28 -9
  26. package/dist/commands/codex-chip/selection.js.map +1 -1
  27. package/dist/commands/codex-model-policy.d.ts +1 -1
  28. package/dist/commands/codex-model-policy.js +17 -6
  29. package/dist/commands/codex-model-policy.js.map +1 -1
  30. package/dist/commands/codex.js +1 -1
  31. package/dist/commands/init.js +22 -2
  32. package/dist/commands/init.js.map +1 -1
  33. package/dist/commands/load-primer-reminder.js +1 -1
  34. package/dist/commands/load-primer-reminder.js.map +1 -1
  35. package/dist/commands/load.d.ts +1 -1
  36. package/dist/commands/load.js +28 -4
  37. package/dist/commands/load.js.map +1 -1
  38. package/dist/commands/mechanic-spawn.js +1 -1
  39. package/dist/commands/mechanic-spawn.js.map +1 -1
  40. package/dist/commands/opencode-chip-mission.d.ts +4 -4
  41. package/dist/commands/opencode-chip-mission.js.map +1 -1
  42. package/dist/commands/opencode-chip-store.d.ts +2 -2
  43. package/dist/commands/opencode-chip.js +3 -2
  44. package/dist/commands/opencode-chip.js.map +1 -1
  45. package/dist/commands/parity.js +1 -1
  46. package/dist/commands/skill-mirror-reminder.d.ts +3 -4
  47. package/dist/commands/skill-mirror-reminder.js +13 -8
  48. package/dist/commands/skill-mirror-reminder.js.map +1 -1
  49. package/dist/commands/skill.js +35 -0
  50. package/dist/commands/skill.js.map +1 -1
  51. package/dist/index.js +7 -0
  52. package/dist/index.js.map +1 -1
  53. package/dist/native-skill-mirror.d.ts +35 -0
  54. package/dist/native-skill-mirror.js +413 -0
  55. package/dist/native-skill-mirror.js.map +1 -0
  56. package/dist/opencode-plugin.bundle.js +9 -4
  57. package/dist/skill-mirror-client.d.ts +2 -5
  58. package/dist/skill-mirror-client.js +18 -6
  59. package/dist/skill-mirror-client.js.map +1 -1
  60. package/dist/skill-mirror-files.d.ts +6 -0
  61. package/dist/skill-mirror-files.js +51 -0
  62. package/dist/skill-mirror-files.js.map +1 -0
  63. package/package.json +1 -1
  64. package/skill/greprag/docs/codex-chip.md +4 -3
  65. package/skill/templates/chip-leader.md +37 -15
  66. package/skill/templates/codex-chip-spawn.md +40 -25
@@ -6,14 +6,15 @@ Use `greprag load codex-chip-spawn` for the three-primitives method:
6
6
  worktree, manifest, inbox, or goal);
7
7
  - quick mode: rename the current task `LEAD: <Mission>` and directly spawn
8
8
  1–2 visible `Chip A/B: <Specific Purview>` worktree tasks;
9
- - Leader mode: create a separate `LEAD: <Mission>` task before spawning
9
+ - Leader mode: rename the current task `PLANNER: <Mission>`, then create a
10
+ separate `LEAD: <Mission>` task before that LEAD spawns
10
11
  `Chip A/B/C: <Specific Purview>` children for seams or larger orchestration.
11
12
 
12
13
  Normal chips are writable and own discovery, design, implementation, tests, and
13
14
  commit. Preserve the Codex-provided worktree, committed result artifact, and
14
15
  parent cleanup. The child opening prompt starts with the exact visible title
15
- alone (`Chip A: <Specific Purview>`, `LEAD: <Mission>`, `ADVISOR: <Purview>`, or
16
- `MECHANIC: <Mission>`) and then has exactly three sections:
16
+ alone (`Chip A: <Specific Purview>`, `LEAD: <Mission>`, `PLANNER: <Mission>`,
17
+ `ADVISOR: <Purview>`, or `FIX: <one friction unit>`) and then has exactly three sections:
17
18
  `Setup — do this FIRST`, `Task`, and `Report when done`. It has no lease,
18
19
  read-only, mandatory nested-goal, or nonce/ACK requirement. Completion is the
19
20
  native Codex parent-child task reply: commit the durable result, then reply to
@@ -1,4 +1,4 @@
1
- # Leader Mission
1
+ # Planner + Leader Mission
2
2
 
3
3
  Load this method when the work needs a dedicated orchestrator: more than the
4
4
  quick 1–2 visible chips, shared files or contracts, ordering, integration, or
@@ -6,13 +6,23 @@ another coordination seam.
6
6
 
7
7
  ## Identity first
8
8
 
9
- Before any child is created, the orchestrating task becomes the dedicated
10
- leader by renaming itself exactly:
9
+ This is the explicit Leader shape. Before any child is created, the initiating
10
+ task becomes the planner by renaming itself exactly:
11
+
12
+ ```text
13
+ PLANNER: <Mission>
14
+ ```
15
+
16
+ The PLANNER then creates one separate task whose exact first-line title is:
11
17
 
12
18
  ```text
13
19
  LEAD: <Mission>
14
20
  ```
15
21
 
22
+ Do not leave the initiator unnamed, and do not name it LEAD when it creates a
23
+ separate LEAD. The title split makes planning authority and execution
24
+ leadership visible before fanout.
25
+
16
26
  Children use the exact ordinal discoverability schema:
17
27
 
18
28
  ```text
@@ -24,13 +34,21 @@ Chip C: <Specific Purview>
24
34
  Naming identifies the workstream and makes the task legible. It does not grant
25
35
  execution authority; every child remains an ordinary writable chip.
26
36
 
37
+ <!-- adr: adr/codex-lead-native-goal.md -->
38
+ After the PLANNER creates it and before fanout, the dedicated LEAD creates a
39
+ native top-level mission goal with `create_goal`, then runs `get_goal` and
40
+ verifies the active goal names this mission before fanout. That native goal
41
+ tracks the LEAD mission; it is not a GrepRAG lease, durable manifest, or child
42
+ permission gate.
43
+
27
44
  ## Quick versus Leader
28
45
 
29
46
  - **Quick:** the current task renames itself `LEAD: <Mission>` and directly
30
47
  spawns 1–2 children. No separate leader task is created.
31
- - **Leader:** the initiator creates a separate `LEAD: <Mission>` task. That
32
- dedicated task owns decomposition, child dispatch, seam reconciliation,
33
- checks, integration, parent messaging, and cleanup.
48
+ - **Leader:** the initiator first renames itself `PLANNER: <Mission>`, then
49
+ creates a separate `LEAD: <Mission>` task. That dedicated task owns
50
+ decomposition, child dispatch, seam reconciliation, checks, integration,
51
+ parent messaging, and cleanup.
34
52
 
35
53
  This template is for the second shape. If the mission fits the quick shape,
36
54
  load `greprag load codex-chip-spawn` and keep the initiator as the implicit
@@ -56,14 +74,18 @@ ordering in the brief rather than relying on hidden coordination metadata.
56
74
 
57
75
  ## Dispatch and closeout
58
76
 
59
- 1. Rename the leader task before the first child spawn.
60
- 2. Spawn each `Chip A/B/C: <Specific Purview>` with its own visible worktree
61
- and the mission context it needs.
62
- A child titled exactly `MECHANIC: <Mission>` must make `greprag load mechanic`
63
- its first Setup action before diagnosis or edits.
64
- 3. Keep children writable and let them investigate, edit, test, and commit
77
+ 1. Rename the initiating task `PLANNER: <Mission>` before any child creation.
78
+ 2. Create the separate `LEAD: <Mission>` task; do not dispatch worker chips
79
+ directly from the PLANNER.
80
+ 3. In the dedicated LEAD, create the native top-level mission goal with
81
+ `create_goal`, then verify it with `get_goal`.
82
+ 4. From the LEAD, spawn each `Chip A/B/C: <Specific Purview>` with its own
83
+ visible worktree and the mission context it needs.
84
+ A `FIX: <one friction unit>` child must make `greprag load mechanic` its
85
+ first Setup action before diagnosis or edits.
86
+ 5. Keep children writable and let them investigate, edit, test, and commit
65
87
  within their worktrees.
66
- 4. Require each child to return `DONE` or `BLOCKED` through the native
88
+ 6. Require each child to return `DONE` or `BLOCKED` through the native
67
89
  parent-child task result, including the commit, checks, and caveats. Use
68
90
  `greprag send` only for explicit cross-harness or peer messaging:
69
91
 
@@ -73,9 +95,9 @@ ordering in the brief rather than relying on hidden coordination metadata.
73
95
  --from-session <child-session>
74
96
  ```
75
97
 
76
- 5. Review reports, reconcile seams in the planned order, run the whole-mission
98
+ 7. Review reports, reconcile seams in the planned order, run the whole-mission
77
99
  checks, and send the parent a concise closeout.
78
- 6. The parent owns integration and cleanup. Do not silently delete a child
100
+ 8. The parent owns integration and cleanup. Do not silently delete a child
79
101
  worktree or treat a report as acceptance.
80
102
 
81
103
  Do not introduce a separate read-only, lease, nested-goal, or delivery-proof
@@ -6,12 +6,13 @@ authority.
6
6
 
7
7
  ## Identity first
8
8
 
9
- For any coordinated multi-chip mission, rename the orchestrating task before
10
- spawning children:
9
+ Choose the mission shape before naming the current task:
11
10
 
12
- ```text
13
- LEAD: <Mission>
14
- ```
11
+ - **Quick mode:** rename the current task `LEAD: <Mission>` before spawning
12
+ 1–2 children. No separate leader task exists.
13
+ - **Leader mode:** rename the current initiating task `PLANNER: <Mission>`
14
+ before creating a separate `LEAD: <Mission>` task. Once a separate LEAD
15
+ exists, the PLANNER never presents itself as the LEAD.
15
16
 
16
17
  Then name children with the exact ordinal schema:
17
18
 
@@ -21,10 +22,15 @@ Chip B: <Specific Purview>
21
22
  Chip C: <Specific Purview>
22
23
  ```
23
24
 
24
- In quick mode, the current task renames itself `LEAD: <Mission>` and directly
25
- spawns 1–2 children. It is the **implicit LEAD**; no separate leader task is
26
- created. In Leader mode, the initiator creates a separate `LEAD: <Mission>`
27
- task, and that LEAD spawns and manages the children.
25
+ The identity transition happens before the first child creation. In Leader
26
+ mode the `PLANNER:` task creates only the dedicated `LEAD:` first; that LEAD
27
+ then spawns and manages `Chip A/B/C`.
28
+
29
+ <!-- adr: adr/codex-lead-native-goal.md -->
30
+ A dedicated `LEAD: <Mission>` task must create a native top-level mission goal
31
+ with `create_goal`, then run `get_goal` and verify the active goal names the
32
+ mission before any child fanout. This is Codex-native mission tracking, not a
33
+ GrepRAG durable manifest, lease, or permission gate.
28
34
 
29
35
  ## Three primitives
30
36
 
@@ -52,12 +58,12 @@ dispatch `Chip A` and `Chip B` directly.
52
58
  - Children are writable ordinary chips. Do not add a read-only role, lease,
53
59
  mandatory nested goal, or delivery-proof gate.
54
60
  - Role models come from the Codex model policy slots: `chip.worker`,
55
- `chip.leader`, `chip.advisor`, and `chip.mechanic`. Inspect the active policy
56
- with `greprag codex models show`; override a single child only with explicit
57
- `--model` / `--effort` flags when needed.
61
+ `chip.leader`, `chip.planner`, `chip.advisor`, and `chip.fix`. Inspect the
62
+ active policy with `greprag codex models show`; override a single child only
63
+ with explicit `--model` / `--effort` flags when needed.
58
64
  - Select the role slot from the first-line title before dispatch:
59
- `Chip A/B/C` -> `chip.worker`, `LEAD` -> `chip.leader`, `ADVISOR` ->
60
- `chip.advisor`, and `MECHANIC` -> `chip.mechanic`. ABOUT TO call
65
+ `Chip A/B/C` -> `chip.worker`, `LEAD` -> `chip.leader`, `PLANNER` ->
66
+ `chip.planner`, `ADVISOR` -> `chip.advisor`, and `FIX` -> `chip.fix`. ABOUT TO call
61
67
  `codex_app__create_thread`? STOP - pass that slot as top-level `model` and
62
68
  `thinking`; never rely on Codex Desktop defaults for a visible chip.
63
69
  - An `ADVISOR: <Purview>` child is a lead-facing consultant. It reports
@@ -76,11 +82,16 @@ dispatch `Chip A` and `Chip B` directly.
76
82
 
77
83
  Use this when the work is more than the quick 1–2-chip shape, or when shared
78
84
  files, contracts, ordering, integration, or a seam require a dedicated
79
- orchestrator. The initiator creates the separate `LEAD: <Mission>` task first.
80
- That LEAD decomposes the mission, assigns exact `Chip A/B/C: <Specific Purview>`
85
+ orchestrator. The initiator renames itself `PLANNER: <Mission>`, then creates
86
+ the separate `LEAD: <Mission>` task first. That LEAD decomposes the mission,
87
+ assigns exact `Chip A/B/C: <Specific Purview>`
81
88
  titles, dispatches ordinary writable chips, reconciles their reports, and owns
82
89
  integration checks and cleanup.
83
90
 
91
+ Before dispatching any child, the LEAD creates and verifies its native
92
+ top-level mission goal (`create_goal` -> `get_goal`). Child fanout starts only
93
+ after that verified goal exists.
94
+
84
95
  Load `greprag load chip-leader` for the mission worksheet before dispatch.
85
96
 
86
97
  ## Codex Desktop dispatch route
@@ -146,10 +157,9 @@ dedicated `LEAD: <Mission>` task.
146
157
  ## FIX missions — the one landing exception
147
158
 
148
159
  Landing authority follows the MISSION SHAPE, not the harness
149
- (adr/codex-landing-doctrine.md). Every chip shape above (`Chip A/B/C`, `LEAD`,
150
- `ADVISOR`, `MECHANIC`) keeps the parent-owned landing: commit, native reply
151
- with archive clearance, and the parent reviews, integrates, archives, and
152
- cleans up.
160
+ (adr/codex-landing-doctrine.md). Every non-FIX chip shape above (`Chip A/B/C`,
161
+ `LEAD`, `PLANNER`, `ADVISOR`) keeps the parent-owned landing: commit, native reply with
162
+ archive clearance, and the parent reviews, integrates, archives, and cleans up.
153
163
 
154
164
  A mission whose first line begins `FIX:` — emitted by `greprag fix spawn`
155
165
  (grepragOS law 4) — is the ONE exception: it carries its own Phase 3
@@ -189,9 +199,13 @@ Chip <Label>: <Specific Purview>
189
199
  ## Setup — do this FIRST
190
200
  Stay in the Codex-provided isolated worktree; do not create a second worktree.
191
201
  Read AGENTS.md and the session-start recap, then inspect the current repo state.
192
- No leases, read-only mode, or goals.
193
- If the exact first-line title is `MECHANIC: <Mission>`, make `greprag load
194
- mechanic` the first Setup action before diagnosis or edits.
202
+ If the exact first-line title is `LEAD: <Mission>`, create a native top-level
203
+ mission goal with `create_goal`, then run `get_goal` and verify the active goal
204
+ names this mission before any child fanout.
205
+ No leases, read-only mode, or GrepRAG goal gates.
206
+ If the exact first-line title is `FIX: <one friction unit>`, make `greprag
207
+ load mechanic` the first Setup action before diagnosis or edits; mechanic is
208
+ the doctrine, not the visible task identity.
195
209
  If the exact first-line title is `ADVISOR: <Purview>`, report consultation to
196
210
  the LEAD only: strategic findings, questions, tradeoffs, and recommendations.
197
211
  Do not write operator-facing completion language or decide/spawn worker chips.
@@ -217,5 +231,6 @@ and cleans up.
217
231
 
218
232
  The first line is the exact visible title, alone. Substitute the appropriate
219
233
  discoverability label: `Chip A: <Specific Purview>`, `LEAD: <Mission>`,
220
- `ADVISOR: <Purview>`, or `MECHANIC: <Mission>`. These labels do not change
221
- execution authority.
234
+ `PLANNER: <Mission>`, `ADVISOR: <Purview>`, or `FIX: <one friction unit>`. These labels do not change
235
+ execution authority, except that FIX carries the one-friction Phase 3 contract
236
+ printed by `greprag fix spawn`.