diff --git a/.envrc b/.envrc index d42a767e..903af629 100644 --- a/.envrc +++ b/.envrc @@ -1,2 +1,3 @@ use flake use flake ./src/id +dotenv_if_exists .env.local diff --git a/.gitignore b/.gitignore index e587c3a8..4d07d419 100755 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,10 @@ out **/out result* **/result* +!test/result* +!**/test/result* +!tests/result* +!**/tests/result* target **/target targets @@ -52,6 +56,8 @@ sources/**/data **/.ssh/ .direnv result* +!**/tests/results/ +!tests/results/ *.qcow2 .nixie @@ -95,3 +101,21 @@ override.tf.json terraform.rc *tfplan* +.env.local +.opencode/worktree-session-state.json +*_ses_*.json +ses_*.json +**/*_ses_*.json +**/ses_*.json +*_ses_*/*.json +ses_*/*.json +**/*_ses_*/*.json +**/ses_*/*.json +.opencode/plugin/subtask2/logs/*.log +.opencode/worktrees/ +.iroh* +test.* +pkgs/roc/platforms/rust-basic-cli +codedb.snapshot +**/codedb.snapshot +*bfg-report/ diff --git a/.hydra.json b/.hydra.json index 96f0bb5f..57c39c55 100644 --- a/.hydra.json +++ b/.hydra.json @@ -1,14 +1,14 @@ { - "main": { - "enabled": 1, - "type": 1, - "hidden": false, - "description": "Build main branch", - "flake": "git://m7.rs/nix-config", - "checkinterval": 60, - "schedulingshares": 10, - "enableemail": false, - "emailoverride": "", - "keepnr": 2 - } + "main": { + "enabled": 1, + "type": 1, + "hidden": false, + "description": "Build main branch", + "flake": "git://m7.rs/nix-config", + "checkinterval": 60, + "schedulingshares": 10, + "enableemail": false, + "emailoverride": "", + "keepnr": 2 + } } diff --git a/.opencode/artifact-index/context.db b/.opencode/artifact-index/context.db new file mode 100644 index 00000000..3fefa193 Binary files /dev/null and b/.opencode/artifact-index/context.db differ diff --git a/.opencode/commands/update.md b/.opencode/commands/update.md index e7a12deb..24a6e2e0 100644 --- a/.opencode/commands/update.md +++ b/.opencode/commands/update.md @@ -42,7 +42,7 @@ Do NOT make changes autonomously. Present findings using the question tool with Proposed AGENTS.md updates: 1. [Structure] src/commands/ now has 3 new files - add to tree? (Y/n) -2. [Commands] `just check` renamed to `just verify` - update? (Y/n) +2. [Commands] `just check` renamed to `just verify` - update? (Y/n) 3. [Tighten] Error handling section is 15 lines, could be 3 - condense? (Y/n) 4. [Remove] "Store Access" code example duplicates pattern in store.rs:45 - remove? (Y/n) 5. [Add] New critical rule needed: never delete .env.example? (y/N) diff --git a/.opencode/dcp.jsonc b/.opencode/dcp.jsonc index 6e5c686c..773640b8 100644 --- a/.opencode/dcp.jsonc +++ b/.opencode/dcp.jsonc @@ -1,3 +1,7 @@ { - "$schema": "https://raw.githubusercontent.com/Opencode-DCP/opencode-dynamic-context-pruning/master/dcp.schema.json" + "$schema": "https://raw.githubusercontent.com/Opencode-DCP/opencode-dynamic-context-pruning/master/dcp.schema.json", + "compress": { + "maxContextLimit": "80%", + "minContextLimit": "40%" + } } diff --git a/.opencode/instructions/lootbox.md b/.opencode/instructions/lootbox.md new file mode 100644 index 00000000..13b2242c --- /dev/null +++ b/.opencode/instructions/lootbox.md @@ -0,0 +1,72 @@ +All tools are accessed through lootbox. The lootbox server runs on `http://localhost:9420` (auto-started by devshell). + +## Always write scripts + +Write `.ts` scripts to `.lootbox/scripts/` for any tool usage. Only use `lootbox exec 'code'` for one-line checks. Scripts are reusable, testable, and composable. + +```bash +# Write a script (preferred) +cat > .lootbox/scripts/find-todos.ts << 'EOF' +const results = await tools.mcp_fff.grep({ query: "TODO" }); +console.log(JSON.stringify(results, null, 2)); +EOF +lootbox find-todos.ts + +# Inline only for quick checks +lootbox exec 'console.log(await tools.mcp_codedb.status({}))' +``` + +## Available MCP namespaces + +| Namespace | Tools | What it does | +|---|---|---| +| `mcp_codedb` | tree, outline, symbol, search, word, hot, deps, read, edit, changes, status, snapshot, bundle, projects, index, remote | Codebase exploration, symbol lookup, AST-aware search | +| `mcp_fff` | grep, find_files, multi_grep | Frecency-ranked file search and content grep | +| `mcp_chrome_devtools` | navigate_page, take_screenshot, take_snapshot, click, fill, press_key, hover, type_text, evaluate_script, wait_for, upload_file, handle_dialog, list_console_messages, get_console_message, list_network_requests, get_network_request, ... | Browser automation, UI verification, screenshots | +| `mcp_context7` | resolve_library_id, query_docs | Library documentation lookup (API refs, usage guides, examples) | + +## Script patterns + +```typescript +// .lootbox/scripts/search-code.ts — find definitions +const sym = await tools.mcp_codedb.symbol({ name: "handleAuth" }); +console.log(sym); + +// .lootbox/scripts/check-ui.ts — browser verification +await tools.mcp_chrome_devtools.navigate_page({ url: "http://localhost:3000" }); +const snap = await tools.mcp_chrome_devtools.take_snapshot({}); +console.log(snap); + +// .lootbox/scripts/lookup-docs.ts — library docs +const lib = await tools.mcp_context7.resolve_library_id({ query: "how to use React hooks", libraryName: "react" }); +const docs = await tools.mcp_context7.query_docs({ libraryId: lib.libraryId, query: "useEffect cleanup" }); +console.log(docs); + +// .lootbox/scripts/multi-search.ts — chain tools +const files = await tools.mcp_fff.grep({ query: "deprecated" }); +for (const f of files.matches || []) { + const outline = await tools.mcp_codedb.outline({ path: f.path }); + console.log(f.path, outline); +} +``` + +## Commands + +| Command | Description | +|---|---| +| `lootbox \n", assets.main_js ); - html.push_str("\n\n
\n"); - html.push_str("