greprag 5.58.0 → 5.59.0

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greprag",
3
- "version": "5.58.0",
3
+ "version": "5.59.0",
4
4
  "description": "GrepRAG — agent memory for Claude Code, Codex, and OpenCode.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -4,9 +4,18 @@ Use a chip when parallel work needs an independent Codex task and repository
4
4
  isolation. A chip is a new app-server thread, not a native subagent.
5
5
 
6
6
  ```bash
7
- greprag codex chip spawn "<task>" --name <slug> --owns "src/area/**"
7
+ greprag codex chip goal create --objective "<objective>" \
8
+ --final-state "<observable final state>" --criterion <id>:"<acceptance>"
9
+ greprag codex chip spawn "<task>" --name <slug> --title "<Purview>" \
10
+ --goal-id <goal-id> --covers <id> --owns "src/area/**"
8
11
  ```
9
12
 
13
+ Native-v4 sends the full mission, selected model/effort, and worktree in the
14
+ initial `create_thread`. There is no bootstrap task and no second assignment.
15
+ The initial hook binds the lease before tools; attach emits `IN-FLIGHT` and
16
+ starts monitoring only. A single task is `Chip: <Purview>`. Multi-chip missions
17
+ use `LEAD: <Mission>` and unique `Chip A/B/C: <Specific Purview>` identities.
18
+
10
19
  The standard/default profile is `gpt-5.6-luna` at `xhigh`. Use
11
20
  `--profile complex` (or `--complex`) for `gpt-5.6-sol` at `high` when the chip
12
21
  owns orchestration or unusually difficult work. Explicit `--model <model-id>`
@@ -25,13 +34,16 @@ greprag codex chip steer <id|name> "<correction>"
25
34
  greprag codex chip stop <id|name>
26
35
  ```
27
36
 
28
- The child commits inside its isolated checkout and runs `greprag codex chip report`.
37
+ The child commits inside its isolated checkout and runs `greprag codex chip report`,
38
+ mapping concrete `--evidence criterion-id:proof` to every covered criterion.
29
39
  The host validates the receipt and imports only that unique branch. The parent reviews
30
40
  the reported commit and integrates it. Never ask the child to merge, push, or
31
- delete its own checkout. After integration, the parent runs:
41
+ delete its own checkout. After review and integration, the parent explicitly
42
+ accepts the goal, then follows each returned closeout entry—archive the native
43
+ Codex task first, then run its exact cleanup command:
32
44
 
33
45
  ```bash
34
- greprag codex chip cleanup <id|name>
46
+ greprag codex chip goal accept <goal-id> --summary "<review judgment>"
35
47
  ```
36
48
 
37
49
  Messages between the parent and child use the normal GrepRAG session inbox, so
@@ -11,6 +11,31 @@ plans the whole mission *before* any worker deploys and reconciles them *after*.
11
11
  Topology is a planning decision, not an execution afterthought — draw the map
12
12
  before mobilizing the troops.
13
13
 
14
+ ## Codex Desktop standard
15
+
16
+ For Codex, the leader first creates one durable mission goal with objective,
17
+ observable final state, and criterion IDs. The leader task is named
18
+ `LEAD: <Mission>`. Before dispatch it assigns each workstream a unique letter
19
+ and human purview—`Chip A: <Specific Purview>`, `Chip B: ...`—plus disjoint
20
+ leases and explicit `--covers` criteria. Every spawn uses `--multi-chip`, its
21
+ `--label`, and its proper `--title`.
22
+
23
+ Dispatch uses the native-v4 `createRequest` exactly once. It contains the real
24
+ mission, the parent-selected model/effort, and native worktree setup; never send
25
+ a bootstrap prompt or a second assignment. The initial hook binds before tool
26
+ use, the leader applies the exact task title as soon as the resolved task ID is
27
+ available, attach emits `IN-FLIGHT`, and the child reports evidence through the
28
+ parent's breakthrough inbox.
29
+
30
+ Closeout is parent-owned and immediate: review each report and commit, integrate
31
+ it, verify the whole mission, explicitly accept the goal, then follow each
32
+ returned closeout entry (archive the native task first; run its cleanup command).
33
+ A report is not acceptance, cleanup never implies
34
+ acceptance, and an accepted/integrated child should not remain in the active
35
+ task list. These rules supersede any Claude `spawn_task`, Block 1/Block 2, or
36
+ manual worktree instructions later in this shared template when operating in
37
+ Codex.
38
+
14
39
  **Hard fire:** the moment you're about to spawn the **2nd chip**, stop and plan.
15
40
  Spawn-then-plan is the exact failure this prevents.
16
41
 
@@ -9,17 +9,26 @@ A single independent task proceeds directly. If two or more chips target one
9
9
  objective, or you are about to create a second chip, stop and run `greprag load
10
10
  chip-leader`. Plan the integration branch, ownership seams, dependency order,
11
11
  merge order, and whole-feature test gate before another spawn. Rename the
12
- orchestrating task so its title begins `LEAD: `. Every spawned worker title
13
- begins `Chip: `; the native handoff supplies the exact title.
12
+ orchestrating task so its title begins `LEAD: <Mission>`. Multi-chip workers are
13
+ uniquely named `Chip A: <Specific Purview>`, `Chip B: ...`; a single worker is
14
+ `Chip: <Purview>`. Labels are stable coordination handles, not execution order.
14
15
 
15
16
  ## Prepare the isolated task
16
17
 
17
- Every write chip declares non-overlapping ownership leases; research uses
18
- `--read-only`. The parent session id is mandatory.
18
+ Every mission starts with a durable parent-owned goal. Give it a concrete
19
+ objective, final state, and stable acceptance criterion IDs. Every write chip
20
+ declares non-overlapping ownership leases; research uses `--read-only`.
19
21
 
20
22
  ```bash
23
+ greprag codex chip goal create \
24
+ --objective "<concrete objective>" \
25
+ --final-state "<observable final state>" \
26
+ --criterion <id>:"<acceptance statement>"
27
+
21
28
  greprag codex chip spawn "<independent task>" \
22
29
  --name <slug> \
30
+ --title "<Properly Capitalized Purview>" \
31
+ --goal-id <goal-id> --covers <criterion-id> \
23
32
  --owns "<path/**>" \
24
33
  --codex-project-id <desktop-project-id> \
25
34
  --parent-session <parent-thread-id> \
@@ -56,27 +65,30 @@ Native Desktop is the default runtime.
56
65
  `--runtime cli` is opt-in and only valid when PATH Codex `model/list` actually
57
66
  exposes the requested model and effort; validation remains fail-loud.
58
67
 
68
+ For a multi-chip mission every spawn also uses `--multi-chip --label A` (then B,
69
+ C...) and a different `--title`. Duplicate active slugs, labels, or purview
70
+ titles fail loudly.
71
+
59
72
  The spawn command creates a unique starting branch, records the manifest and
60
- lease, and returns a `greprag-codex-native-v3` handoff. Pass `createRequest`
61
- exactly to native `create_thread`: `target.type=project`, the supplied Codex
62
- `projectId` from `list_projects`, and `environment.type=worktree` with
63
- `startingState={type:"branch", branchName}`.
73
+ lease, and returns a `greprag-codex-native-v4` handoff. Pass `createRequest`
74
+ exactly to native `create_thread`: it already contains the full real mission,
75
+ selected `model`, `thinking`, project target, and worktree starting branch.
64
76
  `expectedBaseSha` is the attach-time commit invariant behind that reserved branch.
65
- Do not add `cwd`, `title`, `model`, or `effort`—they are not valid create fields.
77
+ This is the only assignment turn. Never create a bootstrap task and never send
78
+ the mission again after attach.
66
79
 
67
80
  Creation returns `clientThreadId` while Codex builds its own detached worktree.
68
- Wait for the bootstrap/auto-title turn to settle and verify the nonce-bearing
69
- `bootstrapAck`. Resolve `threadId` + actual cwd with `list_threads`/`read_thread`.
70
- Then call `set_thread_title` with the exact `Chip: ` name (`LEAD: ` for an
71
- orchestrator) and read it back twice. Retry the rename at most three times if
72
- auto-title overwrites it; fail loudly if it will not remain exact. Only then run
81
+ The initial `UserPromptSubmit` hook provisionally binds the manifest and native
82
+ cwd before tool use. Resolve `threadId` + actual cwd immediately, then call
83
+ `set_thread_title` with the exact handoff title and read it back twice. Retry at
84
+ most three times if auto-title overwrites it; fail loudly if it will not remain
85
+ exact. `create_thread` has no title field, so the mission's first line carries
86
+ the correct identity immediately and task metadata is renamed as soon as the
87
+ resolved task exists. Only then run
73
88
  `verifyTitleCommand`, rerun handoff, and run `attachCommand`. Attach validates
74
89
  project/base/sandbox attestation, writes the marker, sends parent `IN-FLIGHT`,
75
- and starts the monitor. Rerun handoff again and deliver `sendRequest` via
76
- `send_message_to_thread`. The enforced order is createsettlerename
77
- verify → attach → IN-FLIGHT → mission. This two-phase send applies
78
- `model` + `thinking` after creation because high/xhigh validation rejects a
79
- worktree `startingState` create request. A standalone CLI cannot
90
+ and starts the monitor. The enforced order is create-real-mission provisional
91
+ bind resolve rename/verify attach IN-FLIGHTmonitor. A standalone CLI cannot
80
92
  invoke the Desktop-owned surface, so it prepares rather than pretending an old
81
93
  PATH app-server successfully ran a 5.6 turn.
82
94
 
@@ -97,11 +109,14 @@ The attached host monitor validates receipts from the recorded native cwd,
97
109
  exact base ancestry, clean state, and every changed path against the lease. A
98
110
  detached HEAD is valid; the host imports the reported exact commit into the
99
111
  reserved chip ref, then sends the terminal inbox event. The
100
- child never merges, pushes, cleans up, or edits the parent checkout. The parent
101
- reviews/integrates and runs `greprag codex chip cleanup <id>` only afterward.
102
- After a verified squash/cherry-pick (where the exact report commit is not an
103
- ancestor), the parent acknowledges integration with `cleanup <id> --integrated`;
104
- ordinary merge ancestry remains automatic.
112
+ child never merges, pushes, cleans up, or edits the parent checkout. Reports map
113
+ concrete evidence to every covered goal criterion. The parent reviews the diff,
114
+ integrates it, and runs `greprag codex chip goal accept <goal-id> --summary
115
+ "<review judgment>"` only when all criteria and chips are satisfied. For a
116
+ verified squash/cherry-pick add `--integrated <chip-id>` to acceptance. Acceptance
117
+ returns machine-readable closeout entries: apply each native `archiveRequest`
118
+ first, then its exact `cleanupCommand`. Cleanup does not imply acceptance, is
119
+ refused before it, and requires `--native-archived` for native tasks.
105
120
 
106
121
  Native chips have a receipt deadline (default 180 minutes; override with
107
122
  `--native-timeout-minutes`). This standalone CLI cannot query Desktop-private
@@ -117,7 +132,7 @@ the claim and preserves the originally resolved target across retries.
117
132
 
118
133
  The native worktree sandbox is the physical boundary. Verification accepts only
119
134
  the Codex-issued `client-new-thread:<uuid>` token (or its bare UUID form), a
120
- distinct resolved UUID task ID, the expected project/base/bootstrap proof,
135
+ distinct resolved UUID task ID, the expected project/base proof,
121
136
  an attested `workspace-write` sandbox, and a Git root beneath Codex's own
122
137
  `worktrees` directory at the exact base commit. Hook guards require the exact
123
138
  bound task/cwd/sandbox and deny out-of-lease file tools, destructive
@@ -131,9 +146,13 @@ Useful recovery commands:
131
146
  greprag codex chip handoff <id> --json
132
147
  greprag codex chip status <id>
133
148
  greprag codex chip steer <id> "<follow-up>"
149
+ greprag codex chip resume <id>
134
150
  greprag codex chip stop <id>
135
151
  ```
136
152
 
137
153
  For a native chip, `steer` emits a `send_message_to_thread` handoff. Stop fails
138
154
  loud until the parent interrupts the Desktop task, then confirms that fact with
139
155
  `stop <id> --native-interrupted`; the CLI never records a false cancellation.
156
+ After restart/usage interruption, use `resume`, deliver its handoff, and wait for
157
+ the nonce-bound breakthrough acknowledgment. A delivered message without that
158
+ ack is not recovery. Cleaned/cancelled/failed tasks cannot resume; relaunch them.