the-grid-cc 1.1.5 → 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/README.md CHANGED
@@ -51,6 +51,18 @@ Already have The Grid? Update from within Claude Code:
51
51
  /grid:update
52
52
  ```
53
53
 
54
+ ### Status Bar
55
+
56
+ The Grid adds a context meter to your Claude Code status bar:
57
+
58
+ ```
59
+ Master Control ░░░░░░░░░░ 0% ← Fresh session
60
+ Master Control █████░░░░░ 50% ← Half context used
61
+ Master Control █████████░ 90% ← Running low
62
+ ```
63
+
64
+ Visual `/context` at a glance. Bar fills as you use more context.
65
+
54
66
  ---
55
67
 
56
68
  ## The Hierarchy
package/TICKETS.md ADDED
@@ -0,0 +1,585 @@
1
+ # THE GRID - COMPREHENSIVE TICKET LIST
2
+
3
+ > Generated from competitive analysis of get-shit-done and best practices research.
4
+ > 28 agents deployed to extract patterns. 24 tickets created.
5
+
6
+ ---
7
+
8
+ ## PRIORITY 1: CORE PARALLEL EXECUTION
9
+
10
+ ### TICKET #1: Implement true subprocess spawning for Grid agents
11
+ **Status:** ✅ COMPLETED
12
+
13
+ Add ability for Master Control to spawn Claude Code agents as actual background processes with their own context windows. Use the Task tool with run_in_background:true pattern. Each spawned agent gets fresh 200k context. Key patterns from research:
14
+ - BatchTool pattern: multiple Task calls in single message
15
+ - Background execution with output file tracking
16
+ - Agent ID tracking for resumption
17
+
18
+ ---
19
+
20
+ ### TICKET #3: Build parallel BatchTool execution pattern into Master Control
21
+ **Status:** ✅ COMPLETED
22
+
23
+ Master Control should spawn multiple agents in a SINGLE message with multiple Task tool calls. This is the key to true parallel execution. Pattern:
24
+ ```
25
+ [Single Message]:
26
+ - Task("Agent 1...")
27
+ - Task("Agent 2...")
28
+ - Task("Agent 3...")
29
+ ```
30
+ NOT sequential calls. Must be batched.
31
+
32
+ ---
33
+
34
+ ### TICKET #12: Implement wave-based parallel execution (pre-computed during planning)
35
+ **Status:** ✅ COMPLETED
36
+
37
+ GSD's killer feature: waves are computed DURING PLANNING, not at execution time.
38
+
39
+ Pattern:
40
+ - Planner assigns wave numbers to each plan based on file_modified arrays
41
+ - Plans that touch same files = sequential (next wave)
42
+ - Plans with no overlap = parallel (same wave)
43
+ - Checkpoints always get their own wave (blocking)
44
+
45
+ Orchestrator just reads wave numbers from frontmatter and groups:
46
+ ```
47
+ waves = {
48
+ 1: [plan-01, plan-02], # parallel
49
+ 2: [plan-03, plan-04], # parallel, after wave 1
50
+ 3: [plan-05] # sequential
51
+ }
52
+ ```
53
+
54
+ This is the foundation for true parallel agent spawning.
55
+
56
+ ---
57
+
58
+ ### TICKET #13: Add inline content pattern for agent spawning (break @-ref boundaries)
59
+ **Status:** ✅ COMPLETED
60
+
61
+ Critical pattern from GSD: @-references DON'T work across Task() boundaries.
62
+
63
+ Before spawning an agent, read ALL files and INLINE the content:
64
+ ```python
65
+ PLAN_CONTENT = read(".planning/01-PLAN.md")
66
+ STATE_CONTENT = read(".planning/STATE.md")
67
+ CONFIG_CONTENT = read(".planning/config.json")
68
+
69
+ Task(
70
+ prompt=f"...{PLAN_CONTENT}...{STATE_CONTENT}...{CONFIG_CONTENT}...",
71
+ ...
72
+ )
73
+ ```
74
+
75
+ Each agent gets a FRESH 200k context with everything it needs PRE-LOADED. No file access overhead, no context leakage.
76
+
77
+ ---
78
+
79
+ ## PRIORITY 2: VERIFICATION & QUALITY
80
+
81
+ ### TICKET #14: Implement goal-backward verification in Recognizer
82
+ **Status:** ✅ COMPLETED
83
+
84
+ GSD's most powerful pattern: Goal-backward verification.
85
+
86
+ Task completion ≠ Goal achievement. A task "create chat component" can be complete while the component is just a stub.
87
+
88
+ Process:
89
+ 1. Start with GOAL (not task list)
90
+ 2. Derive TRUTHS - "What must be TRUE for goal to succeed?" (3-7 observable behaviors)
91
+ 3. Derive ARTIFACTS - "What must EXIST?" (concrete files)
92
+ 4. Derive KEY_LINKS - "What must be CONNECTED?" (wiring points where stubs hide)
93
+ 5. Verify each level: existence → substantive → wired
94
+
95
+ YAML structure:
96
+ ```yaml
97
+ must_haves:
98
+ truths: ["User can see messages", "User can send message"]
99
+ artifacts:
100
+ - path: "src/components/Chat.tsx"
101
+ provides: "Message list rendering"
102
+ min_lines: 15
103
+ key_links:
104
+ - from: "Chat.tsx"
105
+ to: "/api/chat"
106
+ via: "fetch in useEffect"
107
+ ```
108
+
109
+ ---
110
+
111
+ ### TICKET #16: Implement three-level artifact verification (existence, substantive, wired)
112
+ **Status:** ✅ COMPLETED
113
+
114
+ Every artifact must pass three checks:
115
+
116
+ **Level 1: EXISTENCE**
117
+ - Does the file physically exist?
118
+
119
+ **Level 2: SUBSTANTIVE**
120
+ - Is it real code, not a stub?
121
+ - Minimum line count (15+ for components, 10+ for API)
122
+ - No TODO/FIXME/placeholder patterns
123
+ - Functions actually exported
124
+
125
+ **Level 3: WIRED**
126
+ - Is it imported and used elsewhere?
127
+ - Critical connections exist?
128
+ - Not orphaned code?
129
+
130
+ Stub detection patterns:
131
+ ```bash
132
+ # Comments
133
+ TODO|FIXME|PLACEHOLDER|coming soon
134
+
135
+ # Empty implementations
136
+ return null|return {}|return []|pass
137
+
138
+ # React stubs
139
+ <div>Component</div>|onClick={() => {}}
140
+
141
+ # API stubs
142
+ "Not implemented"|return Response.json([])
143
+ ```
144
+
145
+ ---
146
+
147
+ ### TICKET #7: Add Recognizer aerial patrol for spawned agents
148
+ **Status:** ✅ COMPLETED
149
+
150
+ Recognizer should patrol all spawned agent outputs, checking for:
151
+ - Incomplete code (TODO, FIXME, stub functions)
152
+ - Failed tests
153
+ - Errors in output
154
+ - Task completion verification
155
+
156
+ Pattern: Goal-backward verification - start from desired outcome, verify work meets it.
157
+
158
+ ---
159
+
160
+ ### TICKET #15: Add deviation rules for automatic decision-making
161
+ **Status:** ✅ COMPLETED
162
+
163
+ GSD executors auto-fix common issues without stopping:
164
+
165
+ **RULE 1: Auto-fix bugs**
166
+ - Trigger: Code doesn't work (errors, logic issues)
167
+ - Action: Fix immediately, track in SUMMARY
168
+ - No permission needed
169
+
170
+ **RULE 2: Auto-add missing critical functionality**
171
+ - Trigger: Missing error handling, validation, auth checks
172
+ - Action: Add immediately, track in SUMMARY
173
+ - No permission needed
174
+
175
+ **RULE 3: Auto-install blocking dependencies**
176
+ - Trigger: Import failing, missing peer dependency
177
+ - Action: Install immediately, track in SUMMARY
178
+ - No permission needed
179
+
180
+ **RULE 4: Ask about architectural changes**
181
+ - Trigger: Fix requires significant structural modification
182
+ - Action: STOP, present I/O Tower checkpoint
183
+ - User decision required
184
+
185
+ All deviations tracked in SUMMARY.md with evidence.
186
+
187
+ ---
188
+
189
+ ## PRIORITY 3: STATE & DOCUMENTATION
190
+
191
+ ### TICKET #17: Add SUMMARY.md generation per plan execution
192
+ **Status:** ✅ COMPLETED
193
+
194
+ After each plan executes, create SUMMARY.md with:
195
+
196
+ YAML frontmatter:
197
+ ```yaml
198
+ ---
199
+ phase: 03-features
200
+ plan: 01
201
+ subsystem: auth
202
+ requires:
203
+ - phase: 01-foundation
204
+ provides: "User model, database setup"
205
+ provides:
206
+ - "JWT login/logout endpoints"
207
+ affects:
208
+ - 04-dashboard (uses auth types)
209
+ tech-stack:
210
+ added: [jose, bcrypt]
211
+ key-files:
212
+ created: [src/lib/auth.ts]
213
+ modified: [prisma/schema.prisma]
214
+ duration: 28min
215
+ commits: [abc123, def456]
216
+ ---
217
+ ```
218
+
219
+ Body with:
220
+ - Tasks completed
221
+ - Commits made
222
+ - Deviations from plan
223
+ - Files created/modified
224
+
225
+ Frontmatter enables fast context assembly (scan 30 lines, not full file).
226
+
227
+ ---
228
+
229
+ ### TICKET #4: Add agent output file monitoring and synthesis
230
+ **Status:** ✅ COMPLETED
231
+
232
+ When agents run in background, they write to output files. Master Control needs:
233
+ 1. Track all spawned agent output files
234
+ 2. Monitor progress via tail/Read
235
+ 3. Synthesize results when agents complete
236
+ 4. Aggregate into final report
237
+
238
+ Pattern: /private/tmp/claude/.../tasks/{agentId}.output
239
+
240
+ ---
241
+
242
+ ### TICKET #8: Implement agent result synthesis/aggregation
243
+ **Status:** ✅ COMPLETED
244
+
245
+ When parallel agents complete, their outputs need to be synthesized:
246
+ 1. Collect all agent results
247
+ 2. Spawn synthesis agent to merge findings
248
+ 3. Resolve conflicts between agent outputs
249
+ 4. Produce unified final result
250
+
251
+ Pattern from claude-flow: KN5 synthesis function merges parallel agent results.
252
+
253
+ ---
254
+
255
+ ## PRIORITY 4: TOPOLOGY & SCALING
256
+
257
+ ### TICKET #2: Add swarm topology configuration (mesh, hierarchical, star)
258
+ **Status:** ✅ COMPLETED
259
+
260
+ Allow Master Control to configure different agent topologies:
261
+ - MESH: All agents can communicate with all
262
+ - HIERARCHICAL: Orchestrator → Coordinators → Workers
263
+ - STAR: Central orchestrator, radiating workers
264
+
265
+ Based on claude-flow MCP patterns. Store topology in .grid/STATE.md
266
+
267
+ ---
268
+
269
+ ### TICKET #9: Add dynamic agent scaling based on task complexity
270
+ **Status:** ✅ COMPLETED
271
+
272
+ Master Control should dynamically decide how many agents to spawn based on:
273
+ - Task complexity score
274
+ - Number of subtasks identified by Planner
275
+ - Available resources/context budget
276
+
277
+ Simple tasks: 1-2 agents
278
+ Medium tasks: 3-5 agents
279
+ Complex tasks: 5-10+ agents
280
+
281
+ Auto-spawn based on Planner's decomposition.
282
+
283
+ ---
284
+
285
+ ### TICKET #10: Build inter-agent communication protocol
286
+ **Status:** ✅ COMPLETED
287
+
288
+ Agents need to communicate results to each other, not just back to orchestrator:
289
+ - Shared state file (.grid/SHARED_STATE.md)
290
+ - Message queue pattern
291
+ - Agent-to-agent handoff protocol
292
+
293
+ For mesh topology, any agent can write to shared state and others read it.
294
+
295
+ ---
296
+
297
+ ### TICKET #11: Add context budget management for spawned agents
298
+ **Status:** ✅ COMPLETED
299
+
300
+ Track and manage context usage across spawned agents:
301
+ - Each agent has ~200k context budget
302
+ - Monitor context usage per agent
303
+ - Auto-clear/restart agents when context runs low
304
+ - Pattern: context_threshold setting (default 20%)
305
+
306
+ Prevents agent degradation from context exhaustion.
307
+
308
+ ---
309
+
310
+ ## PRIORITY 5: PERSISTENT SESSIONS
311
+
312
+ ### TICKET #5: Implement tmux-based persistent agent sessions
313
+ **Status:** ✅ COMPLETED
314
+
315
+ For true fission-style agent spawning, use tmux to create persistent Claude sessions:
316
+ ```bash
317
+ tmux new-session -d -s grid_agents
318
+ tmux new-window -t grid_agents -n "agent_1"
319
+ tmux send-keys -t grid_agents:agent_1 'claude -p "task..."' C-m
320
+ ```
321
+ This allows agents to survive and run independently with their own terminals.
322
+
323
+ ---
324
+
325
+ ### TICKET #22: Add debug session persistence that survives /clear
326
+ **Status:** ✅ COMPLETED
327
+
328
+ When debugging, persist state to .grid/debug/{session}.md:
329
+
330
+ ```yaml
331
+ ---
332
+ status: investigating
333
+ trigger: "App crashes on login"
334
+ created: 2024-01-23T10:00:00Z
335
+ updated: 2024-01-23T10:30:00Z
336
+ ---
337
+
338
+ ## Current Focus
339
+ hypothesis: Auth token expiry not handled
340
+ test: Check token refresh logic
341
+ expecting: Missing refresh call
342
+
343
+ ## Symptoms (IMMUTABLE)
344
+ expected: User logs in successfully
345
+ actual: App crashes after 15 minutes
346
+ errors: "TypeError: Cannot read property 'token' of null"
347
+
348
+ ## Eliminated (APPEND only)
349
+ - hypothesis: Server down
350
+ evidence: curl returns 200
351
+
352
+ ## Evidence (APPEND only)
353
+ - timestamp: 10:15
354
+ checked: auth.ts:45
355
+ found: No token refresh
356
+ ```
357
+
358
+ Resume with /grid:debug (no args).
359
+
360
+ ---
361
+
362
+ ## PRIORITY 6: NEW COMMANDS
363
+
364
+ ### TICKET #18: Add /grid:program_disc command to view agent system prompts
365
+ **Status:** ✅ COMPLETED
366
+
367
+ Create a command that shows any Grid program's system prompt with beautiful TRON-themed ASCII art.
368
+
369
+ Usage: /grid:program_disc [program_name]
370
+ - /grid:program_disc planner - shows Planner's instructions
371
+ - /grid:program_disc executor - shows Executor's instructions
372
+ - /grid:program_disc recognizer - shows Recognizer's instructions
373
+
374
+ Display format:
375
+ ```
376
+ ╔══════════════════════════╗
377
+ ╔╝ ╚╗
378
+ ╔╝ PLANNER PROGRAM DISC ╚╗
379
+ ║ ║
380
+ ║ ████████████████████ ║
381
+ ║ ██ ████ ║
382
+ ║ ██ IDENTITY ████ ║
383
+ ║ ██ ████ ║
384
+ ║ ████████████████████ ║
385
+ ║ ║
386
+ ╚╗ ╔╝
387
+ ╚╗ ╔╝
388
+ ╚══════════════════════════╝
389
+
390
+ [System prompt content follows]
391
+ ```
392
+
393
+ List all available programs if no argument given.
394
+
395
+ ---
396
+
397
+ ### TICKET #19: Add /grid:status command with visual progress display
398
+ **Status:** ✅ COMPLETED
399
+
400
+ Create a status command showing Grid state with TRON visuals:
401
+
402
+ ```
403
+ THE GRID - STATUS
404
+ ═════════════════
405
+
406
+ CLUSTER: React Todo App
407
+ ├─ BLOCK 1: Core Application [████████░░] 80%
408
+ │ ├─ THREAD 1.1: Initialize ✓ Complete
409
+ │ ├─ THREAD 1.2: Components ✓ Complete
410
+ │ ├─ THREAD 1.3: Logic ⚡ In Progress
411
+ │ └─ THREAD 1.4: Styling ○ Pending
412
+
413
+ └─ BLOCK 2: Testing [░░░░░░░░░░] 0%
414
+ └─ Blocked by BLOCK 1
415
+
416
+ PROGRAMS ACTIVE: Executor (THREAD 1.3)
417
+ I/O TOWER: Idle
418
+
419
+ End of Line.
420
+ ```
421
+
422
+ ---
423
+
424
+ ### TICKET #24: Add /grid:quick for ad-hoc tasks without full planning
425
+ **Status:** ✅ COMPLETED
426
+
427
+ Like GSD's /gsd:quick - for simple tasks that don't need full cluster/block/thread breakdown:
428
+
429
+ Usage: /grid:quick "Add dark mode toggle"
430
+
431
+ Process:
432
+ 1. Quick questioning (1-2 clarifying questions max)
433
+ 2. Direct planning (single PLAN.md)
434
+ 3. Execute immediately
435
+ 4. Create SUMMARY.md
436
+
437
+ Stored in .grid/quick/{timestamp}-{slug}/
438
+
439
+ Good for:
440
+ - Bug fixes
441
+ - Small features
442
+ - Refactoring tasks
443
+ - Documentation updates
444
+
445
+ Skip the full orchestration ceremony.
446
+
447
+ ---
448
+
449
+ ## PRIORITY 7: NEW PROGRAMS
450
+
451
+ ### TICKET #23: Add Grid Debugger program for systematic bug investigation
452
+ **Status:** ✅ COMPLETED
453
+
454
+ Create a new Debugger program with GSD's methodology:
455
+
456
+ **1. Hypothesis Testing Framework**
457
+ - Form specific, falsifiable hypotheses
458
+ - One hypothesis at a time
459
+ - Strong evidence requirement
460
+ - Track eliminated hypotheses
461
+
462
+ **2. Investigation Techniques**
463
+ - Binary search (divide problem space)
464
+ - Rubber duck debugging
465
+ - Minimal reproduction
466
+ - Working backwards
467
+ - Differential debugging (what changed?)
468
+ - Observability first (add logging before fixing)
469
+
470
+ **3. Debug File Protocol**
471
+ - Current Focus section
472
+ - Symptoms (immutable)
473
+ - Eliminated hypotheses (append only)
474
+ - Evidence log (append only)
475
+ - Resolution (filled when found)
476
+
477
+ ---
478
+
479
+ ## PRIORITY 8: CONFIGURATION
480
+
481
+ ### TICKET #20: Add questioning/dream extraction to Grid initialization
482
+ **Status:** ✅ COMPLETED
483
+
484
+ When user invokes /grid with a vague request, use GSD's questioning methodology:
485
+
486
+ 1. Dream extraction, not requirements gathering
487
+ 2. Question types:
488
+ - Motivation: "What prompted this?"
489
+ - Concreteness: "Walk me through using this"
490
+ - Clarification: "When you say X, do you mean A or B?"
491
+ - Success: "How will you know this is working?"
492
+
493
+ 3. Anti-patterns to avoid:
494
+ - Checklist walking
495
+ - Canned questions
496
+ - Corporate speak
497
+ - Interrogation
498
+ - Taking vague answers
499
+
500
+ Ask until you have concrete, specific understanding.
501
+
502
+ ---
503
+
504
+ ### TICKET #21: Add model routing configuration (opus/sonnet/haiku per task type)
505
+ **Status:** ✅ COMPLETED
506
+
507
+ Allow Grid to route different tasks to different models:
508
+
509
+ Config in .grid/config.json:
510
+ ```json
511
+ {
512
+ "model_profile": "balanced",
513
+ "routing": {
514
+ "planner": {
515
+ "quality": "opus",
516
+ "balanced": "sonnet",
517
+ "budget": "haiku"
518
+ },
519
+ "executor": {
520
+ "quality": "opus",
521
+ "balanced": "sonnet",
522
+ "budget": "sonnet"
523
+ },
524
+ "recognizer": {
525
+ "quality": "sonnet",
526
+ "balanced": "haiku",
527
+ "budget": "haiku"
528
+ }
529
+ }
530
+ }
531
+ ```
532
+
533
+ Spawn agents with the configured model.
534
+
535
+ ---
536
+
537
+ ## PRIORITY 9: INFRASTRUCTURE
538
+
539
+ ### TICKET #6: Create MCP server for Grid orchestration (grid-flow)
540
+ **Status:** ❌ SKIPPED - Unnecessary
541
+
542
+ ~~Build an MCP server similar to claude-flow that exposes Grid operations as MCP tools.~~
543
+
544
+ **Decision:** The Grid already has full orchestration capabilities through the Task tool:
545
+ - BatchTool pattern for parallel spawning
546
+ - Agent output monitoring via Read/tail
547
+ - Swarm topology via SHARED_STATE.md
548
+ - Wave-based execution via plan frontmatter
549
+
550
+ Adding an MCP layer would be redundant complexity. The existing approach is cleaner and more aligned with Claude Code's architecture.
551
+
552
+ ---
553
+
554
+ ## SUMMARY
555
+
556
+ | Priority | Count | Status | Focus |
557
+ |----------|-------|--------|-------|
558
+ | P1: Core Parallel | 4 | ✅ ALL DONE | Subprocess spawning, BatchTool, waves, inline content |
559
+ | P2: Verification | 4 | ✅ ALL DONE | Goal-backward, 3-level, patrol, deviation rules |
560
+ | P3: State/Docs | 3 | ✅ ALL DONE | SUMMARY.md, output monitoring, synthesis |
561
+ | P4: Topology | 4 | ✅ ALL DONE | Swarm config, scaling, inter-agent comms, context budget |
562
+ | P5: Persistence | 2 | ✅ ALL DONE | tmux sessions, debug persistence |
563
+ | P6: Commands | 3 | ✅ ALL DONE | program_disc, status, quick |
564
+ | P7: Programs | 1 | ✅ ALL DONE | Debugger program |
565
+ | P8: Config | 2 | ✅ ALL DONE | Dream extraction, model routing |
566
+ | P9: Infrastructure | 1 | ❌ SKIPPED | MCP server (unnecessary) |
567
+
568
+ **TOTAL: 23/24 TICKETS COMPLETE (100% of needed work)**
569
+
570
+ ---
571
+
572
+ ## RESEARCH AGENTS DEPLOYED
573
+
574
+ 28 parallel agents analyzing get-shit-done:
575
+ - 9 agent file extractors (planner, executor, verifier, debugger, etc.)
576
+ - 4 directory scanners (commands, workflows, templates, references)
577
+ - 3 style/readme extractors
578
+ - 4 system extractors (hooks, bin, ASCII, model routing, state)
579
+ - 8 pattern extractors (Task spawning, checkpoints, YAML, questioning, etc.)
580
+
581
+ Results being aggregated...
582
+
583
+ ---
584
+
585
+ *End of Line.*