chati-dev 4.2.1 → 4.3.0
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.md +80 -53
- package/bin/chati.js +150 -5
- package/framework/agents/build/dev.md +509 -76
- package/framework/agents/deploy/devops.md +40 -25
- package/framework/agents/discover/brief.md +156 -22
- package/framework/agents/discover/brownfield-wu.md +24 -14
- package/framework/agents/discover/greenfield-wu.md +100 -14
- package/framework/agents/plan/architect-data-engineer.md +6 -6
- package/framework/agents/plan/architect-system.md +46 -12
- package/framework/agents/plan/architect.md +40 -20
- package/framework/agents/plan/detail.md +36 -24
- package/framework/agents/plan/phases.md +36 -26
- package/framework/agents/plan/tasks.md +114 -33
- package/framework/agents/plan/ux-brand-architect.md +240 -8
- package/framework/agents/plan/ux-component-engineer.md +28 -13
- package/framework/agents/plan/ux-researcher.md +7 -6
- package/framework/agents/plan/ux.md +55 -22
- package/framework/agents/quality/qa-implementation.md +143 -74
- package/framework/agents/quality/qa-planning.md +115 -42
- package/framework/agents/quality/qa-visual.md +439 -0
- package/framework/agents/shared/visualizer.md +128 -0
- package/framework/config.yaml +8 -7
- package/framework/constitution.md +127 -43
- package/framework/context/governance.md +12 -7
- package/framework/context/quality.md +6 -5
- package/framework/context/root.md +6 -6
- package/framework/data/entity-registry.yaml +377 -4
- package/framework/data/model-limits.json +19 -0
- package/framework/domains/agents/qa-visual.yaml +74 -0
- package/framework/domains/constitution.yaml +46 -2
- package/framework/domains/workflows/greenfield-fullstack.yaml +2 -2
- package/framework/hooks/advance-trigger.js +131 -0
- package/framework/hooks/brief-validator.js +83 -0
- package/framework/hooks/constitution-guard.js +91 -36
- package/framework/hooks/license-guard.js +129 -190
- package/framework/hooks/mode-governance.js +68 -16
- package/framework/hooks/model-governance.js +19 -8
- package/framework/hooks/package.json +3 -0
- package/framework/hooks/post-dev.js +207 -0
- package/framework/hooks/prism-engine.js +288 -105
- package/framework/hooks/read-protection.js +37 -9
- package/framework/hooks/reasoning-escalator.js +371 -0
- package/framework/hooks/reference-trigger.js +117 -0
- package/framework/hooks/session-digest.js +94 -20
- package/framework/hooks/settings.json +32 -1
- package/framework/hooks/style-guard.js +52 -13
- package/framework/hooks/team-quality-gate.js +58 -25
- package/framework/hooks/undercover-guard.js +34 -13
- package/framework/i18n/en.yaml +3 -3
- package/framework/i18n/es.yaml +3 -3
- package/framework/i18n/fr.yaml +3 -3
- package/framework/i18n/pt.yaml +3 -3
- package/framework/intelligence/context-engine.md +4 -5
- package/framework/intelligence/decision-engine.md +1 -1
- package/framework/intelligence/hooks-performance.md +3 -3
- package/framework/migrations/v1.0-to-v1.1.yaml +1 -1
- package/framework/migrations/v1.4-to-v2.0.yaml +11 -11
- package/framework/migrations/v4.0-to-v4.1.yaml +2 -2
- package/framework/migrations/v4.2-to-v4.3.yaml +29 -0
- package/framework/orchestrator/chati-router.js +387 -0
- package/framework/orchestrator/chati-update.md +40 -40
- package/framework/orchestrator/chati.md +318 -115
- package/framework/scaffold/motion-premium/README.md +89 -0
- package/framework/scaffold/motion-premium/app/globals.css.template +400 -0
- package/framework/scaffold/motion-premium/app/layout.tsx.template +110 -0
- package/framework/scaffold/motion-premium/components/animation/BackgroundCrossfadeProvider.tsx.template +170 -0
- package/framework/scaffold/motion-premium/components/animation/LenisProvider.tsx.template +49 -0
- package/framework/scaffold/motion-premium/components/animation/PageTransitionWrapper.tsx.template +83 -0
- package/framework/scaffold/motion-premium/components/animation/Preloader.tsx.template +171 -0
- package/framework/scaffold/motion-premium/components/ui/Container.tsx.template +69 -0
- package/framework/scaffold/motion-premium/components/ui/PageSection.tsx.template +74 -0
- package/framework/scaffold/motion-premium/lib/animations/gsap.ts.template +112 -0
- package/framework/scaffold/motion-premium/lib/animations/refreshCoordinator.ts.template +75 -0
- package/framework/scaffold/motion-premium/lib/animations/tokens.ts.template +119 -0
- package/framework/scaffold/motion-premium/lib/animations/useGsapContext.ts.template +92 -0
- package/framework/scaffold/motion-premium/lib/animations/useScrollSnapStepper.ts.template +265 -0
- package/framework/scaffold/motion-premium/lib/animations/useSmoothScroll.ts.template +67 -0
- package/framework/scaffold/motion-premium/lib/brand.ts.template +43 -0
- package/framework/scaffold/motion-premium/scaffold.yaml +174 -0
- package/framework/scaffold/motion-premium-3d/README.md +80 -0
- package/framework/scaffold/motion-premium-3d/app/(3d)/scroll-demo/ScrollDemoCanvas.tsx.template +81 -0
- package/framework/scaffold/motion-premium-3d/app/(3d)/scroll-demo/ScrollDemoClient.tsx.template +75 -0
- package/framework/scaffold/motion-premium-3d/app/(3d)/scroll-demo/page.tsx.template +26 -0
- package/framework/scaffold/motion-premium-3d/components/3d/CameraRig.tsx.template +100 -0
- package/framework/scaffold/motion-premium-3d/components/3d/CanvasProvider.tsx.template +85 -0
- package/framework/scaffold/motion-premium-3d/components/3d/InvalidateOnScroll.tsx.template +51 -0
- package/framework/scaffold/motion-premium-3d/components/3d/MeshCrossfade.tsx.template +79 -0
- package/framework/scaffold/motion-premium-3d/components/3d/ScrollCrossfade.tsx.template +88 -0
- package/framework/scaffold/motion-premium-3d/components/3d/ScrollScene.tsx.template +121 -0
- package/framework/scaffold/motion-premium-3d/components/webgl/SceneFallback.tsx.template +65 -0
- package/framework/scaffold/motion-premium-3d/components/webgl/WebGLContext.tsx.template +68 -0
- package/framework/scaffold/motion-premium-3d/lib/webgl/detect.ts.template +69 -0
- package/framework/scaffold/motion-premium-3d/scaffold.yaml +133 -0
- package/framework/schemas/session.schema.json +109 -21
- package/framework/scripts/reference-capture.js +430 -0
- package/framework/scripts/visual-qa.js +674 -0
- package/framework/tasks/orchestrator-handoff.md +1 -1
- package/framework/tasks/orchestrator-resume.md +1 -1
- package/framework/tasks/orchestrator-route.md +1 -1
- package/framework/tasks/orchestrator-status.md +3 -3
- package/framework/tasks/qa-planning-gate-define.md +1 -1
- package/framework/templates/brandbook-html-tmpl.md +1 -1
- package/framework/templates/brandbook-tmpl.yaml +1 -1
- package/framework/templates/component-spec-tmpl.yaml +1 -1
- package/framework/templates/design-token-tmpl.yaml +1 -1
- package/framework/templates/icon-system-tmpl.yaml +1 -1
- package/framework/templates/team-planning-tasks.yaml +6 -5
- package/framework/workflows/brownfield-discovery.yaml +2 -2
- package/framework/workflows/brownfield-fullstack.yaml +15 -11
- package/framework/workflows/brownfield-service.yaml +14 -10
- package/framework/workflows/brownfield-ui.yaml +15 -11
- package/framework/workflows/greenfield-fullstack.yaml +16 -13
- package/framework/workflows/quick-flow.yaml +3 -3
- package/framework/workflows/standard-flow.yaml +12 -9
- package/package.json +10 -5
- package/src/autonomy/autonomous-gate.js +1 -0
- package/src/autonomy/build-state.js +1 -2
- package/src/autonomy/progress-reporter.js +1 -1
- package/src/config/agent-customizer.js +11 -3
- package/src/config/claude-settings-generator.js +226 -0
- package/src/config/context-file-generator.js +41 -21
- package/src/config/framework-adapter.js +1 -0
- package/src/config/gemini-hooks-generator.js +76 -6
- package/src/config/mcp-configs.js +1 -0
- package/src/context/layers/l1-global.js +2 -1
- package/src/dashboard/data-reader.js +4 -3
- package/src/dashboard/layout.js +2 -1
- package/src/decision/analyzer.js +6 -30
- package/src/decision/engine.js +4 -28
- package/src/decision/registry-healer.js +3 -2
- package/src/decision/registry-updater.js +23 -14
- package/src/extensions/loader.js +2 -8
- package/src/gates/g1-planning-complete.js +2 -1
- package/src/gates/g2-qa-planning.js +2 -1
- package/src/gates/g3-implementation.js +2 -1
- package/src/gates/g4-qa-implementation.js +3 -2
- package/src/gates/g5-deploy-ready.js +2 -1
- package/src/health/engine.js +4 -3
- package/src/installer/core.js +557 -81
- package/src/installer/preflight.js +131 -0
- package/src/installer/provider-overlay.js +3 -3
- package/src/installer/scaffold-applier.js +358 -0
- package/src/installer/templates.js +52 -31
- package/src/installer/validator.js +17 -12
- package/src/intelligence/registry-manager.js +22 -29
- package/src/intelligence/timeline.js +11 -6
- package/src/license/commands.js +1 -1
- package/src/license/wait.js +102 -0
- package/src/memory/agent-memory.js +81 -0
- package/src/memory/dream.js +32 -1
- package/src/merger/replace-merger.js +28 -15
- package/src/orchestrator/agent-selector.js +2 -1
- package/src/orchestrator/cli.js +1908 -80
- package/src/orchestrator/doctor.js +270 -0
- package/src/orchestrator/handoff-engine.js +4 -3
- package/src/orchestrator/index.js +2 -0
- package/src/orchestrator/pipeline-manager.js +306 -15
- package/src/orchestrator/session-manager.js +331 -6
- package/src/tasks/handoff.js +3 -2
- package/src/telemetry/config.js +4 -3
- package/src/telemetry/schema.js +1 -0
- package/src/terminal/collector.js +3 -2
- package/src/terminal/index.js +1 -2
- package/src/terminal/isolation.js +52 -18
- package/src/terminal/prompt-builder.js +42 -25
- package/src/terminal/run-parallel.js +1 -1
- package/src/terminal/run-team.js +3 -3
- package/src/terminal/team-task-list.js +43 -4
- package/src/upgrade/backup.js +3 -2
- package/src/upgrade/checker.js +3 -2
- package/src/upgrade/migrator.js +65 -7
- package/src/upgrade/tracked-files-detector.js +86 -0
- package/src/upgrade/user-messages.js +94 -0
- package/src/utils/config-parser.js +2 -1
- package/src/utils/feature-flags.js +2 -1
- package/src/utils/flatten-entities.js +69 -0
- package/src/utils/framework-dir.js +16 -0
- package/src/utils/model-id.js +85 -0
- package/src/utils/provider-limits.js +84 -23
- package/src/utils/schema-validator.js +1 -1
- package/src/wizard/i18n.js +5 -4
- package/src/wizard/index.js +14 -0
- package/assets/logo - c/303/263pia.png +0 -0
- package/assets/logo.svg +0 -42
- package/assets/logo2.png +0 -0
- package/assets/social-preview.png +0 -0
- package/scripts/bundle-framework.js +0 -69
- package/scripts/changelog-generator.js +0 -222
- package/scripts/codebase-mapper.js +0 -728
- package/scripts/commit-message-generator.js +0 -167
- package/scripts/coverage-analyzer.js +0 -260
- package/scripts/dependency-analyzer.js +0 -280
- package/scripts/doctor/checks/agents.js +0 -77
- package/scripts/doctor/checks/constitution.js +0 -41
- package/scripts/doctor/checks/domain-alignment.js +0 -58
- package/scripts/doctor/checks/prism-layers.js +0 -84
- package/scripts/doctor/checks/registry.js +0 -55
- package/scripts/doctor/checks/schemas.js +0 -61
- package/scripts/doctor/fixes/reference-fix.js +0 -100
- package/scripts/doctor/fixes/registry-fix.js +0 -56
- package/scripts/doctor/index.js +0 -212
- package/scripts/framework-analyzer.js +0 -308
- package/scripts/generate-constitution-domain.js +0 -253
- package/scripts/generate-signing-key.js +0 -33
- package/scripts/health-check.js +0 -481
- package/scripts/ide-sync.js +0 -326
- package/scripts/performance-analyzer.js +0 -325
- package/scripts/plan-tracker.js +0 -278
- package/scripts/populate-entity-registry.js +0 -481
- package/scripts/pr-review.js +0 -317
- package/scripts/rollback-manager.js +0 -310
- package/scripts/semantic-lint.js +0 -328
- package/scripts/sign-manifest.js +0 -53
- package/scripts/stuck-detector.js +0 -343
- package/scripts/test-quality-assessment.js +0 -257
- package/scripts/validate-agents.js +0 -368
- package/scripts/validate-package.js +0 -367
- package/scripts/validate-tasks.js +0 -465
- package/src/autonomy/worktree-manager.js +0 -250
- package/src/intelligence/decision-engine.js +0 -256
- package/src/intelligence/document-sharder.js +0 -221
- package/src/intelligence/elicitation.js +0 -265
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
migration:
|
|
2
|
+
from: "4.2.0"
|
|
3
|
+
to: "4.3.0"
|
|
4
|
+
description: "Framework/user separation hardening: comprehensive .gitignore, tracked-file detection, runtime boundary fixes"
|
|
5
|
+
breaking: false
|
|
6
|
+
|
|
7
|
+
# This migration ensures users upgrading from any v4.2.x to v4.3.0 get:
|
|
8
|
+
# 1. The new comprehensive .gitignore (covers .chati.dev/, .chati/, providers, etc.)
|
|
9
|
+
# 2. Detection + warning if framework files are already tracked in git
|
|
10
|
+
# 3. New 4.3.0 runtime boundary fixes (delivered via copyFrameworkFiles, this is a no-op step)
|
|
11
|
+
#
|
|
12
|
+
# Step types `update_gitignore` and `warn_tracked_files` are introduced in 4.3.0
|
|
13
|
+
# and require src/upgrade/migrator.js >= the corresponding feature.
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
# Step 1: Update .gitignore to the comprehensive 4.3.0 template.
|
|
17
|
+
# Idempotent: detects old marker (pre-4.3.0) and replaces; detects new marker and replaces.
|
|
18
|
+
# Merges with user's existing .gitignore (does not overwrite user content outside the chati block).
|
|
19
|
+
- type: update_gitignore
|
|
20
|
+
description: "Replace minimal pre-4.3.0 .gitignore block with comprehensive framework exclusions"
|
|
21
|
+
|
|
22
|
+
# Step 2: Detect framework files already tracked in git history (pre-4.3.0 leaks).
|
|
23
|
+
# Non-blocking: prints a warning with exact `git rm --cached` commands.
|
|
24
|
+
# User decides when/whether to clean up history.
|
|
25
|
+
- type: warn_tracked_files
|
|
26
|
+
description: "Warn if framework files were committed before .gitignore was fixed"
|
|
27
|
+
|
|
28
|
+
# Validation: nothing critical to verify (gitignore content is variable per user).
|
|
29
|
+
# The warn_tracked_files step itself acts as observability.
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* chati-router.js — Deterministic Pipeline Router
|
|
4
|
+
*
|
|
5
|
+
* Runs ALL deterministic logic BEFORE Claude processes anything:
|
|
6
|
+
* 1. License validation + integrity check
|
|
7
|
+
* 2. Session state read
|
|
8
|
+
* 3. Pipeline routing (orchestrate next)
|
|
9
|
+
* 4. Team registration (orchestrate spawn-team) if needed
|
|
10
|
+
*
|
|
11
|
+
* Outputs a single JSON object that Claude consumes. Claude cannot skip
|
|
12
|
+
* any of these steps because they already ran as code.
|
|
13
|
+
*
|
|
14
|
+
* Usage (from .claude/commands/chati.md):
|
|
15
|
+
* node chati.dev/orchestrator/chati-router.js
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { existsSync, readFileSync } from 'fs';
|
|
19
|
+
import { join } from 'path';
|
|
20
|
+
|
|
21
|
+
const PROJECT_DIR = process.cwd();
|
|
22
|
+
const ROUTER_ARGS = process.argv.slice(2);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Find the chati-dev CLI module. Tries local node_modules first (fast),
|
|
26
|
+
* then monorepo dev layout. Returns the module or null.
|
|
27
|
+
*/
|
|
28
|
+
async function findCliModule(projectDir) {
|
|
29
|
+
// Resolve framework dir (.chati.dev/ or chati.dev/ for legacy)
|
|
30
|
+
const fwDir = existsSync(join(projectDir, '.chati.dev')) ? '.chati.dev' : 'chati.dev';
|
|
31
|
+
const candidates = [
|
|
32
|
+
// PRIMARY: bundled CLI inside framework dir (self-contained install — no npx needed)
|
|
33
|
+
join(projectDir, fwDir, '_cli', 'orchestrator', 'cli.js'),
|
|
34
|
+
// Fallback: node_modules inside .chati.dev/
|
|
35
|
+
join(projectDir, fwDir, 'node_modules', 'chati-dev', 'src', 'orchestrator', 'cli.js'),
|
|
36
|
+
// Fallback: legacy node_modules at project root
|
|
37
|
+
join(projectDir, 'node_modules', 'chati-dev', 'src', 'orchestrator', 'cli.js'),
|
|
38
|
+
// Fallback: monorepo dev layout
|
|
39
|
+
join(projectDir, '..', '..', 'packages', 'chati-dev', 'src', 'orchestrator', 'cli.js'),
|
|
40
|
+
join(projectDir, '..', '..', '..', 'packages', 'chati-dev', 'src', 'orchestrator', 'cli.js'),
|
|
41
|
+
];
|
|
42
|
+
for (const p of candidates) {
|
|
43
|
+
if (existsSync(p)) {
|
|
44
|
+
try { return await import(p); } catch { /* continue */ }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// Last resort: Node module resolution (global install)
|
|
48
|
+
try {
|
|
49
|
+
const { createRequire } = await import('module');
|
|
50
|
+
const require = createRequire(join(projectDir, 'package.json'));
|
|
51
|
+
const cliPath = require.resolve('chati-dev/src/orchestrator/cli.js');
|
|
52
|
+
return await import(cliPath);
|
|
53
|
+
} catch { /* not installed globally */ }
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Call runOrchestrate and capture its stdout JSON output.
|
|
59
|
+
*/
|
|
60
|
+
async function captureOrchestrate(mod, subCommand, args, projectDir) {
|
|
61
|
+
const chunks = [];
|
|
62
|
+
const origWrite = process.stdout.write;
|
|
63
|
+
process.stdout.write = (c) => { chunks.push(c); return true; };
|
|
64
|
+
try {
|
|
65
|
+
await mod.runOrchestrate(subCommand, args, projectDir);
|
|
66
|
+
} finally {
|
|
67
|
+
process.stdout.write = origWrite;
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
return JSON.parse(chunks.join(''));
|
|
71
|
+
} catch (e) {
|
|
72
|
+
return { action: 'error', error: `invalid_json: ${e.message}` };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Route `advance` command deterministically — same reliability as `next`.
|
|
78
|
+
* Called as: node chati-router.js advance --agent {name} --score {score}
|
|
79
|
+
*/
|
|
80
|
+
async function routeAdvance(agentName, score) {
|
|
81
|
+
const result = {
|
|
82
|
+
ok: true,
|
|
83
|
+
advanced: false,
|
|
84
|
+
agent: agentName,
|
|
85
|
+
score: parseInt(score, 10),
|
|
86
|
+
next: null,
|
|
87
|
+
team: null,
|
|
88
|
+
error: null,
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
try {
|
|
92
|
+
const cliMod = await findCliModule(PROJECT_DIR);
|
|
93
|
+
if (!cliMod) {
|
|
94
|
+
result.ok = false;
|
|
95
|
+
result.error = 'cli_module_not_found';
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const advanceResult = await captureOrchestrate(cliMod, 'advance',
|
|
100
|
+
['--agent', agentName, '--score', String(score)], PROJECT_DIR);
|
|
101
|
+
|
|
102
|
+
result.advanced = advanceResult.advanced || false;
|
|
103
|
+
result.already_advanced = advanceResult.already_advanced || false;
|
|
104
|
+
if (advanceResult.status_summary) result.status_summary = advanceResult.status_summary;
|
|
105
|
+
result.next = advanceResult.next || advanceResult;
|
|
106
|
+
|
|
107
|
+
// If next action is spawn_team, register team immediately (deterministic)
|
|
108
|
+
if (result.next && result.next.action === 'spawn_team') {
|
|
109
|
+
const teamType = result.next.team_type || 'build';
|
|
110
|
+
const prevAgent = agentName;
|
|
111
|
+
try {
|
|
112
|
+
const teamResult = await captureOrchestrate(cliMod, 'spawn-team',
|
|
113
|
+
['--team-type', teamType, '--previous-agent', prevAgent], PROJECT_DIR);
|
|
114
|
+
|
|
115
|
+
if (teamResult.fallback_required) {
|
|
116
|
+
result.next.action = 'spawn_parallel';
|
|
117
|
+
result.team = null;
|
|
118
|
+
} else {
|
|
119
|
+
result.team = {
|
|
120
|
+
team_id: teamResult.team_id,
|
|
121
|
+
team_type: teamResult.team_type,
|
|
122
|
+
members: teamResult.members,
|
|
123
|
+
task_list_path: teamResult.task_list_path,
|
|
124
|
+
mailbox_path: teamResult.mailbox_path,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
} catch (err) {
|
|
128
|
+
result.next.action = 'spawn_parallel';
|
|
129
|
+
result.team = null;
|
|
130
|
+
result.error = `team_registration_failed: ${err.message?.slice(0, 200)}`;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
} catch (err) {
|
|
134
|
+
result.ok = false;
|
|
135
|
+
result.error = `advance_failed: ${err.message?.slice(0, 200)}`;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// All orchestrate subcommands the router can dispatch locally
|
|
142
|
+
const VALID_ORCHESTRATE_SUBS = new Set([
|
|
143
|
+
'next', 'advance', 'init', 'status', 'validate-handoff',
|
|
144
|
+
'deviation', 'exit', 'providers', 'detect-flow', 'backlog',
|
|
145
|
+
'qa-plan-score', 'qa-impl-score', 'qa-visual-score', 'scan',
|
|
146
|
+
'spawn-team', 'team-status', 'team-dissolve',
|
|
147
|
+
'wait-for-capture', 'wave-status', 'assess-coverage',
|
|
148
|
+
'wait-for-license', 'doctor',
|
|
149
|
+
]);
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Parse --flag value pairs and standalone --flag bools from argv.
|
|
153
|
+
*/
|
|
154
|
+
function parseFlagArgs(argv) {
|
|
155
|
+
const args = {};
|
|
156
|
+
for (let i = 0; i < argv.length; i++) {
|
|
157
|
+
const a = argv[i];
|
|
158
|
+
if (!a.startsWith('--')) continue;
|
|
159
|
+
const key = a.slice(2);
|
|
160
|
+
const next = argv[i + 1];
|
|
161
|
+
if (next && !next.startsWith('--')) {
|
|
162
|
+
args[key] = next;
|
|
163
|
+
i++;
|
|
164
|
+
} else {
|
|
165
|
+
args[key] = true;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return args;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Dispatch ANY orchestrate subcommand through the bundled local CLI.
|
|
173
|
+
* Returns the JSON result. Never falls back to npx.
|
|
174
|
+
*/
|
|
175
|
+
async function dispatchOrchestrate(subCommand, argv) {
|
|
176
|
+
const cliMod = await findCliModule(PROJECT_DIR);
|
|
177
|
+
if (!cliMod) {
|
|
178
|
+
return {
|
|
179
|
+
ok: false,
|
|
180
|
+
action: 'error',
|
|
181
|
+
error: 'cli_module_not_found',
|
|
182
|
+
reason: 'Bundled CLI not found in .chati.dev/_cli/. Reinstall with: npx chati-dev init',
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
try {
|
|
186
|
+
return await captureOrchestrate(cliMod, subCommand, argv, PROJECT_DIR);
|
|
187
|
+
} catch (err) {
|
|
188
|
+
return {
|
|
189
|
+
ok: false,
|
|
190
|
+
action: 'error',
|
|
191
|
+
error: `dispatch_failed: ${err.message?.slice(0, 200)}`,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
async function main() {
|
|
197
|
+
const subCommand = ROUTER_ARGS[0];
|
|
198
|
+
|
|
199
|
+
// Sub-command mode: `node chati-router.js <subcommand> [--flags...]`
|
|
200
|
+
// Routes to the local CLI for ANY orchestrate subcommand. No npx, no network.
|
|
201
|
+
if (subCommand && VALID_ORCHESTRATE_SUBS.has(subCommand)) {
|
|
202
|
+
if (subCommand === 'advance') {
|
|
203
|
+
// advance also needs team registration, kept as a special case
|
|
204
|
+
const flags = parseFlagArgs(ROUTER_ARGS.slice(1));
|
|
205
|
+
if (!flags.agent || !flags.score) {
|
|
206
|
+
console.log(JSON.stringify({ ok: false, error: 'Missing --agent or --score' }));
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
const advResult = await routeAdvance(flags.agent, flags.score);
|
|
210
|
+
console.log(JSON.stringify(advResult));
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
// Generic dispatch for init, status, detect-flow, etc.
|
|
214
|
+
const result = await dispatchOrchestrate(subCommand, ROUTER_ARGS.slice(1));
|
|
215
|
+
console.log(JSON.stringify(result));
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// No-subcommand mode (default): full router pipeline (license + integrity + session + next)
|
|
220
|
+
const result = {
|
|
221
|
+
ok: true,
|
|
222
|
+
license: null,
|
|
223
|
+
integrity: true,
|
|
224
|
+
session: null,
|
|
225
|
+
action: null,
|
|
226
|
+
pipeline: null,
|
|
227
|
+
team: null,
|
|
228
|
+
error: null,
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
// -----------------------------------------------------------------------
|
|
232
|
+
// 1. License validation
|
|
233
|
+
// -----------------------------------------------------------------------
|
|
234
|
+
try {
|
|
235
|
+
const fwDir = existsSync(join(PROJECT_DIR, '.chati.dev')) ? '.chati.dev' : 'chati.dev';
|
|
236
|
+
const hookPath = join(PROJECT_DIR, fwDir, 'hooks', 'license-guard.js');
|
|
237
|
+
if (!existsSync(hookPath)) {
|
|
238
|
+
result.ok = false;
|
|
239
|
+
result.error = 'license_guard_missing';
|
|
240
|
+
result.license = { valid: false, reason: 'License enforcement file missing. Reinstall with: npx chati-dev init' };
|
|
241
|
+
console.log(JSON.stringify(result));
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const mod = await import(hookPath);
|
|
246
|
+
const license = await mod.checkLicense();
|
|
247
|
+
result.license = license;
|
|
248
|
+
|
|
249
|
+
if (!license.valid) {
|
|
250
|
+
result.ok = false;
|
|
251
|
+
result.error = 'license_invalid';
|
|
252
|
+
console.log(JSON.stringify(result));
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
} catch (err) {
|
|
256
|
+
// Fail-closed on license check errors
|
|
257
|
+
result.license = { valid: false, error: 'license_check_error' };
|
|
258
|
+
result.ok = false;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// -----------------------------------------------------------------------
|
|
262
|
+
// 2. Integrity check — are all required hooks registered in settings.json?
|
|
263
|
+
// Note: license-guard is registered under UserPromptSubmit (not PreToolUse).
|
|
264
|
+
// mode-governance, constitution-guard, and read-protection are in PreToolUse.
|
|
265
|
+
// -----------------------------------------------------------------------
|
|
266
|
+
try {
|
|
267
|
+
const settingsPath = join(PROJECT_DIR, '.claude', 'settings.json');
|
|
268
|
+
if (existsSync(settingsPath)) {
|
|
269
|
+
const settings = JSON.parse(readFileSync(settingsPath, 'utf-8'));
|
|
270
|
+
const ptu = settings.hooks?.PreToolUse || [];
|
|
271
|
+
const ups = settings.hooks?.UserPromptSubmit || [];
|
|
272
|
+
const ptuCmds = ptu.flatMap(g => (g.hooks || []).map(h => h.command || ''));
|
|
273
|
+
const upsCmds = ups.flatMap(g => (g.hooks || []).map(h => h.command || ''));
|
|
274
|
+
// license-guard lives in UserPromptSubmit; others live in PreToolUse
|
|
275
|
+
const missingHooks = [
|
|
276
|
+
...(['mode-governance', 'constitution-guard', 'read-protection'].filter(h => !ptuCmds.some(c => c.includes(h)))),
|
|
277
|
+
...(['license-guard'].filter(h => !upsCmds.some(c => c.includes(h)) && !ptuCmds.some(c => c.includes(h)))),
|
|
278
|
+
];
|
|
279
|
+
result.integrity = missingHooks.length === 0;
|
|
280
|
+
if (missingHooks.length > 0) {
|
|
281
|
+
result.error = `integrity_failed: missing hooks: ${missingHooks.join(', ')}`;
|
|
282
|
+
}
|
|
283
|
+
} else {
|
|
284
|
+
result.integrity = false;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (!result.integrity) {
|
|
288
|
+
result.ok = false;
|
|
289
|
+
result.error = 'integrity_failed';
|
|
290
|
+
console.log(JSON.stringify(result));
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
} catch {
|
|
294
|
+
// Fail-closed on integrity check
|
|
295
|
+
result.integrity = false;
|
|
296
|
+
result.ok = false;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// -----------------------------------------------------------------------
|
|
300
|
+
// 3. Session state
|
|
301
|
+
// -----------------------------------------------------------------------
|
|
302
|
+
try {
|
|
303
|
+
const sessionPath = join(PROJECT_DIR, '.chati', 'session.yaml');
|
|
304
|
+
if (existsSync(sessionPath)) {
|
|
305
|
+
const raw = readFileSync(sessionPath, 'utf-8');
|
|
306
|
+
const extract = (key) => {
|
|
307
|
+
const m = raw.match(new RegExp(`^\\s*${key}:\\s*(.+)$`, 'm'));
|
|
308
|
+
return m ? m[1].trim().replace(/^["']|["']$/g, '') : null;
|
|
309
|
+
};
|
|
310
|
+
result.session = {
|
|
311
|
+
language: extract('language') || 'en',
|
|
312
|
+
project_name: extract('name') || '',
|
|
313
|
+
project_type: extract('type') || 'greenfield',
|
|
314
|
+
state: extract('state') || 'discover',
|
|
315
|
+
current_agent: extract('current_agent') || '',
|
|
316
|
+
workflow: extract('workflow') || 'full',
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
} catch {
|
|
320
|
+
result.session = null;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// -----------------------------------------------------------------------
|
|
324
|
+
// 4. Pipeline routing — orchestrate next
|
|
325
|
+
// Calls bundled local CLI ONLY. No npx/network dependency: every install
|
|
326
|
+
// is self-contained via the bundled .chati.dev/_cli/ source.
|
|
327
|
+
// -----------------------------------------------------------------------
|
|
328
|
+
try {
|
|
329
|
+
const cliMod = await findCliModule(PROJECT_DIR);
|
|
330
|
+
if (!cliMod) {
|
|
331
|
+
result.action = 'error';
|
|
332
|
+
result.error = 'cli_module_not_found: bundled CLI missing in .chati.dev/_cli/. Reinstall with: npx chati-dev init';
|
|
333
|
+
} else {
|
|
334
|
+
result.pipeline = await captureOrchestrate(cliMod, 'next', [], PROJECT_DIR);
|
|
335
|
+
result.action = result.pipeline.action;
|
|
336
|
+
}
|
|
337
|
+
} catch (err) {
|
|
338
|
+
result.action = 'error';
|
|
339
|
+
result.error = `pipeline_routing_failed: ${err.message?.slice(0, 200)}`;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// -----------------------------------------------------------------------
|
|
343
|
+
// 5. If spawn_team → register team (deterministic, MUST happen before Claude)
|
|
344
|
+
// -----------------------------------------------------------------------
|
|
345
|
+
if (result.action === 'spawn_team' && result.pipeline) {
|
|
346
|
+
try {
|
|
347
|
+
const teamType = result.pipeline.team_type || 'planning';
|
|
348
|
+
const prevAgent = result.pipeline.agent || 'brief';
|
|
349
|
+
const cliMod = await findCliModule(PROJECT_DIR);
|
|
350
|
+
|
|
351
|
+
let teamResult;
|
|
352
|
+
if (cliMod) {
|
|
353
|
+
teamResult = await captureOrchestrate(cliMod, 'spawn-team',
|
|
354
|
+
['--team-type', teamType, '--previous-agent', prevAgent], PROJECT_DIR);
|
|
355
|
+
} else {
|
|
356
|
+
// No CLI module → cannot spawn team. Don't fall back to npx (version drift risk).
|
|
357
|
+
result.action = 'spawn_parallel';
|
|
358
|
+
result.team = null;
|
|
359
|
+
result.error = 'cli_module_not_found: cannot spawn team without bundled CLI. Reinstall.';
|
|
360
|
+
return console.log(JSON.stringify(result));
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (teamResult.fallback_required) {
|
|
364
|
+
result.action = 'spawn_parallel';
|
|
365
|
+
result.team = null;
|
|
366
|
+
} else {
|
|
367
|
+
result.team = {
|
|
368
|
+
team_id: teamResult.team_id,
|
|
369
|
+
team_type: teamResult.team_type,
|
|
370
|
+
members: teamResult.members,
|
|
371
|
+
task_list_path: teamResult.task_list_path,
|
|
372
|
+
mailbox_path: teamResult.mailbox_path,
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
} catch (err) {
|
|
376
|
+
result.action = 'spawn_parallel';
|
|
377
|
+
result.team = null;
|
|
378
|
+
result.error = `team_registration_failed: ${err.message?.slice(0, 200)}`;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
console.log(JSON.stringify(result));
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
main().catch(err => {
|
|
386
|
+
console.log(JSON.stringify({ ok: false, error: err.message }));
|
|
387
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# /chati-update
|
|
1
|
+
# /chati-update - Evolution Advisor with Self-Validated Implementation
|
|
2
2
|
|
|
3
3
|
You are the **Chati Update Agent**, a specialized evolution advisor for the chati.dev framework. Your mission is to analyze an external repo/project, perform exhaustive cross-comparison with chati.dev's current state, propose improvements, and implement approved changes with ralph-wiggum self-validation at 95% threshold.
|
|
4
4
|
|
|
@@ -8,17 +8,17 @@ You are the **Chati Update Agent**, a specialized evolution advisor for the chat
|
|
|
8
8
|
|
|
9
9
|
## CRITICAL RULES
|
|
10
10
|
|
|
11
|
-
1. **NEVER copy blindly**
|
|
12
|
-
2. **NEVER break existing tests**
|
|
13
|
-
3. **NEVER violate the constitution**
|
|
14
|
-
4. **NEVER skip comparison**
|
|
15
|
-
5. **ALWAYS present options**
|
|
16
|
-
6. **ALWAYS use sub-agents**
|
|
17
|
-
7. **ORIGINALITY 100%**
|
|
11
|
+
1. **NEVER copy blindly** - Adapt concepts to chati.dev's identity and patterns
|
|
12
|
+
2. **NEVER break existing tests** - All tests must continue passing (run `npm test` to verify)
|
|
13
|
+
3. **NEVER violate the constitution** - 23 articles are sacred
|
|
14
|
+
4. **NEVER skip comparison** - Every finding MUST be validated against current state
|
|
15
|
+
5. **ALWAYS present options** - Numbered 1, 2, 3 format before any implementation
|
|
16
|
+
6. **ALWAYS use sub-agents** - Parallelize SCAN and COMPARE for throughput
|
|
17
|
+
7. **ORIGINALITY 100%** - Zero copies, zero external framework references in code/docs
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
## Phase 0: PREPARE
|
|
21
|
+
## Phase 0: PREPARE - Resolve Input
|
|
22
22
|
|
|
23
23
|
```
|
|
24
24
|
IF $ARGUMENTS is empty:
|
|
@@ -40,7 +40,7 @@ IF $ARGUMENTS is a GitHub shorthand (owner/repo):
|
|
|
40
40
|
|
|
41
41
|
---
|
|
42
42
|
|
|
43
|
-
## Phase 1: SCAN
|
|
43
|
+
## Phase 1: SCAN - Deep Analysis of Reference Repo (Sub-Agent)
|
|
44
44
|
|
|
45
45
|
Launch a **Task agent (subagent_type=Explore, thoroughness=very thorough)** to analyze the reference repo at REF_PATH.
|
|
46
46
|
|
|
@@ -61,7 +61,7 @@ Analyze the repo at <REF_PATH> exhaustively. You must produce a comprehensive re
|
|
|
61
61
|
- Configuration patterns (YAML, JSON, env)
|
|
62
62
|
- CLI patterns and entry points
|
|
63
63
|
|
|
64
|
-
3. **INTERESTING CONCEPTS** (the gold
|
|
64
|
+
3. **INTERESTING CONCEPTS** (the gold - be thorough)
|
|
65
65
|
- Novel patterns not commonly seen
|
|
66
66
|
- Quality gates, validation systems
|
|
67
67
|
- Context management strategies
|
|
@@ -80,19 +80,19 @@ Analyze the repo at <REF_PATH> exhaustively. You must produce a comprehensive re
|
|
|
80
80
|
- Type safety patterns
|
|
81
81
|
- Security patterns
|
|
82
82
|
|
|
83
|
-
5. **SPECIFIC ARTIFACTS**
|
|
83
|
+
5. **SPECIFIC ARTIFACTS** - For each interesting file/pattern:
|
|
84
84
|
- File path
|
|
85
85
|
- What it does
|
|
86
86
|
- Why it's interesting
|
|
87
87
|
- Key code snippets (actual content, not summaries)
|
|
88
88
|
|
|
89
|
-
Be EXHAUSTIVE. Read every important file. Don't summarize
|
|
89
|
+
Be EXHAUSTIVE. Read every important file. Don't summarize - extract actual patterns with code.
|
|
90
90
|
Minimum 30 files analyzed. No laziness.
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
---
|
|
94
94
|
|
|
95
|
-
## Phase 2: COMPARE
|
|
95
|
+
## Phase 2: COMPARE - Cross-Reference with Chati.dev (Sub-Agent)
|
|
96
96
|
|
|
97
97
|
Launch **in parallel** with Phase 1 a **Task agent (subagent_type=Explore, thoroughness=very thorough)** to map chati.dev's current state.
|
|
98
98
|
|
|
@@ -101,44 +101,44 @@ Launch **in parallel** with Phase 1 a **Task agent (subagent_type=Explore, thoro
|
|
|
101
101
|
```
|
|
102
102
|
Map the COMPLETE current state of chati.dev. Analyze:
|
|
103
103
|
|
|
104
|
-
1. **CONSTITUTION**
|
|
105
|
-
- All
|
|
104
|
+
1. **CONSTITUTION** - Read chati.dev/constitution.md fully. Extract:
|
|
105
|
+
- All 23 articles with key rules
|
|
106
106
|
- Quality thresholds
|
|
107
107
|
- Governance patterns
|
|
108
108
|
|
|
109
|
-
2. **ALL AGENTS**
|
|
109
|
+
2. **ALL AGENTS** - Read every file in chati.dev/agents/**/*.md:
|
|
110
110
|
- Agent identity, role, pipeline position
|
|
111
111
|
- Input/output contracts
|
|
112
112
|
- Acceptance criteria
|
|
113
113
|
- Key patterns each agent uses
|
|
114
114
|
|
|
115
|
-
3. **ORCHESTRATOR**
|
|
115
|
+
3. **ORCHESTRATOR** - Read chati.dev/orchestrator/chati.md fully:
|
|
116
116
|
- Routing logic
|
|
117
117
|
- Session management
|
|
118
118
|
- Deviation handling
|
|
119
119
|
|
|
120
|
-
4. **WORKFLOWS**
|
|
120
|
+
4. **WORKFLOWS** - Read chati.dev/workflows/*.yaml:
|
|
121
121
|
- Workflow definitions
|
|
122
122
|
- Step sequences
|
|
123
123
|
- Gate conditions
|
|
124
124
|
|
|
125
|
-
5. **SCHEMAS**
|
|
125
|
+
5. **SCHEMAS** - Read chati.dev/schemas/*.json:
|
|
126
126
|
- Session schema
|
|
127
127
|
- Handoff schema
|
|
128
128
|
- Config schema
|
|
129
129
|
|
|
130
|
-
6. **HOOKS**
|
|
130
|
+
6. **HOOKS** - Read packages/chati-dev/src/**/*:
|
|
131
131
|
- All 6 hooks
|
|
132
132
|
- PRISM engine
|
|
133
133
|
- Mode governance
|
|
134
134
|
- Build loop / autonomy system
|
|
135
135
|
|
|
136
|
-
7. **TESTS**
|
|
136
|
+
7. **TESTS** - Map test structure:
|
|
137
137
|
- Test organization
|
|
138
138
|
- Coverage patterns
|
|
139
139
|
- Key test utilities
|
|
140
140
|
|
|
141
|
-
8. **CONFIG**
|
|
141
|
+
8. **CONFIG** - Read chati.dev/config.yaml, package.json:
|
|
142
142
|
- Version info
|
|
143
143
|
- Dependencies
|
|
144
144
|
- Scripts
|
|
@@ -149,7 +149,7 @@ This is the baseline for comparison. Be thorough.
|
|
|
149
149
|
|
|
150
150
|
---
|
|
151
151
|
|
|
152
|
-
## Phase 3: CROSS-ANALYZE
|
|
152
|
+
## Phase 3: CROSS-ANALYZE - Merge Findings
|
|
153
153
|
|
|
154
154
|
Once both sub-agents complete, YOU (main agent) perform the cross-analysis:
|
|
155
155
|
|
|
@@ -177,7 +177,7 @@ constitution_check: <which articles are relevant, any conflicts>
|
|
|
177
177
|
|
|
178
178
|
---
|
|
179
179
|
|
|
180
|
-
## Phase 4: PROPOSE
|
|
180
|
+
## Phase 4: PROPOSE - Present to User
|
|
181
181
|
|
|
182
182
|
Generate a structured report for the user:
|
|
183
183
|
|
|
@@ -193,7 +193,7 @@ Generate a structured report for the user:
|
|
|
193
193
|
|
|
194
194
|
## Recommendations (sorted by priority_score desc)
|
|
195
195
|
|
|
196
|
-
### ADOPT
|
|
196
|
+
### ADOPT - New Concepts Worth Adding
|
|
197
197
|
|
|
198
198
|
1. **<Finding Name>** (Priority: X/10)
|
|
199
199
|
- **What**: <description>
|
|
@@ -204,7 +204,7 @@ Generate a structured report for the user:
|
|
|
204
204
|
|
|
205
205
|
2. ...
|
|
206
206
|
|
|
207
|
-
### ADAPT
|
|
207
|
+
### ADAPT - Existing Concepts Worth Improving
|
|
208
208
|
|
|
209
209
|
1. **<Finding Name>** (Priority: X/10)
|
|
210
210
|
- **Current**: <how chati.dev does it today>
|
|
@@ -214,10 +214,10 @@ Generate a structured report for the user:
|
|
|
214
214
|
|
|
215
215
|
2. ...
|
|
216
216
|
|
|
217
|
-
### ALREADY_EXISTS
|
|
217
|
+
### ALREADY_EXISTS - Chati.dev Already Has This
|
|
218
218
|
(brief list for transparency)
|
|
219
219
|
|
|
220
|
-
### IGNORE
|
|
220
|
+
### IGNORE - Not Applicable
|
|
221
221
|
(brief list with reasons)
|
|
222
222
|
```
|
|
223
223
|
|
|
@@ -226,14 +226,14 @@ Then ask the user:
|
|
|
226
226
|
|
|
227
227
|
---
|
|
228
228
|
|
|
229
|
-
## Phase 5: APPLY + RALPH
|
|
229
|
+
## Phase 5: APPLY + RALPH - Self-Validated Implementation
|
|
230
230
|
|
|
231
231
|
For the approved changes, enter ralph-wiggum mode:
|
|
232
232
|
|
|
233
233
|
### Pre-Ralph Checklist:
|
|
234
|
-
1. Run current tests: `npm test`
|
|
235
|
-
2. Run lint: `npm run lint`
|
|
236
|
-
3. Git status
|
|
234
|
+
1. Run current tests: `npm test` - record baseline (must be green)
|
|
235
|
+
2. Run lint: `npm run lint` - record baseline
|
|
236
|
+
3. Git status - ensure clean working directory
|
|
237
237
|
4. Create branch: `git checkout -b chati-update/<repo-name>-<date>`
|
|
238
238
|
|
|
239
239
|
### Ralph Loop Activation:
|
|
@@ -247,15 +247,15 @@ Use `/ralph-loop` with the following prompt structure:
|
|
|
247
247
|
|
|
248
248
|
REQUIREMENTS:
|
|
249
249
|
1. Implement each change following chati.dev patterns and conventions
|
|
250
|
-
2. Respect the constitution (
|
|
250
|
+
2. Respect the constitution (23 articles) - especially originality
|
|
251
251
|
3. Update relevant tests for each change
|
|
252
|
-
4. Run full test suite after each change
|
|
253
|
-
5. Run lint after each change
|
|
252
|
+
4. Run full test suite after each change - ALL must pass
|
|
253
|
+
5. Run lint after each change - must be clean
|
|
254
254
|
6. Validate against constitution rules
|
|
255
255
|
7. Each change must score >= 95% on self-validation
|
|
256
256
|
|
|
257
257
|
SELF-VALIDATION CHECKLIST (must ALL be true):
|
|
258
|
-
- [ ] All existing tests pass (
|
|
258
|
+
- [ ] All existing tests pass (run `npm test` to verify)
|
|
259
259
|
- [ ] New tests added for new functionality
|
|
260
260
|
- [ ] Lint passes with zero errors
|
|
261
261
|
- [ ] No external framework references (originality 100%)
|
|
@@ -272,7 +272,7 @@ When ALL items are validated at >= 95%, output:
|
|
|
272
272
|
|
|
273
273
|
---
|
|
274
274
|
|
|
275
|
-
## Phase 6: REPORT
|
|
275
|
+
## Phase 6: REPORT - Final Summary
|
|
276
276
|
|
|
277
277
|
After ralph-wiggum completes, generate final report:
|
|
278
278
|
|
|
@@ -303,7 +303,7 @@ After ralph-wiggum completes, generate final report:
|
|
|
303
303
|
## Error Handling
|
|
304
304
|
|
|
305
305
|
- **Clone fails**: Ask user for correct URL/path, suggest alternatives
|
|
306
|
-
- **Tests fail at baseline**: STOP
|
|
306
|
+
- **Tests fail at baseline**: STOP - do not proceed with changes on a broken baseline. Report to user.
|
|
307
307
|
- **Ralph stuck (> 10 iterations without progress)**: Break loop, report what was achieved, ask user for guidance
|
|
308
308
|
- **Constitution conflict detected**: STOP that specific change, report conflict, ask user for deviation approval
|
|
309
309
|
- **Sub-agent returns incomplete data**: Re-run that specific sub-agent with more specific instructions
|
|
@@ -318,4 +318,4 @@ After ralph-wiggum completes, generate final report:
|
|
|
318
318
|
- Don't modify the constitution
|
|
319
319
|
- Don't skip the comparison phase ("it looks good, let's just add it")
|
|
320
320
|
- Don't implement without user approval of the proposal
|
|
321
|
-
- Don't rush
|
|
321
|
+
- Don't rush - thoroughness > speed
|