From af0a0c5c39f3fc30de567a8394a516a0b4b6abf3 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Fri, 27 Mar 2026 16:20:31 -0400 Subject: [PATCH] Fix documentation mismatches and fill gaps - Update KV TTL from 24 hours to 7 days in memory.md - Add AUTH_SECRET setup to Docker quickstart in installation.md - Rename ralph to loop in docs and config.jsonc - Add deprecation note for ralph.* prefix - Fix test description in CONTRIBUTING.md - Clarify skills path in skills.md - Update setup-dev.sh to use curl install method - Add memory-kv-delete documentation - Add stallTimeoutMs to default config example --- CONTRIBUTING.md | 2 +- docs/features/memory.md | 38 ++++++++++++++++++---------- docs/features/skills.md | 2 +- docs/getting-started/installation.md | 3 +++ packages/memory/config.jsonc | 2 +- scripts/setup-dev.sh | 4 +-- 6 files changed, 32 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ff1ee37b..3b2c0a69 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,7 +72,7 @@ Each item is tagged with a theme to help you find work in your area of interest: ### Running Tests ```bash -pnpm test # Run all backend tests +pnpm test # Run all tests (backend + memory plugin) cd backend && vitest # Run single test file ``` diff --git a/docs/features/memory.md b/docs/features/memory.md index 5d3c8344..fc7cec6d 100644 --- a/docs/features/memory.md +++ b/docs/features/memory.md @@ -80,7 +80,8 @@ The file is only created if it does not already exist. The config is validated o "cleanupWorktree": false, "defaultAudit": true, "model": "", - "minAudits": 1 + "minAudits": 1, + "stallTimeoutMs": 60000 } } ``` @@ -132,13 +133,16 @@ Set `baseUrl` to point at any OpenAI-compatible self-hosted service (vLLM, Ollam | `messagesTransform.enabled` | Enable the messages transform hook (memory injection + Architect enforcement) | `true` | | `messagesTransform.debug` | Enable debug logging for messages transform | `false` | | `executionModel` | Model override for plan execution sessions (`provider/model`). Falls back to OpenCode's default model. | — | -| `ralph.enabled` | Enable Ralph iterative development loops | `true` | -| `ralph.defaultMaxIterations` | Default max iterations (0 = unlimited) | `15` | -| `ralph.cleanupWorktree` | Auto-remove worktree on cancel | `false` | -| `ralph.defaultAudit` | Run auditor after each coding iteration | `true` | -| `ralph.model` | Model override for Ralph sessions (`provider/model`), falls back to `executionModel` | — | -| `ralph.minAudits` | Minimum audit iterations required before completion | `1` | -| `ralph.stallTimeoutMs` | Watchdog stall detection timeout (ms) | `60000` | +| `loop.enabled` | Enable Ralph iterative development loops | `true` | +| `loop.defaultMaxIterations` | Default max iterations (0 = unlimited) | `15` | +| `loop.cleanupWorktree` | Auto-remove worktree on cancel | `false` | +| `loop.defaultAudit` | Run auditor after each coding iteration | `true` | +| `loop.model` | Model override for Ralph sessions (`provider/model`), falls back to `executionModel` | — | +| `loop.minAudits` | Minimum audit iterations required before completion | `1` | +| `loop.stallTimeoutMs` | Watchdog stall detection timeout (ms) | `60000` | + +!!! note "Deprecated Options" + The `ralph.*` prefix is deprecated but still accepted for backward compatibility. Use `loop.*` instead. | `auditorModel` | Model override for the auditor agent (`provider/model`). When set, overrides the auditor agent's default model. When not set, the auditor uses the platform default. | — | --- @@ -187,7 +191,7 @@ SQLite pragmas are tuned for concurrent access: The KV store provides ephemeral project state management with automatic TTL-based expiration: - **Key-Value Storage**: Store arbitrary JSON values under string keys, scoped by project ID -- **TTL Management**: Each entry has a configurable expiration time (default 24 hours) +- **TTL Management**: Each entry has a configurable expiration time (default 7 days) - **Auto-Cleanup**: Background cleanup runs every 30 minutes to remove expired entries - **Graceful Degradation**: `get()` and `list()` methods handle malformed JSON gracefully - **Use Cases**: Planning progress, code review patterns, session context, temporary state @@ -397,13 +401,13 @@ The model used for execution is determined by `executionModel` in the plugin con ### memory-kv-set -Store a key-value pair for the current project. Values expire after 24 hours by default. Use for ephemeral project state like planning progress, code review patterns, or session context. +Store a key-value pair for the current project. Values expire after 7 days by default. Use for ephemeral project state like planning progress, code review patterns, or session context. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `key` | string | Yes | The key to store the value under | | `value` | string | Yes | The value to store (JSON string) | -| `ttlMs` | number | No | Time-to-live in milliseconds (default: 24 hours) | +| `ttlMs` | number | No | Time-to-live in milliseconds (default: 7 days) | Returns confirmation with the key and expiration timestamp. @@ -425,6 +429,14 @@ No parameters required. Returns a list of all stored keys with their values and expiration times. Useful for debugging or inspecting current project state. +### memory-kv-delete + +Delete a key-value pair for the current project. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `key` | string | Yes | The key to delete | + ### memory-loop-cancel Cancel an active Ralph loop and optionally clean up the worktree. @@ -454,7 +466,7 @@ Execute an architect plan using a Ralph iterative development loop. Designed to | `worktree` | boolean | No | Run in isolated git worktree instead of current directory (default: false) | !!! note "KV Store vs Memory" - The KV store is designed for **ephemeral** project state that expires automatically (default 24 hours). Use `memory-write` for **durable** knowledge that should persist across sessions, such as conventions, decisions, and context. + The KV store is designed for **ephemeral** project state that expires automatically (default 7 days). Use `memory-write` for **durable** knowledge that should persist across sessions, such as conventions, decisions, and context. --- @@ -590,7 +602,7 @@ Blocking is enforced via `tool.execute.before` (throws error) with `tool.execute | Config Key | Purpose | Fallback | |------------|---------|----------| -| `ralph.model` | Model for Ralph coding sessions | `executionModel` → platform default | +| `loop.model` | Model for Ralph coding sessions | `executionModel` → platform default | | `auditorModel` | Model for the auditor agent | Platform default (no fallback chain) | #### Model Fallback on Error diff --git a/docs/features/skills.md b/docs/features/skills.md index eff5adec..7ebf5f3d 100644 --- a/docs/features/skills.md +++ b/docs/features/skills.md @@ -6,7 +6,7 @@ Skills are reusable instruction sets that provide domain-specific workflows and | Scope | Location | Description | |-------|----------|-------------| -| **Global** | `/.config/opencode/skills//SKILL.md` | Available across all repositories | +| **Global** | `$WORKSPACE_PATH/.config/opencode/skills//SKILL.md` (defaults to `./workspace/.config/opencode/skills/`) | Available across all repositories | | **Project** | `/.opencode/skills//SKILL.md` | Scoped to a specific repository | ## Skill File Format diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 82449eeb..16e04cef 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -9,6 +9,9 @@ Docker is the fastest way to get started and recommended for production use. ```bash git clone https://github.com/chriswritescode-dev/opencode-manager.git cd opencode-manager +cp .env.example .env +# Generate AUTH_SECRET and add to .env +echo "AUTH_SECRET=$(openssl rand -base64 32)" >> .env docker-compose up -d ``` diff --git a/packages/memory/config.jsonc b/packages/memory/config.jsonc index 5b3b680b..1ccbb418 100644 --- a/packages/memory/config.jsonc +++ b/packages/memory/config.jsonc @@ -28,7 +28,7 @@ }, "executionModel": "", "auditorModel": "", - "ralph": { + "loop": { "enabled": true, "defaultMaxIterations": 15, "cleanupWorktree": false, diff --git a/scripts/setup-dev.sh b/scripts/setup-dev.sh index ca50641c..dd84fb8e 100755 --- a/scripts/setup-dev.sh +++ b/scripts/setup-dev.sh @@ -32,9 +32,7 @@ echo "✅ Git is installed" # Check if OpenCode TUI is installed if ! opencode --version &> /dev/null; then echo "❌ OpenCode TUI is not installed. Please install it with:" - echo " npm install -g @opencode/tui" - echo " or" - echo " bun add -g @opencode/tui" + echo " curl -fsSL https://opencode.ai/install | bash" exit 1 fi