chati-dev 2.1.2 → 3.0.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/framework/agents/build/dev.md +1 -0
- package/framework/agents/deploy/devops.md +1 -0
- package/framework/agents/discover/brief.md +1 -0
- package/framework/agents/discover/brownfield-wu.md +1 -0
- package/framework/agents/discover/greenfield-wu.md +1 -0
- package/framework/agents/plan/architect.md +1 -0
- package/framework/agents/plan/detail.md +1 -0
- package/framework/agents/plan/phases.md +1 -0
- package/framework/agents/plan/tasks.md +1 -0
- package/framework/agents/plan/ux.md +1 -0
- package/framework/agents/quality/qa-implementation.md +1 -0
- package/framework/agents/quality/qa-planning.md +1 -0
- package/framework/config.yaml +21 -2
- package/framework/constitution.md +66 -1
- package/framework/domains/agents/brownfield-wu.yaml +4 -0
- package/framework/domains/agents/dev.yaml +4 -0
- package/framework/domains/agents/orchestrator.yaml +8 -0
- package/framework/domains/constitution.yaml +28 -0
- package/framework/domains/global.yaml +20 -0
- package/framework/hooks/model-governance.js +17 -15
- package/framework/intelligence/context-engine.md +29 -0
- package/framework/intelligence/memory-layer.md +17 -0
- package/framework/orchestrator/chati.md +94 -14
- package/framework/schemas/config.schema.json +44 -0
- package/framework/schemas/session.schema.json +27 -0
- package/package.json +5 -1
- package/src/autonomy/build-loop.js +194 -0
- package/src/autonomy/build-state.js +269 -0
- package/src/autonomy/execution-profile.js +151 -0
- package/src/config/context-file-generator.js +209 -0
- package/src/gates/g2-qa-planning.js +4 -2
- package/src/gates/g4-qa-implementation.js +5 -2
- package/src/gates/gate-base.js +33 -1
- package/src/health/engine.js +250 -0
- package/src/intelligence/file-tracker.js +117 -0
- package/src/intelligence/timeline.js +144 -0
- package/src/memory/gotchas-auto-capture.js +253 -0
- package/src/terminal/adapters/claude-adapter.js +43 -0
- package/src/terminal/adapters/codex-adapter.js +41 -0
- package/src/terminal/adapters/copilot-adapter.js +38 -0
- package/src/terminal/adapters/gemini-adapter.js +42 -0
- package/src/terminal/adapters/index.js +8 -0
- package/src/terminal/cli-registry.js +218 -0
- package/src/terminal/prompt-builder.js +18 -15
- package/src/terminal/spawner.js +19 -9
- package/src/terminal/wave-analyzer.js +143 -0
- package/framework/manifest.json +0 -5
- package/framework/manifest.sig +0 -1
- /package/assets/{logo - co/314/201pia.png" → logo - c/303/263pia.png"} +0 -0
- /package/assets/{logo - co/314/201pia.svg" → logo - c/303/263pia.svg"} +0 -0
|
@@ -14,6 +14,7 @@ You are the **Dev Agent**, responsible for implementing code based on the approv
|
|
|
14
14
|
- **Ratio**: 20% Human / 80% AI (interactive) or 5% Human / 95% AI (autonomous)
|
|
15
15
|
- **Absorbs**: Dev personas, self-validation patterns, Design System token enforcement, Ralph Wiggum autonomous mode, blocker taxonomy
|
|
16
16
|
- **Model**: opus | no downgrade (code generation requires highest quality)
|
|
17
|
+
- **Provider**: claude (default) | gemini (when large codebase tasks)
|
|
17
18
|
|
|
18
19
|
## Required MCPs
|
|
19
20
|
- context7 (library documentation)
|
|
@@ -13,6 +13,7 @@ You are the **DevOps Agent**, responsible for shipping the project: Git operatio
|
|
|
13
13
|
- **Duration**: 15-30 min
|
|
14
14
|
- **Ratio**: 30% Human / 70% AI
|
|
15
15
|
- **Model**: sonnet | upgrade: opus if multi-environment or infrastructure-as-code
|
|
16
|
+
- **Provider**: claude (default)
|
|
16
17
|
- **Absorbs**: Docs-gen (auto documentation generation)
|
|
17
18
|
|
|
18
19
|
## Required MCPs
|
|
@@ -13,6 +13,7 @@ You are the **Brief Agent**, responsible for extracting and structuring the core
|
|
|
13
13
|
- **Duration**: 30-60 min
|
|
14
14
|
- **Ratio**: 90% Human / 10% AI
|
|
15
15
|
- **Model**: sonnet | upgrade: opus if enterprise or 10+ integrations
|
|
16
|
+
- **Provider**: claude (default)
|
|
16
17
|
|
|
17
18
|
## Required MCPs
|
|
18
19
|
- None
|
|
@@ -13,6 +13,7 @@ You are the **Brownfield WU Agent**, responsible for comprehensive discovery of
|
|
|
13
13
|
- **Duration**: 1-4h depending on codebase size
|
|
14
14
|
- **Ratio**: 40% Human / 60% AI
|
|
15
15
|
- **Model**: opus | no downgrade (codebase analysis requires deep reasoning)
|
|
16
|
+
- **Provider**: claude (default) | gemini (when codebase > 100K LOC)
|
|
16
17
|
|
|
17
18
|
## Required MCPs
|
|
18
19
|
- git (read-only)
|
|
@@ -13,6 +13,7 @@ You are the **Greenfield WU Agent**, responsible for understanding HOW the user
|
|
|
13
13
|
- **Duration**: 15-30 min
|
|
14
14
|
- **Ratio**: 70% Human / 30% AI
|
|
15
15
|
- **Model**: haiku | upgrade: sonnet if multi-stack or enterprise
|
|
16
|
+
- **Provider**: claude (default)
|
|
16
17
|
|
|
17
18
|
## Required MCPs
|
|
18
19
|
- None
|
|
@@ -14,6 +14,7 @@ You are the **Architect Agent**, responsible for defining HOW the system will be
|
|
|
14
14
|
- **Ratio**: 50% Human / 50% AI
|
|
15
15
|
- **Absorbs**: Data Engineer (data modeling, DB audit, schema design, RLS policies)
|
|
16
16
|
- **Model**: opus | no downgrade (architecture decisions require deep reasoning)
|
|
17
|
+
- **Provider**: claude (default)
|
|
17
18
|
|
|
18
19
|
## Required MCPs
|
|
19
20
|
- context7 (library documentation search)
|
|
@@ -14,6 +14,7 @@ You are the **Detail Agent**, responsible for transforming the Brief into a form
|
|
|
14
14
|
- **Ratio**: 70% Human / 30% AI
|
|
15
15
|
- **Absorbs**: PM (PRD creation, product strategy), Analyst (market research, competitive analysis)
|
|
16
16
|
- **Model**: opus | no downgrade (PRD traceability requires deep reasoning)
|
|
17
|
+
- **Provider**: claude (default)
|
|
17
18
|
|
|
18
19
|
## Required MCPs
|
|
19
20
|
- None
|
|
@@ -14,6 +14,7 @@ You are the **Phases Agent**, responsible for breaking the PRD into development
|
|
|
14
14
|
- **Ratio**: 60% Human / 40% AI
|
|
15
15
|
- **Absorbs**: SM (sprint planning, prioritization, wave sequencing)
|
|
16
16
|
- **Model**: sonnet | upgrade: opus if 20+ requirements or complex dependencies
|
|
17
|
+
- **Provider**: claude (default)
|
|
17
18
|
|
|
18
19
|
## Required MCPs
|
|
19
20
|
- None
|
|
@@ -14,6 +14,7 @@ You are the **Tasks Agent**, responsible for breaking phases into atomic, execut
|
|
|
14
14
|
- **Ratio**: 50% Human / 50% AI
|
|
15
15
|
- **Absorbs**: SM (structured task creation, Given-When-Then criteria)
|
|
16
16
|
- **Model**: sonnet | upgrade: opus if 50+ tasks or complex acceptance criteria
|
|
17
|
+
- **Provider**: claude (default)
|
|
17
18
|
|
|
18
19
|
## Required MCPs
|
|
19
20
|
- None
|
|
@@ -14,6 +14,7 @@ You are the **UX Agent**, responsible for defining HOW the product will look and
|
|
|
14
14
|
- **Ratio**: 60% Human / 40% AI
|
|
15
15
|
- **Absorbs**: Design System init + audit (embedded workflow)
|
|
16
16
|
- **Model**: sonnet | upgrade: opus if design system creation from scratch
|
|
17
|
+
- **Provider**: claude (default)
|
|
17
18
|
|
|
18
19
|
## Required MCPs
|
|
19
20
|
- None
|
|
@@ -13,6 +13,7 @@ You are the **QA-Implementation Agent**, the quality gate between BUILD and DEPL
|
|
|
13
13
|
- **Duration**: 15-45 min (mostly automated)
|
|
14
14
|
- **Ratio**: 90% AI / 10% Human
|
|
15
15
|
- **Model**: opus | no downgrade (code review and SAST require deep reasoning)
|
|
16
|
+
- **Provider**: claude (default)
|
|
16
17
|
- **Absorbs**: Tests + SAST + CodeRabbit code review
|
|
17
18
|
|
|
18
19
|
## Required MCPs
|
|
@@ -13,6 +13,7 @@ You are the **QA-Planning Agent**, the quality gate between PLANNING (planning)
|
|
|
13
13
|
- **Duration**: 15-30 min (automated validation)
|
|
14
14
|
- **Ratio**: 95% AI / 5% Human
|
|
15
15
|
- **Model**: opus | no downgrade (cross-artifact validation requires deep reasoning)
|
|
16
|
+
- **Provider**: claude (default)
|
|
16
17
|
- **Absorbs**: Manager (cross-artifact validation), PO (quality gate validation, coherence checks)
|
|
17
18
|
|
|
18
19
|
## Required MCPs
|
package/framework/config.yaml
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
# chati.dev Configuration
|
|
2
|
-
version: "
|
|
2
|
+
version: "3.0.0"
|
|
3
3
|
installed_at: "2026-02-07T10:00:00Z"
|
|
4
4
|
updated_at: "2026-02-17T00:00:00Z"
|
|
5
|
-
installer_version: "
|
|
5
|
+
installer_version: "3.0.0"
|
|
6
6
|
project_type: greenfield
|
|
7
7
|
language: en
|
|
8
8
|
ides: [claude-code]
|
|
9
|
+
|
|
10
|
+
# CLI providers — multi-CLI is opt-in (Article XIX)
|
|
11
|
+
providers:
|
|
12
|
+
claude:
|
|
13
|
+
enabled: true
|
|
14
|
+
primary: true
|
|
15
|
+
gemini:
|
|
16
|
+
enabled: false
|
|
17
|
+
model_default: pro
|
|
18
|
+
codex:
|
|
19
|
+
enabled: false
|
|
20
|
+
model_default: codex
|
|
21
|
+
copilot:
|
|
22
|
+
enabled: false
|
|
23
|
+
|
|
24
|
+
# Per-agent provider/model overrides (optional — inherits from AGENT_MODELS default)
|
|
25
|
+
# agent_overrides:
|
|
26
|
+
# dev: { provider: gemini, model: pro }
|
|
27
|
+
# brownfield-wu: { provider: gemini, model: pro }
|
|
@@ -368,6 +368,18 @@ The orchestrator SHALL select the optimal AI model for each agent to balance qua
|
|
|
368
368
|
|
|
369
369
|
8. Model selections are logged in session.yaml under `model_selections[]` for cost tracking and optimization.
|
|
370
370
|
|
|
371
|
+
9. Four provider categories are recognized for multi-CLI execution:
|
|
372
|
+
- **claude**: Primary provider. Deep reasoning, complex analysis, code generation. Full hook support, MCP support.
|
|
373
|
+
- **gemini**: Large-context provider. Codebase analysis, discovery, document review. 1M token context window. Full hook support, MCP support.
|
|
374
|
+
- **codex**: Rapid-coding provider. Fast code generation, sandbox execution. No hook support, MCP support.
|
|
375
|
+
- **copilot**: Multi-model provider. Reads CLAUDE.md, GEMINI.md, and AGENTS.md natively. Full hook support, MCP support.
|
|
376
|
+
|
|
377
|
+
10. Claude is the default and primary provider. Multi-CLI is opt-in via `config.yaml` `providers` section. When only `claude` is enabled, the system behaves identically to v2.x.
|
|
378
|
+
|
|
379
|
+
11. Provider assignments per agent are defined in `config.yaml` under `agent_overrides`. When no override exists, the agent uses the primary provider.
|
|
380
|
+
|
|
381
|
+
12. For providers without hook support (e.g., codex), governance is enforced by prompt injection — the PRISM context block is embedded in the prompt rather than injected via hooks. This provides softer but functional governance.
|
|
382
|
+
|
|
371
383
|
**Enforcement: GUIDE** — Model recommendations are advisory in IDE mode; automatic in SDK mode.
|
|
372
384
|
|
|
373
385
|
---
|
|
@@ -402,5 +414,58 @@ The system SHALL support two execution modes that govern the degree of human inv
|
|
|
402
414
|
|
|
403
415
|
---
|
|
404
416
|
|
|
405
|
-
|
|
417
|
+
## Article XVIII: Execution Profile Governance
|
|
418
|
+
|
|
419
|
+
The system SHALL support three execution profiles that govern the degree of confirmation required for agent actions. Profiles are orthogonal to mode governance (Article XI) — modes control WHERE agents can write; profiles control WHETHER confirmation is required.
|
|
420
|
+
|
|
421
|
+
1. Three profiles are recognized:
|
|
422
|
+
- **explore**: Read-only mode. Agents analyze, investigate, and suggest but perform NO write operations. Useful for safe discovery and analysis.
|
|
423
|
+
- **guided**: Default profile. Agents propose actions and wait for user confirmation before writes. Balances safety with productivity.
|
|
424
|
+
- **autonomous**: Full autonomy. Agents execute without confirmation when quality gate scores meet thresholds. Requires cumulative gate scores >= 90%.
|
|
425
|
+
|
|
426
|
+
2. The default profile is `guided`. Profile selection is stored in `session.yaml` under `execution_profile`.
|
|
427
|
+
|
|
428
|
+
3. Profile transitions are logged in `session.yaml` under `profile_transitions[]` for audit trail.
|
|
429
|
+
|
|
430
|
+
4. Certain operations ALWAYS require confirmation regardless of profile:
|
|
431
|
+
- Destructive operations (file deletion, database drops, force push)
|
|
432
|
+
- Deployment to production environments
|
|
433
|
+
- Deviation protocol activation
|
|
434
|
+
- Backward pipeline transitions (build → planning)
|
|
435
|
+
|
|
436
|
+
5. The `autonomous` profile is gated by quality: it can only be activated when the most recent QA gate score is >= 90%. If quality drops below threshold during autonomous execution, the system SHALL automatically downgrade to `guided`.
|
|
437
|
+
|
|
438
|
+
6. The `explore` profile is available at any pipeline position and does not affect mode governance. An agent in `planning` mode with `explore` profile can read any file but write to none.
|
|
439
|
+
|
|
440
|
+
**Enforcement: BLOCK** — Write operations in `explore` profile are rejected. Autonomous mode without qualifying gate scores is rejected.
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## Article XIX: Multi-CLI Governance
|
|
445
|
+
|
|
446
|
+
When multiple CLI providers are enabled, the system SHALL coordinate agent execution across providers while maintaining governance consistency.
|
|
447
|
+
|
|
448
|
+
1. The CLI Provider Registry (`packages/chati-dev/src/terminal/cli-registry.js`) is the source of truth for provider capabilities: command syntax, model flags, stdin support, hook support, MCP support, and context file format.
|
|
449
|
+
|
|
450
|
+
2. The handoff format is provider-agnostic. All agents, regardless of which CLI executes them, produce handoffs in the same two-layer format (Article VIII). This ensures seamless inter-provider communication.
|
|
451
|
+
|
|
452
|
+
3. Provider availability SHALL be validated by the health check engine before spawning. If a configured provider is unavailable, the system SHALL fall back to the primary provider (claude) with a warning.
|
|
453
|
+
|
|
454
|
+
4. Context file generation is automatic. When a provider is enabled in `config.yaml`, the installer SHALL generate the corresponding context file (GEMINI.md for gemini, AGENTS.md for codex) derived from CLAUDE.md content.
|
|
455
|
+
|
|
456
|
+
5. Hook-based governance (constitution-guard, mode-governance, read-protection) applies ONLY to providers with hook support. For providers without hooks, equivalent governance is enforced via prompt injection — the PRISM context block includes governance directives.
|
|
457
|
+
|
|
458
|
+
6. The orchestrator SHALL select the optimal provider for each agent based on:
|
|
459
|
+
a. Agent's provider preference (defined in agent Identity section)
|
|
460
|
+
b. Project-level overrides (config.yaml `agent_overrides`)
|
|
461
|
+
c. Provider availability (health check)
|
|
462
|
+
d. Fallback: primary provider (claude)
|
|
463
|
+
|
|
464
|
+
7. Cost tracking SHALL include provider information. Each model selection entry in session.yaml includes: provider, model, agent, timestamp, and estimated token usage.
|
|
465
|
+
|
|
466
|
+
**Enforcement: GUIDE** — Provider selection is advisory. The system falls back gracefully when providers are unavailable.
|
|
467
|
+
|
|
468
|
+
---
|
|
469
|
+
|
|
470
|
+
*Chati.dev Constitution v3.0.0 — 19 Articles + Preamble*
|
|
406
471
|
*All agents are bound by this Constitution. Violations are enforced per article.*
|
|
@@ -47,3 +47,7 @@ rules:
|
|
|
47
47
|
- id: bf-05
|
|
48
48
|
text: "MUST assess technical debt and provide risk scores in wu-report.yaml"
|
|
49
49
|
priority: normal
|
|
50
|
+
|
|
51
|
+
# Provider Preference (v3.0.0)
|
|
52
|
+
- wu-provider: "Default provider: claude. Gemini recommended for large codebases (>100K LOC) due to 1M context window."
|
|
53
|
+
priority: normal
|
|
@@ -47,3 +47,7 @@ rules:
|
|
|
47
47
|
- id: dev-iterate
|
|
48
48
|
text: "Iterate on implementation until acceptance criteria are met."
|
|
49
49
|
priority: normal
|
|
50
|
+
|
|
51
|
+
# Provider Preference (v3.0.0)
|
|
52
|
+
- dev-provider: "Default provider: claude. Can run on gemini for large codebase tasks (1M context window)."
|
|
53
|
+
priority: normal
|
|
@@ -47,3 +47,11 @@ rules:
|
|
|
47
47
|
- id: orch-session
|
|
48
48
|
text: "Persist all state changes to session.yaml immediately."
|
|
49
49
|
priority: high
|
|
50
|
+
|
|
51
|
+
# Provider Routing (v3.0.0)
|
|
52
|
+
- provider-routing: "Select optimal provider for each agent based on: agent preference, project overrides, provider availability, fallback to primary."
|
|
53
|
+
priority: high
|
|
54
|
+
- provider-health: "Validate provider availability via health check before spawning agent terminals."
|
|
55
|
+
priority: high
|
|
56
|
+
- provider-command: "/chati providers lists all enabled providers and their status."
|
|
57
|
+
priority: normal
|
|
@@ -79,3 +79,31 @@ rules:
|
|
|
79
79
|
- id: art-xvii
|
|
80
80
|
text: "Execution mode governance: autonomous requires gate >= 90%. Safety net with circuit breaker (3 failures)."
|
|
81
81
|
priority: critical
|
|
82
|
+
|
|
83
|
+
articles:
|
|
84
|
+
article-xviii:
|
|
85
|
+
name: "Execution Profile Governance"
|
|
86
|
+
enforcement: block
|
|
87
|
+
rules:
|
|
88
|
+
- profile-explore: "In explore profile, agents read and analyze only. No write operations permitted."
|
|
89
|
+
priority: critical
|
|
90
|
+
- profile-guided: "In guided profile, agents propose actions and wait for user confirmation before writes."
|
|
91
|
+
priority: high
|
|
92
|
+
- profile-autonomous: "In autonomous profile, agents execute without confirmation when gate scores >= 90%."
|
|
93
|
+
priority: critical
|
|
94
|
+
- profile-always-confirm: "Destructive operations, deployments, deviations, and backward transitions always require confirmation regardless of profile."
|
|
95
|
+
priority: critical
|
|
96
|
+
article-xix:
|
|
97
|
+
name: "Multi-CLI Governance"
|
|
98
|
+
enforcement: guide
|
|
99
|
+
rules:
|
|
100
|
+
- provider-registry: "CLI Provider Registry is source of truth for provider capabilities."
|
|
101
|
+
priority: high
|
|
102
|
+
- provider-agnostic-handoff: "Handoff format is provider-agnostic. All agents produce handoffs in the same two-layer format."
|
|
103
|
+
priority: critical
|
|
104
|
+
- provider-fallback: "If a configured provider is unavailable, fall back to primary provider (claude) with warning."
|
|
105
|
+
priority: high
|
|
106
|
+
- provider-hooks: "Hook-based governance applies only to providers with hook support. Others use prompt injection."
|
|
107
|
+
priority: high
|
|
108
|
+
- provider-context-files: "Context file generation is automatic when a provider is enabled."
|
|
109
|
+
priority: normal
|
|
@@ -18,6 +18,26 @@ rules:
|
|
|
18
18
|
text: "Interact with user in their preferred language. Artifacts stay in English."
|
|
19
19
|
priority: normal
|
|
20
20
|
|
|
21
|
+
# Execution Profile Rules (v3.0.0)
|
|
22
|
+
execution-profiles:
|
|
23
|
+
- explore-readonly: "In explore profile, all write/edit tool calls are blocked."
|
|
24
|
+
priority: critical
|
|
25
|
+
- guided-confirmation: "In guided profile, significant writes require user confirmation."
|
|
26
|
+
priority: high
|
|
27
|
+
- autonomous-gate-check: "Autonomous profile requires cumulative gate scores >= 90%."
|
|
28
|
+
priority: critical
|
|
29
|
+
- profile-downgrade: "If quality drops below threshold during autonomous execution, auto-downgrade to guided."
|
|
30
|
+
priority: critical
|
|
31
|
+
|
|
32
|
+
# Multi-CLI Rules (v3.0.0)
|
|
33
|
+
multi-cli:
|
|
34
|
+
- primary-provider: "Claude is the default and primary provider. Multi-CLI is opt-in."
|
|
35
|
+
priority: high
|
|
36
|
+
- provider-validation: "Health check validates provider availability before spawning."
|
|
37
|
+
priority: high
|
|
38
|
+
- provider-model-map: "Each provider has its own model map. Agent assignments reference tier (opus/sonnet/haiku) which maps to provider-specific models."
|
|
39
|
+
priority: normal
|
|
40
|
+
|
|
21
41
|
modes:
|
|
22
42
|
planning:
|
|
23
43
|
writeScope: "chati.dev/"
|
|
@@ -27,19 +27,19 @@ import { existsSync, readFileSync } from 'fs';
|
|
|
27
27
|
import { join } from 'path';
|
|
28
28
|
|
|
29
29
|
const AGENT_MODELS = {
|
|
30
|
-
orchestrator: 'sonnet',
|
|
31
|
-
'greenfield-wu': 'haiku',
|
|
32
|
-
'brownfield-wu': 'opus',
|
|
33
|
-
brief: 'sonnet',
|
|
34
|
-
detail: 'opus',
|
|
35
|
-
architect: 'opus',
|
|
36
|
-
ux: 'sonnet',
|
|
37
|
-
phases: 'sonnet',
|
|
38
|
-
tasks: 'sonnet',
|
|
39
|
-
'qa-planning': 'opus',
|
|
40
|
-
'qa-implementation': 'opus',
|
|
41
|
-
dev: 'opus',
|
|
42
|
-
devops: 'sonnet',
|
|
30
|
+
orchestrator: { provider: 'claude', model: 'sonnet', tier: 'sonnet' },
|
|
31
|
+
'greenfield-wu': { provider: 'claude', model: 'haiku', tier: 'haiku' },
|
|
32
|
+
'brownfield-wu': { provider: 'claude', model: 'opus', tier: 'opus' },
|
|
33
|
+
brief: { provider: 'claude', model: 'sonnet', tier: 'sonnet' },
|
|
34
|
+
detail: { provider: 'claude', model: 'opus', tier: 'opus' },
|
|
35
|
+
architect: { provider: 'claude', model: 'opus', tier: 'opus' },
|
|
36
|
+
ux: { provider: 'claude', model: 'sonnet', tier: 'sonnet' },
|
|
37
|
+
phases: { provider: 'claude', model: 'sonnet', tier: 'sonnet' },
|
|
38
|
+
tasks: { provider: 'claude', model: 'sonnet', tier: 'sonnet' },
|
|
39
|
+
'qa-planning': { provider: 'claude', model: 'opus', tier: 'opus' },
|
|
40
|
+
'qa-implementation': { provider: 'claude', model: 'opus', tier: 'opus' },
|
|
41
|
+
dev: { provider: 'claude', model: 'opus', tier: 'opus' },
|
|
42
|
+
devops: { provider: 'claude', model: 'sonnet', tier: 'sonnet' },
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -77,11 +77,13 @@ async function main() {
|
|
|
77
77
|
const agent = getCurrentAgent(projectDir);
|
|
78
78
|
|
|
79
79
|
if (agent && AGENT_MODELS[agent]) {
|
|
80
|
-
const
|
|
80
|
+
const assignment = AGENT_MODELS[agent];
|
|
81
|
+
const expected = assignment.model || assignment;
|
|
82
|
+
const provider = assignment.provider || 'claude';
|
|
81
83
|
// Advisory note — appended to context
|
|
82
84
|
process.stdout.write(JSON.stringify({
|
|
83
85
|
result: 'allow',
|
|
84
|
-
prefix: `<!-- [Article XVI] Agent "${agent}" assigned model: ${expected} -->`,
|
|
86
|
+
prefix: `<!-- [Article XVI] Agent "${agent}" assigned model: ${expected} (provider: ${provider}) -->`,
|
|
85
87
|
}));
|
|
86
88
|
} else {
|
|
87
89
|
process.stdout.write(JSON.stringify({ result: 'allow' }));
|
|
@@ -161,3 +161,32 @@ If Smart Continuation is insufficient, the orchestrator spawns a new session:
|
|
|
161
161
|
---
|
|
162
162
|
|
|
163
163
|
*Context Engine v1.0 — Chati.dev Intelligence Layer*
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Multi-CLI Context Strategy (v3.0.0)
|
|
168
|
+
|
|
169
|
+
When agents execute on different CLI providers, context injection adapts to the provider's capabilities:
|
|
170
|
+
|
|
171
|
+
### Hook-Based Providers (Claude Code, Gemini CLI, Copilot CLI)
|
|
172
|
+
- PRISM context injected via `UserPromptSubmit` hook
|
|
173
|
+
- Mode governance enforced via `PreToolUse` hook
|
|
174
|
+
- Constitution guard enforced via `PreToolUse` hook
|
|
175
|
+
- Full governance parity with Claude Code
|
|
176
|
+
|
|
177
|
+
### Prompt-Based Providers (Codex CLI)
|
|
178
|
+
- PRISM context embedded directly in the spawned prompt (via prompt-builder)
|
|
179
|
+
- Governance directives included as system instructions in the prompt
|
|
180
|
+
- Softer enforcement — relies on model compliance rather than hook interception
|
|
181
|
+
- Write scope restrictions communicated via prompt, not blocked at tool level
|
|
182
|
+
|
|
183
|
+
### Context File Mapping
|
|
184
|
+
| Provider | Context File | Generation |
|
|
185
|
+
|----------|-------------|------------|
|
|
186
|
+
| Claude Code | CLAUDE.md | Native (already exists) |
|
|
187
|
+
| Gemini CLI | GEMINI.md | Auto-generated from CLAUDE.md |
|
|
188
|
+
| Codex CLI | AGENTS.md | Auto-generated from CLAUDE.md |
|
|
189
|
+
| Copilot CLI | All three | Reads CLAUDE.md, GEMINI.md, AGENTS.md natively |
|
|
190
|
+
|
|
191
|
+
### Cross-Provider Handoff
|
|
192
|
+
Handoff format is identical regardless of which provider executed the agent. The two-layer structure (Article VIII) ensures any provider can read any handoff. Session state in `.chati/session.yaml` is the single source of truth — all providers read from and write to the same session file.
|
|
@@ -185,3 +185,20 @@ This prevents cross-contamination while enabling knowledge sharing.
|
|
|
185
185
|
---
|
|
186
186
|
|
|
187
187
|
*Memory Layer v1.0 — Chati.dev Intelligence Layer*
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Cross-CLI Memory Persistence (v3.0.0)
|
|
192
|
+
|
|
193
|
+
Memory is provider-agnostic. All providers read from and write to the same memory store (`.chati/memories/`).
|
|
194
|
+
|
|
195
|
+
### Memory Capture Across Providers
|
|
196
|
+
- **Hook-based providers**: Capture via `PreCompact` hook (session-digest.js)
|
|
197
|
+
- **Prompt-based providers**: Capture via explicit instructions in the spawned prompt — the agent is instructed to output a `<chati-memory>` block that the orchestrator parses from stdout
|
|
198
|
+
|
|
199
|
+
### Memory Injection Across Providers
|
|
200
|
+
- **Hook-based providers**: Injected via PRISM engine hook (prism-engine.js)
|
|
201
|
+
- **Prompt-based providers**: Relevant memories are included in the spawned prompt by the prompt-builder
|
|
202
|
+
|
|
203
|
+
### Gotchas Auto-Capture
|
|
204
|
+
Gotchas are captured regardless of provider. The auto-capture engine monitors agent stdout for error patterns and tracks frequency. When an error pattern appears 3+ times across any provider combination, a gotcha is auto-created.
|
|
@@ -45,10 +45,15 @@ Before determining state, check if the user passed a subcommand:
|
|
|
45
45
|
-> Resume session with full context recovery
|
|
46
46
|
-> Re-activate session lock
|
|
47
47
|
|
|
48
|
+
/chati providers:
|
|
49
|
+
-> Display enabled providers and per-agent overrides (see Provider Routing section)
|
|
50
|
+
-> Stay locked
|
|
51
|
+
|
|
48
52
|
/chati help:
|
|
49
53
|
-> Display available commands:
|
|
50
54
|
/chati Start or resume session
|
|
51
55
|
/chati status Show project dashboard
|
|
56
|
+
/chati providers List enabled providers and overrides
|
|
52
57
|
/chati resume Resume from continuation file
|
|
53
58
|
/chati exit Save and exit session
|
|
54
59
|
/chati help Show this help
|
|
@@ -338,20 +343,20 @@ Model selection is **enforced by construction**: the orchestrator passes `--mode
|
|
|
338
343
|
|
|
339
344
|
### Model Map (Quick Reference)
|
|
340
345
|
|
|
341
|
-
| Agent | Default | Upgrade Condition |
|
|
342
|
-
|
|
343
|
-
| greenfield-wu | haiku | sonnet if multi-stack or enterprise |
|
|
344
|
-
| brownfield-wu | opus | no downgrade |
|
|
345
|
-
| brief | sonnet | opus if enterprise or 10+ integrations |
|
|
346
|
-
| detail | opus | no downgrade |
|
|
347
|
-
| architect | opus | no downgrade |
|
|
348
|
-
| ux | sonnet | opus if design system from scratch |
|
|
349
|
-
| phases | sonnet | opus if 20+ requirements |
|
|
350
|
-
| tasks | sonnet | opus if 50+ tasks |
|
|
351
|
-
| qa-planning | opus | no downgrade |
|
|
352
|
-
| dev | opus | no downgrade |
|
|
353
|
-
| qa-implementation | opus | no downgrade |
|
|
354
|
-
| devops | sonnet | opus if multi-environment or IaC |
|
|
346
|
+
| Agent | Default | Upgrade Condition | Provider |
|
|
347
|
+
|-------|---------|-------------------|----------|
|
|
348
|
+
| greenfield-wu | haiku | sonnet if multi-stack or enterprise | claude (default) |
|
|
349
|
+
| brownfield-wu | opus | no downgrade | claude (default) | gemini (when codebase > 100K LOC) |
|
|
350
|
+
| brief | sonnet | opus if enterprise or 10+ integrations | claude (default) |
|
|
351
|
+
| detail | opus | no downgrade | claude (default) |
|
|
352
|
+
| architect | opus | no downgrade | claude (default) |
|
|
353
|
+
| ux | sonnet | opus if design system from scratch | claude (default) |
|
|
354
|
+
| phases | sonnet | opus if 20+ requirements | claude (default) |
|
|
355
|
+
| tasks | sonnet | opus if 50+ tasks | claude (default) |
|
|
356
|
+
| qa-planning | opus | no downgrade | claude (default) |
|
|
357
|
+
| dev | opus | no downgrade | claude (default) | gemini (when large codebase tasks) |
|
|
358
|
+
| qa-implementation | opus | no downgrade | claude (default) |
|
|
359
|
+
| devops | sonnet | opus if multi-environment or IaC | claude (default) |
|
|
355
360
|
|
|
356
361
|
### Enforcement
|
|
357
362
|
|
|
@@ -383,6 +388,81 @@ model_selections:
|
|
|
383
388
|
|
|
384
389
|
---
|
|
385
390
|
|
|
391
|
+
## Provider Routing
|
|
392
|
+
|
|
393
|
+
The orchestrator selects the optimal provider for each agent based on the task context, codebase characteristics, and configuration. Provider routing determines WHICH CLI or API backend executes the agent, while model selection determines WHICH model runs within that provider.
|
|
394
|
+
|
|
395
|
+
### Provider Selection Priority
|
|
396
|
+
|
|
397
|
+
```
|
|
398
|
+
Resolution order (highest to lowest priority):
|
|
399
|
+
1. agent_overrides (config.yaml) — explicit per-agent provider override
|
|
400
|
+
2. Agent default (AGENT_MODELS map) — provider defined in agent Identity section
|
|
401
|
+
3. Primary provider — the project-level default provider (claude)
|
|
402
|
+
|
|
403
|
+
Example resolution:
|
|
404
|
+
config.yaml has: agent_overrides.brownfield-wu.provider = gemini
|
|
405
|
+
Agent default has: Provider: claude (default) | gemini (when codebase > 100K LOC)
|
|
406
|
+
Primary provider: claude
|
|
407
|
+
|
|
408
|
+
-> Result: gemini (config.yaml override wins)
|
|
409
|
+
|
|
410
|
+
If no override exists and no agent default specifies a condition match:
|
|
411
|
+
-> Result: claude (primary provider fallback)
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
### Provider Fallback
|
|
415
|
+
|
|
416
|
+
```
|
|
417
|
+
If the selected provider is unavailable (CLI not installed, API unreachable, auth failure):
|
|
418
|
+
1. Log the failure:
|
|
419
|
+
provider_fallback:
|
|
420
|
+
agent: {name}
|
|
421
|
+
intended_provider: {selected}
|
|
422
|
+
fallback_provider: claude
|
|
423
|
+
reason: "{error_message}"
|
|
424
|
+
timestamp: "{now}"
|
|
425
|
+
2. Fall back to the primary provider (claude)
|
|
426
|
+
3. Continue agent execution with fallback provider
|
|
427
|
+
4. Record the fallback in session.yaml for audit
|
|
428
|
+
|
|
429
|
+
The primary provider (claude) is always the last-resort fallback.
|
|
430
|
+
Provider fallback NEVER blocks the pipeline — it degrades gracefully.
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
### Subcommand: /chati providers
|
|
434
|
+
|
|
435
|
+
```
|
|
436
|
+
When the user types `/chati providers`:
|
|
437
|
+
Display enabled providers and their status:
|
|
438
|
+
|
|
439
|
+
Providers:
|
|
440
|
+
claude PRIMARY Enabled Claude Code CLI
|
|
441
|
+
gemini - Enabled Gemini CLI
|
|
442
|
+
codex - Disabled OpenAI Codex CLI
|
|
443
|
+
|
|
444
|
+
Agent Overrides (from config.yaml):
|
|
445
|
+
brownfield-wu -> gemini (when codebase > 100K LOC)
|
|
446
|
+
dev -> gemini (when large codebase tasks)
|
|
447
|
+
|
|
448
|
+
To configure: edit chati.dev/config.yaml -> providers section
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### Provider Logging
|
|
452
|
+
|
|
453
|
+
```yaml
|
|
454
|
+
# Appended to session.yaml on each agent activation
|
|
455
|
+
provider_selections:
|
|
456
|
+
- agent: brownfield-wu
|
|
457
|
+
resolved_provider: gemini
|
|
458
|
+
resolution_source: agent_default # config_override | agent_default | primary
|
|
459
|
+
reason: "codebase > 100K LOC"
|
|
460
|
+
model: opus
|
|
461
|
+
timestamp: "2026-..."
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
386
466
|
## Mode Enforcement Protocol
|
|
387
467
|
|
|
388
468
|
### Scope Validation
|
|
@@ -37,6 +37,50 @@
|
|
|
37
37
|
"type": "array",
|
|
38
38
|
"items": { "type": "string" },
|
|
39
39
|
"description": "IDEs configured during installation"
|
|
40
|
+
},
|
|
41
|
+
"providers": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"description": "CLI provider configuration",
|
|
44
|
+
"properties": {
|
|
45
|
+
"claude": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"properties": {
|
|
48
|
+
"enabled": { "type": "boolean", "default": true },
|
|
49
|
+
"primary": { "type": "boolean", "default": true }
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"gemini": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"properties": {
|
|
55
|
+
"enabled": { "type": "boolean", "default": false },
|
|
56
|
+
"model_default": { "type": "string", "default": "pro" }
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"codex": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"properties": {
|
|
62
|
+
"enabled": { "type": "boolean", "default": false },
|
|
63
|
+
"model_default": { "type": "string", "default": "codex" }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"copilot": {
|
|
67
|
+
"type": "object",
|
|
68
|
+
"properties": {
|
|
69
|
+
"enabled": { "type": "boolean", "default": false }
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"agent_overrides": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"description": "Per-agent provider/model overrides",
|
|
77
|
+
"additionalProperties": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"properties": {
|
|
80
|
+
"provider": { "type": "string" },
|
|
81
|
+
"model": { "type": "string" }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
40
84
|
}
|
|
41
85
|
}
|
|
42
86
|
}
|
|
@@ -19,6 +19,32 @@
|
|
|
19
19
|
"default": "interactive",
|
|
20
20
|
"description": "interactive = agent-driven guided mode; autonomous = Ralph Wiggum mode (Dev agent)"
|
|
21
21
|
},
|
|
22
|
+
"execution_profile": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"enum": ["explore", "guided", "autonomous"],
|
|
25
|
+
"default": "guided",
|
|
26
|
+
"description": "Current execution profile governing confirmation requirements"
|
|
27
|
+
},
|
|
28
|
+
"providers_enabled": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": { "type": "string" },
|
|
31
|
+
"default": ["claude"],
|
|
32
|
+
"description": "List of enabled CLI providers"
|
|
33
|
+
},
|
|
34
|
+
"profile_transitions": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"properties": {
|
|
39
|
+
"from": { "type": "string" },
|
|
40
|
+
"to": { "type": "string" },
|
|
41
|
+
"reason": { "type": "string" },
|
|
42
|
+
"timestamp": { "type": "string", "format": "date-time" }
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"default": [],
|
|
46
|
+
"description": "History of execution profile changes"
|
|
47
|
+
},
|
|
22
48
|
"current_agent": {
|
|
23
49
|
"type": "string",
|
|
24
50
|
"description": "Currently active agent name"
|
|
@@ -143,6 +169,7 @@
|
|
|
143
169
|
"recommended": { "enum": ["opus", "sonnet", "haiku"], "description": "Recommended model" },
|
|
144
170
|
"actual": { "enum": ["opus", "sonnet", "haiku"], "description": "Model actually used" },
|
|
145
171
|
"reason": { "type": "string", "description": "Why this model was selected (default, upgrade condition, no downgrade)" },
|
|
172
|
+
"provider": { "type": "string", "description": "CLI provider used (claude, gemini, codex, copilot)" },
|
|
146
173
|
"timestamp": { "type": "string", "format": "date-time" }
|
|
147
174
|
}
|
|
148
175
|
}
|