greprag 5.74.9 → 5.74.11

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.
@@ -1752,8 +1752,8 @@ function buildOsPrimer(env) {
1752
1752
  "[grepragOS \u2014 the operating laws. Full doctrine: `greprag load os`.]",
1753
1753
  '\u2022 Doctrine vs state: methods ship in the CLI (`greprag load`); live state lives in the repo. A skill that depends on repo state carries a "STATE \u2014 read these first" block naming exact paths.',
1754
1754
  "\u2022 Discoverability: every durable artifact must be findable next session \u2014 docs auto-register, skills auto-mirror, decisions get a dated ADR/decision-log entry, everything else gets its path named in the owning skill/doc. If nothing points at it, you didn't finish.",
1755
- "\u2022 Pull before derive: `greprag memory search` / `corpus search` / `load` BEFORE asking the operator or re-deriving what the project already knows. Named person/org/project/repo/customer/handle or unexplained proper noun \u2192 search Memory before guessing, unless fully defined in-turn.",
1756
- `\u2022 Friction \u21D2 fix NOW: type by durable repair surface (\`harness|doctrine|injection|env|code\`) \u21D2 \`greprag fix spawn --type <type> "<unit>"\`. It PRINTS a fix-chip mission \u2014 YOU then create the visible child task with that mission as its first message (how: \`greprag load ${spawnEntry}\`, or your harness's native task tool). Repo write = isolated worktree; data-only row/diagnosis = no repo write. One unit per chip; the chip fixes, verifies, checkpoints, and hands it to the mission delivery owner. Never queue friction.`,
1755
+ "\u2022 Pull before derive: `greprag memory search` / `corpus search` / `load` BEFORE asking the operator or re-deriving what the project already knows. Friction or an env/toolchain/worktree/secret bootstrap roadblock \u2192 search Memory for the exact error/friction + repo/tool before inventing a workaround. Clear overcome \u2192 apply it and continue. Named person/org/project/repo/customer/handle or unexplained proper noun \u2192 search Memory before guessing, unless fully defined in-turn.",
1756
+ `\u2022 Unresolved friction \u21D2 fix: only when Memory has no answer, the remembered overcome fails, or the same friction repeats. Then type by durable repair surface (\`harness|doctrine|injection|env|code\`) \u21D2 \`greprag fix spawn --type <type> "<unit>"\`. It PRINTS a fix-chip mission \u2014 YOU then create the visible child task with that mission as its first message (how: \`greprag load ${spawnEntry}\`, or your harness's native task tool). Repo write = isolated worktree; data-only row/diagnosis = no repo write. One unresolved unit per chip; the chip fixes, verifies, checkpoints, and hands it to the mission delivery owner.`,
1757
1757
  "\u2022 Teach the system, not the chat: explained twice by the operator \u21D2 it belongs in a skill / load entry / STATE block / ADR, not the conversation."
1758
1758
  ].join("\n");
1759
1759
  }
@@ -1827,7 +1827,7 @@ var OPENCODE_CHIP_SPAWN_POINTER = [
1827
1827
  "\u2022 Delegating a component of a plan to an isolated chip session, or `greprag fix spawn` just printed a FIX-chip mission? \u2192 run `greprag load chip-bootloader` FIRST for the method: OpenCode chips spawn natively via `greprag opencode chip goal create` + `greprag opencode chip spawn` (HTTP child session; manual paste only when the API is down). \u22652 chips at one objective \u2192 `greprag load chip-leader-opencode` BEFORE the first spawn."
1828
1828
  ].join("\n");
1829
1829
  var CODEX_CHIP_SPAWN_POINTER = [
1830
- "[greprag Codex delegation \u2014 internal subagent, 1\u20132-chip quick path with the initiator as LEAD, or a separate LEAD for larger/seamed missions.]",
1830
+ "[greprag Codex delegation \u2014 1\u20132-chip quick path with the initiator as LEAD, or a separate LEAD for larger/seamed missions.]",
1831
1831
  "\u2022 About to delegate a Codex task? \u2192 run `greprag load codex-chip-spawn` FIRST. Use exact first-line titles `LEAD: <Mission>`, `Chip A/B/C: <Specific Purview>`, and `FIX: [type] <one friction unit>`. Chips are ordinary writable native tasks; completion is a native Codex task reply to the LEAD after committing. A `FIX:` task loads `greprag load mechanic` first."
1832
1832
  ].join("\n");
1833
1833
  var loadPrimerModule = {
@@ -2022,15 +2022,16 @@ function frictionReminderTier(stress) {
2022
2022
  return "silent";
2023
2023
  }
2024
2024
  var FIX_SPAWN = 'greprag fix spawn --type <harness|doctrine|injection|env|code> "<one unit>"';
2025
+ var MEMORY_SEARCH = 'greprag memory search "<exact error/friction + repo/tool>"';
2025
2026
  function buildMechanicLiveNotice(_env) {
2026
- return `GrepRAG Mechanic is live. Friction reflex: \`${FIX_SPAWN}\` \u2014 one fix chip per unit, spawned at the moment; then keep working. Check role only when needed: \`greprag mechanic role\`.`;
2027
+ return `GrepRAG Mechanic is live. Friction order: \`${MEMORY_SEARCH}\` first; apply a clear overcome and continue. No answer, failed overcome, or repeated friction \u2192 \`${FIX_SPAWN}\`. Check role only when needed: \`greprag mechanic role\`.`;
2027
2028
  }
2028
2029
  function buildFrictionReminder(tier, env) {
2029
2030
  switch (tier) {
2030
2031
  case "nag":
2031
- return `\u26A0 FRICTION HIGH (live signal: repetition / errors / churn) \u2014 STOP pushing through. Name the ONE unit, choose type by repair surface, and spawn now: \`${FIX_SPAWN}\` (chip fixes, verifies, checkpoints, and hands it to the mission delivery owner). No friction? say "clear" + continue.`;
2032
+ return `\u26A0 FRICTION HIGH (live signal: repetition / errors / churn) \u2014 STOP pushing through. MEMORY FIRST: \`${MEMORY_SEARCH}\`. Clear overcome \u2192 apply + continue. No answer, remembered overcome fails, or same friction repeats \u2192 \`${FIX_SPAWN}\`. No friction? say "clear" + continue.`;
2032
2033
  case "nudge":
2033
- return `\u26A0 Friction detected (live signal) \u2014 repeated yourself, fought a tool, or hit a wall? Choose type by repair surface and spawn: \`${FIX_SPAWN}\`, then keep working. Otherwise say "clear" + continue.`;
2034
+ return `\u26A0 Friction detected (live signal) \u2014 repeated yourself, fought a tool, or hit a wall? Search first: \`${MEMORY_SEARCH}\`. Apply a clear overcome + continue; no answer, failed overcome, or repeat \u2192 \`${FIX_SPAWN}\`. Otherwise say "clear" + continue.`;
2034
2035
  default:
2035
2036
  return null;
2036
2037
  }
@@ -2041,22 +2042,11 @@ function buildBootstrapFrictionReminder(env) {
2041
2042
  return null;
2042
2043
  const repeats = b.repeats && b.repeats > 1 ? ` repeated ${b.repeats}x` : "";
2043
2044
  const error = b.error ? ` Last error: ${b.error}` : "";
2044
- return `\u26A0 BOOTSTRAP FRICTION detected${repeats}: setup/toolchain failure (${b.signal || "setup"}) around \`${b.command || "unknown command"}\`.${error} If this is not caused by the code you just edited, spawn a fix chip now: \`greprag fix spawn --type env "${bootstrapSummary(env)}"\`. The chip owns the root-cause repair, verifies it, and hands it to the mission delivery owner so future sessions stop hitting it.`;
2045
- }
2046
- function buildMechanicAnnounce() {
2047
- return [
2048
- "[Fix reflex \u2014 friction is fixed at the MOMENT it happens, one chip per unit (grepragOS law; full doctrine: `greprag load os`).]",
2049
- "WHEN friction happens \u2014 repeated yourself, fought a tool, got corrected >=2x on the same thing, rediscovered something already known, or hit a setup/toolchain failure not caused by code you just edited \u2014 spawn its fix chip NOW, then keep working. Ordinary misunderstanding or misreading user intent is not friction unless it repeats or exposes a durable doctrine/harness/injection/env/code failure. One unit = one chip; adjacent friction gets its own spawn. Never queue friction for later.",
2050
- 'TYPE = durable repair surface: harness=hooks/watchers/task dispatch; doctrine=greprag load/skills/AGENTS; injection=recap/Capture/doc-pointer/stateful injection; env=bootstrap/deps/scripts/worktree setup; code=product/source behavior. Use: `greprag fix spawn --type <type> "<one unit>"`.',
2051
- "WORKSPACE ROUTING: `fix spawn` detects usable Git history before dispatch \u2014 Git uses an isolated worktree; non-Git, unavailable Git, or no commit uses the project-local task with serialized writes. No fail-then-fallback attempt.",
2052
- "THE CHIP'S CONTRACT (it self-enforces; you just spawn): identify the exact friction \u2192 make the smallest durable root-cause fix \u2192 explain and verify it \u2192 checkpoint \u2192 hand it to the mission delivery owner. With no live parent and a full-goal mission, the chip becomes delivery owner and follows the repo profile. No second lifecycle approval.",
2053
- "Every repair is ROOT-CAUSE \u2014 fix the pattern that makes the friction class possible, never a guard on today's trigger.",
2054
- 'A per-turn reminder fires ONLY when live friction is DETECTED (the stress signal \u2014 repetition / errors / churn), never on a timer \u2014 act on it, or say "clear" and continue.'
2055
- ].join("\n");
2045
+ const summary = bootstrapSummary(env);
2046
+ return `\u26A0 BOOTSTRAP FRICTION detected${repeats}: setup/toolchain failure (${b.signal || "setup"}) around \`${b.command || "unknown command"}\`.${error} MEMORY FIRST: \`greprag memory search "${summary}"\`. Apply a clear overcome + continue. No answer, remembered overcome fails, or the same failure repeats \u2192 \`greprag fix spawn --type env "${summary}"\`.`;
2056
2047
  }
2057
2048
  var mechanicFrictionModule = {
2058
2049
  id: "mechanic-friction",
2059
- dependsOn: ["chip-spawn-pointer"],
2060
2050
  // Stress fires the real friction reminder. A designated Mechanic also creates a
2061
2051
  // one-shot ambient route notice per source session/role epoch (hook-stamped).
2062
2052
  detect: (env) => {
@@ -2069,14 +2059,7 @@ var mechanicFrictionModule = {
2069
2059
  return { tier: "ambient" };
2070
2060
  return { tier: "silent" };
2071
2061
  },
2072
- announce: (env = {}) => {
2073
- const base = buildMechanicAnnounce();
2074
- if (env.mechanicLive && !env.mechanic)
2075
- return `${base}
2076
-
2077
- ${buildMechanicLiveNotice(env)}`;
2078
- return base;
2079
- },
2062
+ announce: () => null,
2080
2063
  reminder: (d, env) => {
2081
2064
  if (d.detail?.kind === "bootstrap-friction")
2082
2065
  return buildBootstrapFrictionReminder(env);
@@ -2558,9 +2541,9 @@ function buildOpenCodeEnv(params) {
2558
2541
  // No opencode-native friction detector is wired yet: Claude Code's stress /
2559
2542
  // bootstrap-friction signals come from state-trigger.ts reading the
2560
2543
  // transcript in hook.ts, and opencode has no equivalent source plumbed.
2561
- // 0 = calm keeps the mechanic-friction REMINDER silent while its ANNOUNCE
2562
- // (the fix-spawn doctrine) still lands every session. Detector design is
2563
- // parked with scored options in the chip report
2544
+ // 0 = calm keeps the reminder-only mechanic-friction module silent. The
2545
+ // os-primer still lands the memory-first escalation doctrine every session.
2546
+ // Detector design is parked with scored options in the chip report
2564
2547
  // (chip/opencode-fix-chip-system-parity).
2565
2548
  stress: 0,
2566
2549
  armed: params.armed ?? false,
@@ -10,7 +10,9 @@
10
10
  * silently emitted no loadout announce and the report looked like a server
11
11
  * bug. The CLI must catch that split itself: `greprag status` names every
12
12
  * shim + the version it actually executes; `greprag doctor` rewrites stale
13
- * shims to forward to a current one.
13
+ * shims to forward to a current one. Durable shims must not forward into
14
+ * fnm_multishells: those are per-shell temp directories and can disappear
15
+ * while the stable PATH entry remains.
14
16
  *
15
17
  * Pure helpers (parse/version/plan) are exported for unit tests; only
16
18
  * `auditWindowsShims`/`repairStaleShims` touch PATH + disk.
@@ -55,6 +57,7 @@ exports.missingRequiredShimFiles = missingRequiredShimFiles;
55
57
  exports.auditWindowsShims = auditWindowsShims;
56
58
  exports.shimNeedsRepair = shimNeedsRepair;
57
59
  exports.planShimRepairs = planShimRepairs;
60
+ exports.shimInstallCommand = shimInstallCommand;
58
61
  exports.repairStaleShims = repairStaleShims;
59
62
  const fs = __importStar(require("fs"));
60
63
  const path = __importStar(require("path"));
@@ -111,6 +114,9 @@ function missingRequiredShimFiles(scriptPath, name) {
111
114
  return [];
112
115
  return requiredFilesForShim(name).filter(file => !fs.existsSync(path.join(info.root, file)));
113
116
  }
117
+ function isFnmMultishellPath(p) {
118
+ return !!p && /[\\/]fnm_multishells[\\/]/i.test(path.normalize(p));
119
+ }
114
120
  /** Resolve one shim: follow up to 3 .cmd forwarding hops, then read the
115
121
  * owning package version. */
116
122
  function resolveShim(name, shimPath, active, installed) {
@@ -134,6 +140,7 @@ function resolveShim(name, shimPath, active, installed) {
134
140
  }
135
141
  const info = target ? shimPackageInfo(target) : null;
136
142
  const missingFiles = info ? requiredFilesForShim(name).filter(file => !fs.existsSync(path.join(info.root, file))) : [];
143
+ const volatileForward = !isFnmMultishellPath(shimPath) && isFnmMultishellPath(target);
137
144
  return {
138
145
  name,
139
146
  extension: path.extname(shimPath).toLowerCase() === '.ps1' ? '.ps1' : '.cmd',
@@ -143,6 +150,7 @@ function resolveShim(name, shimPath, active, installed) {
143
150
  version: info?.version ?? null,
144
151
  stale: info !== null && info.version !== installed,
145
152
  incomplete: missingFiles.length > 0,
153
+ volatileForward,
146
154
  missingFiles,
147
155
  unresolvable: target === null || info === null,
148
156
  };
@@ -199,7 +207,7 @@ function auditWindowsShims(installedVersion) {
199
207
  return out;
200
208
  }
201
209
  function shimNeedsRepair(shim) {
202
- return shim.stale || shim.incomplete;
210
+ return shim.stale || shim.incomplete || shim.volatileForward;
203
211
  }
204
212
  function canForward(from, to) {
205
213
  if (from.extension === '.ps1')
@@ -214,6 +222,7 @@ function planShimRepairs(audits) {
214
222
  && !shimNeedsRepair(a)
215
223
  && !a.unresolvable
216
224
  && a.shimPath !== shim.shimPath
225
+ && (isFnmMultishellPath(shim.shimPath) || !isFnmMultishellPath(a.shimPath))
217
226
  && canForward(shim, a));
218
227
  return { shim, forwardTo: healthy ? healthy.shimPath : null };
219
228
  });
@@ -224,8 +233,15 @@ function describeProblem(shim) {
224
233
  parts.push(`v${shim.version}`);
225
234
  if (shim.incomplete)
226
235
  parts.push(`missing ${shim.missingFiles.join(', ')}`);
236
+ if (shim.volatileForward)
237
+ parts.push('fnm temp forward');
227
238
  return parts.length ? parts.join(', ') : 'unhealthy';
228
239
  }
240
+ function shimInstallCommand() {
241
+ return process.platform === 'win32'
242
+ ? 'npm i -g greprag@latest --prefix "%APPDATA%\\npm"'
243
+ : 'npm i -g greprag@latest';
244
+ }
229
245
  function writeForwarder(shim, forwardTo) {
230
246
  if (shim.extension === '.ps1') {
231
247
  fs.writeFileSync(shim.shimPath, [
@@ -250,7 +266,7 @@ function repairStaleShims(repairs) {
250
266
  const lines = [];
251
267
  for (const r of repairs) {
252
268
  if (!r.forwardTo) {
253
- lines.push(`✗ ${r.shim.shimPath} is unhealthy (${describeProblem(r.shim)}) and no current ${r.shim.name} shim exists on PATH to forward to — run \`npm i -g greprag@latest\`, then re-run doctor.`);
269
+ lines.push(`✗ ${r.shim.shimPath} is unhealthy (${describeProblem(r.shim)}) and no durable current ${r.shim.name} shim exists on PATH to forward to — run \`${shimInstallCommand()}\`, then re-run doctor.`);
254
270
  continue;
255
271
  }
256
272
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greprag",
3
- "version": "5.74.9",
3
+ "version": "5.74.11",
4
4
  "description": "GrepRAG — agent memory for Claude Code, Codex, and OpenCode.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -148,6 +148,8 @@ Aliases (silent back-compat): `greprag memory briefing` → `recap` (renamed v5.
148
148
 
149
149
  **Codex/Windows: ABOUT TO VALIDATE WITH NONTRIVIAL `node -e` JAVASCRIPT? STOP — write the code to a temporary `.cjs` file and run `node <file>`.** PowerShell parses the command before Node sees it; regex lookarounds, `$1`, pipes, nested quotes, and semicolons can be split or expanded before Node runs. Keep `node -e` only for tiny quote-free probes.
150
150
 
151
+ **Codex/Windows: ABOUT TO CLEAN A GENERATED `dist` DIRECTORY? STOP — run `greprag codex clean-generated <path-to-dist>` instead of inline `Remove-Item -Recurse`.** Codex's native command launcher can reject free-form recursive delete text before PowerShell executes your path checks; the GrepRAG command resolves the `dist` path, requires a Git-root or explicit `--under` bound, rejects symlink/repo-metadata targets, and removes only that checked generated directory.
152
+
151
153
  **Codex messaging has one simple contract.** Discover Codex tasks with `codex_app.list_threads` unfiltered first, scope by cwd, then coordinate Codex-to-Codex with `codex_app.send_message_to_thread`; `query` may narrow only after cwd scoping. `greprag send` is the durable cross-harness inbox rail and fallback queue; it does not by itself prove that an idle Codex task woke or acted. Public installs use `greprag init --codex --tenant-id <handle>` and Codex hooks surface queued inbox rows at SessionStart/UserPromptSubmit boundaries. There is no Codex startup watcher to install. A stored row, completed user-only turn, app-server `turn/start` / `turn/steer`, or `codex exec resume` is not proof of agent action. Only the recipient's actual peer response proves delivery.
152
154
 
153
155
  **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`.
@@ -158,7 +160,7 @@ Aliases (silent back-compat): `greprag memory briefing` → `recap` (renamed v5.
158
160
 
159
161
  - `docs/setup.md` — codex · claude-code · opencode · auth · hooks · conventions · permissions · channels · anchor · bulk-register
160
162
  - `docs/platforms.md` — exact platform paths for Claude Code · Codex · OpenCode
161
- - `docs/codex-chip.md` — Codex subagent, quick-chip, Leader, reporting, and cleanup shape
163
+ - `docs/codex-chip.md` — Codex quick-chip, Leader, reporting, and cleanup shape
162
164
  - `docs/per-project-flags.md` — flip `memory_capture` / `session_start_recap` / `inbox_notify`
163
165
  - `docs/inbox.md` — `greprag send`, `greprag inbox`, address grammar, retract (internal messaging)
164
166
  - `docs/email.md` — `greprag email send`/`pending`/`pull`/`boxes`/`domain` — REAL SMTP: send-as custom domains, segregated mailboxes (distinct from `send`)
@@ -2,14 +2,18 @@
2
2
 
3
3
  Use `greprag load codex-chip-spawn` for the Codex block recipe:
4
4
 
5
- - internal same-session subagent (`max_threads=6`, `max_depth=1`; no separate
6
- worktree, manifest, inbox, or goal) uses `greprag load codex-subagent-spawn`;
7
5
  - quick mode: rename the current task `LEAD: <Mission>` and directly spawn
8
6
  1–2 visible `Chip A/B: <Specific Purview>` worktree tasks;
9
7
  - Leader mode: rename the current task `PLANNER: <Mission>`, then create a
10
8
  separate `LEAD: <Mission>` task before that LEAD spawns
11
9
  `Chip A/B/C: <Specific Purview>` children for seams or larger orchestration.
12
10
 
11
+ Same-session subagents are native Codex behavior, not GrepRAG chip doctrine.
12
+ Create visible chips with native `codex_app__create_thread`: `target.type =
13
+ project`, the current `projectId`, a Codex `worktree` environment with
14
+ `startingState: { type: "branch", branchName: "<prepared chip branch>" }`,
15
+ plus top-level `model` and `thinking` from `greprag codex models show`.
16
+
13
17
  Normal chips are writable and own discovery, design, implementation, tests, and
14
18
  commit. Preserve the Codex-provided worktree, committed result artifact, and
15
19
  parent cleanup. The child opening prompt starts with the exact visible title
@@ -28,6 +32,10 @@ means the child archives its own Codex task; `Archive: no` leaves it open. The
28
32
  lead remains responsible for integration and post-merge branch bookkeeping,
29
33
  not routine child-task archival.
30
34
  Review is a separate explicit review chip/session when the lead asks for it.
35
+ If the repo ships `scripts/codex-run.cjs`, children use
36
+ `node scripts/codex-run.cjs -- <command ...>` for build/test/env-driven
37
+ commands so ignored `.env`, `.env.local`, `.dev.vars`, and package-level env
38
+ files are read from the main checkout without copying or printing secrets.
31
39
  FIX landing (adr/codex-landing-doctrine.md): a mission whose first line
32
40
  begins `FIX:` (from `greprag fix spawn`) uses the handoff's detected
33
41
  `workspaceMode`. Usable Git history selects an isolated worktree; non-Git,
@@ -2,7 +2,7 @@
2
2
  name: mechanic
3
3
  description: |
4
4
  The Mechanic — keep the harness healthy. The loop is friction → fix → repair:
5
- spawn one fix chip per live friction unit, then repair so it can't recur.
5
+ recall known overcomes first; spawn one fix chip per unresolved friction unit.
6
6
  Digest the existing fix queue and audit/design notes, audit fixes for drift,
7
7
  mine episodic memory, promote project-agnostic repairs to global. One-at-a-time
8
8
  conversational review — never bulk.
@@ -19,10 +19,13 @@ license: MIT
19
19
 
20
20
  # Mechanic
21
21
 
22
- > **Fix-spawn reflex (ratified 2026-07-12, grepragOS law 4 — supersedes the
23
- > routing/queueing reflex below wherever they conflict).** Friction is fixed at
24
- > the MOMENT it happens: `greprag fix spawn --type <type> "<one unit>"` emits a
25
- > FIX chip for exactly that unit (never absorb adjacent friction). The chip's
22
+ > **Memory-first friction reflex (refined 2026-07-28, grepragOS laws 3–4 —
23
+ > supersedes the routing/queueing reflex below wherever they conflict).** Search
24
+ > Memory for the exact error/friction plus repo/tool first. Apply a clear
25
+ > remembered overcome and continue. Only when Memory has no answer, the overcome
26
+ > fails, or the same friction repeats does
27
+ > `greprag fix spawn --type <type> "<one unit>"` emit a FIX chip for that
28
+ > unresolved unit. The chip's
26
29
  > contract: identify the exact friction → make the smallest durable root-cause
27
30
  > fix → explain the friction and fix in human terms → checkpoint → hand it to
28
31
  > the mission delivery owner. A full-goal chip with no live parent becomes that
@@ -46,7 +49,7 @@ task.
46
49
 
47
50
  The Mechanic keeps the harness healthy. The loop is **friction → fix → repair**:
48
51
 
49
- - **friction** — a rough spot the agent or operator hit: a gotcha, a rediscovery, a repeated correction, churn, rework. Ordinary misunderstanding or misreading user intent is not friction unless it repeats or exposes a durable doctrine/harness/injection/env/code failure. Live friction becomes one `greprag fix spawn --type <type> "<unit>"` chip at the moment it happens.
52
+ - **friction** — a rough spot the agent or operator hit: a gotcha, a rediscovery, a repeated correction, churn, rework. Ordinary misunderstanding or misreading user intent is not friction unless it repeats or exposes a durable doctrine/harness/injection/env/code failure. Search Memory first; a clear overcome is applied inline, while unresolved friction becomes one `greprag fix spawn --type <type> "<unit>"` chip.
50
53
  - **fix** — the repair mission or audit note. Live fixes are owned by spawned FIX chips; the queue remains for existing backlog and deliberate design-input notes.
51
54
  - **repair** — the fix wired in so it can't recur: a hook, a code change, or *surfacing it* (a doc line / a fact-seed / an injection). A repaired fix is done.
52
55
 
@@ -97,8 +100,8 @@ the Codex-provided checkout: bundled load entries, skill templates, docs, hook
97
100
  context, CLI messages, and tests that teach agents how to use the harness.
98
101
  Inspect Codex behavior only far enough to correct those GrepRAG surfaces or to
99
102
  report a precise external blocker. Codex owns native task creation, worktrees,
100
- permissions, Git, and task lifecycle. Do not create another child or use an
101
- internal subagent unless the parent explicitly changes that assignment.
103
+ permissions, Git, and task lifecycle. Do not create another child unless the
104
+ parent explicitly changes that assignment.
102
105
  Landing (adr/codex-landing-doctrine.md): a `MECHANIC: <Mission>` or
103
106
  `FIX: <friction>` chip replies to its LEAD with the commit, exact friction,
104
107
  change, reason, checks, and cleanup parameters. The LEAD is the delivery owner
@@ -113,8 +116,7 @@ project worktree or local target. For 1–2 children the current
113
116
  task is the implicit LEAD; for more than two children or shared seams, load
114
117
  `chip-leader` and create a separate `LEAD: <Mission>` that dispatches exact
115
118
  `Chip A/B/C: <Specific Purview>` tasks.
116
- `multi_agent_v1__spawn_agent` is only an ephemeral same-session subagent and
117
- never satisfies a visible-chip requirement.
119
+ Native same-session helpers never satisfy a visible-chip requirement.
118
120
 
119
121
  ABOUT TO answer a Mechanic peer who offers to coordinate, integrate, rework, or
120
122
  take over a harness repair? STOP — hand off the repair state: commit/branch,
@@ -293,11 +295,11 @@ greprag mechanic off / on PANIC SWITCH — local file, no network; s
293
295
 
294
296
  **Legacy Mechanic role.** A `--mechanic` inbox watcher can still receive
295
297
  legacy `mechanic_friction` / `mechanic_reply` rows in addition to its own session
296
- lane, but live working sessions no longer route friction there. New friction is
297
- always Law 4: `greprag fix spawn --type <type> "<one unit>"`, one FIX chip per
298
- unit, at the moment it happens. `greprag mechanic set` only fans out a notice
299
- that teaches this fix-spawn reflex and preserves the reply rail for old mechanic
300
- threads. The Mechanic replies with `greprag mechanic reply --to <source-session>
298
+ lane, but live working sessions no longer route friction there. Laws 3–4 search
299
+ Memory first, then route each unresolved unit through
300
+ `greprag fix spawn --type <type> "<one unit>"`. `greprag mechanic set` only
301
+ fans out a notice that teaches this reflex and preserves the reply rail for old
302
+ mechanic threads. The Mechanic replies with `greprag mechanic reply --to <source-session>
301
303
  "..."` only for legacy follow-up coordination.
302
304
 
303
305
  **Born shadow → graduate.** Every repair is born `shadow`: it matches and logs would-have-fired
@@ -6,7 +6,7 @@
6
6
 
7
7
  The skill-tuning reflex injects a directive when a skill under break-in loads. The old directive said "watch your execution, emit a SELF-TUNING block, propose a fix" — vague (it pointed at the *run*, not the *skill*) and propose-only (no edit ever landed). This doc replaces that with **six locatable skill defects**, each mapped to one concrete edit. The reflex's loop is: **detect a defined friction → locate it in the skill's SKILL.md → apply the fix per the matching recipe → show the diff for one accept/revert.**
8
8
 
9
- A friction that doesn't match one of the six below is **not auto-fixable inline** spawn a doctrine fix chip for the one unit (`greprag fix spawn --type doctrine "<skill friction unit>"`) and keep working. Use `greprag fix log` only for deliberate audit/design notes, not as the live-friction reflex. Do not invent edits outside these recipes.
9
+ A friction that doesn't match one of the six below is **not auto-fixable inline**. Search Memory for the exact skill/friction first; apply a clear overcome and continue. If Memory has no answer, the overcome fails, or the friction repeats, spawn one doctrine fix chip (`greprag fix spawn --type doctrine "<skill friction unit>"`). Use `greprag fix log` only for deliberate audit/design notes. Do not invent edits outside these recipes.
10
10
 
11
11
  ## The two edit primitives (skill-optimize vocabulary)
12
12