greprag 5.74.0 → 5.74.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.
Files changed (39) 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/codex-chip/prompt.js +1 -1
  4. package/dist/commands/codex-chip/prompt.js.map +1 -1
  5. package/dist/commands/collision-check.js +3 -2
  6. package/dist/commands/collision-check.js.map +1 -1
  7. package/dist/commands/fix.js +2 -2
  8. package/dist/commands/fix.js.map +1 -1
  9. package/dist/commands/friction-reminder.d.ts +1 -1
  10. package/dist/commands/friction-reminder.js +4 -4
  11. package/dist/commands/friction-reminder.js.map +1 -1
  12. package/dist/commands/init.js +2 -2
  13. package/dist/commands/mechanic-spawn.d.ts +2 -1
  14. package/dist/commands/mechanic-spawn.js +11 -9
  15. package/dist/commands/mechanic-spawn.js.map +1 -1
  16. package/dist/commands/mechanic.js +1 -1
  17. package/dist/commands/opencode-chip-mission.js +1 -1
  18. package/dist/commands/opencode-chip-mission.js.map +1 -1
  19. package/dist/commands/os-primer-reminder.js +1 -1
  20. package/dist/commands/os-primer-reminder.js.map +1 -1
  21. package/dist/hook.js +21 -5
  22. package/dist/hook.js.map +1 -1
  23. package/dist/native-skill-mirror.js +12 -0
  24. package/dist/native-skill-mirror.js.map +1 -1
  25. package/dist/opencode-plugin.bundle.js +629 -104
  26. package/dist/opencode-plugin.js +33 -0
  27. package/dist/opencode-plugin.js.map +1 -1
  28. package/dist/procedure-runtime.d.ts +10 -0
  29. package/dist/procedure-runtime.js +67 -0
  30. package/dist/procedure-runtime.js.map +1 -1
  31. package/dist/procedure.d.ts +4 -5
  32. package/dist/procedure.js +27 -34
  33. package/dist/procedure.js.map +1 -1
  34. package/package.json +1 -1
  35. package/skill/greprag/SKILL.md +1 -1
  36. package/skill/greprag/docs/codex-chip.md +5 -3
  37. package/skill/mechanic/SKILL.md +13 -11
  38. package/skill/templates/chip-spawn.md +2 -2
  39. package/skill/templates/codex-chip-spawn.md +7 -3
@@ -24,8 +24,10 @@ license: MIT
24
24
  > the MOMENT it happens: `greprag fix spawn --type <type> "<one unit>"` emits a
25
25
  > FIX chip for exactly that unit (never absorb adjacent friction). The chip's
26
26
  > contract: identify the exact friction → make the smallest durable root-cause
27
- > fix → explain the friction and fix in human terms → STOP for human approval
28
- > before merge/push/deploy/archive/cleanup. `greprag mechanic friction` (routing to
27
+ > fix → explain the friction and fix in human terms → checkpoint hand it to
28
+ > the mission delivery owner. A full-goal chip with no live parent becomes that
29
+ > owner and follows `.greprag/delivery.json`; no second lifecycle approval is
30
+ > introduced. `greprag mechanic friction` (routing to
29
31
  > a live Mechanic) and `greprag fix log` (queueing) are RETIRED as reflexes —
30
32
  > `fix log` survives for audit/design-input notes; this skill's queue-digestion
31
33
  > method still applies to the EXISTING backlog and to audit notes. A chip titled
@@ -53,7 +55,7 @@ The Mechanic keeps the harness healthy. The loop is **friction → fix → repai
53
55
  **Autonomy = blast radius** (not repair-vs-not). Don't route every repair through the operator — gate by what can be affected:
54
56
  - **Tier 0 — inert / instantly-reversible, zero reach → just do it, report.** Author schemas **born-shadow** (logs only, injects nothing until armed), record/close/delete existing fixes, fix skill/doc text you own, ADR entries, record audit/design notes. Born-shadow makes authoring free — nothing fires until graduation.
55
57
  - **Tier 1 — local code, test-covered, reversible → do it, commit, report.** Contained to the repo, green on its own tests, no prod/fleet/external reach.
56
- - **Tier 2 — real reach or hard to undo → confirm first.** ARM a schema (shadow→active = fleet-wide inject), any deny/transform, prod/deploy/secrets/money/external, untested load-bearing code, deleting what you didn't author, editing a file a peer is live in.
58
+ - **Tier 2 — reach outside the authorized coding mission or hard to undo → confirm first.** ARM a schema (shadow→active = fleet-wide inject), any deny/transform, secrets/money/external communication, untested load-bearing code, deleting claimed user work, or editing a file a peer is actively changing. Ordinary repo-scoped push/deploy/release already implied by a full-goal mission is governed by the Delivery Profile, not this gate.
57
59
 
58
60
  The seam: **author freely (shadow), arm deliberately (operator).** Full doctrine: `docs/mechanic-repairs.md` D10.
59
61
 
@@ -78,13 +80,13 @@ Same gate the hourly compactor applies at write-time — Mechanic and compactor
78
80
 
79
81
  ## Hard rules
80
82
 
81
- - **Tier-2 actions need explicit confirm** (arm/graduate, deny/transform, prod·secrets·external, deleting what you didn't author). Tier 0/1 don't — just do + report.
83
+ - **Tier-2 actions need explicit confirm** (arm/graduate, deny/transform, secrets·money·external communication, deleting claimed user work). Ordinary profile-declared repo delivery does not. Tier 0/1 just do + report.
82
84
  - **Removal-first repair.** Remove the offending text, gate, control, duplicated doctrine, or wrong boundary before adding new guidance. Add prose or controls only when no removal action can solve the friction; never wrap bad doctrine in explanatory caveats when deleting the bad boundary fixes it.
83
85
  - **Bulk is fine for Tier-0 when the set is named aloud** (clearing verified-stale / noise fixes); never bulk a Tier-2 action.
84
86
  - **Never edit `~/.claude/docs/chip-spawn.md` without confirm.** Global rules are sticky.
85
87
  - **Cross-project carve-out.** Default to the current project (resolved via `greprag fix list`). The Phase 0 census MAY read sibling queues to show where fixes piled up; *draining* one requires the operator to name it, and every `add`/`delete` against it MUST carry `--project <that-project>`. Never touch a sibling silently.
86
88
  - **Harness scope is mandatory.** Friction carries its source harness (`claude-code`, `codex`, `opencode`). Repairs to hooks/skills/watchers must target that harness with `greprag mechanic install ... --harness <name>`. In a Codex session, default to `--harness codex`; use `--harness all` only for deliberately portable mechanisms.
87
- - **Coordinate with peer Mechanics before repo gates.** Assume other Mechanic chips or repair sessions may be active in the same repo. Before merging, pushing, deploying, publishing, tagging, or cutting a release, inspect live peers/worktrees and coordinate ownership/status with them. Classify dirty repository state before crossing the boundary: intentional deploy work, peer-owned work, user-owned work, or stale/discardable residue. Sweep intentional dirt into the boundary; block only on unknown ownership, overlapping peer work, or unproven stale residue. If another Mechanic owns overlapping files, surfaces, or release scope, stop and get an explicit handoff/confirmation before taking over, merging, or shipping their patch. A `send_message_to_thread` call, `greprag send`, stored row, or completed empty turn is not proof of coordination; require an actual peer response or another verifiable status signal, and report unconfirmed peers as a caveat. Do not treat a clean current checkout as proof the whole repo is clear.
89
+ - **Coordinate with peer Mechanics before repo gates.** Assume other Mechanic chips or repair sessions may be active in the same repo. Before merging, pushing, deploying, publishing, tagging, or cutting a release, inspect live peers/worktrees and coordinate ownership/status with them. Classify dirty repository state as intentional mission work, peer-owned, user-owned, stale/discardable, or unknown. Include ready peer checkpoints. If no peer claims remaining dirt, assess sensitivity and staleness, preserve a recoverable copy when warranted, then adopt or discard it so production continues. Overlapping live work is coordinated into one delivery owner; silence is a caveat, not a permanent stop. Do not treat a clean current checkout as proof the whole repo is clear.
88
90
 
89
91
  ## Codex Mechanic chip handoff
90
92
 
@@ -97,12 +99,12 @@ Inspect Codex behavior only far enough to correct those GrepRAG surfaces or to
97
99
  report a precise external blocker. Codex owns native task creation, worktrees,
98
100
  permissions, Git, and task lifecycle. Do not create another child or use an
99
101
  internal subagent unless the parent explicitly changes that assignment.
100
- Landing (adr/codex-landing-doctrine.md): a `MECHANIC: <Mission>` chip replies
101
- to its LEAD, which owns merge, archive, and cleanup. A `FIX: <friction>`
102
- mission (from `greprag fix spawn`) also stops for human approval after making
103
- the fix: it explains the exact friction, the change made, why it works, and the
104
- checks run. It must not land, archive, or clean up its selected workspace
105
- before approval.
102
+ Landing (adr/codex-landing-doctrine.md): a `MECHANIC: <Mission>` or
103
+ `FIX: <friction>` chip replies to its LEAD with the commit, exact friction,
104
+ change, reason, checks, and cleanup parameters. The LEAD is the delivery owner
105
+ and integrates without another human approval. If no live parent exists and
106
+ the chip itself carries the full-goal mission, it becomes delivery owner and
107
+ follows `.greprag/delivery.json` through verification.
106
108
 
107
109
  ABOUT TO dispatch or replace a visible Codex chip? STOP — load
108
110
  `codex-chip-spawn` first and create the child with Codex Desktop's native
@@ -105,6 +105,6 @@ Chips never `npm link` from the worktree — dangling symlinks silently break th
105
105
 
106
106
  ## Parent merge discipline — prune at the merge (HARD RULE)
107
107
 
108
- When you (the parent) merge a chip branch — via `/commit` or raw `git merge` — prune in the same breath: junction guard (`~/.claude/skills/commit/guard-junctions.sh <worktree>`), `git worktree remove .claude/worktrees/<slug>`, and `git branch -d chip/<slug>` once merged. Deferred cleanup = stale worktrees piling up (field state 2026-06-10: 3 leftovers). Multi-chip missions: worktree dies at the feature-branch merge; the branch lives until the master merge (chip-leader Phase 4).
108
+ When you (the parent) merge a chip branch — through the canonical commit path or a profile-declared merge — prune in the same breath: junction guard (`~/.claude/skills/commit/guard-junctions.sh <worktree>`), `git worktree remove .claude/worktrees/<slug>`, and `git branch -d chip/<slug>` once merged. Deferred cleanup = stale worktrees piling up (field state 2026-06-10: 3 leftovers). Multi-chip missions: worktree dies at the integration-branch merge; the branch lives until the configured default-branch merge (chip-leader Phase 4).
109
109
 
110
- **Exception — FIX chips stop for approval.** A `greprag fix spawn` mission is the source of truth for FIX behavior. `fix spawn` detects usable Git history and emits `workspaceMode`: Git uses an isolated worktree; non-Git, unavailable Git, or no commit uses the project-local task with serialized writes. Dispatch honors that mode without trying a worktree first. The FIX chip identifies the exact friction, makes the smallest durable root-cause fix, explains the friction and fix in human terms, reports checks, then stops for human approval. It does not land, archive, or clean up the selected workspace before approval.
110
+ **FIX chips use the same delivery owner.** A `greprag fix spawn` mission is the source of truth for FIX behavior. `fix spawn` detects usable Git history and emits `workspaceMode`: Git uses an isolated worktree; non-Git, unavailable Git, or no commit uses the project-local task with serialized writes. Dispatch honors that mode without trying a worktree first. The FIX chip identifies the exact friction, makes the smallest durable root-cause fix, verifies and checkpoints it, then reports the commit/result and cleanup parameters to the parent delivery owner. It creates no human landing gate. If no live parent exists and the chip carries the full-goal mission, it becomes delivery owner and follows the repo profile.
@@ -184,13 +184,17 @@ recap/Capture/doc-pointer/stateful injection, `env` bootstrap/deps/scripts, and
184
184
  `code` product/source behavior. Repo writes use the selected workspace mode;
185
185
  data-only repair rows and diagnosis need no writable task. The chip identifies
186
186
  the exact friction, makes the smallest durable root-cause fix, explains the
187
- friction and fix in human terms, reports checks, then stops for human approval.
187
+ friction and fix in human terms, verifies and checkpoints it, then hands the
188
+ commit/result to the parent delivery owner without a second human approval
189
+ gate. With no live parent and a full-goal mission, it becomes delivery owner
190
+ and follows the repo profile.
188
191
  Removal comes first: remove offending text, gates, controls, duplicated
189
192
  doctrine, and wrong boundaries before adding new guidance. Add prose or
190
193
  controls only when no removal action can solve the friction; never wrap bad
191
194
  doctrine in explanatory caveats when deleting the bad boundary fixes it.
192
- It must not land, archive, or clean up selected workspace state before
193
- approval.
195
+ As a child, it does not independently land, archive, or clean up selected
196
+ workspace state; the parent delivery owner does that immediately after
197
+ integration. The no-live-parent full-goal fallback owns those actions itself.
194
198
 
195
199
  ## After spawning
196
200