@c-d-cc/reap 0.15.1 → 0.15.3

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.
@@ -3,4 +3,4 @@ description: "REAP Refresh Knowledge — Load REAP context (Genome, Environment,
3
3
  ---
4
4
 
5
5
  Run `reap run refreshKnowledge` and incorporate the returned REAP context into your working knowledge.
6
- This is useful when you don't have REAP context loaded (e.g., in a subagent or after context compaction).
6
+ This is useful when REAP context is lost or not loaded (e.g., after context compaction, in a subagent, or when starting without a session-start hook).
@@ -22,7 +22,7 @@ Slash Commands (use in Claude Code):
22
22
  /reap.status Show current state
23
23
  /reap.sync Synchronize Genome with source code
24
24
  /reap.help Contextual help (AI-powered)
25
- /reap.refreshKnowledge Load REAP context for subagents
25
+ /reap.refreshKnowledge Reload REAP context (Genome, Environment, state)
26
26
 
27
27
  Quick Start:
28
28
  1. reap init my-project
@@ -22,7 +22,7 @@ CLI 명령어:
22
22
  /reap.status 현재 상태 확인
23
23
  /reap.sync Genome을 소스 코드와 동기화
24
24
  /reap.help 상황별 도움말 (AI 기반)
25
- /reap.refreshKnowledge 서브에이전트용 REAP 컨텍스트 로드
25
+ /reap.refreshKnowledge REAP 컨텍스트 재로드 (Genome, Environment, 상태)
26
26
 
27
27
  빠른 시작:
28
28
  1. reap init my-project
@@ -222,16 +222,16 @@ function buildStrictSection(strictEdit, strictMerge, genStage) {
222
222
 
223
223
  if (strictEdit) {
224
224
  if (genStage === 'implementation') {
225
- sections += "\n\n## Strict Mode — Edit (ACTIVE — SCOPED MODIFICATION ALLOWED)\n<HARD-GATE>\nStrict mode is enabled. Code modification is ALLOWED only within the scope of the current Generation's plan.\n- You MUST read `.reap/life/02-planning.md` before writing any code.\n- You may ONLY modify files and modules listed in the plan's task list.\n- Changes outside the plan's scope are BLOCKED. If you discover out-of-scope work is needed, add it to the backlog instead of implementing it.\n- If the user explicitly requests to bypass strict mode (e.g., \"override\", \"bypass strict\"), you may proceed — but inform them that strict mode is being bypassed.\n</HARD-GATE>";
225
+ sections += "\n\n## Strict Mode — Edit (ACTIVE — SCOPED MODIFICATION ALLOWED)\n<HARD-GATE>\nStrict mode is enabled. Code modification is ALLOWED only within the scope of the current Generation's plan.\n- You MUST read `.reap/life/02-planning.md` before writing any code.\n- You may ONLY modify files and modules listed in the plan's task list.\n- Changes outside the plan's scope are BLOCKED. If you discover out-of-scope work is needed, add it to the backlog instead of implementing it.\n- If the user explicitly requests to bypass strict mode (e.g., \"override\", \"bypass strict\"), you may proceed for that specific action only — but inform them that strict mode is being bypassed. The bypass does NOT persist; strict mode re-engages immediately after the requested action is complete.\n</HARD-GATE>";
226
226
  } else if (genStage === 'none') {
227
- sections += "\n\n## Strict Mode — Edit (ACTIVE — CODE MODIFICATION BLOCKED)\n<HARD-GATE>\nStrict mode is enabled and there is NO active Generation.\nYou MUST NOT write, edit, or create any source code files.\nAllowed actions: reading files, analyzing code, answering questions, running commands.\nTo start coding, the user must first run `/reap.start` and advance to the implementation stage.\nIf the user explicitly requests to bypass strict mode (e.g., \"override\", \"bypass strict\", \"just do it\"), you may proceed — but inform them that strict mode is being bypassed.\n</HARD-GATE>";
227
+ sections += "\n\n## Strict Mode — Edit (ACTIVE — CODE MODIFICATION BLOCKED)\n<HARD-GATE>\nStrict mode is enabled and there is NO active Generation.\nYou MUST NOT write, edit, or create any source code files.\nAllowed actions: reading files, analyzing code, answering questions, running commands.\nTo start coding, the user must first run `/reap.start` and advance to the implementation stage.\nIf the user explicitly requests to bypass strict mode (e.g., \"override\", \"bypass strict\", \"just do it\"), you may proceed for that specific action only — but inform them that strict mode is being bypassed. The bypass does NOT persist; strict mode re-engages immediately after the requested action is complete.\n</HARD-GATE>";
228
228
  } else {
229
- sections += `\n\n## Strict Mode — Edit (ACTIVE — CODE MODIFICATION BLOCKED)\n<HARD-GATE>\nStrict mode is enabled. Current stage is '${genStage}', which is NOT the implementation stage.\nYou MUST NOT write, edit, or create any source code files.\nAllowed actions: reading files, analyzing code, answering questions, running commands, writing REAP artifacts.\nAdvance to the implementation stage via the REAP lifecycle to unlock code modification.\nIf the user explicitly requests to bypass strict mode (e.g., \"override\", \"bypass strict\", \"just do it\"), you may proceed — but inform them that strict mode is being bypassed.\n</HARD-GATE>`;
229
+ sections += `\n\n## Strict Mode — Edit (ACTIVE — CODE MODIFICATION BLOCKED)\n<HARD-GATE>\nStrict mode is enabled. Current stage is '${genStage}', which is NOT the implementation stage.\nYou MUST NOT write, edit, or create any source code files.\nAllowed actions: reading files, analyzing code, answering questions, running commands, writing REAP artifacts.\nAdvance to the implementation stage via the REAP lifecycle to unlock code modification.\nIf the user explicitly requests to bypass strict mode (e.g., \"override\", \"bypass strict\", \"just do it\"), you may proceed for that specific action only — but inform them that strict mode is being bypassed. The bypass does NOT persist; strict mode re-engages immediately after the requested action is complete.\n</HARD-GATE>`;
230
230
  }
231
231
  }
232
232
 
233
233
  if (strictMerge) {
234
- sections += "\n\n## Strict Mode — Merge (ACTIVE)\nDirect git pull, git push, and git merge commands are restricted.\nUse REAP slash commands instead: `/reap.pull`, `/reap.push`, `/reap.merge.start`.\nThis ensures genome-first conflict resolution and proper lineage tracking.\nIf the user explicitly requests to bypass (e.g., \"override\", \"bypass strict\"), you may proceed — but inform them that strict merge mode is being bypassed.";
234
+ sections += "\n\n## Strict Mode — Merge (ACTIVE)\nDirect git pull, git push, and git merge commands are restricted.\nUse REAP slash commands instead: `/reap.pull`, `/reap.push`, `/reap.merge.start`.\nThis ensures genome-first conflict resolution and proper lineage tracking.\nIf the user explicitly requests to bypass (e.g., \"override\", \"bypass strict\"), you may proceed for that specific action only — but inform them that strict merge mode is being bypassed. The bypass does NOT persist; strict mode re-engages immediately after the requested action is complete.";
235
235
  }
236
236
 
237
237
  return sections;
@@ -200,7 +200,7 @@ When `strict: true` is set in `.reap/config.yml`, the AI agent enforces code mod
200
200
  | Active Generation, not implementation stage | **BLOCKED** | Read, analyze, answer questions, write REAP artifacts |
201
201
  | Active Generation, implementation stage | **SCOPED** — only files/modules listed in 02-planning.md | Full development within plan scope |
202
202
 
203
- - **Escape hatch**: If the user explicitly requests to bypass strict mode (e.g., "override", "bypass strict", "just do it"), the agent may proceed but must inform the user that strict mode is being bypassed.
203
+ - **Escape hatch**: If the user explicitly requests to bypass strict mode (e.g., "override", "bypass strict", "just do it"), the agent may proceed **for that specific action only** and must inform the user that strict mode is being bypassed. The bypass does NOT persist — strict mode re-engages immediately after the requested action is complete.
204
204
  - **Default**: `strict: false` (no restrictions beyond normal REAP workflow guidance).
205
205
 
206
206
  ## Critical Rules
@@ -6,7 +6,7 @@ const gl = require('./genome-loader.cjs');
6
6
 
7
7
  const startTime = Date.now();
8
8
  let step = 0;
9
- const totalSteps = 7;
9
+ const totalSteps = 8;
10
10
 
11
11
  function log(msg) {
12
12
  step++;
@@ -29,6 +29,9 @@ if (!gl.dirExists(reapDir)) {
29
29
  }
30
30
 
31
31
  // Step 0: Install project-level skill files (.claude/skills/{name}/SKILL.md)
32
+ // NOTE: This section is Claude Code-specific. Claude Code uses .claude/skills/ for
33
+ // slash command discovery. Other agents (Codex CLI, OpenCode) use different mechanisms
34
+ // (AGENTS.md, plugins) and this section is safely skipped when the directory doesn't exist.
32
35
  const fs = require('fs');
33
36
  const os = require('os');
34
37
  const userReapCommands = path.join(os.homedir(), '.reap', 'commands');
@@ -198,6 +201,25 @@ if (currentContent && currentContent.trim()) {
198
201
  initLines.push('⚪ No active Generation');
199
202
  }
200
203
 
204
+ // Integrity check via reap fix --check subprocess
205
+ log('Checking integrity...');
206
+ try {
207
+ require('child_process').execSync('reap fix --check', { encoding: 'utf-8', timeout: 5000, stdio: 'pipe' });
208
+ initLines.push('🟢 Integrity — OK');
209
+ } catch (integrityErr) {
210
+ const output = (integrityErr.stdout || '').trim();
211
+ const errorCount = (output.match(/✗/g) || []).length;
212
+ const warnCount = (output.match(/⚠/g) || []).length;
213
+ if (errorCount > 0 || warnCount > 0) {
214
+ const parts = [];
215
+ if (errorCount > 0) parts.push(`${errorCount} error${errorCount > 1 ? 's' : ''}`);
216
+ if (warnCount > 0) parts.push(`${warnCount} warning${warnCount > 1 ? 's' : ''}`);
217
+ initLines.push(`🔴 Integrity — ${parts.join(', ')}`);
218
+ } else {
219
+ initLines.push('🟡 Integrity — check failed');
220
+ }
221
+ }
222
+
201
223
  const initSummary = initLines.join('\n');
202
224
 
203
225
  // Load session-init format template and render
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c-d-cc/reap",
3
- "version": "0.15.1",
3
+ "version": "0.15.3",
4
4
  "description": "Recursive Evolutionary Autonomous Pipeline — AI and humans evolve software across generations",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,6 +40,7 @@ try {
40
40
  const agentDirs = [
41
41
  join(homedir(), ".claude", "commands"),
42
42
  join(homedir(), ".config", "opencode", "commands"),
43
+ join(homedir(), ".codex", "commands"),
43
44
  ];
44
45
  for (const agentDir of agentDirs) {
45
46
  if (!existsSync(agentDir)) continue;