the-grid-cc 1.7.14 → 1.7.16

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.
@@ -22,7 +22,7 @@ Initialize the `.grid/` directory structure for the current project. This create
22
22
  Create the complete `.grid/` directory structure:
23
23
 
24
24
  ```bash
25
- mkdir -p .grid/plans .grid/phases .grid/discs .grid/debug .grid/refinement/screenshots .grid/refinement/e2e .grid/refinement/personas
25
+ mkdir -p .grid/plans .grid/phases .grid/discs .grid/debug .grid/daemon .grid/refinement/screenshots .grid/refinement/e2e .grid/refinement/personas
26
26
  ```
27
27
 
28
28
  ### Directory Purposes
@@ -34,6 +34,7 @@ mkdir -p .grid/plans .grid/phases .grid/discs .grid/debug .grid/refinement/scree
34
34
  | `.grid/phases/` | Execution artifacts (SUMMARY.md files) | Mission-scoped |
35
35
  | `.grid/discs/` | Identity Discs for Programs | Session-scoped |
36
36
  | `.grid/debug/` | Debug session state | Survives /clear |
37
+ | `.grid/daemon/` | Daemon execution state | Mission-scoped |
37
38
  | `.grid/refinement/` | Refinement swarm outputs | Mission-scoped |
38
39
 
39
40
  ## CORE STATE FILES
@@ -234,6 +235,36 @@ Configuration for Grid behavior:
234
235
  }
235
236
  ```
236
237
 
238
+ ### budget.json (Budget Tracking)
239
+
240
+ Initialize from template if not exists:
241
+
242
+ ```bash
243
+ if [ ! -f .grid/budget.json ]; then
244
+ cp .grid/budget.template.json .grid/budget.json
245
+ fi
246
+ ```
247
+
248
+ Budget configuration for cost tracking (see `/grid:budget` for details):
249
+
250
+ ```json
251
+ {
252
+ "budget_limit": null,
253
+ "currency": "USD",
254
+ "enforcement": "hard",
255
+ "warning_threshold": 0.75,
256
+ "confirmation_threshold": 0.90,
257
+ "current_session": {
258
+ "estimated_cost": 0,
259
+ "spawns": []
260
+ },
261
+ "history": {
262
+ "total_cost": 0,
263
+ "total_spawns": 0
264
+ }
265
+ }
266
+ ```
267
+
237
268
  ## INITIALIZATION BEHAVIOR
238
269
 
239
270
  ### Step 1: Check Existing State
@@ -262,6 +293,7 @@ mkdir -p .grid/plans
262
293
  mkdir -p .grid/phases
263
294
  mkdir -p .grid/discs
264
295
  mkdir -p .grid/debug
296
+ mkdir -p .grid/daemon
265
297
  mkdir -p .grid/refinement/screenshots
266
298
  mkdir -p .grid/refinement/e2e
267
299
  mkdir -p .grid/refinement/personas
@@ -302,11 +334,13 @@ Directory structure created:
302
334
  ├── DECISIONS.md User decisions log
303
335
  ├── BLOCKERS.md Blocker tracking
304
336
  ├── config.json Grid configuration
337
+ ├── budget.json Budget tracking (cost management)
305
338
 
306
339
  ├── plans/ Execution plans
307
340
  ├── phases/ Execution artifacts (SUMMARY.md files)
308
341
  ├── discs/ Identity Discs for Programs
309
342
  ├── debug/ Debug session state
343
+ ├── daemon/ Daemon execution state (long-running tasks)
310
344
  └── refinement/ Refinement swarm outputs
311
345
  ├── screenshots/
312
346
  ├── e2e/
@@ -341,30 +341,77 @@ These cause MC to go rogue. If you catch yourself doing ANY of these, STOP.
341
341
  ## QUICK REFERENCE
342
342
 
343
343
  ```
344
+ CORE PROGRAMS
345
+ ─────────────
344
346
  Spawn Planner: Task(prompt="First, read ~/.claude/agents/grid-planner.md...", ...)
345
347
  Spawn Executor: Task(prompt="First, read ~/.claude/agents/grid-executor.md...", ...)
346
348
  Spawn Recognizer: Task(prompt="First, read ~/.claude/agents/grid-recognizer.md...", ...)
347
349
  Spawn Debugger: Task(prompt="First, read ~/.claude/agents/grid-debugger.md...", ...)
348
350
 
349
- Refinement Swarm:
350
- Visual: Task(prompt="First, read ~/.claude/agents/grid-visual-inspector.md...", ...)
351
- E2E: Task(prompt="First, read ~/.claude/agents/grid-e2e-exerciser.md...", ...)
352
- Persona: Task(prompt="First, read ~/.claude/agents/grid-persona-simulator.md...", ...)
353
- Synth: Task(prompt="First, read ~/.claude/agents/grid-refinement-synth.md...", ...)
354
-
351
+ REFINEMENT SWARM
352
+ ────────────────
353
+ Visual: Task(prompt="First, read ~/.claude/agents/grid-visual-inspector.md...", ...)
354
+ E2E: Task(prompt="First, read ~/.claude/agents/grid-e2e-exerciser.md...", ...)
355
+ Persona: Task(prompt="First, read ~/.claude/agents/grid-persona-simulator.md...", ...)
356
+ Synth: Task(prompt="First, read ~/.claude/agents/grid-refinement-synth.md...", ...)
357
+
358
+ SPECIALIST PROGRAMS
359
+ ───────────────────
360
+ Git Ops: Task(prompt="First, read ~/.claude/agents/grid-git-operator.md...", ...)
361
+ Accountant: Task(prompt="First, read ~/.claude/agents/grid-accountant.md...", ...)
362
+ Researcher: Task(prompt="First, read ~/.claude/agents/grid-researcher.md...", ...)
363
+ Scout: Task(prompt="First, read ~/.claude/agents/grid-scout.md...", ...)
364
+
365
+ COMMANDS
366
+ ────────
367
+ /grid Main entry point (AUTOPILOT mode)
368
+ /grid:quick Fast execution (trivial tasks)
369
+ /grid:refine Refinement swarm (visual, e2e, personas)
370
+ /grid:debug Systematic bug investigation
371
+ /grid:status Grid status and progress
372
+ /grid:resume Resume interrupted missions
373
+ /grid:daemon Background execution mode
374
+ /grid:budget Cost tracking and limits
375
+ /grid:branch Git branch management
376
+ /grid:model Configure model selection
377
+ /grid:init Initialize Grid state
378
+ /grid:help Command reference
379
+ /grid:mc Master Control (this)
380
+ /grid:program_disc View program identity disc
381
+ /grid:update Update Grid to latest
382
+
383
+ OPERATIONS
384
+ ──────────
355
385
  Parallel spawn: Multiple Task() calls in ONE message
356
386
  Wave execution: Read wave numbers from plan frontmatter, auto-verify after each
357
387
  Verification: Automatic after SUCCESS (wave-level, opt-out via verify: false)
358
388
  Quick mode: Auto-detect trivial builds (<=5 files, single block, clear scope)
359
389
  Checkpoints: Present via I/O Tower, spawn fresh with warmth
360
- State: Check .grid/STATE.md on startup
361
- Learnings: Check .grid/LEARNINGS.md for past patterns
362
- Scratchpad: .grid/SCRATCHPAD.md for live discoveries (MANDATORY writes)
363
- Debug: Check .grid/debug/ for investigation graphs
364
- Warmth: lessons_learned in SUMMARY.md frontmatter
365
- Retry: Pass failure report to retry spawns
366
- Plan pipeline: Planner returns structured YAML with inline content
367
- Protocols: Full details in ~/.claude/docs/MC_PROTOCOLS.md
390
+ Budget checks: Before EVERY spawn, enforce limits
391
+ Branch management: Auto-create feature branches, never commit to main
392
+ Cost tracking: Record all spawns, estimate cluster costs
393
+
394
+ STATE FILES
395
+ ───────────
396
+ State: .grid/STATE.md - Current mission state
397
+ Learnings: .grid/LEARNINGS.md - Past patterns
398
+ Scratchpad: .grid/SCRATCHPAD.md - Live discoveries (MANDATORY writes)
399
+ Debug: .grid/debug/ - Investigation graphs
400
+ Budget: .grid/budget.json - Cost tracking
401
+ Config: .grid/config.json - All settings
402
+ Checkpoint: .grid/CHECKPOINT.md - Resume points
403
+
404
+ TRANSFER
405
+ ────────
406
+ Warmth: lessons_learned in SUMMARY.md frontmatter
407
+ Retry: Pass failure report to retry spawns
408
+ Research: Cache in .grid/research_cache/
409
+ Scout: Recon reports in .grid/scout/
410
+
411
+ PROTOCOLS
412
+ ─────────
413
+ Plan pipeline: Planner returns structured YAML with inline content
414
+ Full details: ~/.claude/docs/MC_PROTOCOLS.md
368
415
  ```
369
416
 
370
417
  End of Line.
@@ -0,0 +1,479 @@
1
+ # Grid Configuration Schema
2
+
3
+ Complete reference for `.grid/config.json` - the master configuration file for all Grid settings.
4
+
5
+ ---
6
+
7
+ ## MASTER CONFIG STRUCTURE
8
+
9
+ ```json
10
+ {
11
+ "version": "1.7.x",
12
+ "initialized": "2026-01-23T10:00:00Z",
13
+
14
+ "model_tier": "quality",
15
+
16
+ "git": {
17
+ "auto_branch": true,
18
+ "branch_prefix": "grid/",
19
+ "auto_push": "wave",
20
+ "auto_pr": true,
21
+ "protected_branches": ["main", "master", "production"],
22
+ "default_base": "main",
23
+ "sync_strategy": "merge",
24
+ "commit_signing": false,
25
+ "wip_commits": true
26
+ },
27
+
28
+ "budget": {
29
+ "enabled": true,
30
+ "budget_limit": null,
31
+ "currency": "USD",
32
+ "enforcement": "hard",
33
+ "warning_threshold": 0.75,
34
+ "confirmation_threshold": 0.90
35
+ },
36
+
37
+ "daemon": {
38
+ "default_mode": "autopilot",
39
+ "max_runtime_hours": 24,
40
+ "checkpoint_on_wave_complete": true,
41
+ "heartbeat_interval_seconds": 30,
42
+ "stall_threshold_minutes": 30,
43
+
44
+ "notifications": {
45
+ "system": true,
46
+ "sound": true,
47
+ "webhook": null
48
+ },
49
+
50
+ "notify_on": {
51
+ "start": false,
52
+ "checkpoint": true,
53
+ "complete": true,
54
+ "error": true,
55
+ "stall": true
56
+ },
57
+
58
+ "cleanup": {
59
+ "auto_clean_completed_days": 7,
60
+ "keep_audit_logs": true
61
+ }
62
+ },
63
+
64
+ "verification": {
65
+ "auto_verify": true,
66
+ "wave_level": true,
67
+ "skip_for_types": []
68
+ },
69
+
70
+ "refinement": {
71
+ "auto_refine": true,
72
+ "skip_backend_only": true,
73
+ "persona_count": 3,
74
+ "parallel_execution": true
75
+ },
76
+
77
+ "research": {
78
+ "auto_research": true,
79
+ "cache_duration_hours": 24,
80
+ "parallel_searches": true,
81
+ "max_sources_per_query": 10
82
+ },
83
+
84
+ "scout": {
85
+ "auto_scout": true,
86
+ "timeout_seconds": 120,
87
+ "max_file_scan": 100,
88
+ "max_depth": 4
89
+ },
90
+
91
+ "scratchpad": {
92
+ "mandatory": true,
93
+ "archive_on_wave_complete": true,
94
+ "max_entries_before_archive": 100
95
+ },
96
+
97
+ "learnings": {
98
+ "auto_capture": true,
99
+ "load_on_startup": true
100
+ },
101
+
102
+ "debug": {
103
+ "persist_sessions": true,
104
+ "max_session_age_days": 30
105
+ },
106
+
107
+ "ui": {
108
+ "progress_updates": "live",
109
+ "emoji": false,
110
+ "color": true,
111
+ "verbose": false
112
+ }
113
+ }
114
+ ```
115
+
116
+ ---
117
+
118
+ ## FIELD REFERENCE
119
+
120
+ ### Top Level
121
+
122
+ | Field | Type | Default | Description |
123
+ |-------|------|---------|-------------|
124
+ | `version` | string | "1.7.x" | Grid version |
125
+ | `initialized` | ISO timestamp | (auto) | When config was created |
126
+ | `model_tier` | enum | "quality" | Default model tier: quality/balanced/budget |
127
+
128
+ ---
129
+
130
+ ### Git Section
131
+
132
+ Controls git operations and branch management.
133
+
134
+ | Field | Type | Default | Description |
135
+ |-------|------|---------|-------------|
136
+ | `auto_branch` | boolean | true | Auto-create feature branches |
137
+ | `branch_prefix` | string | "grid/" | Prefix for Grid branches |
138
+ | `auto_push` | enum | "wave" | Push timing: wave/block/manual/immediate |
139
+ | `auto_pr` | boolean | true | Offer PR creation on completion |
140
+ | `protected_branches` | array | ["main",...] | Branches that require PRs |
141
+ | `default_base` | string | "main" | Default base branch for PRs |
142
+ | `sync_strategy` | enum | "merge" | How to sync: merge/rebase |
143
+ | `commit_signing` | boolean | false | GPG sign commits |
144
+ | `wip_commits` | boolean | true | Allow WIP commits for long sessions |
145
+
146
+ **Auto Push Modes:**
147
+ - `wave` - Push after each wave completes (default)
148
+ - `block` - Push after each block completes
149
+ - `manual` - Never auto-push
150
+ - `immediate` - Push after every commit
151
+
152
+ **Sync Strategy:**
153
+ - `merge` - git merge origin/main
154
+ - `rebase` - git rebase origin/main
155
+
156
+ ---
157
+
158
+ ### Budget Section
159
+
160
+ Controls cost tracking and spending limits.
161
+
162
+ | Field | Type | Default | Description |
163
+ |-------|------|---------|-------------|
164
+ | `enabled` | boolean | true | Enable budget tracking |
165
+ | `budget_limit` | number\|null | null | Max spending (null = unlimited) |
166
+ | `currency` | string | "USD" | Currency for display |
167
+ | `enforcement` | enum | "hard" | hard=block, soft=warn only |
168
+ | `warning_threshold` | number | 0.75 | Warn at 75% usage |
169
+ | `confirmation_threshold` | number | 0.90 | Require confirmation at 90% |
170
+
171
+ **Enforcement Modes:**
172
+ - `hard` - Block spawns when budget exceeded
173
+ - `soft` - Warn but allow spawns
174
+
175
+ **Thresholds:**
176
+ - 0.0-0.75: Normal operation
177
+ - 0.75-0.90: Display warnings
178
+ - 0.90-1.0: Require confirmation before spawn
179
+ - 1.0+: Block spawns (if hard enforcement)
180
+
181
+ ---
182
+
183
+ ### Daemon Section
184
+
185
+ Controls background execution mode.
186
+
187
+ | Field | Type | Default | Description |
188
+ |-------|------|---------|-------------|
189
+ | `default_mode` | enum | "autopilot" | Default execution mode |
190
+ | `max_runtime_hours` | number | 24 | Max daemon runtime |
191
+ | `checkpoint_on_wave_complete` | boolean | true | Checkpoint after each wave |
192
+ | `heartbeat_interval_seconds` | number | 30 | Heartbeat frequency |
193
+ | `stall_threshold_minutes` | number | 30 | Alert if no heartbeat |
194
+
195
+ **Notifications:**
196
+
197
+ | Field | Type | Default | Description |
198
+ |-------|------|---------|-------------|
199
+ | `system` | boolean | true | System notifications |
200
+ | `sound` | boolean | true | Play sound alerts |
201
+ | `webhook` | string\|null | null | Webhook URL for notifications |
202
+
203
+ **Notify On:**
204
+
205
+ | Field | Type | Default | Description |
206
+ |-------|------|---------|-------------|
207
+ | `start` | boolean | false | Notify on daemon start |
208
+ | `checkpoint` | boolean | true | Notify on checkpoints |
209
+ | `complete` | boolean | true | Notify on completion |
210
+ | `error` | boolean | true | Notify on errors |
211
+ | `stall` | boolean | true | Notify on stalls |
212
+
213
+ **Cleanup:**
214
+
215
+ | Field | Type | Default | Description |
216
+ |-------|------|---------|-------------|
217
+ | `auto_clean_completed_days` | number | 7 | Delete completed daemons after N days |
218
+ | `keep_audit_logs` | boolean | true | Keep audit logs even after cleanup |
219
+
220
+ ---
221
+
222
+ ### Verification Section
223
+
224
+ Controls automatic verification behavior.
225
+
226
+ | Field | Type | Default | Description |
227
+ |-------|------|---------|-------------|
228
+ | `auto_verify` | boolean | true | Auto-spawn Recognizer after SUCCESS |
229
+ | `wave_level` | boolean | true | Verify at wave level (vs block level) |
230
+ | `skip_for_types` | array | [] | Block types to skip verification |
231
+
232
+ **Example skip types:**
233
+ ```json
234
+ {
235
+ "skip_for_types": ["prototype", "throwaway", "spike"]
236
+ }
237
+ ```
238
+
239
+ ---
240
+
241
+ ### Refinement Section
242
+
243
+ Controls refinement swarm behavior.
244
+
245
+ | Field | Type | Default | Description |
246
+ |-------|------|---------|-------------|
247
+ | `auto_refine` | boolean | true | Auto-run refinement after building |
248
+ | `skip_backend_only` | boolean | true | Skip refinement for backend-only changes |
249
+ | `persona_count` | number | 3 | Number of personas to simulate |
250
+ | `parallel_execution` | boolean | true | Run refinement agents in parallel |
251
+
252
+ ---
253
+
254
+ ### Research Section
255
+
256
+ Controls external research behavior.
257
+
258
+ | Field | Type | Default | Description |
259
+ |-------|------|---------|-------------|
260
+ | `auto_research` | boolean | true | Auto-research unfamiliar tech |
261
+ | `cache_duration_hours` | number | 24 | How long to cache research |
262
+ | `parallel_searches` | boolean | true | Execute searches in parallel |
263
+ | `max_sources_per_query` | number | 10 | Max sources to analyze per query |
264
+
265
+ ---
266
+
267
+ ### Scout Section
268
+
269
+ Controls codebase reconnaissance behavior.
270
+
271
+ | Field | Type | Default | Description |
272
+ |-------|------|---------|-------------|
273
+ | `auto_scout` | boolean | true | Auto-scout existing codebases |
274
+ | `timeout_seconds` | number | 120 | Max scout duration (2 minutes) |
275
+ | `max_file_scan` | number | 100 | Max files to scan per type |
276
+ | `max_depth` | number | 4 | Max directory depth to scan |
277
+
278
+ ---
279
+
280
+ ### Scratchpad Section
281
+
282
+ Controls live observability during execution.
283
+
284
+ | Field | Type | Default | Description |
285
+ |-------|------|---------|-------------|
286
+ | `mandatory` | boolean | true | Programs MUST write to scratchpad |
287
+ | `archive_on_wave_complete` | boolean | true | Archive after each wave |
288
+ | `max_entries_before_archive` | number | 100 | Archive threshold |
289
+
290
+ ---
291
+
292
+ ### Learnings Section
293
+
294
+ Controls institutional memory capture.
295
+
296
+ | Field | Type | Default | Description |
297
+ |-------|------|---------|-------------|
298
+ | `auto_capture` | boolean | true | Capture learnings after completion |
299
+ | `load_on_startup` | boolean | true | Load learnings at session start |
300
+
301
+ ---
302
+
303
+ ### Debug Section
304
+
305
+ Controls debug session persistence.
306
+
307
+ | Field | Type | Default | Description |
308
+ |-------|------|---------|-------------|
309
+ | `persist_sessions` | boolean | true | Keep debug sessions in .grid/debug/ |
310
+ | `max_session_age_days` | number | 30 | Delete sessions older than N days |
311
+
312
+ ---
313
+
314
+ ### UI Section
315
+
316
+ Controls output formatting and display.
317
+
318
+ | Field | Type | Default | Description |
319
+ |-------|------|---------|-------------|
320
+ | `progress_updates` | enum | "live" | Update frequency: live/wave/block/silent |
321
+ | `emoji` | boolean | false | Use emoji in output |
322
+ | `color` | boolean | true | Use ANSI colors |
323
+ | `verbose` | boolean | false | Show detailed internal operations |
324
+
325
+ **Progress Update Modes:**
326
+ - `live` - Show real-time scratchpad updates
327
+ - `wave` - Update after each wave
328
+ - `block` - Update after each block
329
+ - `silent` - No progress updates (status on demand only)
330
+
331
+ ---
332
+
333
+ ## CONFIGURATION COMMANDS
334
+
335
+ ### Initialize Default Config
336
+
337
+ ```bash
338
+ /grid:init
339
+ ```
340
+
341
+ Creates `.grid/config.json` with defaults.
342
+
343
+ ### Update Config
344
+
345
+ ```bash
346
+ /grid:model quality # Set model tier
347
+ /grid:budget set $50 # Set budget limit
348
+ /grid:branch --auto-push=block # Change push timing
349
+ ```
350
+
351
+ ### View Current Config
352
+
353
+ ```bash
354
+ /grid:status --config
355
+ ```
356
+
357
+ ---
358
+
359
+ ## CONFIGURATION OVERRIDES
360
+
361
+ ### Environment Variables
362
+
363
+ Environment variables override config file:
364
+
365
+ ```bash
366
+ GRID_MODEL_TIER=balanced
367
+ GRID_GIT_AUTO_PUSH=manual
368
+ GRID_BUDGET_LIMIT=100
369
+ GRID_DEBUG_VERBOSE=true
370
+ ```
371
+
372
+ ### Per-Session Overrides
373
+
374
+ Specify at invocation:
375
+
376
+ ```bash
377
+ /grid --no-verify "build feature"
378
+ /grid --budget-check=false "quick fix"
379
+ /grid --model=sonnet "simple task"
380
+ ```
381
+
382
+ ---
383
+
384
+ ## MIGRATION
385
+
386
+ ### From Older Versions
387
+
388
+ If config is missing fields, defaults are used. Run:
389
+
390
+ ```bash
391
+ /grid:init --merge
392
+ ```
393
+
394
+ Merges new defaults with existing config without overwriting.
395
+
396
+ ---
397
+
398
+ ## VALIDATION
399
+
400
+ Config is validated on load. Invalid configs show:
401
+
402
+ ```
403
+ CONFIG ERROR
404
+ ============
405
+
406
+ Invalid config: .grid/config.json
407
+
408
+ Issues:
409
+ - model_tier must be one of: quality, balanced, budget
410
+ - budget.budget_limit must be number or null
411
+ - git.auto_push must be one of: wave, block, manual, immediate
412
+
413
+ Fix the config or run /grid:init --reset to restore defaults.
414
+ ```
415
+
416
+ ---
417
+
418
+ ## EXAMPLES
419
+
420
+ ### Budget-Conscious Setup
421
+
422
+ ```json
423
+ {
424
+ "model_tier": "balanced",
425
+ "budget": {
426
+ "enabled": true,
427
+ "budget_limit": 25.00,
428
+ "enforcement": "hard"
429
+ },
430
+ "verification": {
431
+ "auto_verify": false
432
+ },
433
+ "refinement": {
434
+ "auto_refine": false
435
+ }
436
+ }
437
+ ```
438
+
439
+ ### Team Collaboration Setup
440
+
441
+ ```json
442
+ {
443
+ "git": {
444
+ "auto_branch": true,
445
+ "auto_push": "wave",
446
+ "auto_pr": true,
447
+ "commit_signing": true
448
+ },
449
+ "daemon": {
450
+ "notifications": {
451
+ "webhook": "https://hooks.slack.com/services/..."
452
+ }
453
+ }
454
+ }
455
+ ```
456
+
457
+ ### Fast Iteration Setup
458
+
459
+ ```json
460
+ {
461
+ "model_tier": "quality",
462
+ "verification": {
463
+ "auto_verify": true
464
+ },
465
+ "refinement": {
466
+ "auto_refine": false
467
+ },
468
+ "research": {
469
+ "auto_research": false
470
+ },
471
+ "git": {
472
+ "auto_push": "immediate"
473
+ }
474
+ }
475
+ ```
476
+
477
+ ---
478
+
479
+ End of Line.