Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
10000 commits
Select commit Hold shift + click to select a range
8bd94dd
chore: generate
Jun 5, 2026
6e212c2
feat(core): honor default session models (#30982)
Jun 5, 2026
8b3e02e
fix(core): harden model selection edges (#30987)
Jun 5, 2026
8435354
fix(tui): show current location in working copies; order by created; …
Jun 5, 2026
eba8230
chore: generate
Jun 5, 2026
ddc712e
feat(core): compact v2 session context (#30986)
Jun 5, 2026
b2e0c43
fix(opencode): terminate help output with newline (#30992)
Jun 5, 2026
a3641e9
fix(opencode): honor Bedrock Mantle config (#31001)
Jun 5, 2026
c562306
fix(core): preserve model request semantics (#30990)
Jun 5, 2026
b18a738
chore: generate
Jun 5, 2026
0b68d83
feat(core): bound v2 tool output (#30999)
Jun 5, 2026
3a1e6a5
chore: generate
Jun 5, 2026
14ec368
fix(core): scope Vertex provider transforms (#31004)
Jun 5, 2026
b92d712
feat(core): expose session model switching (#31011)
Jun 5, 2026
f1292cb
fix(tui): update tool spacing before layout
Jun 5, 2026
9113019
fix(core): recover v2 context overflow (#31005)
Jun 5, 2026
e8447de
fix(core): validate public session model switches (#31012)
Jun 5, 2026
9772491
feat(tui): delete working copies from move dialog (#31017)
Jun 5, 2026
ba13ced
chore: generate
Jun 5, 2026
ba8de94
fix(tui): bootstrap new project copies (#31019)
Jun 5, 2026
41174e3
fix(opencode): limit generated project copy names (#31022)
Jun 5, 2026
6eabf19
fix(tui): inject reminder after moving session (#31027)
Jun 5, 2026
60cb3ab
fix(session): respect directory filter with workspaces (#30804)
Jun 5, 2026
6cfa385
feat(app): improve servers UI (#30961)
Jun 5, 2026
59938fe
chore: generate
Jun 5, 2026
8d3875d
feat(app): updates to project avatar (#30964)
Jun 5, 2026
317ab4d
chore: generate
Jun 5, 2026
73a03c5
feat(app): sessions list improvements (#30941)
Jun 5, 2026
db1bbcf
chore: generate
Jun 5, 2026
fbadb97
fix(core): scope v2 prompt cache by session (#31036)
Jun 5, 2026
f4d8805
fix(stats): filter market share to go
Jun 5, 2026
c951623
fix(app): increase project session limit and add scrolling (#31035)
Jun 5, 2026
ec13b3c
fix(core): make V2 reads media-aware and binary-safe (#31038)
Jun 5, 2026
27e8ec4
chore: update nix node_modules hashes
Jun 6, 2026
18c3a90
feat(opencode): add search to auth logout command (#31053)
Jun 6, 2026
8a5d65a
feat(opencode): support non-interactive MCP add (#31054)
Jun 6, 2026
ad8e71d
feat(http-recorder): prepare public beta release (#31018)
Jun 6, 2026
9d376a4
refactor(core): simplify filesystem mutation protocol (#31059)
Jun 6, 2026
d67a100
refactor(core): simplify filesystem read protocol (#31058)
Jun 6, 2026
f708555
chore: update nix node_modules hashes
Jun 6, 2026
b4d824c
refactor(core): simplify search root protocol (#31060)
Jun 6, 2026
656cadd
feat: desktop v2 everything WSL (#23407)
Jun 6, 2026
679cfc9
chore: generate
Jun 6, 2026
b9faa1a
fix(core): bound prompt cache session keys (#31062)
Jun 6, 2026
6b26ba3
fix(core): enforce V2 tool permissions (#31061)
Jun 6, 2026
5372c74
feat(opencode): fff search tools (#27802)
Jun 6, 2026
cfd490d
chore: generate
Jun 6, 2026
7a8bd1a
chore: update nix node_modules hashes
Jun 6, 2026
7b7b214
fix: background agent prompting, lets kill this sleep behavior oml (#…
Jun 6, 2026
0e800c6
test: fix tool test (#31163)
Jun 6, 2026
f4c49fc
docs: fix MCP header interpolation example to {env:VAR} (#31078)
Jun 6, 2026
27a35d5
chore(http-recorder): disable release automation (#31160)
Jun 7, 2026
6cd13c8
refactor(core): unify v2 tool architecture (#31168)
Jun 7, 2026
e63d80a
fix(core): use static tool type imports (#31170)
Jun 7, 2026
dc7fe4e
docs(v2): update permission rule naming (#31167)
Jun 7, 2026
9605b1a
fix(core): isolate image normalization (#31165)
Jun 7, 2026
241585d
fix(test): release Windows search handles (#31172)
Jun 7, 2026
f8c2516
fix(core): harden unified tool runtime (#31171)
Jun 7, 2026
5831935
test(core): cover managed output read permissions (#31166)
Jun 7, 2026
d642be7
fix(core): preserve session failure causes
Jun 7, 2026
18b7150
refactor(server): canonicalize service API (#31049)
Jun 7, 2026
1b249a9
chore: generate
Jun 7, 2026
087c919
chore: update nix node_modules hashes
Jun 7, 2026
3648c6a
fix(tui): sort connect providers alphabetically (#30891)
Jun 7, 2026
5b42ba7
feat(desktop): make updates persistent and responsive (#31191)
Jun 7, 2026
bc405cb
chore: generate
Jun 7, 2026
a2e2108
refactor(tui): extract standalone package (#31193)
Jun 7, 2026
7d126ad
chore: generate
Jun 7, 2026
4860122
chore: update nix node_modules hashes
Jun 7, 2026
01621eb
fix(app): refresh directory MCP status (#31194)
Jun 7, 2026
56ac7dc
feat(desktop): open attachments in active project (#31192)
Jun 7, 2026
ffd9203
chore: generate
Jun 7, 2026
d00e27c
fix(desktop): style home session scrollbar (#31202)
Jun 7, 2026
4f5b3ef
fix(desktop): disable hidden agent cycling (#31207)
Jun 7, 2026
504556f
test(core): cover skill directory output (#31263)
Jun 7, 2026
7225203
fix(opencode): avoid duplicate skill catalog (#31269)
Jun 7, 2026
1377a7b
chore(opencode): update MCP SDK to 1.29.0 (#31268)
Jun 7, 2026
9a195cb
chore: generate
Jun 7, 2026
0c7d588
chore: update nix node_modules hashes
Jun 7, 2026
b61150e
run: make minimal mode more minimal (#31227)
Jun 7, 2026
02c6a41
chore: generate
Jun 7, 2026
6f0e44d
chore: update web and desktop code owners (#31289)
Jun 8, 2026
b95e454
fix(desktop): few WSL bugs (#31095)
Jun 8, 2026
9c33c31
chore: generate
Jun 8, 2026
9b75eec
fix(opencode): respect MCP server capabilities (#31271)
Jun 8, 2026
a909db1
console: update email
Jun 8, 2026
5017d04
zen: fix
Jun 8, 2026
81e4159
fix(opencode): include acp pending tool input (#31321)
Jun 8, 2026
21f9557
fix(lsp): resolve JDTLS root to topmost pom.xml in Java Maven multi-m…
Jun 8, 2026
089e8b7
chore: generate
Jun 8, 2026
3210ca2
fix(session): merge per-call tool rules into session permission (#30529)
Jun 8, 2026
5ffe52c
docs(go): update MiniMax M3 pricing (#31350)
Jun 8, 2026
8dc300f
fix: speed up fff file search (#31366)
Jun 8, 2026
ca9fa6e
chore: generate
Jun 8, 2026
e2563d5
fix(stats): show new for leaderboard deltas
Jun 8, 2026
6582f3f
fix: stabilize fff file results (#31369)
Jun 8, 2026
70f1ee1
chore: generate
Jun 8, 2026
b2ecae0
fix(core): restore npm proxy agent patch (#31373)
Jun 8, 2026
8ce6f0e
chore: update nix node_modules hashes
Jun 8, 2026
3176528
chore: upgrade OpenTUI to v0.3.4 (#31326)
Jun 8, 2026
7f50282
chore: update nix node_modules hashes
Jun 8, 2026
9315ae4
fix(core): disable fff trace logs (#31380)
Jun 8, 2026
28c7cc9
fix(session): avoid sticky prompt tool overrides (#31394)
Jun 8, 2026
490f0eb
fix(opencode): await run event loop (#31389)
Jun 8, 2026
2d3d811
refactor(core): replace legacy logger with Effect logging (#31310)
Jun 8, 2026
4cc9342
chore: generate
Jun 8, 2026
619d420
fix(tui): trim select footer action highlight (#31411)
Jun 8, 2026
67099bb
fix(opencode): support MiniMax M3 thinking toggle (#31426)
Jun 8, 2026
460cf1d
fix: adjust item id stripping to happen prior to request signing (#31…
Jun 8, 2026
48a1f64
fix(opencode): generate reasoning variants for all OpenRouter models.…
Jun 9, 2026
94353be
feat(app): add draft tab support to tabs store (#31343)
Jun 9, 2026
fd581ba
chore: generate
Jun 9, 2026
fa569bb
fix(opencode): paginate MCP catalogs (#31442)
Jun 9, 2026
56217bf
fix(opencode): pass abort signal to MCP tool calls (#31455)
Jun 9, 2026
2ca9e40
feat(app): draft prompt state (#31452)
Jun 9, 2026
210136b
chore: generate
Jun 9, 2026
9476f23
feat(app): tabs help button (#31454)
Jun 9, 2026
1715ddd
feat: add "reasoning" as interleaved field option for vLLM providers …
Jun 9, 2026
e11e81c
fix(app): clip rounded session panels (#31462)
Jun 9, 2026
af8fe5a
core: fix idle CPU use in file logger (#31478)
Jun 9, 2026
76fa342
docs: add uninstall troubleshooting steps (#31424)
Jun 9, 2026
bfe2228
leave a breadcrumb comment about batchWindow zero (#31508)
Jun 9, 2026
dd691f3
chore: stats -> data
Jun 9, 2026
3af830f
test(core): avoid Windows worker close race (#31532)
Jun 9, 2026
58e3a17
refactor(tui): centralize application exit (#31524)
Jun 9, 2026
47aff70
chore: generate
Jun 9, 2026
e6cd63e
feat(opencode): configure Cohere North model (#31536)
Jun 9, 2026
f0931a7
refactor(core): consolidate references (#31539)
Jun 9, 2026
f1f4c6c
feat(tui): show project copy in session list (#31421)
Jun 9, 2026
f889e7d
chore: generate
Jun 9, 2026
400c08a
fix(stats): use data branding assets
Jun 9, 2026
1fa3c45
drop citation_options from cohere (#31543)
Jun 9, 2026
a94a749
zen: add north mini code model
Jun 9, 2026
0da931a
fix(data): timestamp formatting
Jun 9, 2026
ae73875
fix(opencode): support Claude Fable reasoning (#31546)
Jun 9, 2026
915c82a
fix(mcp): log actionable connection statuses (#31544)
Jun 9, 2026
85bab89
refactor(core): simplify location filesystem (#31545)
Jun 9, 2026
2a7c601
chore: generate
Jun 9, 2026
3a1dc0c
chore: update nix node_modules hashes
Jun 9, 2026
987b908
fix(opencode): restore effect error logging (#31551)
Jun 9, 2026
343f1f7
chore: generate
Jun 9, 2026
a98f437
feat(opencode): add typed application layer graph (#31531)
Jun 9, 2026
f3fff0d
zen: add claude fable 5
Jun 9, 2026
7e2bd42
chore: generate
Jun 9, 2026
57d7d5d
refactor(mcp): simplify service helpers (#31549)
Jun 9, 2026
498ff73
feat: add X-Session-Id header for proxy cache routing affinity (#31511)
Jun 9, 2026
a788415
zen: update email
Jun 9, 2026
ac08f41
fix(desktop): update Electron stack and panel layout (#31571)
Jun 9, 2026
65e01e8
chore: generate
Jun 9, 2026
a55ec93
chore: update nix node_modules hashes
Jun 9, 2026
86deb54
refactor(core): unify filesystem search service (#31566)
Jun 10, 2026
860420c
chore: generate
Jun 10, 2026
9be1896
chore: update nix node_modules hashes
Jun 10, 2026
f745b37
fix(tui): let gutter replace current marker (#31586)
Jun 10, 2026
0e1f55d
fix(core): prefer shorter paths for tied search scores
Jun 10, 2026
6045f87
chore: generate
Jun 10, 2026
7b44444
fix(core): expose partial filesystem scan results
Jun 10, 2026
8a6a841
chore: generate
Jun 10, 2026
e1d164d
chore: Update fff to 0.9.4 (#31583)
Jun 10, 2026
92920d5
chore: update nix node_modules hashes
Jun 10, 2026
5b8646c
sync release versions for v1.17.0
Jun 10, 2026
5dad1bb
feat(app): /new-session route for new design (#31457)
Jun 10, 2026
5d23c7a
feat(core): add project reference guidance (#31601)
Jun 10, 2026
cd00a7f
fix(mcp): make client creation failure-safe (#31595)
Jun 10, 2026
6541464
fix(opencode): support Anthropic fallback responses (#31611)
Jun 10, 2026
413585d
fix(mcp): apply timeouts to prompts and resources (#31612)
Jun 10, 2026
d6b6de4
chore: update nix node_modules hashes
Jun 10, 2026
7a0cbef
fix(desktop): restore macOS auto-updates (#31621)
Jun 10, 2026
e3c42ba
chore: update nix node_modules hashes
Jun 10, 2026
948b81b
zen: deepseek v4 pro
Jun 10, 2026
bc3bdfc
fix(core): accept deprecated reference config key (#31659)
Jun 10, 2026
735a06d
chore: generate
Jun 10, 2026
05b91c0
sync release versions for v1.17.1
Jun 10, 2026
037ee66
put fff behind flag
Jun 10, 2026
74643f6
ci: change model from gpt-5.4-nano to gpt-5.4-mini (#31695)
Jun 10, 2026
59e764f
fix(core): do not gate fff on initial scan
Jun 10, 2026
7ccba83
feat(core): enable fff by default
Jun 10, 2026
98c59e0
fix(core): disable fff by default on windows
Jun 10, 2026
6be1538
fix(opencode): let subagents use their own permissions (#31696)
Jun 10, 2026
195dc28
fix: recover from expired enterprise auth on remote config load (#31661)
Jun 10, 2026
7962ed2
fix(app): restore device attachment picker (#31707)
Jun 10, 2026
43a3578
chore: generate
Jun 10, 2026
84f5c77
fix(desktop): restore linux launcher identity (#31709)
Jun 10, 2026
23cfd2a
sync release versions for v1.17.2
Jun 10, 2026
62513e0
fix fff disabling logic
Jun 10, 2026
f4cf284
chore: bump gitlab-ai-provider to 6.9.1 (#31728)
Jun 10, 2026
5f5821b
chore: update nix node_modules hashes
Jun 10, 2026
5dfa3d0
feat(web): data link
Jun 10, 2026
ac8f0da
sync release versions for v1.17.3
Jun 10, 2026
dae913e
update opencode.jsonc
Jun 10, 2026
01f9e9b
chore: pin gitlab-ai-provider to 6.9.0 (#31741)
Jun 10, 2026
2157038
fix(mcp): apply timeouts to catalog requests (#31618)
Jun 10, 2026
065e5ae
tui: fix session list search filtering (#31748)
Jun 10, 2026
98a50a3
feat(mcp): support server log notifications (#31752)
Jun 10, 2026
5edebc7
chore: update nix node_modules hashes
Jun 10, 2026
846c5ad
test(opencode): simplify test registry layer wiring (#31761)
Jun 10, 2026
cffa54a
docs: add branch naming guidance
Jun 10, 2026
a8a8142
fix(snapshot): reuse source git objects to avoid re-hashing huge repo…
Jun 11, 2026
b692ead
test(opencode): simplify share layer wiring (#31811)
Jun 11, 2026
2ae7e32
chore: generate
Jun 11, 2026
a7f672c
feat(server): add v2 session API endpoints (#31822)
Jun 11, 2026
207072c
test(opencode): simplify processor layer wiring (#31823)
Jun 11, 2026
e6af0cf
chore: generate
Jun 11, 2026
1eb925d
refactor(tui): replace v2 sync with data context (#31826)
Jun 11, 2026
d1fc698
chore: generate
Jun 11, 2026
2aacea2
fix(mcp): preserve headers during auth and debug (#31802)
Jun 11, 2026
8b0ffdf
feat(core): add connector authentication (#31837)
Jun 11, 2026
e343b4a
chore: generate
Jun 11, 2026
eeb03b6
upgrade opentui-spinner (#31561)
Jun 11, 2026
8409589
chore: update nix node_modules hashes
Jun 11, 2026
1d5b2b9
fix(tui): preserve exit epilogue during scoped shutdown (#31805)
Jun 11, 2026
1ba0f06
test(opencode): simplify snapshot race layer wiring (#31827)
Jun 11, 2026
439ed01
fix(tui): restore legacy sync consumers (#31908)
Jun 11, 2026
c547537
chore: generate
Jun 11, 2026
c1d5bd2
refactor(server): serve raw filesystem content (#31911)
Jun 11, 2026
da79930
chore: generate
Jun 11, 2026
3bde0ee
chore: bump gitlab-ai-provider to 6.9.3 and opencode-gitlab-auth to 2…
Jun 11, 2026
fe813ca
chore: update nix node_modules hashes
Jun 11, 2026
6d6d3aa
fix(opencode): surface content-filter finish reason as visible error …
Jun 11, 2026
1f303e0
fix(gemini): prevent gemini incompatibility with some tools (#31877)
Jun 11, 2026
0e69ae8
fix(tui): show terminal tool failure labels (#31934)
Jun 11, 2026
e21c5c9
chore: generate
Jun 11, 2026
9ad7ebc
fix(stats): align deep route metadata with /data (#31930)
Jun 11, 2026
55cbf3a
chore: generate
Jun 11, 2026
2ce1e5f
fix(tui): show prompt submission errors (#31949)
Jun 11, 2026
3ab8f3c
feat(opencode): support cwd on local MCP servers (#30676)
Jun 11, 2026
a3ca9de
chore: generate
Jun 11, 2026
1d2068d
zen: make payment method off_session
Jun 11, 2026
33cf74a
fix(tui): shorten move session description (#31967)
Jun 12, 2026
92aa1e6
sync release versions for v1.17.4
Jun 12, 2026
23164be
fix(tui): double file content injection in commands using $ARGUMENTS …
Jun 12, 2026
20d911b
refactor(core): simplify integration credentials (#31968)
Jun 12, 2026
47903e1
chore: generate
Jun 12, 2026
fb225d7
fix(core): preserve credential schema compatibility
Jun 12, 2026
6c8e9c1
chore: generate
Jun 12, 2026
1449c8f
feat(app): update oc-2 colors (#31071)
Jun 12, 2026
c2b44a1
chore: generate
Jun 12, 2026
b32297d
feat(go): promote MiniMax M3 usage limits (#31986)
Jun 12, 2026
ee8af80
feat: dreamcode fork — opencode + mimo-code + our skill system
Jun 12, 2026
6f14d19
feat: native TypeScript skill+sensor tools, install.sh unzip fix
Jun 12, 2026
3cafce2
feat: memory reconciliation TypeScript, checkpoint system
Jun 12, 2026
1f7fcd4
feat: shippable install + sandbox opt-in + interactive guide + VS Cod…
Jun 12, 2026
ff635dd
feat: shippable install + sandbox opt-in + interactive guide + VS Cod…
Jun 12, 2026
b531834
feat: make DreamCode shippable — 37 skills, working build, sensor gat…
Jun 12, 2026
558ada3
feat: make DreamCode shippable — 37 skills, working build, sensor gat…
Jun 12, 2026
e233b64
fix: ESM-compatible bin script + native binary symlink in install.sh
Jun 12, 2026
9b7abad
fix: ESM-compatible bin script + native binary symlink in install.sh
Jun 12, 2026
eabe6a0
feat: dreamcode v1.0 - full native agent with skill ecosystem
Jun 12, 2026
f315678
merge: resolve all conflicts with remote, keep dreamcode changes
Jun 12, 2026
d102878
fix: build errors - TodoWriteTool export, SensorGate/ContextCompresso…
Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions .antigravity/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"dreamcode": {
"enabled": true,
"sandbox": false,
"dream_mode": true,
"scoring": true,
"model_router": true,
"skills": {
"auto_chain": true,
"max_chain_length": 16
},
"sensor_gate": {
"enabled": true,
"guardian_ai": true
},
"memory": {
"backend": "sqlite",
"auto_persist": true
}
}
}
Empty file.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
74 changes: 74 additions & 0 deletions .dreamcode/automations/prompts/prompt_engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
"""NeuroPromptEngine - Builds context-aware prompts for NEURO analysis."""

from pathlib import Path
from typing import Any


class NeuroPromptEngine:
"""Builds prompts for NEURO AI architecture review."""

SYSTEM_PROMPTS = {
"full_audit": """You are an expert software architect reviewing a codebase.
Analyze the provided code for:
1. Architecture issues and anti-patterns
2. Security vulnerabilities
3. Performance bottlenecks
4. Code quality and maintainability
5. Testing gaps

Provide specific, actionable recommendations with file:line references.""",

"security": """You are a security expert reviewing code for vulnerabilities.
Focus on:
1. OWASP Top 10 vulnerabilities
2. Authentication/authorization flaws
3. Input validation issues
4. Secret/credential exposure
5. Dependency vulnerabilities

Provide specific fixes with code examples.""",

"bug_hunt": """You are a debugging expert analyzing code for bugs.
Focus on:
1. Logic errors and edge cases
2. Race conditions
3. Memory leaks
4. Error handling gaps
5. Type safety issues

Provide specific fixes with file:line references.""",

"test_gap": """You are a testing expert analyzing code coverage gaps.
Focus on:
1. Missing unit tests
2. Integration test gaps
3. Edge cases not covered
4. Error path testing
5. Performance testing needs

Provide specific test cases with examples.""",
}

def build(self, scan_type: str, files: list[dict], context: str = "") -> dict[str, Any]:
"""Build a prompt for NEURO analysis."""
system_prompt = self.SYSTEM_PROMPTS.get(scan_type, self.SYSTEM_PROMPTS["full_audit"])

file_contents = []
for f in files:
path = f.get("path", "unknown")
content = f.get("content", "")
file_contents.append(f"## File: {path}\n```\n{content}\n```")

user_prompt = f"Analyze the following code:\n\n{chr(10).join(file_contents)}"
if context:
user_prompt += f"\n\nAdditional context: {context}"

estimated_tokens = len(system_prompt.split()) + len(user_prompt.split())

return {
"system_prompt": system_prompt,
"user_prompt": user_prompt,
"estimated_tokens": estimated_tokens,
"scan_type": scan_type,
"file_count": len(files),
}
66 changes: 66 additions & 0 deletions .dreamcode/automations/timezone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
"""timezone.py — IST timezone utilities for all automation scripts.

All timestamps in the automation system use IST (India Standard Time, UTC+5:30).
This module provides helpers to get current IST time and convert between timezones.
"""

from __future__ import annotations

from datetime import UTC, datetime, timedelta, timezone

# IST offset: UTC+5:30
IST = timezone(timedelta(hours=5, minutes=30))


def now_ist() -> datetime:
"""Get current time in IST."""
return datetime.now(IST)


def now_ist_iso() -> str:
"""Get current IST time as ISO 8601 string."""
return now_ist().isoformat()


def now_ist_filesafe() -> str:
"""Get current IST time formatted for filenames."""
return now_ist().strftime("%Y%m%d_%H%M%S")


def now_ist_date() -> str:
"""Get current IST date as YYYY-MM-DD."""
return now_ist().strftime("%Y-%m-%d")


def now_ist_time() -> str:
"""Get current IST time as HH:MM:SS."""
return now_ist().strftime("%H:%M:%S")


def ist_hour() -> int:
"""Get current IST hour (0-23)."""
return now_ist().hour


def ist_minute() -> int:
"""Get current IST minute (0-59)."""
return now_ist().minute


def to_ist(dt: datetime) -> datetime:
"""Convert any datetime to IST."""
if dt.tzinfo is None:
dt = dt.replace(tzinfo=UTC)
return dt.astimezone(IST)


def format_duration(seconds: float) -> str:
"""Format seconds as human-readable duration."""
if seconds < 60:
return f"{seconds:.1f}s"
elif seconds < 3600:
minutes = seconds / 60
return f"{minutes:.1f}m"
else:
hours = seconds / 3600
return f"{hours:.1f}h"
13 changes: 13 additions & 0 deletions .dreamcode/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# DreamCode Python Dependencies
# Install: pip install -r .dreamcode/requirements.txt

# Core dependencies for skill scripts
httpx>=0.27.0
pyyaml>=6.0.1

# Optional: YouTube transcript support
# yt-dlp>=2024.1.1

# Optional: AI/ML dependencies for neuro harness
# openai>=1.50.0
# anthropic>=0.39.0
111 changes: 111 additions & 0 deletions .dreamcode/skills/api/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
name: api-design
description: "API design patterns, REST conventions, and endpoint standards. Use when creating or modifying API endpoints. Covers routing, request/response patterns, error handling, and versioning."
chains_with:
- security
- quality
---

# API Design Skill — Contracts First

## Design Principles

1. **Resource-oriented**: URLs name resources, not actions
2. **Consistent**: Same patterns across all endpoints
3. **Versioned**: Never break existing clients
4. **Documented**: Every endpoint has its contract
5. **Backward compatible**: Add fields, don't remove them

## REST Conventions

### URL Structure
```
GET /api/assets # List resources
GET /api/assets/{id} # Get one resource
POST /api/assets # Create resource
PUT /api/assets/{id} # Replace resource
PATCH /api/assets/{id} # Partial update
DELETE /api/assets/{id} # Delete resource
```

### Query Parameters
- `?page=2&per_page=20` — Pagination
- `?sort=date&order=desc` — Sorting
- `?fields=id,name,value` — Field selection
- `?filter[status]=active` — Filtering

### Response Envelope
```json
{
"status": "ready",
"data": { ... },
"meta": {
"page": 1,
"total": 100,
"timestamp": "2026-05-27T10:30:00Z"
}
}
```

### Error Response
```json
{
"error": "Human-readable message",
"code": "INVALID_INPUT",
"details": {
"field": "confidence_level",
"reason": "Must be between 0 and 1"
}
}
```

## Flask Patterns (Project-Q)

```python
# Standard endpoint pattern
@app.route("/api/resource")
def get_resource():
# 1. Parse parameters
param = request.args.get("param", default_value, type=str)

# 2. Validate
if not valid(param):
return jsonify({"error": "Invalid param"}), 400

# 3. Process
result = compute(param)

# 4. Return
return jsonify({"status": "ready", "data": result})
```

### Cache Pattern
```python
_cache = {"data": None, "timestamp": 0}
TTL = 300 # 5 minutes

@app.route("/api/expensive")
def expensive():
now = time.time()
if _cache["data"] and (now - _cache["timestamp"]) < TTL:
return jsonify(_cache["data"])

data = compute()
_cache = {"data": data, "timestamp": now}
return jsonify(data)
```

## Project-Q API Map

| Endpoint | Method | Purpose | Cached |
|----------|--------|---------|--------|
| `/api/health` | GET | Health check | No |
| `/api/kpis` | GET | Portfolio KPIs | No |
| `/api/correlation` | GET | Correlation matrix | No |
| `/api/regime` | GET | Current regime | No |
| `/api/risk/metrics` | GET | Full risk metrics | 5 min |
| `/api/risk/backtesting` | GET | Backtesting results | No |
| `/api/quantum/summary` | GET | Quantum POC summary | No |
| `/api/quantum/run` | POST | Run quantum layer | No |
| `/api/monte-carlo/distribution` | GET | MC distribution | No |
| `/api/pipeline/run` | POST | Trigger pipeline | No |
86 changes: 86 additions & 0 deletions .dreamcode/skills/architecture/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
name: architecture
description: "Architectural design, system patterns, and dependency management. Use when designing new modules, refactoring existing systems, or making architectural decisions. Covers layering, coupling, cohesion, and design patterns."
chains_with:
- neuro
- code-hardener
---

# Architecture Skill — Design Before Build

## Mandate

Every architectural decision must be explicit, documented, and justified. Do not make implicit architectural choices.

## Trigger Conditions

- New module or subsystem
- Cross-cutting concerns
- API or data contract design
- Performance-sensitive architecture
- Security architecture
- Refactoring existing architecture
- Dependency management

## Core Principles

### 1. Separation of Concerns
- One module = one responsibility
- Business logic isolated from infrastructure
- Data access isolated from presentation
- Configuration externalized

### 2. Dependency Rule
- Dependencies point INWARD (toward business logic)
- Outer layers depend on inner layers
- Never the reverse

### 3. API Design First
- Define contracts before implementation
- API is a contract, not an implementation detail
- Version from day one
- Document all endpoints with request/response schemas

### 4. Data Flow Clarity
- Every data flow has a clear source, path, and sink
- No hidden side effects
- Transformations are explicit and testable

## Evaluation Checklist

Before approving any architecture:

- [ ] Each module has a single, named responsibility
- [ ] Dependencies form a DAG (no cycles)
- [ ] Public API is minimal and documented
- [ ] Private implementation is hidden
- [ ] Configuration is externalized
- [ ] Error handling is designed (not an afterthought)
- [ ] Testing strategy is defined
- [ ] Performance characteristics are understood
- [ ] Security boundaries are identified
- [ ] Scalability limits are documented

## Patterns Library

### When to Use Each

| Pattern | Use Case | Example |
|---------|----------|---------|
| Repository | Data access abstraction | Portfolio repository |
| Factory | Complex object creation | Model factory |
| Strategy | Interchangeable algorithms | Risk calculation |
| Observer | Event-driven updates | Market data feed |
| Adapter | Third-party integration | External API wrapper |
| Decorator | Cross-cutting behavior | Logging, caching |
| Pipeline | Sequential processing | Data transformation |
| Bridge | Platform abstraction | Quantum backend abstraction |

## Anti-Patterns to Flag

- **God Module**: A module that does everything
- **Circular Dependency**: A → B → A
- **Leaky Abstraction**: Internal details visible in the API
- **Shotgun Surgery**: One change requires edits everywhere
- **Feature Envy**: Module A uses more of B's data than its own
- **Premature Optimization**: Complex architecture before it's needed
Loading