chati-dev 1.0.1 → 1.2.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/bin/chati.js CHANGED
@@ -121,7 +121,7 @@ async function main() {
121
121
  console.log(' - Constitution (10 Articles + Preamble)');
122
122
  console.log(' - Dashboard TUI');
123
123
  console.log(' - Upgrade system with migrations');
124
- console.log(' - 7 IDE support');
124
+ console.log(' - 6 IDE support');
125
125
  console.log(' - 4-language i18n (EN/PT/ES/FR)');
126
126
  break;
127
127
  }
@@ -234,5 +234,30 @@ Example of BAD criteria:
234
234
 
235
235
  ---
236
236
 
237
- *chati.dev Constitution v1.0.0 10 Articles + Preamble*
237
+ ## Article XI: Mode Governance
238
+
239
+ The pipeline operates in three execution modes that control agent permissions. Modes are derived from `project.state` in session.yaml.
240
+
241
+ ### Mode Definitions
242
+
243
+ | Mode | States | Read Scope | Write Scope |
244
+ |------|--------|------------|-------------|
245
+ | **clarity** | clarity | Entire project (codebase + chati.dev/) | `chati.dev/` and `.chati/` only |
246
+ | **build** | build, validate | Entire project | Entire project |
247
+ | **deploy** | deploy | Entire project | Entire project + infra/CI operations |
248
+
249
+ ### Enforcement Rules
250
+
251
+ 1. In `clarity` mode, agents MAY read any file in the project (essential for brownfield-wu)
252
+ 2. In `clarity` mode, agents MUST NOT write/edit files outside `chati.dev/` and `.chati/`
253
+ 3. Transition to `build` requires QA-Planning score >= 95% (Article II)
254
+ 4. Transition to `deploy` requires QA-Implementation APPROVED
255
+ 5. Backward transition from `build` to `clarity` is permitted when QA-Implementation classifies an issue as `spec` or `architecture` (not `code`)
256
+ 6. Mode overrides require explicit user confirmation and are logged in session.yaml
257
+
258
+ **Enforcement: BLOCK** — Write operations outside permitted scope are rejected.
259
+
260
+ ---
261
+
262
+ *chati.dev Constitution v1.0.0 — 11 Articles + Preamble*
238
263
  *All agents are bound by this Constitution. Violations are enforced per article.*
@@ -143,6 +143,119 @@ When an agent completes (score >= 95%):
143
143
 
144
144
  ---
145
145
 
146
+ ## Mode Enforcement Protocol
147
+
148
+ ### Scope Validation
149
+
150
+ Before any agent writes a file, the orchestrator validates the operation against the current mode:
151
+
152
+ ```
153
+ If project.state == "clarity":
154
+ ALLOW write to: chati.dev/**, .chati/**
155
+ BLOCK write to: everything else
156
+ ALLOW read: everything (essential for brownfield-wu codebase analysis)
157
+
158
+ If project.state == "build" OR "validate":
159
+ ALLOW write to: everything
160
+ ALLOW read: everything
161
+
162
+ If project.state == "deploy":
163
+ ALLOW write to: everything
164
+ ALLOW read: everything
165
+ ALLOW infra operations (CI/CD, deployment)
166
+ ```
167
+
168
+ ### Autonomous Mode Transitions
169
+
170
+ Mode transitions are AUTOMATIC based on quality gate results. The orchestrator executes the transition when the trigger condition is met.
171
+
172
+ ```
173
+ clarity -> build:
174
+ TRIGGER: qa-planning agent completes with score >= 95%
175
+ ACTION:
176
+ 1. Update project.state = "build"
177
+ 2. Log transition in session.yaml mode_transitions:
178
+ - timestamp: "{now}"
179
+ from: clarity
180
+ to: build
181
+ trigger: "qa-planning completed with score {score}%"
182
+ type: automatic
183
+ 3. Notify user: "Planning approved. Entering BUILD mode."
184
+ 4. Route to dev agent
185
+
186
+ build -> validate:
187
+ TRIGGER: dev agent completes all assigned tasks
188
+ ACTION:
189
+ 1. Update project.state = "validate"
190
+ 2. Log transition in mode_transitions
191
+ 3. Route to qa-implementation agent
192
+
193
+ validate -> deploy:
194
+ TRIGGER: qa-implementation agent APPROVED
195
+ ACTION:
196
+ 1. Update project.state = "deploy"
197
+ 2. Log transition in mode_transitions
198
+ 3. Notify user: "Code validated. Entering DEPLOY mode."
199
+ 4. Route to devops agent
200
+
201
+ deploy -> completed:
202
+ TRIGGER: devops agent completes deployment
203
+ ACTION:
204
+ 1. Update project.state = "completed"
205
+ 2. Log transition in mode_transitions
206
+ 3. Present final project summary
207
+ ```
208
+
209
+ ### Backward Transitions
210
+
211
+ ```
212
+ build/validate -> clarity:
213
+ TRIGGER: qa-implementation classifies issue as:
214
+ - issue_type: "spec" (requirement gap, ambiguity, conflict)
215
+ - issue_type: "architecture" (design flaw, missing component)
216
+ ACTION:
217
+ 1. Update project.state = "clarity"
218
+ 2. Log backward transition in mode_transitions:
219
+ - type: backward
220
+ reason: "{QA finding description}"
221
+ 3. Identify target agent:
222
+ - issue_type "spec" -> route to detail agent
223
+ - issue_type "architecture" -> route to architect agent
224
+ 4. Mark downstream agents as "needs_revalidation" in session.yaml
225
+ 5. Route to target agent with QA findings as context
226
+ 6. After fix: re-run qa-planning before returning to build
227
+
228
+ NOT TRIGGERED when issue_type is:
229
+ - "code" (implementation bug) -> fix in build mode
230
+ - "test" (missing/failing tests) -> fix in build mode
231
+ - "security" (vulnerability) -> fix in build mode
232
+ ```
233
+
234
+ ### Mode Override (via Deviation Protocol)
235
+
236
+ When user requests to skip phases (e.g., "I need to code this NOW"):
237
+
238
+ ```
239
+ 1. Orchestrator detects intent to change mode
240
+ 2. Inform user of current state and what will be skipped:
241
+ "You're in CLARITY mode. Skipping to BUILD will bypass:
242
+ - {list of pending CLARITY agents}
243
+ Artifacts from these agents will not be generated."
244
+ 3. Request explicit confirmation
245
+ 4. If confirmed:
246
+ - Update project.state to requested mode
247
+ - Log override in mode_transitions:
248
+ - type: override
249
+ skipped_agents: [list of skipped agents]
250
+ reason: "{user's stated reason}"
251
+ - Mark skipped agents as "skipped" in session.yaml (not "completed")
252
+ - Continue with target agent
253
+ 5. After override session completes, suggest:
254
+ "You skipped CLARITY phases. Want to go back and complete planning?"
255
+ ```
256
+
257
+ ---
258
+
146
259
  ## Deviation Protocol (Protocol 5.7)
147
260
 
148
261
  ```
@@ -302,7 +415,7 @@ To activate autonomous mode:
302
415
  ## Constitution Enforcement
303
416
 
304
417
  The orchestrator enforces the Constitution (chati.dev/constitution.md):
305
- - **BLOCK** enforcement: Halt agent on violation (Articles I, II, III, IV, VII, VIII, X)
418
+ - **BLOCK** enforcement: Halt agent on violation (Articles I, II, III, IV, VII, VIII, X, XI)
306
419
  - **GUIDE** enforcement: Correct behavior without halting (Articles V, IX)
307
420
  - **WARN** enforcement: Generate warning in QA (Article VI)
308
421
 
@@ -31,7 +31,7 @@
31
31
  "ides": {
32
32
  "type": "array",
33
33
  "items": {
34
- "enum": ["claude-code", "vscode", "antigravity", "cursor", "windsurf", "gemini-cli", "github-copilot"]
34
+ "enum": ["claude-code", "vscode", "antigravity", "cursor", "gemini-cli", "github-copilot"]
35
35
  },
36
36
  "description": "Configured IDEs"
37
37
  },
@@ -60,7 +60,7 @@
60
60
  "type": "object",
61
61
  "required": ["status", "score", "criteria_count"],
62
62
  "properties": {
63
- "status": { "enum": ["pending", "in_progress", "completed"] },
63
+ "status": { "enum": ["pending", "in_progress", "completed", "skipped", "needs_revalidation"] },
64
64
  "score": { "type": "number", "minimum": 0, "maximum": 100 },
65
65
  "criteria_count": { "type": "integer", "minimum": 0 },
66
66
  "completed_at": { "type": ["string", "null"], "format": "date-time" }
@@ -98,6 +98,27 @@
98
98
  "resolved": { "type": "boolean" }
99
99
  }
100
100
  }
101
+ },
102
+ "mode_transitions": {
103
+ "type": "array",
104
+ "description": "Audit trail of all mode transitions",
105
+ "items": {
106
+ "type": "object",
107
+ "required": ["timestamp", "from", "to", "trigger"],
108
+ "properties": {
109
+ "timestamp": { "type": "string", "format": "date-time" },
110
+ "from": { "enum": ["clarity", "build", "validate", "deploy", "completed"] },
111
+ "to": { "enum": ["clarity", "build", "validate", "deploy", "completed"] },
112
+ "trigger": { "type": "string", "description": "What caused the transition (agent completion, override, backward)" },
113
+ "type": { "enum": ["automatic", "backward", "override"], "description": "Transition classification" },
114
+ "skipped_agents": {
115
+ "type": "array",
116
+ "items": { "type": "string" },
117
+ "description": "Agents skipped (override only)"
118
+ },
119
+ "reason": { "type": "string", "description": "User reason (override only) or QA finding (backward only)" }
120
+ }
121
+ }
101
122
  }
102
123
  }
103
124
  }
@@ -99,6 +99,23 @@ phases:
99
99
  creates: [chati.dev/artifacts/8-Validation/deploy-report.md]
100
100
 
101
101
  transitions:
102
- clarity_to_build: "QA-Planning score >= 95%"
103
- build_to_deploy: "QA-Implementation APPROVED"
104
- deploy_to_completed: "DevOps deployment verified"
102
+ clarity_to_build:
103
+ trigger: "qa-planning.score >= 95"
104
+ type: automatic
105
+ action: "Update project.state = build"
106
+ build_to_validate:
107
+ trigger: "dev.status == completed"
108
+ type: automatic
109
+ action: "Update project.state = validate"
110
+ validate_to_deploy:
111
+ trigger: "qa-implementation.status == approved"
112
+ type: automatic
113
+ action: "Update project.state = deploy"
114
+ deploy_to_completed:
115
+ trigger: "devops.status == completed"
116
+ type: automatic
117
+ action: "Update project.state = completed"
118
+ backward_to_clarity:
119
+ trigger: "qa-implementation.issue_type in [spec, architecture]"
120
+ type: backward
121
+ action: "Update project.state = clarity, route to responsible agent"
@@ -103,6 +103,23 @@ phases:
103
103
  notes: "Git operations, deployment, documentation"
104
104
 
105
105
  transitions:
106
- clarity_to_build: "QA-Planning score >= 95%"
107
- build_to_deploy: "QA-Implementation APPROVED"
108
- deploy_to_completed: "DevOps deployment verified"
106
+ clarity_to_build:
107
+ trigger: "qa-planning.score >= 95"
108
+ type: automatic
109
+ action: "Update project.state = build"
110
+ build_to_validate:
111
+ trigger: "dev.status == completed"
112
+ type: automatic
113
+ action: "Update project.state = validate"
114
+ validate_to_deploy:
115
+ trigger: "qa-implementation.status == approved"
116
+ type: automatic
117
+ action: "Update project.state = deploy"
118
+ deploy_to_completed:
119
+ trigger: "devops.status == completed"
120
+ type: automatic
121
+ action: "Update project.state = completed"
122
+ backward_to_clarity:
123
+ trigger: "qa-implementation.issue_type in [spec, architecture]"
124
+ type: backward
125
+ action: "Update project.state = clarity, route to responsible agent"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "chati-dev",
3
- "version": "1.0.1",
4
- "description": "AI-Powered Multi-Agent Development Framework — 13 agents, 7 IDEs, 4 languages",
3
+ "version": "1.2.0",
4
+ "description": "AI-Powered Multi-Agent Development Framework — 13 agents, 6 IDEs, 4 languages",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "chati": "bin/chati.js",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * IDE Configuration Mapping (7 IDEs)
2
+ * IDE Configuration Mapping (6 IDEs)
3
3
  * Defines where chati.dev agents are deployed per IDE
4
4
  */
5
5
  export const IDE_CONFIGS = {
@@ -39,15 +39,6 @@ export const IDE_CONFIGS = {
39
39
  mcpConfigFile: null,
40
40
  formatNotes: 'Cursor rules format',
41
41
  },
42
- 'windsurf': {
43
- name: 'Windsurf',
44
- description: 'AI-powered development environment',
45
- recommended: false,
46
- configPath: '.windsurf/rules/',
47
- rulesFile: '.windsurfrules',
48
- mcpConfigFile: null,
49
- formatNotes: 'Windsurf rules format',
50
- },
51
42
  'gemini-cli': {
52
43
  name: 'Gemini CLI',
53
44
  description: 'Google AI for development',