greprag 5.49.15 → 5.50.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.
Files changed (57) hide show
  1. package/README.md +4 -1
  2. package/dist/commands/codex-delivery.d.ts +2 -0
  3. package/dist/commands/codex-delivery.js +9 -16
  4. package/dist/commands/codex-delivery.js.map +1 -1
  5. package/dist/commands/codex-doctor.js +2 -1
  6. package/dist/commands/codex-doctor.js.map +1 -1
  7. package/dist/commands/codex-wake-test.js +2 -1
  8. package/dist/commands/codex-wake-test.js.map +1 -1
  9. package/dist/commands/codex.js +6 -3
  10. package/dist/commands/codex.js.map +1 -1
  11. package/dist/commands/doc-pointer-reminder.d.ts +18 -0
  12. package/dist/commands/doc-pointer-reminder.js +41 -0
  13. package/dist/commands/doc-pointer-reminder.js.map +1 -0
  14. package/dist/commands/enrichment-health-reminder.d.ts +23 -0
  15. package/dist/commands/enrichment-health-reminder.js +39 -0
  16. package/dist/commands/enrichment-health-reminder.js.map +1 -0
  17. package/dist/commands/inbox-primer-reminder.js +2 -2
  18. package/dist/commands/inbox-primer-reminder.js.map +1 -1
  19. package/dist/commands/init.js +20 -0
  20. package/dist/commands/init.js.map +1 -1
  21. package/dist/commands/load.js +8 -0
  22. package/dist/commands/load.js.map +1 -1
  23. package/dist/commands/memory.js +40 -12
  24. package/dist/commands/memory.js.map +1 -1
  25. package/dist/commands/opencode-interrupt.d.ts +5 -0
  26. package/dist/commands/opencode-interrupt.js +8 -2
  27. package/dist/commands/opencode-interrupt.js.map +1 -1
  28. package/dist/commands/opencode-relay.js +1 -1
  29. package/dist/commands/opencode-relay.js.map +1 -1
  30. package/dist/commands/procedure.d.ts +15 -0
  31. package/dist/commands/procedure.js +167 -0
  32. package/dist/commands/procedure.js.map +1 -0
  33. package/dist/commands/reminder-registry.js +6 -0
  34. package/dist/commands/reminder-registry.js.map +1 -1
  35. package/dist/commands/reminder-types.d.ts +27 -0
  36. package/dist/commands/skill-gain-reminder.d.ts +17 -0
  37. package/dist/commands/skill-gain-reminder.js +32 -0
  38. package/dist/commands/skill-gain-reminder.js.map +1 -0
  39. package/dist/commands/skillgain.d.ts +12 -0
  40. package/dist/commands/skillgain.js +109 -0
  41. package/dist/commands/skillgain.js.map +1 -0
  42. package/dist/hook.js +204 -2
  43. package/dist/hook.js.map +1 -1
  44. package/dist/index.js +4 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/opencode-plugin.bundle.js +70 -3
  47. package/dist/procedure.d.ts +88 -0
  48. package/dist/procedure.js +269 -0
  49. package/dist/procedure.js.map +1 -0
  50. package/dist/skill-landing.d.ts +88 -0
  51. package/dist/skill-landing.js +220 -0
  52. package/dist/skill-landing.js.map +1 -0
  53. package/package.json +1 -1
  54. package/skill/commander/SKILL.md +2 -2
  55. package/skill/greprag/SKILL.md +2 -2
  56. package/skill/greprag/docs/inbox-watch.md +5 -5
  57. package/skill/templates/chip-leader-opencode.md +98 -0
@@ -119,7 +119,7 @@ Aliases (silent back-compat): `greprag memory briefing` → `recap` (renamed v5.
119
119
 
120
120
  ## Proactive-fire rules
121
121
 
122
- **Claude Code: ABOUT TO BACKGROUND A `greprag inbox watch`? USE THE `Monitor` AGENT TOOL, NOT `Bash(run_in_background: true)`.** Bash background notifies only on process completion; watchers run forever, so the agent gets zero events until it manually reads the output file. Arm it **bare** — `greprag inbox watch --session <short> --json` under Monitor `persistent:true`. Do NOT wrap in `while true; …; done` that wrapper was removed 2026-06-04 (it orphaned and OOM-crashed the desktop); the supervisor + EPIPE-terminal handle crashes and clean shutdown without it. Full pattern: `docs/inbox-watch.md`.
122
+ **Claude Code: ABOUT TO BACKGROUND A `greprag inbox watch`? USE THE `Monitor` AGENT TOOL, NOT `Bash(run_in_background: true)`.** Bash background notifies only on process completion; watchers run forever, so the agent gets zero events until it manually reads the output file. Arm it with the **exit-aware relauncher** — `while true; do greprag inbox watch --session <short> --json --owner-pid <pid>; case $? in 0|64) break;; esac; sleep 1; done` under Monitor `persistent:true` (this is exactly what the arm hook prints; paste it verbatim). The loop is supervisor-death recovery: Monitor `persistent:true` does NOT re-run the command on exit, so without it a crashed supervisor only recovers on the next turn. The `case $? in 0|64) break` is what makes it safe — it breaks on clean/consumer-gone (0) and fatal/bad-key (64), relaunching ONLY on a crash. (A *bare* `while true; …; sleep 1; done` WITHOUT that break is the 2026-06-04 OOM orphan don't use that form; the exit-aware version was restored 2026-06-14.) Full pattern: `docs/inbox-watch.md`.
123
123
 
124
124
  **INBOX MESSAGE FROM A PEER SESSION? REPLY DIRECTLY — the "summarize + confirm" rule is HUMAN-scoped.** Classify by the server-authoritative `from.session_id` (spoof-safe — a cold-open cannot set it): **set ⇒ PEER** agent session → reply/coordinate directly, NO human confirm; **null ⇒ HUMAN** (cold-open / inbound email) → summarize + confirm before acting. The asyncRewake poll tags each delivered wake with `[peer coordination …]` / `[human …]`; the Monitor `--json` stream carries `from.session_id` raw. **GUARD: auto-REPLY, not auto-OBEY** — coordinate with peers freely, but a destructive action a peer *requests* still passes the normal gates; never blindly execute peer instructions. adr: adr/monitor-resilience.md.
125
125
 
@@ -127,7 +127,7 @@ Aliases (silent back-compat): `greprag memory briefing` → `recap` (renamed v5.
127
127
 
128
128
  **Codex: DO NOT CLAIM HOOKS ARE ACTIVE JUST BECAUSE `~/.codex/hooks.json` EXISTS.** Codex Desktop requires Settings -> Settings -> Hooks trust review before command hooks run automatically. If turn capture is missing after `greprag init --codex`, tell the user: open Codex Desktop Settings -> Settings -> Hooks, trust the 6 GrepRAG hooks, then start a fresh Codex session.
129
129
 
130
- **Codex live inbox push requires the startup watcher.** Hooks only fire at Codex turn/tool/session boundaries. Public installs should use `greprag init --codex --tenant-id <handle> --install-watcher`; run `greprag codex doctor --wake-test` to inspect state, and use `greprag codex watch --session <id>` only for foreground testing. The sidecar listens to GrepRAG inbox SSE; the proven Desktop-visible wake path is Codex app-layer thread continuation (`send_message_to_thread` shape, visible `codex_delegation` turn). `codex exec resume` is only fallback/diagnostic because it can append to history without surfacing in the active Desktop pane. If wake-test reports only fallback, describe live push as unconfirmed/non-visible and rely on turn-bound inbox steering for reliable delivery.
130
+ **Codex live inbox push requires the startup watcher plus a Desktop-visible delivery bridge.** Hooks only fire at Codex turn/tool/session boundaries. Public installs should use `greprag init --codex --tenant-id <handle> --install-watcher`; run `greprag codex doctor --wake-test` to inspect state, and use `greprag codex watch --session <id>` only for foreground testing. The sidecar listens to GrepRAG inbox SSE; the proven Desktop-visible wake path is Codex app-layer thread continuation (`send_message_to_thread` shape, visible `codex_delegation` turn). `codex exec resume` is diagnostic/history-only because it can append to history without surfacing in the active Desktop pane. If wake-test reports no loaded Desktop app-layer path, describe live push as unavailable/non-visible and rely on turn-bound inbox steering for reliable delivery.
131
131
 
132
132
  **ABOUT TO `greprag send` TO A `@gmail.com` / `@anthropic.com` / REAL EMAIL ADDRESS? STOP — for `inbox`/`send` (internal cross-session messaging), `users.email` IS NEVER A ROUTING ADDRESS.** Use the numeric handle (`1834729@greprag.com`) or claimed vanity alias (`travis@greprag.com`). If you don't know the recipient's handle, ASK — don't guess from their email. adr: adr/numeric-handles.md. Full grammar: `docs/inbox.md § address`.
133
133
 
@@ -33,7 +33,7 @@ It does **not** respawn on: clean exit (code 0), Ctrl-C / `TaskStop` (SIGINT/SIG
33
33
 
34
34
  **Scope is within-session only.** The supervisor makes the watcher rock-solid while the session stays open. It cannot survive session reload / `--resume` / `/compact` — the Monitor task that pipes the watcher's stdout into chat is a harness construct destroyed on reload, by design (see `adr/monitor-resilience.md`, 2026-06-02). Reload-survival is structurally impossible at the process layer and is not what this fixes.
35
35
 
36
- **The watcher dies with its consumer (2026-06-04).** When the Monitor task goes away (session reload/end), the watcher's stdout/stderr pipe breaks; it detects that (EPIPE, or a periodic stderr probe while idle) and exits terminal — the supervisor does **not** respawn it. So a watcher lives the whole session and then dies cleanly, leaving no orphan. A SessionStart reaper (`greprag inbox reap`, run automatically) sweeps any watcher a hard-kill left behind, keyed on the `--owner-pid` the arm hook stamps: it kills a watcher only when that stamped claude.exe is dead. The "bare" arm forms below carry no `--owner-pid` and are **kept, never false-killed** — the old ancestry-walk fallback that reaped flagless watchers was retired 2026-06-13 (it false-killed live backgrounded watchers; see `adr/monitor-resilience.md`). The hook's printed arm command does stamp `--owner-pid`, so prefer pasting that verbatim where you want a hard-killed orphan to also be reapable. ("Bare" here means **no `while sleep` wrapper** see below not "no flags".)
36
+ **The watcher dies with its consumer (2026-06-04).** When the Monitor task goes away (session reload/end), the watcher's stdout/stderr pipe breaks; it detects that (EPIPE, or a periodic stderr probe while idle) and exits terminal — the supervisor does **not** respawn it. So a watcher lives the whole session and then dies cleanly, leaving no orphan. A SessionStart reaper (`greprag inbox reap`, run automatically) sweeps any watcher a hard-kill left behind, keyed on the `--owner-pid` the arm hook stamps: it kills a watcher only when that stamped claude.exe is dead. A watch armed with **no `--owner-pid`** is **kept, never false-killed** — the old ancestry-walk fallback that reaped flagless watchers was retired 2026-06-13 (it false-killed live backgrounded watchers; see `adr/monitor-resilience.md`). The shipped arm command (what `armMonitorCommand` and the arm hook print) **does** stamp `--owner-pid`, so a hard-killed orphan stays reapable — prefer pasting that verbatim. NOTE: "lives the whole session, then dies cleanly" is about the EPIPE-terminal exit, **not** the absence of a loop the shipped arm command **is** wrapped in the exit-aware relauncher (`case $? in 0|64) break`; see the patterns below). That wrapper is supervisor-death recovery, not an orphan source.
37
37
 
38
38
  `--no-supervise` runs the SSE loop directly in-process (tests, SDK, debugging). A present programmatic `signal` (AbortSignal) implies the same direct mode.
39
39
 
@@ -42,10 +42,10 @@ It does **not** respawn on: clean exit (code 0), Ctrl-C / `TaskStop` (SIGINT/SIG
42
42
  Parent arms a Monitor scoped to its own session, then spawns the chip (chip's Block 2 sends with `--session <parent-session-id>`):
43
43
 
44
44
  ```bash
45
- greprag inbox watch --session <parent-session-id> --json
45
+ while true; do greprag inbox watch --session <parent-session-id> --json --owner-pid <pid>; case $? in 0|64) break;; esac; sleep 1; done
46
46
  ```
47
47
 
48
- Arm it **bare** — no `while true … sleep 1` wrapper. The wrapper was removed 2026-06-04: it was the orphan that outlived its Monitor task and piled up until the desktop OOM-crashed. The three layers now cover everything without it: Monitor `persistent: true` restarts the command if the supervisor process itself dies; the in-process supervisor respawns the SSE child on any inner crash; and EPIPE-terminal kills the whole tree when the consuming session goes away. Adding a `while`-loop back re-introduces the orphan don't.
48
+ Arm it with the **exit-aware relauncher** above (this is exactly what `armMonitorCommand` emits) under Monitor `persistent: true`. History, because it's a known trap: a *bare* `while true … sleep 1` wrapper was removed 2026-06-04 because it re-ran on EVERY exit → the orphan that outlived its Monitor task and piled up until the desktop OOM-crashed. The exit-code-aware form was **restored 2026-06-14** and is the shipped arm command. Why the loop is required, not optional: a live probe proved Monitor `persistent: true` does **not** re-run the command on exit, so this loop is the only turn-free recovery for a dead **supervisor** process. It breaks on **0** (consumer-gone / clean / signal) and **64** (fatal / bad-key) so it never busy-loops an orphan, and relaunches only on a crash. The other two layers handle the inner deaths: the in-process supervisor respawns the SSE child on any inner crash; EPIPE-terminal kills the whole tree (child exit 65 → supervisor reports 0 → the loop breaks) when the consuming session goes away. Don't strip the loop back to "bare" — that removes supervisor-death recovery and re-couples it to agent turns.
49
49
 
50
50
  If the parent has no session identity (rare — older sessions before session-scope shipped), give it one rather than relying on a fan-out: project broadcasts were removed (2026-06-07), so a chip reaches the parent only by session id, or by cold-opening its front desk (bare `<handle>@greprag.com`, surfaced on a manual `greprag inbox --front-desk` — a `--project` watcher won't wake on it).
51
51
 
@@ -55,8 +55,8 @@ Any session that sends a message that could draw a directive in response arms th
55
55
 
56
56
  ```bash
57
57
  # After: greprag send "..." --to <someone> --from-session <own-session-id>
58
- # Arm under Monitor (persistent: true) bare, no while-loop wrapper:
59
- greprag inbox watch --session <own-session-id> --json
58
+ # Arm under Monitor (persistent: true) with the exit-aware relauncher:
59
+ while true; do greprag inbox watch --session <own-session-id> --json --owner-pid <pid>; case $? in 0|64) break;; esac; sleep 1; done
60
60
  ```
61
61
 
62
62
  The `--from-session` flag on the outgoing message tells the recipient where to address replies; the `--session` filter on the watcher narrows incoming traffic to messages aimed at this exact session.
@@ -0,0 +1,98 @@
1
+ # Chip Leader — plan a MULTI-CHIP mission (OpenCode)
2
+
3
+ > Loaded via `greprag load chip-leader-opencode` — run this when your task
4
+ > needs ≥2 chips. A single chip → `greprag load chip-bootloader`. Two or more
5
+ > → STOP, pick a mode below, and plan first.
6
+
7
+ `chip-bootloader` launches one worker correctly; **chip-leader is the commander**
8
+ who plans the whole mission *before* any worker deploys and reconciles them
9
+ *after*. Topology is a planning decision, not an execution afterthought — draw
10
+ the map before mobilizing the troops.
11
+
12
+ **Hard fire:** the moment you're about to launch the **2nd chip**, stop and plan.
13
+ Launch-then-plan is the exact failure this prevents.
14
+
15
+ ## Two modes — pick ONE before planning
16
+
17
+ Forks on one question: **do the chips share one objective, or are they independent?**
18
+
19
+ | | **Mode A — Mission** | **Mode B — Orchestrator** |
20
+ |---|---|---|
21
+ | **When** | ≥2 chips at ONE objective, usually ONE repo | N independent issues, often DIFFERENT repos |
22
+ | **Relationship** | chips have seams — shared files, data contracts, ordering | disjoint by construction — no seams |
23
+ | **Branching** | one integration branch `feature/<slug>`; chips base off it, merge into it | each chip self-contained in its OWN repo; no integration branch |
24
+ | **Merge** | leader reconciles all → ONE reviewed merge to master | each chip merges to ITS OWN repo independently |
25
+ | **Leader's core job** | merge-reconciliation across seams | dispatch + completion judgment — chips report back, you adjudicate |
26
+
27
+ Both modes share decompose, dispatch via bootloader, the label system, and the
28
+ merge discipline below.
29
+
30
+ ## Phase 1 — Decompose
31
+
32
+ Break the objective into independent workstreams. Each workstream = one chip.
33
+ Assign each a **Label** (A, B, C...). The label is the shared handle the leader
34
+ and chip both use end-to-end: bootloader title → IN-FLIGHT ping → report-back
35
+ self-ID → merge references.
36
+
37
+ ## Phase 2 — Assign integration branch (Mode A only)
38
+
39
+ Create one branch off the default branch that all Mode A chips merge INTO:
40
+ ```bash
41
+ git checkout -b feature/<slug>
42
+ git push origin feature/<slug>
43
+ ```
44
+
45
+ Each chip's bootloader sets `git checkout -b chip/<slug>` based off this
46
+ integration branch. When the chip reports DONE, its work is ON `chip/<slug>`,
47
+ ready to merge into `feature/<slug>`.
48
+
49
+ ## Phase 3 — Pre-launch & dispatch each chip
50
+
51
+ For each workstream:
52
+
53
+ 1. **Create the worktree:**
54
+ ```bash
55
+ git worktree add C:\\chip-<slug> -b chip/<slug>
56
+ ```
57
+
58
+ 2. **Write the bootloader** (from `greprag load chip-bootloader`):
59
+ - Label: `Chip A: <verb-phrase>`
60
+ - Integration branch name in the task (Mode A)
61
+ - One clear, self-contained task per chip
62
+
63
+ 3. **Present the bootloader** and tell the user:
64
+ > Open a new session here: C:\\chip-<slug>
65
+
66
+ The user starts a new session in the worktree, pastes the bootloader.
67
+
68
+ ## Phase 4 — Reconcile & merge (Mode A)
69
+
70
+ 1. As each chip reports DONE, merge its branch into `feature/<slug>`:
71
+ ```bash
72
+ git checkout feature/<slug>
73
+ git merge chip/<slug>
74
+ ```
75
+ 2. Resolve any seam conflicts between chips
76
+ 3. Run the full feature end-to-end on `feature/<slug>`
77
+ 4. One reviewed merge to master, then prune:
78
+ ```bash
79
+ git checkout master
80
+ git merge feature/<slug>
81
+ git branch -d feature/<slug>
82
+ # for each chip:
83
+ git worktree remove C:\\chip-<chip-slug>
84
+ git branch -d chip/<chip-slug>
85
+ ```
86
+
87
+ ## Phase 4 (Mode B) — Adjudicate
88
+
89
+ Each chip runs in its own repo. As each reports DONE, verify and close
90
+ independently. No integration gate.
91
+
92
+ ## Key difference from Claude Code chip-leader
93
+
94
+ | Feature | Claude Code | OpenCode |
95
+ |---|---|---|
96
+ | Dispatch | `greprag load chip-spawn` (spawn_task) | `greprag load chip-bootloader` (copyable block) |
97
+ | Isolation | git worktree per chip | git branch per chip |
98
+ | Validator | PreToolUse hook validates prompt blocks | No validator — bootloader is manual |