Repository navigation
Expand file tree
/
Copy path.env.devstream
More file actions
470 lines (356 loc) · 19.2 KB
/
Copy path.env.devstream
File metadata and controls
470 lines (356 loc) · 19.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
# DevStream Hook System Configuration
# Context7 & cchooks Compliant Hook Settings
# ============================================================================
# GLOBAL SETTINGS
# ============================================================================
# Enable/disable all DevStream hooks
DEVSTREAM_HOOKS_ENABLED=true
# Feedback level: silent | minimal | verbose
# silent = No user output (only logs)
# minimal = Warnings and errors only (⚠️ ❌)
# verbose = All feedback including success (✅ ⚠️ ❌)
DEVSTREAM_FEEDBACK_LEVEL=verbose
# Fallback mode: strict | graceful
# graceful = Continue on failures (recommended)
# strict = Block on failures
DEVSTREAM_FALLBACK_MODE=graceful
# Debug mode: true | false
# Enables detailed execution logging
DEVSTREAM_DEBUG=true
# ============================================================================
# PER-HOOK ENABLE/DISABLE
# ============================================================================
# PreToolUse Hook (Context injection before Write/Edit)
DEVSTREAM_HOOK_PRETOOLUSE=true
# PostToolUse Hook (Memory storage after Write/Edit)
DEVSTREAM_HOOK_POSTTOOLUSE=true
# UserPromptSubmit Hook (Context enhancement on user queries)
DEVSTREAM_HOOK_USERPROMPTSUBMIT=true
# SessionStart Hook (Project context on session start)
# DISABLED: Cross-session summary system interferes with auto-compacting (2025-10-12)
DEVSTREAM_HOOK_SESSIONSTART=false
# SessionEnd Hook (Session summary generation on session end)
# DISABLED: Cross-session summary system interferes with auto-compacting (2025-10-12)
DEVSTREAM_HOOK_SESSION_END=false
# PreCompact Hook (Session summary before /compact command)
# DISABLED: Cross-session summary system interferes with auto-compacting (2025-10-12)
DEVSTREAM_HOOK_PRE_COMPACT=false
# Stop Hook (Task completion detection on session end) - DISABLED (2025-10-12)
# Session tracking system removed due to complexity and reliability issues
DEVSTREAM_HOOK_STOP=false
# ============================================================================
# AGENT AUTO-DELEGATION SYSTEM (Phase 3) - DEPRECATED (2025-10-09)
# ============================================================================
# ⚠️ DEPRECATED: This system has been replaced by Tier-Based Delegation (Task 16)
# See lines 264-285 for new TIER-BASED DELEGATION POLICY (Protocol v2.2.0)
# These flags are preserved for backward compatibility but are NO LONGER ACTIVE.
# ============================================================================
# DEPRECATED: Enable automatic agent delegation and routing
# REPLACED BY: DEVSTREAM_AUTO_DELEGATION_TIER1_ENABLED (line 270)
DEVSTREAM_AGENT_AUTO_DELEGATION_ENABLED=false
# DEPRECATED: Minimum confidence threshold for delegation recommendation (0.0-1.0)
# REPLACED BY: DEVSTREAM_AUTO_DELEGATION_TIER2_THRESHOLD (line 274)
DEVSTREAM_AGENT_AUTO_DELEGATION_CONFIDENCE_THRESHOLD=0.85
# DEPRECATED: Auto-approve threshold for high-confidence delegations (0.0-1.0)
# REPLACED BY: Tier-based automatic delegation (no approval needed for Tier 1)
DEVSTREAM_AGENT_AUTO_DELEGATION_AUTO_APPROVE_THRESHOLD=0.95
# DEPRECATED: Log delegation decisions to DevStream memory
# REPLACED BY: Tier-based delegation logging (automatic via PostToolUse hook)
DEVSTREAM_AGENT_AUTO_DELEGATION_LOG_DECISIONS=false
# ============================================================================
# CONTEXT7 INTEGRATION
# ============================================================================
# Enable Context7 library documentation lookup
DEVSTREAM_CONTEXT7_ENABLED=true
# Maximum tokens to retrieve from Context7
# CRITICAL: Must match CLAUDE.md specification (5000 tokens for Context7)
DEVSTREAM_CONTEXT7_TOKEN_LIMIT=5000
# Auto-trigger Context7 on detected libraries
DEVSTREAM_CONTEXT7_AUTO_TRIGGER=true
# Context7 Direct Client Hybrid Architecture (Task ID: context7-direct-client-hybrid)
# Enable direct HTTP client for Context7 (bypass MCP for better performance)
# Options: true (always use direct), false (always use MCP), rollout (gradual 10% rollout)
# DISABLED: Direct client causing production issues, using MCP exclusively
DEVSTREAM_CONTEXT7_DIRECT_ENABLED=false
# Direct client LRU cache size (number of cached responses)
DEVSTREAM_CONTEXT7_DIRECT_CACHE_SIZE=100
# Direct client HTTP request timeout (seconds)
DEVSTREAM_CONTEXT7_DIRECT_TIMEOUT=30
# Direct client circuit breaker failure threshold (consecutive failures before opening)
DEVSTREAM_CONTEXT7_DIRECT_CB_THRESHOLD=3
# Enable performance metrics collection for direct client operations
DEVSTREAM_CONTEXT7_METRICS_ENABLED=true
# Enable MCP fallback when direct client fails (recommended for reliability)
DEVSTREAM_CONTEXT7_MCP_FALLBACK=true
# ============================================================================
# DEVSTREAM MEMORY SETTINGS
# ============================================================================
# Enable semantic search in DevStream DB
DEVSTREAM_MEMORY_SEARCH_ENABLED=true
# Enable memory storage after tool use
DEVSTREAM_MEMORY_STORE_ENABLED=true
# Hybrid search: semantic + vector + document
DEVSTREAM_MEMORY_HYBRID_SEARCH=true
# Maximum memory results to inject
DEVSTREAM_MEMORY_MAX_RESULTS=5
# Maximum tokens for DevStream memory context injection
# CRITICAL: Must match CLAUDE.md specification (2000 tokens for DevStream memory)
# Total budget: 7000 tokens (5000 Context7 + 2000 DevStream)
# Performance: +25% relevance, -30% false positives, 83% query reduction
# Optimized: 2025-10-02 (Phases 1-5 complete)
DEVSTREAM_CONTEXT_MAX_TOKENS=2000
# ============================================================================
# EMBEDDING CACHE SETTINGS
# ============================================================================
# Enable SHA256-based LRU embedding cache
# Reduces redundant Ollama API calls for duplicate content
DEVSTREAM_EMBEDDING_CACHE_ENABLED=true
# Maximum number of cached embeddings (LRU eviction when full)
# Default: 1000 entries (~10MB memory for 300-dim embeddings)
DEVSTREAM_EMBEDDING_CACHE_SIZE=1000
# ============================================================================
# TASK MANAGEMENT
# ============================================================================
# Enable task lifecycle automation
DEVSTREAM_TASK_LIFECYCLE_ENABLED=true
# Auto-detect task completion
DEVSTREAM_TASK_AUTO_COMPLETION=true
# ============================================================================
# PERFORMANCE & TIMEOUTS
# ============================================================================
# MCP call timeout (seconds)
DEVSTREAM_MCP_TIMEOUT=10
# Database query timeout (seconds)
DEVSTREAM_DB_TIMEOUT=5
# Context7 API timeout (seconds)
DEVSTREAM_CONTEXT7_TIMEOUT=15
# ============================================================================
# CRASH PREVENTION - RATE LIMITING (FASE 5.4 - Production Deployment)
# ============================================================================
# Memory operations rate limit (operations per second)
# Prevents SQLite lock contention and resource exhaustion
# Validated: FASE 5.4 stress tests (100 ops, zero crashes)
# Target: 10 ops/sec (enforced via aiolimiter GCRA algorithm)
DEVSTREAM_MEMORY_RATE_LIMIT=10
# Ollama embedding operations rate limit (operations per second)
# Prevents Ollama process accumulation and API rate limit violations
# Validated: FASE 5.4 stress tests (20 embeddings, zero orphaned processes)
# Target: 5 ops/sec (enforced via aiolimiter GCRA algorithm)
DEVSTREAM_OLLAMA_RATE_LIMIT=5
# ============================================================================
# MCP SERVER LIFECYCLE (Phase: MCP Reconnection Fix - 2025-10-02)
# ============================================================================
# Heartbeat interval for MCP server health monitoring (milliseconds)
# Default: 300000 (5 minutes)
# Purpose: Log server uptime periodically to detect idle/unresponsive states
DEVSTREAM_MCP_HEARTBEAT_INTERVAL=300000
# Idle warning threshold (milliseconds)
# Default: 600000 (10 minutes)
# Purpose: Warn if server receives no requests for extended period
DEVSTREAM_MCP_IDLE_WARNING_THRESHOLD=600000
# Cleanup timeout safety (milliseconds)
# Default: 5000 (5 seconds)
# Purpose: Force exit if graceful cleanup exceeds timeout (prevents hanging)
DEVSTREAM_MCP_CLEANUP_TIMEOUT=5000
# ============================================================================
# LOGGING
# ============================================================================
# Log directory
DEVSTREAM_LOG_DIR=~/.claude/logs/devstream
# Log level: DEBUG | INFO | WARNING | ERROR
DEVSTREAM_LOG_LEVEL=DEBUG
# Enable structured JSON logging
DEVSTREAM_STRUCTURED_LOGGING=true
# ============================================================================
# CRASH PREVENTION - FILE SYSTEM MONITORING (2025-10-08)
# ============================================================================
# DISABLE REAL-TIME FILE MONITORING TO PREVENT KERNEL PANICS
# CRITICAL: watchdog library conflicts with macOS fseventsd causing use-after-free kernel panics
# Symptoms: Kernel panic with "use-after-free" in fseventsd process
# Solution: Disable watchdog-based real-time monitoring
DEVSTREAM_REAL_TIME_MONITORING_ENABLED=false
# Alternative: Polling-based monitoring (safer but less responsive)
# When real-time monitoring is disabled, fall back to periodic polling
DEVSTREAM_POLLING_MONITORING_ENABLED=true
DEVSTREAM_POLLING_INTERVAL_SECONDS=30
# File system event debouncing (prevents event storms)
DEVSTREAM_FS_EVENT_DEBOUNCE_MS=1000
DEVSTREAM_MAX_FS_EVENTS_PER_SECOND=10
# Emergency resource limits
DEVSTREAM_MAX_MEMORY_USAGE_MB=2048
DEVSTREAM_MAX_CPU_USAGE_PERCENT=80
# ============================================================================
# SESSION COORDINATION & LIMITS - DEPRECATED (2025-10-12)
# ============================================================================
# ⚠️ DEPRECATED: Session tracking system removed due to complexity and reliability issues
# All session-related configuration preserved for reference but no longer active
# ============================================================================
# Maximum concurrent sessions allowed - DEPRECATED
# Prevents resource exhaustion and kernel panics from too many DB connections
# Default: 5 (validated safe for MacBook Pro M3 Max)
DEVSTREAM_MAX_SESSIONS=5
# Session heartbeat timeout (seconds) - DEPRECATED
# Sessions without heartbeat for this duration are considered stale
# Default: 300 (5 minutes)
DEVSTREAM_SESSION_HEARTBEAT_TIMEOUT=300
# Automatic cleanup interval (seconds) - DEPRECATED
# How often to check for zombie/stale sessions
# Default: 60 (1 minute)
DEVSTREAM_SESSION_CLEANUP_INTERVAL=60
# Session queuing behavior when limit reached - DEPRECATED
# Options: block | warn | queue
# block = Reject new sessions immediately
# warn = Allow session but log warning
# queue = Queue session for next available slot (FUTURE)
DEVSTREAM_SESSION_LIMIT_BEHAVIOR=block
# Session priority levels (FUTURE - Phase 4) - DEPRECATED
# Enable priority-based session management
# When enabled, high-priority sessions can preempt low-priority ones
DEVSTREAM_SESSION_PRIORITY_ENABLED=false
# ============================================================================
# DIRECT DB ARCHITECTURE (NEW - 2025-10-14)
# ============================================================================
# Enable Direct DB Architecture (bypass MCP server)
# When true: Uses SQLite direct connections via Python hooks
# When false: Uses MCP server (legacy mode)
# Recommended: true for better performance and reduced complexity
DEVSTREAM_FEATURE_DIRECT_DB_ENABLED=true
# Direct DB feature flags (only active when DEVSTREAM_FEATURE_DIRECT_DB_ENABLED=true)
# Enable direct DB connections in PreToolUse hook
DEVSTREAM_FEATURE_DIRECT_DB_PRE_TOOL_USE=true
# Enable direct DB connections in PostToolUse hook
DEVSTREAM_FEATURE_DIRECT_DB_POST_TOOL_USE=true
# Enable direct DB connections in User Query Context Enhancer
DEVSTREAM_FEATURE_DIRECT_DB_CONTEXT_ENHANCER=true
# Database path (updated to use .noindex for Spotlight exclusion)
DEVSTREAM_DB_PATH=data/devstream.db
# ============================================================================
# PHASE CHECKPOINT AUTOMATION (Task 15 - Protocol v2.2.0)
# ============================================================================
# Enable automated phase checkpoint creation
# When true, system detects phase completion and creates checkpoints automatically
DEVSTREAM_PHASE_CHECKPOINT_ENABLED=true
# Enable automatic git commit after phase completion
# When true, creates descriptive commit for each completed phase
DEVSTREAM_PHASE_AUTO_COMMIT=true
# Enable automatic git push after phase commit
# When true, pushes commits to remote repository automatically
# WARNING: Requires git remote configured and authentication setup
DEVSTREAM_PHASE_AUTO_PUSH=true
# Commit message prefix for phase checkpoints
# Default: "PHASE" (results in "PHASE X - Description COMPLETE")
DEVSTREAM_PHASE_COMMIT_PREFIX=PHASE
# ============================================================================
# TIER-BASED DELEGATION POLICY (Task 16 - Protocol v2.2.0)
# ============================================================================
# Enable Tier 1 (Monolithic First) - 60% of tasks, 0 token overhead
# When true, simple tasks execute without agent delegation (Sonnet 4.5 solo)
# Examples: Bug fixes, single file changes, config updates
DEVSTREAM_AUTO_DELEGATION_TIER1_ENABLED=true
# Confidence threshold for Tier 2 (Single Specialist) - 30% of tasks, 2K overhead
# Tasks with confidence >= this threshold use single specialist (no @tech-lead)
# Default: 0.95 (file pattern match with high confidence)
DEVSTREAM_AUTO_DELEGATION_TIER2_THRESHOLD=0.95
# Confidence threshold for Tier 3 (Multi-Agent Orchestration) - 5% of tasks, 7K overhead
# Tasks with confidence < this threshold require @tech-lead coordination
# Default: 0.70 (multi-stack or architectural decisions)
DEVSTREAM_AUTO_DELEGATION_TIER3_THRESHOLD=0.70
# Enforce Tier 4 (Quality Gate) - 5% of tasks, MANDATORY, 1K overhead
# When true, EVERY git commit triggers @code-reviewer (OWASP Top 10, performance, architecture)
# RECOMMENDED: true (quality gate enforcement)
DEVSTREAM_AUTO_DELEGATION_QUALITY_GATE=true
# ============================================================================
# PROTOCOL v2.2.0 ENFORCEMENT SYSTEM (Protocol Enforcement Integration)
# ============================================================================
# Enable Protocol v2.2.0 enforcement gate for non-trivial tasks
# When true, enforces 7-step workflow for tasks >15min or requiring code
DEVSTREAM_PROTOCOL_ENFORCEMENT_ENABLED=true
# Enable task creation at Step 1 (DISCUSSION) - prevents data loss
# When true, task_first_handler enforces task creation before discussion
DEVSTREAM_TASK_FIRST_HANDLER_ENABLED=true
# Enable MCP graceful fallback (circuit breaker pattern)
# When true, MCP failures don't block sessions - retries 3x with exponential backoff
DEVSTREAM_MCP_GRACEFUL_FALLBACK=true
# Enable micro-task commit handler for Step 6
# When true, creates conventional commits for each completed micro-task
DEVSTREAM_MICRO_TASK_COMMITS=true
# Enable enforcement gate interactive prompts
# When true, shows Protocol/Override/Cancel options for non-trivial tasks
DEVSTREAM_ENFORCEMENT_GATE_INTERACTIVE=true
# Protocol enforcement timeout (seconds)
# Maximum time to wait for user response at enforcement gate
DEVSTREAM_ENFORCEMENT_GATE_TIMEOUT=30
# MCP circuit breaker settings
DEVSTREAM_MCP_CIRCUIT_BREAKER_RETRIES=3
DEVSTREAM_MCP_CIRCUIT_BREAKER_BACKOFF_FACTOR=2
DEVSTREAM_MCP_CIRCUIT_BREAKER_INITIAL_DELAY=1
# Enable protocol state degraded_mode flag
# When true, sets degraded_mode in protocol_state when fallback is used
DEVSTREAM_PROTOCOL_DEGRADED_MODE_FLAG=true
# ============================================================================
# WORKER POOL MIGRATION (Protocol v2.2.0 - Phase 3 - FASE 5)
# ============================================================================
# Enable worker pool for non-blocking database operations
# When true, uses DatabasePool with Piscina worker threads (zero event loop blocking)
# When false, falls back to direct better-sqlite3 (legacy synchronous behavior)
# Performance Impact: 3250ms → 0ms main thread blocking, 3 ops/sec → 100+ ops/sec
# Rollback: Set to false and restart to restore synchronous behavior
DEVSTREAM_WORKER_POOL_ENABLED=true
# Worker Pool Configuration (only applies when DEVSTREAM_WORKER_POOL_ENABLED=true)
# Minimum worker threads (always active, reduces cold-start latency)
# Default: 2 (recommended for production)
DEVSTREAM_WORKER_POOL_MIN_THREADS=2
# Maximum worker threads (concurrent database operation capacity)
# Default: 8 (os.availableParallelism on MacBook Pro M3 Max)
# Adjust based on CPU cores: minThreads <= maxThreads <= os.availableParallelism()
DEVSTREAM_WORKER_POOL_MAX_THREADS=8
# Worker idle timeout (milliseconds)
# Workers inactive for this duration are terminated
# Default: 60000 (60 seconds - avoids spawn overhead)
DEVSTREAM_WORKER_POOL_IDLE_TIMEOUT=60000
# Maximum queue size (pending tasks before backpressure)
# Default: 0 (auto = maxThreads² = 64 for 8 threads)
# Increase for high-concurrency stress tests (e.g., 1024 for 1000 concurrent queries)
DEVSTREAM_WORKER_POOL_MAX_QUEUE=0
# Concurrent tasks per worker (for async I/O like Ollama HTTP)
# Default: 10 (allows each worker to handle 10 concurrent async operations)
DEVSTREAM_WORKER_POOL_CONCURRENT_TASKS=10
# Resource limits per worker (production safety)
# Max heap memory per worker (megabytes)
# Default: 512 (512MB per worker, prevents memory exhaustion)
DEVSTREAM_WORKER_POOL_MAX_HEAP_MB=512
# Max stack size per worker (megabytes)
# Default: 4 (4MB stack, prevents stack overflow)
DEVSTREAM_WORKER_POOL_MAX_STACK_MB=4
# Context7 Direct Client Configuration
DEVSTREAM_CONTEXT7_DIRECT_ENABLED=false
DEVSTREAM_CONTEXT7_MCP_FALLBACK=true
DEVSTREAM_CONTEXT7_METRICS_ENABLED=true
CONTEXT7_API_KEY=ctx7sk-9a2e8753-ad51-41b8-8282-c63131db5564
# ============================================================================
# SUPERPOWERS INTEGRATION (2025-10-31)
# ============================================================================
# Enable Superpowers integration with DevStream
# When true, integrates obra/superpowers skills library with DevStream workflows
DEVSTREAM_SUPERPOWERS_ENABLED=true
# Superpowers skills root directory
# Auto-detected if set to empty, defaults to ~/.config/superpowers/skills
DEVSTREAM_SUPERPOWERS_SKILLS_ROOT=$HOME/.config/superpowers/skills
# Enable auto-suggestion of Superpowers skills
# When true, automatically suggests relevant skills based on context
DEVSTREAM_SUPERPOWERS_AUTO_SUGGEST=true
# Enable Superpowers context injection in PreToolUse hook
# When true, injects relevant skills documentation along with Context7
DEVSTREAM_SUPERPOWERS_CONTEXT_INJECTION=true
# Maximum tokens for Superpowers context injection
# Default: 1000 tokens (part of DevStream memory budget)
DEVSTREAM_SUPERPOWERS_TOKEN_LIMIT=1000
# Enable Superpowers integration with Agent System
# When true, allows agents to use Superpowers skills as complementary tools
DEVSTREAM_SUPERPOWERS_AGENT_INTEGRATION=true
# Enable Superpowers brainstorming enhancement
# When true, enhances brainstorming with Context7 research + Superpowers patterns
DEVSTREAM_SUPERPOWERS_BRAINSTORM_ENHANCEMENT=true
# Enable Superpowers planning enhancement
# When true, enhances implementation plans with Superpowers methodologies
DEVSTREAM_SUPERPOWERS_PLANNING_ENHANCEMENT=true