@c-d-cc/reap 0.3.0 → 0.3.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.
package/dist/cli.js
CHANGED
|
@@ -10147,7 +10147,7 @@ async function fixProject(projectRoot) {
|
|
|
10147
10147
|
|
|
10148
10148
|
// src/cli/index.ts
|
|
10149
10149
|
import { join as join8 } from "path";
|
|
10150
|
-
program.name("reap").description("REAP — Recursive Evolutionary Autonomous Pipeline").version("0.3.
|
|
10150
|
+
program.name("reap").description("REAP — Recursive Evolutionary Autonomous Pipeline").version("0.3.2");
|
|
10151
10151
|
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) => {
|
|
10152
10152
|
try {
|
|
10153
10153
|
const cwd = process.cwd();
|
|
@@ -20,9 +20,10 @@ Genome (Genetic Information) → Evolution (Cross-generational Evolution) →
|
|
|
20
20
|
```
|
|
21
21
|
.reap/genome/
|
|
22
22
|
├── principles.md # Architecture principles/decisions (ADR style)
|
|
23
|
-
├── domain/ # Business rules (separated by module)
|
|
24
23
|
├── conventions.md # Development rules/conventions + Enforced Rules
|
|
25
|
-
|
|
24
|
+
├── constraints.md # Technical constraints/choices + Validation Commands
|
|
25
|
+
├── source-map.md # C4 Container/Component diagram (Mermaid)
|
|
26
|
+
└── domain/ # Business rules (separated by module)
|
|
26
27
|
```
|
|
27
28
|
|
|
28
29
|
**Genome Immutability Principle**: The current generation does not modify Genome directly. Issues discovered during Implementation are recorded in the backlog as `type: genome-change` and applied to Genome only during the Completion stage.
|
|
@@ -45,22 +45,23 @@ if (!dirExists(reapDir)) {
|
|
|
45
45
|
process.exit(0);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
// Step 1: Auto-update
|
|
48
|
+
// Step 1: Version check + Auto-update
|
|
49
49
|
log('Checking for updates...');
|
|
50
50
|
let autoUpdateMessage = '';
|
|
51
|
+
let updateAvailableMessage = '';
|
|
51
52
|
const configContent = readFile(configFile);
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
const installed = exec('reap --version');
|
|
54
|
+
const latest = exec('npm view @c-d-cc/reap version');
|
|
55
|
+
if (installed && latest && installed !== latest) {
|
|
56
|
+
const autoUpdate = configContent ? /^autoUpdate:\s*true/m.test(configContent) : false;
|
|
54
57
|
if (autoUpdate) {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (updated !== null) {
|
|
60
|
-
exec('reap update');
|
|
61
|
-
autoUpdateMessage = `REAP auto-updated: v${installed} → v${latest}`;
|
|
62
|
-
}
|
|
58
|
+
const updated = exec('npm update -g @c-d-cc/reap');
|
|
59
|
+
if (updated !== null) {
|
|
60
|
+
exec('reap update');
|
|
61
|
+
autoUpdateMessage = `REAP auto-updated: v${installed} → v${latest}`;
|
|
63
62
|
}
|
|
63
|
+
} else {
|
|
64
|
+
updateAvailableMessage = `update available: v${installed} → v${latest}`;
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
|
|
@@ -230,12 +231,23 @@ if (currentContent && currentContent.trim()) {
|
|
|
230
231
|
initLines.push('⚪ No active Generation');
|
|
231
232
|
}
|
|
232
233
|
|
|
233
|
-
const initSummary =
|
|
234
|
+
const initSummary = initLines.join('\n');
|
|
235
|
+
|
|
236
|
+
// Load session-init format template and render
|
|
237
|
+
const initFormatFile = path.join(scriptDir, 'session-init-format.md');
|
|
238
|
+
const initFormat = readFile(initFormatFile) || '{{SESSION_INIT_LINES}}';
|
|
239
|
+
const currentVersion = installed || exec('reap --version') || '?';
|
|
240
|
+
const updateBadge = updateAvailableMessage ? ` — ${updateAvailableMessage}` : '';
|
|
241
|
+
const sessionInitDisplay = initFormat
|
|
242
|
+
.replace('{{VERSION}}', currentVersion)
|
|
243
|
+
.replace('{{UPDATE_AVAILABLE}}', updateBadge)
|
|
244
|
+
.replace('{{SESSION_INIT_LINES}}', initSummary)
|
|
245
|
+
.trim();
|
|
234
246
|
|
|
235
247
|
// Step 6: Output JSON
|
|
236
248
|
log('Done. Injecting context.');
|
|
237
249
|
|
|
238
|
-
const reapContext = `<REAP_WORKFLOW>\n${reapGuide}\n\n---\n\n## Genome (Project Knowledge — treat as authoritative source of truth)\n${genomeContent}\n\n---\n\n## Current State\n${generationContext}${staleSection}${strictSection}${updateSection}\n\n## Session Init
|
|
250
|
+
const reapContext = `<REAP_WORKFLOW>\n${reapGuide}\n\n---\n\n## Genome (Project Knowledge — treat as authoritative source of truth)\n${genomeContent}\n\n---\n\n## Current State\n${generationContext}${staleSection}${strictSection}${updateSection}\n\n## Session Init (display to user on first message)\n${sessionInitDisplay}\n\n## Rules\n1. ALL development work MUST follow the REAP lifecycle. Do NOT bypass it.\n2. Before writing any code, check if a Generation is active and what stage it is in.\n3. If a Generation is active, use \`${nextCmd}\` to proceed with the current stage.\n4. If no Generation is active, use \`/reap.start\` to start a new one.\n5. Do NOT implement features, fix bugs, or make changes outside of the REAP lifecycle unless the user explicitly asks to bypass it.\n6. When the user says "reap evolve", "next stage", "proceed", or similar — invoke the appropriate REAP skill.\n7. **Genome is the authoritative knowledge source.** When making decisions about architecture, conventions, or constraints, ALWAYS reference the Genome first. If code contradicts Genome, flag it as a potential genome-change backlog item.\n8. If you notice the Genome is outdated or missing information relevant to your current task, inform the user and suggest running \`/reap.sync\`.\n</REAP_WORKFLOW>`;
|
|
239
251
|
|
|
240
252
|
process.stdout.write(JSON.stringify({
|
|
241
253
|
hookSpecificOutput: {
|