ralph-cli-sandboxed 0.6.2 → 0.6.4

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.
@@ -89,29 +89,30 @@ Set up a Ralph CLI project based on the configuration above.
89
89
 
90
90
  | Stack | language | checkCommand | testCommand |
91
91
  |-------|----------|--------------|-------------|
92
- | Node/TS (pnpm) | `typescript` | `pnpm lint && pnpm build` | `pnpm test` |
93
- | Node/TS (npm) | `node` | `npm run lint && npm run build` | `npm test` |
94
- | Node/TS (bun) | `typescript` | `bun run lint && bun run build` | `bun test` |
95
- | Python (pip) | `python` | `mypy . && ruff check .` | `pytest` |
96
- | Python (poetry) | `python` | `poetry run mypy . && poetry run ruff check .` | `poetry run pytest` |
97
- | Python (uv) | `python` | `uv run mypy . && uv run ruff check .` | `uv run pytest` |
98
- | Go | `go` | `go build ./... && go vet ./...` | `go test ./...` |
99
- | Rust | `rust` | `cargo build && cargo clippy` | `cargo test` |
100
-
101
- ### Required Domains by Tech Stack
102
-
103
- | Stack | Package Registry Domains |
104
- |-------|--------------------------|
105
- | Node.js | `registry.npmjs.org`, `github.com` |
106
- | Python | `pypi.org`, `files.pythonhosted.org`, `github.com` |
107
- | Go | `proxy.golang.org`, `sum.golang.org`, `github.com` |
108
- | Rust | `crates.io`, `static.crates.io`, `github.com` |
92
+ | Node/TS (npm) | `node` | `npm run typecheck` | `npm test` |
93
+ | Node/TS (bun) | `bun` | `bun check` | `bun test` |
94
+ | Python | `python` | `mypy .` | `pytest` |
95
+ | Go | `go` | `go build ./...` | `go test ./...` |
96
+ | Rust | `rust` | `cargo check` | `cargo test` |
97
+
98
+ ### Firewall Domains
99
+
100
+ The Docker firewall allows these domains by default: `github.com`, `api.github.com`, `raw.githubusercontent.com`, `registry.npmjs.org`, `api.anthropic.com`.
101
+
102
+ Add additional domains to `docker.firewall.allowedDomains` in `.ralph/config.json` based on your stack:
103
+
104
+ | Stack | Recommended Additions |
105
+ |-------|----------------------|
106
+ | Python | `pypi.org`, `files.pythonhosted.org` |
107
+ | Go | `proxy.golang.org`, `sum.golang.org` |
108
+ | Rust | `crates.io`, `static.crates.io` |
109
109
 
110
110
  ### API Provider Domains
111
111
 
112
+ Add these to `docker.firewall.allowedDomains` if using external APIs:
113
+
112
114
  | Provider | Domains |
113
115
  |----------|---------|
114
- | Anthropic Claude | `api.anthropic.com` |
115
116
  | OpenAI | `api.openai.com` |
116
117
  | Google AI | `generativelanguage.googleapis.com` |
117
118
  | AWS | `*.amazonaws.com` |
@@ -124,6 +125,8 @@ Set up a Ralph CLI project based on the configuration above.
124
125
 
125
126
  ### Notifications Config
126
127
 
128
+ Supported providers: `ntfy`, `pushover`, `gotify`, `command`.
129
+
127
130
  Using ntfy (recommended - no install needed):
128
131
  ```json
129
132
  {
@@ -137,6 +140,32 @@ Using ntfy (recommended - no install needed):
137
140
  }
138
141
  ```
139
142
 
143
+ Using pushover:
144
+ ```json
145
+ {
146
+ "notifications": {
147
+ "provider": "pushover",
148
+ "pushover": {
149
+ "user": "your-user-key",
150
+ "token": "your-app-token"
151
+ }
152
+ }
153
+ }
154
+ ```
155
+
156
+ Using gotify:
157
+ ```json
158
+ {
159
+ "notifications": {
160
+ "provider": "gotify",
161
+ "gotify": {
162
+ "server": "https://gotify.example.com",
163
+ "token": "your-app-token"
164
+ }
165
+ }
166
+ }
167
+ ```
168
+
140
169
  Using custom command:
141
170
  ```json
142
171
  {
@@ -205,10 +234,14 @@ Log task completions and ralph finished to file:
205
234
  ```
206
235
 
207
236
  Chat commands (send in Telegram):
208
- - `/run` - Start ralph automation
237
+ - `/run [category]` - Start ralph automation
209
238
  - `/status` - Show PRD progress
239
+ - `/stop` - Stop a running ralph process
210
240
  - `/add [desc]` - Add new task
211
241
  - `/exec [cmd]` - Execute shell command
242
+ - `/action [name]` - Execute a daemon action
243
+ - `/claude [prompt]` - Run Claude Code with a prompt
244
+ - `/branch [subcommand]` - Manage git branches
212
245
  - `/help` - Show help
213
246
 
214
247
  ### PRD Task Categories
@@ -216,12 +249,11 @@ Chat commands (send in Telegram):
216
249
  | Category | Use For |
217
250
  |----------|---------|
218
251
  | `setup` | Project initialization, dependency installation |
219
- | `config` | Environment variables, configuration files |
220
252
  | `feature` | New functionality implementation |
221
- | `integration` | External API clients, third-party services |
222
- | `test` | Unit tests, integration tests |
223
- | `refactor` | Code restructuring without behavior change |
224
253
  | `bugfix` | Bug fixes |
254
+ | `ui` | User interface changes |
255
+ | `development` | Development tooling, build configuration |
256
+ | `testing` | Unit tests, integration tests |
225
257
  | `docs` | Documentation |
226
258
 
227
259
  ### PRD Guidelines
@@ -231,7 +263,7 @@ Chat commands (send in Telegram):
231
263
  - Include 2-4 concrete steps per task
232
264
  - End with a verification step (build, typecheck, test)
233
265
  - All tasks start with `"passes": false`
234
- - Order by dependency: setup -> config -> features -> tests -> docs
266
+ - Order by dependency: setup -> development -> feature -> testing -> docs
235
267
 
236
268
  ### Sandbox Safety
237
269
 
package/docs/SECURITY.md CHANGED
@@ -20,7 +20,9 @@ When running inside a container, ralph automatically passes the appropriate auto
20
20
  | AMP | `--dangerously-allow-all` | ✅ Supported |
21
21
  | Aider | `--yes-always` | ✅ Supported |
22
22
  | Goose | (none needed) | ✅ Supported |
23
- | OpenCode | `--yolo` | ❌ Not yet implemented |
23
+ | OpenCode | (none) | ❌ Not yet implemented |
24
+ | Ollama | (none needed) | ✅ Supported |
25
+ | Custom | (none) | ⚙️ User-configured |
24
26
 
25
27
  For providers without autonomous mode support, you may need to manually approve actions during execution.
26
28
 
@@ -64,7 +66,7 @@ For Claude Code users with Pro/Max subscriptions, the `~/.claude` directory is m
64
66
 
65
67
  ```yaml
66
68
  volumes:
67
- - ~/.claude:/home/node/.claude:ro
69
+ - ~/.claude:/home/node/.claude
68
70
  ```
69
71
 
70
72
  This allows the AI agent to use your existing OAuth credentials without exposing API keys.
package/docs/SKILLS.md CHANGED
@@ -174,11 +174,11 @@ Target project-specific requirements:
174
174
 
175
175
  ## How Skills Are Applied
176
176
 
177
- When ralph runs an iteration:
177
+ During `ralph docker init`:
178
178
 
179
179
  1. Skills from `claude.skills` are loaded from config
180
- 2. Skill instructions are injected into the prompt template
181
- 3. Claude receives the combined prompt with all active skill instructions
180
+ 2. Each skill is written as a `.claude/commands/<name>.md` file with YAML frontmatter (`description`, `user-invocable`)
181
+ 3. Claude Code natively reads these command files and applies the skill instructions
182
182
 
183
183
  This ensures Claude consistently follows your defined rules across all iterations.
184
184
 
@@ -47,7 +47,8 @@ The Ralph CLI chat system enables external control of Ralph projects via chat pl
47
47
  │ │ └─────────┘ │ ▼ │
48
48
  │ └─────────────┘ ┌───────────────────────────────────────┐ │
49
49
  │ │ Command Handler │ │
50
- │ │ run, stop, status, exec, add, claude │ │
50
+ │ │ run, stop, status, exec, add, claude, │ │
51
+ │ │ help, start, action, branch │ │
51
52
  │ └───────────────────┬───────────────────┘ │
52
53
  │ │ │
53
54
  │ ▼ │
@@ -96,7 +97,7 @@ The Ralph CLI chat system enables external control of Ralph projects via chat pl
96
97
  ┌─────────────────────────────────────────────────────────────────┐
97
98
  │ ResponderMatcher │
98
99
  │ │
99
- │ 1. Check @mention triggers: @qa, @review, @explain, @code
100
+ │ 1. Check @mention triggers: @qa, @review, @arch, @explain, @code│
100
101
  │ 2. Check keyword triggers: !lint, help │
101
102
  │ 3. Fall back to default responder │
102
103
  └─────────────────────────────┬───────────────────────────────────┘
@@ -111,11 +112,11 @@ The Ralph CLI chat system enables external control of Ralph projects via chat pl
111
112
  ┌─────────────────────────────────────────────────────────────────┐
112
113
  │ LLM Responder │
113
114
  │ │
114
- │ 1. Detect git keyword: "last" → git show HEAD
115
+ │ 1. Detect git keyword: "last" → git show HEAD --stat --patch
115
116
  │ 2. Fetch git diff content │
116
117
  │ 3. Build message with diff │
117
118
  │ 4. Load conversation history (if thread) │
118
- │ 5. Send to LLM (Anthropic/OpenAI)
119
+ │ 5. Send to LLM (Anthropic/OpenAI/Ollama)
119
120
  │ 6. Log to .ralph/logs/responder-YYYY-MM-DD.log │
120
121
  │ 7. Return response │
121
122
  └─────────────────────────────┬───────────────────────────────────┘
@@ -168,48 +169,54 @@ Reply in thread history (max 20 messages)
168
169
 
169
170
  ## Message Queue Format
170
171
 
172
+ The messages file stores a direct JSON array (no wrapper object):
173
+
171
174
  ```json
172
- {
173
- "messages": [
174
- {
175
- "id": "uuid-1234",
176
- "from": "host",
177
- "action": "run",
178
- "args": ["feature"],
179
- "timestamp": 1706789012345,
180
- "status": "pending"
181
- },
182
- {
183
- "id": "uuid-1234",
184
- "from": "host",
185
- "action": "run",
186
- "args": ["feature"],
187
- "timestamp": 1706789012345,
188
- "status": "done",
189
- "response": {
190
- "success": true,
191
- "output": "Ralph run started (category: feature)"
192
- }
175
+ [
176
+ {
177
+ "id": "uuid-1234",
178
+ "from": "host",
179
+ "action": "run",
180
+ "args": ["feature"],
181
+ "timestamp": 1706789012345,
182
+ "status": "pending"
183
+ },
184
+ {
185
+ "id": "uuid-1234",
186
+ "from": "host",
187
+ "action": "run",
188
+ "args": ["feature"],
189
+ "timestamp": 1706789012345,
190
+ "status": "done",
191
+ "response": {
192
+ "success": true,
193
+ "output": "Ralph run started (category: feature)"
193
194
  }
194
- ]
195
- }
195
+ }
196
+ ]
196
197
  ```
197
198
 
199
+ Fields:
200
+ - `from`: `"sandbox"` or `"host"`
201
+ - `args`: optional string array
202
+ - `status`: `"pending"` or `"done"`
203
+ - `response`: optional, contains `success` (boolean), `output` (optional string), and `error` (optional string)
204
+
198
205
  ## Git Diff Keywords
199
206
 
200
207
  | Keyword | Git Command | Description |
201
208
  |---------|-------------|-------------|
202
209
  | `diff` / `changes` | `git diff` | Unstaged changes |
203
210
  | `staged` | `git diff --cached` | Staged changes |
204
- | `last` / `last commit` | `git show HEAD` | Last commit |
211
+ | `last` / `last commit` | `git show HEAD --stat --patch` | Last commit |
205
212
  | `all` | `git diff HEAD` | All uncommitted |
206
- | `HEAD~N` | `git show HEAD~N` | N commits ago |
213
+ | `HEAD~N` | `git show HEAD~N --stat --patch` | N commits ago |
207
214
 
208
215
  ## Responder Types
209
216
 
210
217
  | Type | Description | Example Trigger |
211
218
  |------|-------------|-----------------|
212
- | `llm` | Send to LLM (Anthropic/OpenAI) | `@qa`, `@review` |
219
+ | `llm` | Send to LLM (Anthropic/OpenAI/Ollama) | `@qa`, `@review` |
213
220
  | `claude-code` | Spawn Claude Code CLI | `@code` |
214
221
  | `cli` | Run shell command | `!lint` |
215
222
 
@@ -27,13 +27,21 @@ flowchart TD
27
27
  subgraph Analysis ["4. Result Analysis"]
28
28
  ExitCheck{Exit Code == 0?}
29
29
 
30
- ExitCheck -- "No" --> FailurePath[Increment Failure Counter]
31
- FailurePath --> CriticalCheck{Failures >= 3?}
30
+ ExitCheck -- "No" --> FailurePath[Track Failure]
31
+ FailurePath --> SameCode{Same Exit Code\nas Last Failure?}
32
+ SameCode -- "Yes" --> IncrementFailures[Increment Consecutive\nFailure Counter]
33
+ SameCode -- "No" --> ResetToOne[Reset Counter to 1]
34
+ IncrementFailures --> CriticalCheck{Consecutive\nFailures >= 3?}
35
+ ResetToOne --> CriticalCheck
32
36
  CriticalCheck -- "Yes" --> Abort([Abort: Too Many Errors])
33
- CriticalCheck -- "No" --> SignalCheck
37
+ CriticalCheck -- "No" --> ProgressCheck
34
38
 
35
39
  ExitCheck -- "Yes" --> SuccessPath[Reset Failure Counter]
36
- SuccessPath --> SignalCheck
40
+ SuccessPath --> ProgressCheck
41
+
42
+ ProgressCheck{All Mode:\nProgress Made?}
43
+ ProgressCheck -- "Yes / Not All Mode" --> SignalCheck
44
+ ProgressCheck -- "No progress\n3 iterations" --> StallAbort([Abort: No Progress])
37
45
 
38
46
  SignalCheck{COMPLETE Signal?}
39
47
  SignalCheck -- "Yes" --> CompleteModeCheck
@@ -73,5 +81,6 @@ flowchart TD
73
81
  style Analysis fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
74
82
  style Completion fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
75
83
  style Abort fill:#ffebee,stroke:#c62828,color:#c62828
84
+ style StallAbort fill:#ffebee,stroke:#c62828,color:#c62828
76
85
  style End fill:#e8f5e9,stroke:#2e7d32,color:#2e7d32
77
86
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ralph-cli-sandboxed",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "AI-driven development automation CLI for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {