@c-d-cc/reap 0.13.0 → 0.13.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.
package/README.ja.md CHANGED
@@ -28,10 +28,10 @@ REAPはアプリケーションの設計知識 — Genome(アーキテクチ
28
28
  - [なぜREAPか?](#なぜreapか)
29
29
  - [インストール](#インストール)
30
30
  - [クイックスタート](#クイックスタート)
31
- - [ライフサイクル](#ライフサイクル)
32
- - [コアコンセプト](#コアコンセプト)
31
+ - [ライフサイクル](#ライフサイクル-)
32
+ - [コアコンセプト](#コアコンセプト-)
33
33
  - [分散ワークフロー — 並行開発](#分散ワークフロー--並行開発)
34
- - [CLIコマンド](#cliコマンド)
34
+ - [CLIコマンド](#cliコマンド-)
35
35
  - [エージェント連携](#エージェント連携)
36
36
  - [`reap init`後のプロジェクト構造](#reap-init後のプロジェクト構造)
37
37
  - [系譜圧縮(Lineage Compression)](#系譜圧縮lineage-compression)
@@ -60,6 +60,8 @@ REAPは**世代ベースの進化モデル**でこれらの問題を解決しま
60
60
 
61
61
  ## インストール
62
62
 
63
+ > **グローバルインストール必須。** REAPはCLIツールであり、グローバルにインストールする必要があります。ローカルプロジェクトレベルのインストール(`npm i @c-d-cc/reap`)はブロックされます。
64
+
63
65
  ```bash
64
66
  # npm
65
67
  npm install -g @c-d-cc/reap
@@ -240,6 +242,24 @@ REAPはスラッシュコマンドとセッションフックを通じてAIエ
240
242
 
241
243
  v0.11.0より、28個のスラッシュコマンドが**1行`.md`ラッパー + TypeScriptスクリプト**構造に移行しました。各`.md`ファイルは`reap run <cmd>`を呼び出し、TSスクリプト(`src/cli/commands/run/`)がすべての決定論的ロジックを処理して、AIエージェントにstructured JSONで指示します。一貫性とテスト容易性が大幅に向上しました。
242
244
 
245
+ ### 署名ベースロック(Signature-Based Locking) [↗](https://reap.cc/docs/advanced)
246
+
247
+ REAPは暗号学的nonceチェーンを使用してステージの順序を強制します。ステージコマンドが実行されると、スクリプトがワンタイムnonceを生成し、そのハッシュを`current.yml`に保存して、nonceをAIエージェントに返します。`/reap.next`はこのnonceがなければ進行できず、なければ拒否されます。
248
+
249
+ ```
250
+ Stage Command current.yml /reap.next
251
+ ───────────── ─────────── ──────────
252
+ nonce生成 ────────────→ hash(nonce)を保存
253
+ AIにnonce返却 ←── AIがnonceを渡す
254
+ hash(nonce)を検証
255
+ ✓ ステージ前進
256
+ ```
257
+
258
+ これにより以下を防止します:
259
+ - **ステージのスキップ** — 実行されていないステージには有効なnonceが存在しない
260
+ - **トークンの偽造** — ハッシュは一方向であり、ハッシュからnonceを推測することは不可能
261
+ - **古いnonceの再利用** — 各nonceはワンタイムで、現在のステージにバインドされている
262
+
243
263
  ### autoSubagentモード
244
264
 
245
265
  `/reap.evolve`実行時、自動的にsubagentにGenerationライフサイクル全体を委任できます:
package/README.ko.md CHANGED
@@ -29,7 +29,7 @@ REAP은 Application의 설계 지식 — Genome(아키텍처, 컨벤션, 제약
29
29
  - [설치](#설치)
30
30
  - [빠른 시작](#빠른-시작)
31
31
  - [생애주기 (Life Cycle)](#생애주기-life-cycle)
32
- - [핵심 개념](#핵심-개념)
32
+ - [핵심 개념](#핵심-개념-)
33
33
  - [분산 워크플로우 — 병렬 개발](#분산-워크플로우--병렬-개발)
34
34
  - [CLI 명령어](#cli-명령어)
35
35
  - [에이전트 연동](#에이전트-연동)
@@ -60,6 +60,8 @@ REAP은 **세대 기반 진화 모델**로 이 문제들을 해결합니다:
60
60
 
61
61
  ## 설치
62
62
 
63
+ > **글로벌 설치 필수.** REAP은 CLI 도구이며 반드시 글로벌로 설치해야 합니다. 로컬 프로젝트 레벨 설치(`npm i @c-d-cc/reap`)는 차단됩니다.
64
+
63
65
  ```bash
64
66
  # npm
65
67
  npm install -g @c-d-cc/reap
@@ -240,6 +242,24 @@ REAP은 슬래시 커맨드와 세션 훅을 통해 AI 에이전트와 통합됩
240
242
 
241
243
  v0.11.0부터 28개 슬래시 커맨드가 **1줄 `.md` wrapper + TypeScript 스크립트** 구조로 전환되었습니다. 각 `.md` 파일은 `reap run <cmd>`를 호출하고, TS 스크립트(`src/cli/commands/run/`)가 모든 결정적 로직을 처리하여 AI에게 structured JSON으로 지시합니다. 일관성과 테스트 용이성이 크게 향상되었습니다.
242
244
 
245
+ ### 서명 기반 잠금 (Signature-Based Locking) [↗](https://reap.cc/docs/advanced)
246
+
247
+ REAP은 암호학적 nonce 체인을 사용하여 stage 순서를 강제합니다. stage 커맨드가 실행되면 스크립트가 일회용 nonce를 생성하여 해시를 `current.yml`에 저장하고, nonce를 AI 에이전트에게 반환합니다. `/reap.next`는 이 nonce가 있어야 다음 단계로 진행할 수 있으며, 없으면 진행이 거부됩니다.
248
+
249
+ ```
250
+ Stage Command current.yml /reap.next
251
+ ───────────── ─────────── ──────────
252
+ nonce 생성 ──────────→ hash(nonce) 저장
253
+ AI에게 nonce 반환 ←── AI가 nonce 전달
254
+ hash(nonce) 검증
255
+ ✓ stage 전진
256
+ ```
257
+
258
+ 이를 통해 방지하는 것:
259
+ - **Stage 건너뛰기** — 실행되지 않은 stage에는 유효한 nonce가 존재하지 않음
260
+ - **토큰 위조** — 해시는 단방향이므로 해시에서 nonce를 추측할 수 없음
261
+ - **이전 nonce 재사용** — 각 nonce는 일회용이며 현재 stage에 바인딩됨
262
+
243
263
  ### autoSubagent 모드
244
264
 
245
265
  `/reap.evolve` 실행 시 자동으로 subagent에게 Generation lifecycle 전체를 위임할 수 있습니다:
package/README.md CHANGED
@@ -28,13 +28,13 @@ REAP captures an application's design knowledge — the Genome (architecture, co
28
28
  - [Why REAP?](#why-reap)
29
29
  - [Installation](#installation)
30
30
  - [Quick Start](#quick-start)
31
- - [Life Cycle](#life-cycle)
32
- - [Core Concepts](#core-concepts)
33
- - [Distributed Workflow for Parallel Development](#distributed-workflow-for-parallel-development)
34
- - [CLI Commands](#cli-commands)
31
+ - [Life Cycle](#life-cycle-)
32
+ - [Core Concepts](#core-concepts-)
33
+ - [Distributed Workflow](#distributed-workflow-)
34
+ - [CLI Commands](#cli-commands-)
35
35
  - [Agent Integration](#agent-integration)
36
36
  - [Project Structure](#project-structure-after-reap-init)
37
- - [Lineage Compression](#lineage-compression)
37
+ - [Lineage Compression](#lineage-compression-)
38
38
  - [Evolution Flow](#evolution-flow)
39
39
  - [Presets](#presets)
40
40
  - [Entry Modes](#entry-modes)
@@ -60,6 +60,8 @@ REAP solves these with a **generation-based evolution model**:
60
60
 
61
61
  ## Installation
62
62
 
63
+ > **Global installation required.** REAP is a CLI tool and must be installed globally. Local project-level installation (`npm i @c-d-cc/reap`) is blocked.
64
+
63
65
  ```bash
64
66
  # npm
65
67
  npm install -g @c-d-cc/reap
@@ -239,6 +241,24 @@ REAP integrates with AI agents through slash commands and session hooks. Current
239
241
 
240
242
  Since v0.11.0, all 28 slash commands follow a **1-line `.md` wrapper + TypeScript script** pattern. Each `.md` file simply calls `reap run <cmd>`, and the TS script (`src/cli/commands/run/`) handles all deterministic logic — returning structured JSON instructions for the AI agent. This ensures consistency and testability.
241
243
 
244
+ ### Signature-Based Locking [↗](https://reap.cc/docs/advanced)
245
+
246
+ REAP uses a cryptographic nonce chain to enforce stage ordering. When a stage command runs, the script generates a one-time nonce, stores its hash in `current.yml`, and returns the nonce to the AI agent. `/reap.next` requires this nonce to advance — without it, progression is rejected.
247
+
248
+ ```
249
+ Stage Command current.yml /reap.next
250
+ ───────────── ─────────── ──────────
251
+ generate nonce ──────→ store hash(nonce)
252
+ return nonce to AI ←── AI passes nonce
253
+ verify hash(nonce)
254
+ ✓ advance stage
255
+ ```
256
+
257
+ This prevents:
258
+ - **Skipping stages** — no valid nonce exists for stages that were not executed
259
+ - **Forging tokens** — the hash is one-way; guessing the nonce from the hash is infeasible
260
+ - **Replaying old nonces** — each nonce is single-use and bound to the current stage
261
+
242
262
  ### autoSubagent Mode
243
263
 
244
264
  When `/reap.evolve` is run, REAP can automatically delegate the entire generation lifecycle to a subagent. This is controlled by:
package/README.zh-CN.md CHANGED
@@ -28,10 +28,10 @@ REAP记录应用程序的设计知识 — Genome(架构、约定、约束)
28
28
  - [为什么选择REAP?](#为什么选择reap)
29
29
  - [安装](#安装)
30
30
  - [快速开始](#快速开始)
31
- - [生命周期](#生命周期)
32
- - [核心概念](#核心概念)
31
+ - [生命周期](#生命周期-)
32
+ - [核心概念](#核心概念-)
33
33
  - [分布式工作流 — 并行开发](#分布式工作流--并行开发)
34
- - [CLI命令](#cli命令)
34
+ - [CLI命令](#cli命令-)
35
35
  - [代理集成](#代理集成)
36
36
  - [`reap init`后的项目结构](#reap-init后的项目结构)
37
37
  - [谱系压缩(Lineage Compression)](#谱系压缩lineage-compression)
@@ -60,6 +60,8 @@ REAP通过**基于世代的进化模型**解决这些问题:
60
60
 
61
61
  ## 安装
62
62
 
63
+ > **必须全局安装。** REAP是CLI工具,必须全局安装。本地项目级安装(`npm i @c-d-cc/reap`)将被阻止。
64
+
63
65
  ```bash
64
66
  # npm
65
67
  npm install -g @c-d-cc/reap
@@ -240,6 +242,24 @@ REAP通过斜杠命令和会话钩子与AI代理集成。当前支持的代理
240
242
 
241
243
  从v0.11.0开始,28个斜杠命令全部采用**1行`.md` wrapper + TypeScript脚本**模式。每个`.md`文件仅调用`reap run <cmd>`,TS脚本(`src/cli/commands/run/`)处理所有确定性逻辑,以structured JSON形式指示AI代理。大幅提升了一致性和可测试性。
242
244
 
245
+ ### 签名锁定(Signature-Based Locking) [↗](https://reap.cc/docs/advanced)
246
+
247
+ REAP使用加密nonce链来强制执行阶段顺序。当阶段命令运行时,脚本生成一次性nonce,将其哈希存储在`current.yml`中,并将nonce返回给AI代理。`/reap.next`需要此nonce才能推进 — 没有它,推进将被拒绝。
248
+
249
+ ```
250
+ Stage Command current.yml /reap.next
251
+ ───────────── ─────────── ──────────
252
+ 生成nonce ────────────→ 存储hash(nonce)
253
+ 将nonce返回给AI ←── AI传递nonce
254
+ 验证hash(nonce)
255
+ ✓ 阶段推进
256
+ ```
257
+
258
+ 这可以防止:
259
+ - **跳过阶段** — 未执行的阶段不存在有效的nonce
260
+ - **伪造令牌** — 哈希是单向的,从哈希推测nonce是不可行的
261
+ - **重放旧nonce** — 每个nonce是一次性的,绑定到当前阶段
262
+
243
263
  ### autoSubagent模式
244
264
 
245
265
  执行`/reap.evolve`时,可自动将整个Generation生命周期委托给subagent:
package/dist/cli.js CHANGED
@@ -13619,7 +13619,7 @@ async function runCommand(command, phase, argv = []) {
13619
13619
  try {
13620
13620
  const config = await ConfigManager.read(paths);
13621
13621
  if (config.autoIssueReport) {
13622
- const version = "0.13.0";
13622
+ const version = "0.13.3";
13623
13623
  const errMsg = err instanceof Error ? err.message : String(err);
13624
13624
  const title = `[auto] reap run ${command}: ${errMsg.slice(0, 80)}`;
13625
13625
  const body = [
@@ -14205,7 +14205,7 @@ async function initProject(projectRoot, projectName, entryMode, preset, onProgre
14205
14205
  }
14206
14206
  const detectedLanguage = await AgentRegistry.readLanguage();
14207
14207
  const config = {
14208
- version: "0.13.0",
14208
+ version: "0.13.3",
14209
14209
  project: projectName,
14210
14210
  entryMode,
14211
14211
  strict: false,
@@ -14804,7 +14804,7 @@ async function updateProject(projectRoot, dryRun = false) {
14804
14804
  result.skipped.push(`.claude/commands/ (${reapCmdFiles.length} unchanged)`);
14805
14805
  }
14806
14806
  await migrateLegacyFiles(paths, dryRun, result);
14807
- const currentVersion = "0.13.0";
14807
+ const currentVersion = "0.13.3";
14808
14808
  const migrationResult = await MigrationRunner.run(paths, currentVersion, dryRun);
14809
14809
  for (const m of migrationResult.migrated) {
14810
14810
  result.updated.push(`[migration] ${m}`);
@@ -15002,7 +15002,7 @@ init_fs();
15002
15002
  init_version();
15003
15003
  init_config();
15004
15004
  import { join as join26 } from "path";
15005
- program.name("reap").description("REAP — Recursive Evolutionary Autonomous Pipeline").version("0.13.0");
15005
+ program.name("reap").description("REAP — Recursive Evolutionary Autonomous Pipeline").version("0.13.3");
15006
15006
  program.command("init").description("Initialize a new REAP project (Genesis)").argument("[project-name]", "Project name (defaults to current directory name)").option("-m, --mode <mode>", "Entry mode: greenfield, migration, adoption", "greenfield").option("-p, --preset <preset>", "Bootstrap with a genome preset (e.g., bun-hono-react)").action(async (projectName, options) => {
15007
15007
  try {
15008
15008
  const cwd = process.cwd();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c-d-cc/reap",
3
- "version": "0.13.0",
3
+ "version": "0.13.3",
4
4
  "description": "Recursive Evolutionary Autonomous Pipeline — AI and humans evolve software across generations",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,14 +24,17 @@
24
24
  },
25
25
  "files": [
26
26
  "dist/",
27
- "scripts/postinstall.cjs"
27
+ "scripts/postinstall.cjs",
28
+ "scripts/preinstall.cjs"
28
29
  ],
30
+ "preferGlobal": true,
29
31
  "engines": {
30
32
  "node": ">=18"
31
33
  },
32
34
  "scripts": {
33
35
  "dev": "bun run src/cli/index.ts",
34
36
  "build": "node scripts/build.js",
37
+ "preinstall": "node scripts/preinstall.cjs",
35
38
  "postinstall": "node scripts/postinstall.cjs",
36
39
  "prepublishOnly": "npm run build",
37
40
  "test": "bun test"
@@ -10,6 +10,14 @@ const { join, dirname } = require("path");
10
10
  const { homedir } = require("os");
11
11
 
12
12
  try {
13
+ // Warn if installed locally instead of globally
14
+ const isGlobal = process.env.npm_config_global === "true"
15
+ || (process.env.npm_config_prefix && !process.env.npm_config_prefix.includes("node_modules"));
16
+ if (!isGlobal) {
17
+ console.warn("\n ⚠ @c-d-cc/reap is a CLI tool and should be installed globally:");
18
+ console.warn(" npm install -g @c-d-cc/reap\n");
19
+ }
20
+
13
21
  // Resolve commands source: dist/templates/commands/ relative to this script
14
22
  const commandsSource = join(dirname(__dirname), "dist", "templates", "commands");
15
23
  if (!existsSync(commandsSource)) {
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * preinstall — block local (non-global) installation.
4
+ * REAP is a CLI tool and must be installed globally.
5
+ * Skipped in CI and development environments.
6
+ */
7
+ const isCi = process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true";
8
+ const isDev = process.env.npm_command === "install" && process.cwd().includes("reap");
9
+ if (!isCi && !isDev && process.env.npm_config_global !== "true") {
10
+ console.error("\n ✗ @c-d-cc/reap is a CLI tool. Install globally:\n npm install -g @c-d-cc/reap\n");
11
+ process.exit(1);
12
+ }