@c-d-cc/reap 0.9.0 → 0.9.1

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/dist/cli.js CHANGED
@@ -9771,6 +9771,7 @@ var COMMAND_NAMES = [
9771
9771
  "reap.sync.environment",
9772
9772
  "reap.help",
9773
9773
  "reap.update",
9774
+ "reap.report",
9774
9775
  "reap.merge.start",
9775
9776
  "reap.merge.detect",
9776
9777
  "reap.merge.mate",
@@ -9806,11 +9807,21 @@ async function initProject(projectRoot, projectName, entryMode, preset, onProgre
9806
9807
  await mkdir3(paths.backlog, { recursive: true });
9807
9808
  await mkdir3(paths.lineage, { recursive: true });
9808
9809
  log("Writing config.yml...");
9810
+ let hasGhCli = false;
9811
+ try {
9812
+ const { execSync } = await import("child_process");
9813
+ execSync("which gh", { stdio: "ignore" });
9814
+ hasGhCli = true;
9815
+ } catch {}
9816
+ if (!hasGhCli) {
9817
+ log("GitHub CLI(gh) not found. Install from https://cli.github.com for auto issue reporting.");
9818
+ }
9809
9819
  const config = {
9810
9820
  version: "0.1.0",
9811
9821
  project: projectName,
9812
9822
  entryMode,
9813
9823
  autoUpdate: true,
9824
+ autoIssueReport: hasGhCli,
9814
9825
  ...preset && { preset }
9815
9826
  };
9816
9827
  await ConfigManager.write(paths, config);
@@ -11059,7 +11070,7 @@ async function fixProject(projectRoot) {
11059
11070
  // src/cli/index.ts
11060
11071
  init_fs();
11061
11072
  import { join as join12 } from "path";
11062
- program.name("reap").description("REAP — Recursive Evolutionary Autonomous Pipeline").version("0.9.0");
11073
+ program.name("reap").description("REAP — Recursive Evolutionary Autonomous Pipeline").version("0.9.1");
11063
11074
  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) => {
11064
11075
  try {
11065
11076
  const cwd = process.cwd();
@@ -0,0 +1,127 @@
1
+ ---
2
+ description: "REAP Report — Report a bug or issue to the REAP project"
3
+ ---
4
+
5
+ # Report
6
+
7
+ Report a bug, malfunction, or feedback to the REAP project via GitHub Issue.
8
+ **Language**: All user-facing messages must follow the user's configured language setting (see REAP Guide § Language).
9
+
10
+ ## Gate (Preconditions)
11
+ - Check if `gh` CLI is available: `which gh`
12
+ - If not available: inform user that GitHub CLI is required (https://cli.github.com), then `gh auth login`. **STOP**
13
+ - Check if authenticated: `gh auth status`
14
+ - If not authenticated: inform user to run `gh auth login`. **STOP**
15
+ - Read `.reap/config.yml` — check `autoIssueReport` is not explicitly `false`
16
+ - If `autoIssueReport: false`: inform user that issue reporting is disabled and how to enable it in config.yml. **STOP**
17
+
18
+ ## Mode Detection
19
+
20
+ **Auto mode** (called by agent when malfunction detected):
21
+ - The agent provides error context as arguments
22
+ - Skip to Step 2 with pre-filled context
23
+
24
+ **Manual mode** (user calls `/reap.report` directly):
25
+ - Ask the user what they want to report:
26
+ - Bug / malfunction
27
+ - Feature request
28
+ - Other feedback
29
+ - Gather description from the user
30
+
31
+ ## Steps
32
+
33
+ ### 1. Collect Context
34
+ Automatically gather (do NOT ask the user for these):
35
+ - REAP version: `reap --version`
36
+ - Node version: `node --version`
37
+ - OS: `uname -sr`
38
+ - Agent: detect from environment (Claude Code, OpenCode, etc.)
39
+ - Generation state: read `.reap/life/current.yml` (id, stage — if active)
40
+ - Genome hash: compute from `.reap/genome/`
41
+ - Config: read `.reap/config.yml`
42
+
43
+ ### 2. Draft Issue
44
+
45
+ <PRIVACY_GATE>
46
+ **BEFORE writing any issue content, apply these rules:**
47
+ - Do NOT include: file contents, source code, environment variables, API keys,
48
+ tokens, passwords, usernames, email addresses, IP addresses, domain names,
49
+ database URLs, project-specific business logic, or any proprietary information.
50
+ - ONLY include: REAP version, Node version, OS, generation ID, stage name,
51
+ command name, genome hash, generic error messages, and REAP config structure
52
+ (with all values masked).
53
+ - When in doubt, OMIT the information rather than include it.
54
+ </PRIVACY_GATE>
55
+
56
+ Draft the issue using this template (issue body is always in English for the public repo):
57
+
58
+ ```markdown
59
+ ## {Bug Report / Feature Request / Feedback} (Auto-generated by REAP)
60
+
61
+ **REAP Version**: v{version}
62
+ **Node Version**: v{nodeVersion}
63
+ **OS**: {os}
64
+ **Agent**: {agentName}
65
+
66
+ ### Context
67
+ - **Generation**: {genId or "none"} (stage: {stage or "n/a"})
68
+ - **Command**: {command that triggered the issue}
69
+ - **Genome Hash**: {genomeHash}
70
+
71
+ ### Description
72
+ {user description or auto-detected malfunction description}
73
+
74
+ ### Expected Behavior
75
+ {what should have happened}
76
+
77
+ ### Actual Behavior
78
+ {what actually happened}
79
+
80
+ ### Steps to Reproduce
81
+ 1. {step}
82
+
83
+ ### Config
84
+ ```yaml
85
+ version: {version}
86
+ project: {projectName}
87
+ strict: {on/off}
88
+ autoUpdate: {on/off}
89
+ # all other values masked
90
+ ```
91
+
92
+ ---
93
+ *Auto-reported by REAP agent. Repository: c-d-cc/reap*
94
+ ```
95
+
96
+ ### 3. Post-format Sanitization
97
+ Scan the drafted issue body and mask/remove:
98
+ - Email patterns: `*@*.*` → `[REDACTED_EMAIL]`
99
+ - API key/token patterns: `sk-*`, `ghp_*`, `Bearer *`, `token:*` → `[REDACTED]`
100
+ - URLs with credentials: `https://user:pass@` → `https://[REDACTED]@`
101
+ - Environment variable values: `KEY=value` → `KEY=[REDACTED]`
102
+ - User paths: `/Users/{name}/` or `/home/{name}/` → `/Users/***/`
103
+ - IP addresses: digit patterns like `\d+\.\d+\.\d+\.\d+` → `[REDACTED_IP]`
104
+ - Source code blocks: if any project source code is included, remove it
105
+
106
+ ### 4. User Confirmation
107
+ Show the sanitized issue to the user (in user's language):
108
+ - Explain that this report greatly helps improve the REAP project
109
+ - Ask the user to verify no sensitive information is included
110
+ - Present the full issue body
111
+ - Ask: yes / no / edit
112
+ - **yes**: proceed to Step 5
113
+ - **no**: report cancelled
114
+ - **edit**: let user modify, then re-run Step 3 sanitization and re-confirm
115
+
116
+ ### 5. Submit
117
+ - Determine labels (comma-separated, always include `auto-reported`):
118
+ - Bug: `bug,auto-reported`
119
+ - Feature request: `enhancement,auto-reported`
120
+ - Feedback: `feedback,auto-reported`
121
+ - Add context labels if applicable: `lifecycle`, `genome`, `cli`
122
+ - Run: `gh issue create --repo c-d-cc/reap --title "{title}" --label "{labels}" --body "{sanitized body}"`
123
+ - Show the issue URL to the user
124
+ - Thank the user for their contribution to improving REAP
125
+
126
+ ## Completion
127
+ - "Issue #{number} reported: {url}"
@@ -21,7 +21,11 @@ description: "REAP Start — Start a new Generation"
21
21
 
22
22
  1. Ask the human for the goal of this generation (or use selected backlog item's goal)
23
23
  2. Count existing generations in `.reap/lineage/` to determine the genomeVersion
24
- 3. Generate the next generation ID (existing count + 1, in `gen-XXX-{hash}` format where `{hash}` is a short content hash)
24
+ 3. Generate the next generation ID:
25
+ - Format: `gen-{NNN}-{hash}` (e.g. `gen-042-a3f8c2`)
26
+ - `{NNN}`: zero-padded 3-digit sequence (existing count + 1)
27
+ - `{hash}`: 6-character hex (0-9a-f only) — first 6 chars of `sha256(JSON.stringify({parents, goal, genomeHash, machineId, startedAt}))`
28
+ - Generate: `node -e "const c=require('crypto'),o=require('os');console.log(c.createHash('sha256').update(JSON.stringify({parents:[],goal:'YOUR_GOAL',genomeHash:'',machineId:o.hostname(),startedAt:new Date().toISOString()})).digest('hex').slice(0,6))"`
25
29
  4. **If a backlog item was selected in Step 0**: now mark it as `status: consumed` and add `consumedBy: gen-XXX-{hash}` (using the ID just generated)
26
30
  6. Write the following to `current.yml`:
27
31
  ```yaml
@@ -58,6 +58,11 @@ Objective → Planning → Implementation ⟷ Validation → Completion
58
58
  ### Generation
59
59
  A single generation. Carries one goal through the Life Cycle. State is tracked in `life/current.yml`.
60
60
 
61
+ **Generation ID format**: `gen-{NNN}-{hash}` (e.g. `gen-042-a3f8c2`)
62
+ - `{hash}`: 6-char hex from sha256. **MUST be real hex (0-9a-f), NEVER words/slugs.**
63
+ - Lineage directory appends a goal slug: `gen-042-a3f8c2-fix-login-bug`
64
+ - See `/reap.start` for generation details.
65
+
61
66
  ### Backlog
62
67
  All items to be carried forward to the next generation are stored in `.reap/life/backlog/`. Each item uses markdown + frontmatter format:
63
68
  - `type: genome-change` — Applied to genome during Completion (genome defects discovered mid-generation)
@@ -199,3 +204,4 @@ When `strict: true` is set in `.reap/config.yml`, the AI agent enforces code mod
199
204
  3. **ALL development work MUST follow the REAP lifecycle.** Do NOT bypass it unless the human explicitly asks.
200
205
  4. **Genome is the authoritative source of truth.** When making any decision about architecture, conventions, constraints, or domain rules, ALWAYS consult the Genome first. If you observe code that contradicts the Genome, flag it as a potential `genome-change` backlog item. Do NOT silently ignore discrepancies.
201
206
  5. **Keep Genome fresh.** If you notice the Genome is missing information about current code patterns, or contains outdated information, inform the human and suggest `/reap.sync`. The human may choose to defer sync — respect that choice, but always flag the staleness.
207
+ 6. **Report malfunctions.** If you detect unexpected behavior during REAP operations (state inconsistency, command failure, corrupted files), suggest `/reap.report` to the user. This helps improve REAP for everyone.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c-d-cc/reap",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Recursive Evolutionary Autonomous Pipeline — AI and humans evolve software across generations",
5
5
  "type": "module",
6
6
  "license": "MIT",