Rename samples/ to experiments/, list both in the README
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1111079 parent: fe0695f modified
.memory/handoffs/2026-11-25-v0-2-server-foundation.md +2 -0 | @@ -135,3 +135,5 @@ signing #52. #47 leftovers have no milestone. | ||
| 135 | 135 | User is now trying rzb themselves (installed with `scripts/install.sh`) before starting v0.3 (spike |
| 136 | 136 | #46). Expect feedback from that use first. Not run on the Mac by Claude: install.sh, release.sh, |
| 137 | 137 | compat.sh. Nothing pushed; tag v0.2.0 is local. |
| 138 | +Trap: `samples/` is now `experiments/`; host_runner.py on the Mac must be restarted (old process | |
| 139 | +refuses `experiments/...`). Old tickets and handoffs still say `samples/`. | |
| @@ -135,3 +135,5 @@ signing #52. #47 leftovers have no milestone. | |||
| 135 | User is now trying rzb themselves (installed with `scripts/install.sh`) before starting v0.3 (spike | 135 | User is now trying rzb themselves (installed with `scripts/install.sh`) before starting v0.3 (spike |
| 136 | #46). Expect feedback from that use first. Not run on the Mac by Claude: install.sh, release.sh, | 136 | #46). Expect feedback from that use first. Not run on the Mac by Claude: install.sh, release.sh, |
| 137 | compat.sh. Nothing pushed; tag v0.2.0 is local. | 137 | compat.sh. Nothing pushed; tag v0.2.0 is local. |
| 138 | +Trap: `samples/` is now `experiments/`; host_runner.py on the Mac must be restarted (old process | ||
| 139 | +refuses `experiments/...`). Old tickets and handoffs still say `samples/`. | ||
modified
.memory/history.md +8 -0 | @@ -348,3 +348,11 @@ is unverified). Tested on Linux with `--no-build --prefix` (install, reinstall, | ||
| 348 | 348 | on a foreign rzb); not yet run on the Mac. Docs EN+FR (build guide "Install", README, release |
| 349 | 349 | how-to, release notes). Gate PASS, links OK. main fast-forwarded, local tag v0.2.0. The Mac run of |
| 350 | 350 | scripts/release.sh and scripts/compat.sh was not reported by the user. |
| 351 | + | |
| 352 | +## 2026-11-26 — samples/ renamed experiments/ | |
| 353 | + | |
| 354 | +User asked what samples/ is for (answer: development experiments, standalone packages, not usage | |
| 355 | +examples) and chose to rename it `experiments/` and list both in the README. Updated host-runner | |
| 356 | +(project names are now `experiments/<name>`; its 9 unit tests pass), .vscode, sandbox how-to EN+FR, | |
| 357 | +the experiments' READMEs, summary. Tickets, history and older handoffs keep `samples/` (record). | |
| 358 | +The Mac's running host_runner.py must be restarted to accept the new name. Gate PASS, links OK. | |
| @@ -348,3 +348,11 @@ is unverified). Tested on Linux with `--no-build --prefix` (install, reinstall, | |||
| 348 | on a foreign rzb); not yet run on the Mac. Docs EN+FR (build guide "Install", README, release | 348 | on a foreign rzb); not yet run on the Mac. Docs EN+FR (build guide "Install", README, release |
| 349 | how-to, release notes). Gate PASS, links OK. main fast-forwarded, local tag v0.2.0. The Mac run of | 349 | how-to, release notes). Gate PASS, links OK. main fast-forwarded, local tag v0.2.0. The Mac run of |
| 350 | scripts/release.sh and scripts/compat.sh was not reported by the user. | 350 | scripts/release.sh and scripts/compat.sh was not reported by the user. |
| 351 | + | ||
| 352 | +## 2026-11-26 — samples/ renamed experiments/ | ||
| 353 | + | ||
| 354 | +User asked what samples/ is for (answer: development experiments, standalone packages, not usage | ||
| 355 | +examples) and chose to rename it `experiments/` and list both in the README. Updated host-runner | ||
| 356 | +(project names are now `experiments/<name>`; its 9 unit tests pass), .vscode, sandbox how-to EN+FR, | ||
| 357 | +the experiments' READMEs, summary. Tickets, history and older handoffs keep `samples/` (record). | ||
| 358 | +The Mac's running host_runner.py must be restarted to accept the new name. Gate PASS, links OK. | ||
modified
.memory/summary.md +4 -4 | @@ -24,7 +24,7 @@ its own MLX models. Decided 2026-11-23 (replaces the earlier "Ollama-like API se | ||
| 24 | 24 | - easy to modify: engine/tools/front-ends behind protocols and a registry. |
| 25 | 25 | |
| 26 | 26 | The repository holds tooling (`.claude/` skills, `.tickets/`, `tools/host-runner/`) and a standalone |
| 27 | -sample `samples/01-query-model/` (mlx-swift-lm 3.32.x, streams one prompt to one Hugging Face MLX | |
| 27 | +experiment `experiments/01-query-model/` (renamed from `samples/` 2026-11-26) (mlx-swift-lm 3.32.x, streams one prompt to one Hugging Face MLX | |
| 28 | 28 | model) — built and run on the Mac 2026-11-23, ~175-200 tok/s with Qwen3-0.6B-4bit. |
| 29 | 29 | |
| 30 | 30 | The razorbill package (v0.1, branch `feature/v0.1-agent-mvp`, **nothing committed yet**) implements |
| @@ -104,7 +104,7 @@ when the model carries per-call state, then `TokenIterator` + `generateTask`. Re | ||
| 104 | 104 | `GenerationStats.cachedPromptTokens` → `usage.prompt_tokens_details.cached_tokens` (only when > 0) |
| 105 | 105 | and ` cached=N` in the request log. Raw completions do not use it. Cache freed on unload/load. One |
| 106 | 106 | cache per model (no LRU), not counted in the memory budget. Measured with |
| 107 | -`samples/02-kv-cache-reuse` (Qwen3-4B-4bit, 4k history): TTFT 25–30 s → <1 s per turn; greedy | |
| 107 | +`experiments/02-kv-cache-reuse` (Qwen3-4B-4bit, 4k history): TTFT 25–30 s → <1 s per turn; greedy | |
| 108 | 108 | answers identical thinking off; with thinking on they can differ, as they do between two prefill |
| 109 | 109 | step sizes (numeric). Qwen3-4B KV = 144 KiB/token (bf16), 76.5 KiB (8-bit). |
| 110 | 110 | |
| @@ -188,9 +188,9 @@ with `xcodebuild` (SwiftPM CLI cannot compile MLX Metal shaders), after a one-ti | ||
| 188 | 188 | swiftlint and swift-format can be run there. Sample build command: |
| 189 | 189 | `xcodebuild build -scheme query-model -destination 'platform=macOS' -configuration Release |
| 190 | 190 | -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation` |
| 191 | -(details in `samples/01-query-model/README.md`). | |
| 191 | +(details in `experiments/01-query-model/README.md`). | |
| 192 | 192 | **Remote Mac builds from the sandbox**: start `python3 tools/host-runner/host_runner.py` on the |
| 193 | -Mac (127.0.0.1:7777), then in the sandbox `tools/host-runner/host.sh build|run|clean <sample> | |
| 193 | +Mac (127.0.0.1:7777), then in the sandbox `tools/host-runner/host.sh build|run|clean <experiment> | |
| 194 | 194 | <scheme> [args]` (reaches the Mac via `http://host.docker.internal:7777` through the sbx proxy; |
| 195 | 195 | repo is mounted at the same path on both sides — direct mode). SSH to the host is closed. Samples use mlx-swift-lm's 4-space |
| 196 | 196 | `.swift-format`. |
| @@ -24,7 +24,7 @@ its own MLX models. Decided 2026-11-23 (replaces the earlier "Ollama-like API se | |||
| 24 | - easy to modify: engine/tools/front-ends behind protocols and a registry. | 24 | - easy to modify: engine/tools/front-ends behind protocols and a registry. |
| 25 | 25 | ||
| 26 | The repository holds tooling (`.claude/` skills, `.tickets/`, `tools/host-runner/`) and a standalone | 26 | The repository holds tooling (`.claude/` skills, `.tickets/`, `tools/host-runner/`) and a standalone |
| 27 | -sample `samples/01-query-model/` (mlx-swift-lm 3.32.x, streams one prompt to one Hugging Face MLX | 27 | +experiment `experiments/01-query-model/` (renamed from `samples/` 2026-11-26) (mlx-swift-lm 3.32.x, streams one prompt to one Hugging Face MLX |
| 28 | model) — built and run on the Mac 2026-11-23, ~175-200 tok/s with Qwen3-0.6B-4bit. | 28 | model) — built and run on the Mac 2026-11-23, ~175-200 tok/s with Qwen3-0.6B-4bit. |
| 29 | 29 | ||
| 30 | The razorbill package (v0.1, branch `feature/v0.1-agent-mvp`, **nothing committed yet**) implements | 30 | The razorbill package (v0.1, branch `feature/v0.1-agent-mvp`, **nothing committed yet**) implements |
| @@ -104,7 +104,7 @@ when the model carries per-call state, then `TokenIterator` + `generateTask`. Re | |||
| 104 | `GenerationStats.cachedPromptTokens` → `usage.prompt_tokens_details.cached_tokens` (only when > 0) | 104 | `GenerationStats.cachedPromptTokens` → `usage.prompt_tokens_details.cached_tokens` (only when > 0) |
| 105 | and ` cached=N` in the request log. Raw completions do not use it. Cache freed on unload/load. One | 105 | and ` cached=N` in the request log. Raw completions do not use it. Cache freed on unload/load. One |
| 106 | cache per model (no LRU), not counted in the memory budget. Measured with | 106 | cache per model (no LRU), not counted in the memory budget. Measured with |
| 107 | -`samples/02-kv-cache-reuse` (Qwen3-4B-4bit, 4k history): TTFT 25–30 s → <1 s per turn; greedy | 107 | +`experiments/02-kv-cache-reuse` (Qwen3-4B-4bit, 4k history): TTFT 25–30 s → <1 s per turn; greedy |
| 108 | answers identical thinking off; with thinking on they can differ, as they do between two prefill | 108 | answers identical thinking off; with thinking on they can differ, as they do between two prefill |
| 109 | step sizes (numeric). Qwen3-4B KV = 144 KiB/token (bf16), 76.5 KiB (8-bit). | 109 | step sizes (numeric). Qwen3-4B KV = 144 KiB/token (bf16), 76.5 KiB (8-bit). |
| 110 | 110 | ||
| @@ -188,9 +188,9 @@ with `xcodebuild` (SwiftPM CLI cannot compile MLX Metal shaders), after a one-ti | |||
| 188 | swiftlint and swift-format can be run there. Sample build command: | 188 | swiftlint and swift-format can be run there. Sample build command: |
| 189 | `xcodebuild build -scheme query-model -destination 'platform=macOS' -configuration Release | 189 | `xcodebuild build -scheme query-model -destination 'platform=macOS' -configuration Release |
| 190 | -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation` | 190 | -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation` |
| 191 | -(details in `samples/01-query-model/README.md`). | 191 | +(details in `experiments/01-query-model/README.md`). |
| 192 | **Remote Mac builds from the sandbox**: start `python3 tools/host-runner/host_runner.py` on the | 192 | **Remote Mac builds from the sandbox**: start `python3 tools/host-runner/host_runner.py` on the |
| 193 | -Mac (127.0.0.1:7777), then in the sandbox `tools/host-runner/host.sh build|run|clean <sample> | 193 | +Mac (127.0.0.1:7777), then in the sandbox `tools/host-runner/host.sh build|run|clean <experiment> |
| 194 | <scheme> [args]` (reaches the Mac via `http://host.docker.internal:7777` through the sbx proxy; | 194 | <scheme> [args]` (reaches the Mac via `http://host.docker.internal:7777` through the sbx proxy; |
| 195 | repo is mounted at the same path on both sides — direct mode). SSH to the host is closed. Samples use mlx-swift-lm's 4-space | 195 | repo is mounted at the same path on both sides — direct mode). SSH to the host is closed. Samples use mlx-swift-lm's 4-space |
| 196 | `.swift-format`. | 196 | `.swift-format`. |
modified
.quality/history.jsonl +1 -0 | @@ -28,3 +28,4 @@ | ||
| 28 | 28 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a485576", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 28, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-25T22:03:59Z"} |
| 29 | 29 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "17b9753", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 29, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T04:34:58Z"} |
| 30 | 30 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a218748", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 30, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T05:21:18Z"} |
| 31 | +{"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "fe0695f", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 31, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T07:11:39Z"} | |
| @@ -28,3 +28,4 @@ | |||
| 28 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a485576", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 28, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-25T22:03:59Z"} | 28 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a485576", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 28, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-25T22:03:59Z"} |
| 29 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "17b9753", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 29, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T04:34:58Z"} | 29 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "17b9753", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 29, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T04:34:58Z"} |
| 30 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a218748", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 30, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T05:21:18Z"} | 30 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a218748", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 30, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T05:21:18Z"} |
| 31 | +{"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "fe0695f", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 31, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T07:11:39Z"} | ||
added
.quality/report-20261126T071139Z.md +73 -0 | new file mode 100644 | ||
| @@ -0,0 +1,73 @@ | ||
| 1 | +# Quality report — 2026-11-26T07:11:39Z | |
| 2 | + | |
| 3 | +- **Gate**: ✅ **PASS** | |
| 4 | +- **Commit**: `fe0695f` on `feature/v0.2-openai-server` | |
| 5 | +- **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20) | |
| 6 | +- **swiftlint**: 0.65.1 (run directly, merged into lint issues) | |
| 7 | +- **Run**: #31 (previous: 2026-11-26T05:21:18Z) | |
| 8 | + | |
| 9 | +## Lint issues (`qlty check`) | |
| 10 | + | |
| 11 | +_none_ | |
| 12 | + | |
| 13 | +### Top rules | |
| 14 | + | |
| 15 | +_none_ | |
| 16 | + | |
| 17 | +### Most affected files | |
| 18 | + | |
| 19 | +_none_ | |
| 20 | + | |
| 21 | +## Code smells (`qlty smells`) | |
| 22 | + | |
| 23 | +Total: **0** (vs previous: ±0) | |
| 24 | + | |
| 25 | +_none_ | |
| 26 | + | |
| 27 | +## Metrics (`qlty metrics`) | |
| 28 | + | |
| 29 | +| metric | total | vs previous | | |
| 30 | +|---|---|---| | |
| 31 | +| funcs | 582 | ±0 | | |
| 32 | +| classes | 234 | ±0 | | |
| 33 | +| fields | 1209 | ±0 | | |
| 34 | +| cyclo | 604 | ±0 | | |
| 35 | +| complex | 546 | ±0 | | |
| 36 | +| lcom | 115 | ±0 | | |
| 37 | +| lines | 10669 | ±0 | | |
| 38 | +| loc | 8492 | ±0 | | |
| 39 | + | |
| 40 | +### Most complex files | |
| 41 | + | |
| 42 | +| file | complex | cyclo | loc | | |
| 43 | +|---|---|---|---| | |
| 44 | +| Sources/RazorbillServer/CompletionsRoute.swift | 47 | 20 | 242 | | |
| 45 | +| Sources/RazorbillServer/Chat/CompletionStream.swift | 31 | 20 | 125 | | |
| 46 | +| experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 | | |
| 47 | +| Sources/RazorbillMLX/MLXEngine.swift | 23 | 35 | 246 | | |
| 48 | +| tools/host-runner/host_runner.py | 22 | 22 | 141 | | |
| 49 | +| Sources/RazorbillCore/Config/ConfigValue+JSON.swift | 20 | 25 | 71 | | |
| 50 | +| Sources/RazorbillCore/Config/ServerConfigLoader.swift | 20 | 17 | 227 | | |
| 51 | +| Sources/RazorbillServer/Chat/ToolsAndFormats.swift | 18 | 30 | 170 | | |
| 52 | +| Sources/RazorbillServer/Chat/ChatCompletionRequest.swift | 17 | 24 | 276 | | |
| 53 | +| Sources/RazorbillServer/Chat/ChatCompletionChunk.swift | 16 | 11 | 137 | | |
| 54 | +| Sources/RazorbillServer/ModelManager.swift | 16 | 22 | 220 | | |
| 55 | +| Sources/RazorbillCore/Config/OrderedJSONReader.swift | 15 | 24 | 140 | | |
| 56 | +| Sources/RazorbillCore/Config/GenerationOverrides.swift | 14 | 15 | 67 | | |
| 57 | +| Sources/RazorbillCLI/Commands/ModelsCommand.swift | 13 | 7 | 100 | | |
| 58 | +| Sources/RazorbillServer/EmbeddingsRoute.swift | 13 | 13 | 143 | | |
| 59 | + | |
| 60 | +## Trend | |
| 61 | + | |
| 62 | +| run | timestamp | error | warning | smells | complex | gate | | |
| 63 | +|---|---|---|---|---|---|---| | |
| 64 | +| 22 | 2026-11-25T21:27:49Z | 4 | 1 | 0 | 538 | FAIL | | |
| 65 | +| 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS | | |
| 66 | +| 24 | 2026-11-25T21:37:24Z | 0 | 1 | 1 | 559 | FAIL | | |
| 67 | +| 25 | 2026-11-25T21:37:51Z | 0 | 1 | 0 | 544 | FAIL | | |
| 68 | +| 26 | 2026-11-25T21:38:24Z | 0 | 0 | 0 | 544 | PASS | | |
| 69 | +| 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS | | |
| 70 | +| 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | | |
| 71 | +| 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS | | |
| 72 | +| 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS | | |
| 73 | +| 31 | 2026-11-26T07:11:39Z | 0 | 0 | 0 | 546 | PASS | | |
| new file mode 100644 | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | +# Quality report — 2026-11-26T07:11:39Z | ||
| 2 | + | ||
| 3 | +- **Gate**: ✅ **PASS** | ||
| 4 | +- **Commit**: `fe0695f` on `feature/v0.2-openai-server` | ||
| 5 | +- **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20) | ||
| 6 | +- **swiftlint**: 0.65.1 (run directly, merged into lint issues) | ||
| 7 | +- **Run**: #31 (previous: 2026-11-26T05:21:18Z) | ||
| 8 | + | ||
| 9 | +## Lint issues (`qlty check`) | ||
| 10 | + | ||
| 11 | +_none_ | ||
| 12 | + | ||
| 13 | +### Top rules | ||
| 14 | + | ||
| 15 | +_none_ | ||
| 16 | + | ||
| 17 | +### Most affected files | ||
| 18 | + | ||
| 19 | +_none_ | ||
| 20 | + | ||
| 21 | +## Code smells (`qlty smells`) | ||
| 22 | + | ||
| 23 | +Total: **0** (vs previous: ±0) | ||
| 24 | + | ||
| 25 | +_none_ | ||
| 26 | + | ||
| 27 | +## Metrics (`qlty metrics`) | ||
| 28 | + | ||
| 29 | +| metric | total | vs previous | | ||
| 30 | +|---|---|---| | ||
| 31 | +| funcs | 582 | ±0 | | ||
| 32 | +| classes | 234 | ±0 | | ||
| 33 | +| fields | 1209 | ±0 | | ||
| 34 | +| cyclo | 604 | ±0 | | ||
| 35 | +| complex | 546 | ±0 | | ||
| 36 | +| lcom | 115 | ±0 | | ||
| 37 | +| lines | 10669 | ±0 | | ||
| 38 | +| loc | 8492 | ±0 | | ||
| 39 | + | ||
| 40 | +### Most complex files | ||
| 41 | + | ||
| 42 | +| file | complex | cyclo | loc | | ||
| 43 | +|---|---|---|---| | ||
| 44 | +| Sources/RazorbillServer/CompletionsRoute.swift | 47 | 20 | 242 | | ||
| 45 | +| Sources/RazorbillServer/Chat/CompletionStream.swift | 31 | 20 | 125 | | ||
| 46 | +| experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 | | ||
| 47 | +| Sources/RazorbillMLX/MLXEngine.swift | 23 | 35 | 246 | | ||
| 48 | +| tools/host-runner/host_runner.py | 22 | 22 | 141 | | ||
| 49 | +| Sources/RazorbillCore/Config/ConfigValue+JSON.swift | 20 | 25 | 71 | | ||
| 50 | +| Sources/RazorbillCore/Config/ServerConfigLoader.swift | 20 | 17 | 227 | | ||
| 51 | +| Sources/RazorbillServer/Chat/ToolsAndFormats.swift | 18 | 30 | 170 | | ||
| 52 | +| Sources/RazorbillServer/Chat/ChatCompletionRequest.swift | 17 | 24 | 276 | | ||
| 53 | +| Sources/RazorbillServer/Chat/ChatCompletionChunk.swift | 16 | 11 | 137 | | ||
| 54 | +| Sources/RazorbillServer/ModelManager.swift | 16 | 22 | 220 | | ||
| 55 | +| Sources/RazorbillCore/Config/OrderedJSONReader.swift | 15 | 24 | 140 | | ||
| 56 | +| Sources/RazorbillCore/Config/GenerationOverrides.swift | 14 | 15 | 67 | | ||
| 57 | +| Sources/RazorbillCLI/Commands/ModelsCommand.swift | 13 | 7 | 100 | | ||
| 58 | +| Sources/RazorbillServer/EmbeddingsRoute.swift | 13 | 13 | 143 | | ||
| 59 | + | ||
| 60 | +## Trend | ||
| 61 | + | ||
| 62 | +| run | timestamp | error | warning | smells | complex | gate | | ||
| 63 | +|---|---|---|---|---|---|---| | ||
| 64 | +| 22 | 2026-11-25T21:27:49Z | 4 | 1 | 0 | 538 | FAIL | | ||
| 65 | +| 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS | | ||
| 66 | +| 24 | 2026-11-25T21:37:24Z | 0 | 1 | 1 | 559 | FAIL | | ||
| 67 | +| 25 | 2026-11-25T21:37:51Z | 0 | 1 | 0 | 544 | FAIL | | ||
| 68 | +| 26 | 2026-11-25T21:38:24Z | 0 | 0 | 0 | 544 | PASS | | ||
| 69 | +| 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS | | ||
| 70 | +| 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | | ||
| 71 | +| 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS | | ||
| 72 | +| 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS | | ||
| 73 | +| 31 | 2026-11-26T07:11:39Z | 0 | 0 | 0 | 546 | PASS | | ||
modified
.quality/report-latest.md +5 -5 | @@ -1,10 +1,10 @@ | ||
| 1 | -# Quality report — 2026-11-26T05:21:18Z | |
| 1 | +# Quality report — 2026-11-26T07:11:39Z | |
| 2 | 2 | |
| 3 | 3 | - **Gate**: ✅ **PASS** |
| 4 | -- **Commit**: `a218748` on `feature/v0.2-openai-server` | |
| 4 | +- **Commit**: `fe0695f` on `feature/v0.2-openai-server` | |
| 5 | 5 | - **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20) |
| 6 | 6 | - **swiftlint**: 0.65.1 (run directly, merged into lint issues) |
| 7 | -- **Run**: #30 (previous: 2026-11-26T04:34:58Z) | |
| 7 | +- **Run**: #31 (previous: 2026-11-26T05:21:18Z) | |
| 8 | 8 | |
| 9 | 9 | ## Lint issues (`qlty check`) |
| 10 | 10 | |
| @@ -43,7 +43,7 @@ _none_ | ||
| 43 | 43 | |---|---|---|---| |
| 44 | 44 | | Sources/RazorbillServer/CompletionsRoute.swift | 47 | 20 | 242 | |
| 45 | 45 | | Sources/RazorbillServer/Chat/CompletionStream.swift | 31 | 20 | 125 | |
| 46 | -| samples/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 | | |
| 46 | +| experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 | | |
| 47 | 47 | | Sources/RazorbillMLX/MLXEngine.swift | 23 | 35 | 246 | |
| 48 | 48 | | tools/host-runner/host_runner.py | 22 | 22 | 141 | |
| 49 | 49 | | Sources/RazorbillCore/Config/ConfigValue+JSON.swift | 20 | 25 | 71 | |
| @@ -61,7 +61,6 @@ _none_ | ||
| 61 | 61 | |
| 62 | 62 | | run | timestamp | error | warning | smells | complex | gate | |
| 63 | 63 | |---|---|---|---|---|---|---| |
| 64 | -| 21 | 2026-11-25T19:12:45Z | 0 | 0 | 0 | 512 | PASS | | |
| 65 | 64 | | 22 | 2026-11-25T21:27:49Z | 4 | 1 | 0 | 538 | FAIL | |
| 66 | 65 | | 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS | |
| 67 | 66 | | 24 | 2026-11-25T21:37:24Z | 0 | 1 | 1 | 559 | FAIL | |
| @@ -71,3 +70,4 @@ _none_ | ||
| 71 | 70 | | 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | |
| 72 | 71 | | 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS | |
| 73 | 72 | | 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS | |
| 73 | +| 31 | 2026-11-26T07:11:39Z | 0 | 0 | 0 | 546 | PASS | | |
| @@ -1,10 +1,10 @@ | |||
| 1 | -# Quality report — 2026-11-26T05:21:18Z | 1 | +# Quality report — 2026-11-26T07:11:39Z |
| 2 | 2 | ||
| 3 | - **Gate**: ✅ **PASS** | 3 | - **Gate**: ✅ **PASS** |
| 4 | -- **Commit**: `a218748` on `feature/v0.2-openai-server` | 4 | +- **Commit**: `fe0695f` on `feature/v0.2-openai-server` |
| 5 | - **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20) | 5 | - **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20) |
| 6 | - **swiftlint**: 0.65.1 (run directly, merged into lint issues) | 6 | - **swiftlint**: 0.65.1 (run directly, merged into lint issues) |
| 7 | -- **Run**: #30 (previous: 2026-11-26T04:34:58Z) | 7 | +- **Run**: #31 (previous: 2026-11-26T05:21:18Z) |
| 8 | 8 | ||
| 9 | ## Lint issues (`qlty check`) | 9 | ## Lint issues (`qlty check`) |
| 10 | 10 | ||
| @@ -43,7 +43,7 @@ _none_ | |||
| 43 | |---|---|---|---| | 43 | |---|---|---|---| |
| 44 | | Sources/RazorbillServer/CompletionsRoute.swift | 47 | 20 | 242 | | 44 | | Sources/RazorbillServer/CompletionsRoute.swift | 47 | 20 | 242 | |
| 45 | | Sources/RazorbillServer/Chat/CompletionStream.swift | 31 | 20 | 125 | | 45 | | Sources/RazorbillServer/Chat/CompletionStream.swift | 31 | 20 | 125 | |
| 46 | -| samples/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 | | 46 | +| experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 | |
| 47 | | Sources/RazorbillMLX/MLXEngine.swift | 23 | 35 | 246 | | 47 | | Sources/RazorbillMLX/MLXEngine.swift | 23 | 35 | 246 | |
| 48 | | tools/host-runner/host_runner.py | 22 | 22 | 141 | | 48 | | tools/host-runner/host_runner.py | 22 | 22 | 141 | |
| 49 | | Sources/RazorbillCore/Config/ConfigValue+JSON.swift | 20 | 25 | 71 | | 49 | | Sources/RazorbillCore/Config/ConfigValue+JSON.swift | 20 | 25 | 71 | |
| @@ -61,7 +61,6 @@ _none_ | |||
| 61 | 61 | ||
| 62 | | run | timestamp | error | warning | smells | complex | gate | | 62 | | run | timestamp | error | warning | smells | complex | gate | |
| 63 | |---|---|---|---|---|---|---| | 63 | |---|---|---|---|---|---|---| |
| 64 | -| 21 | 2026-11-25T19:12:45Z | 0 | 0 | 0 | 512 | PASS | | ||
| 65 | | 22 | 2026-11-25T21:27:49Z | 4 | 1 | 0 | 538 | FAIL | | 64 | | 22 | 2026-11-25T21:27:49Z | 4 | 1 | 0 | 538 | FAIL | |
| 66 | | 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS | | 65 | | 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS | |
| 67 | | 24 | 2026-11-25T21:37:24Z | 0 | 1 | 1 | 559 | FAIL | | 66 | | 24 | 2026-11-25T21:37:24Z | 0 | 1 | 1 | 559 | FAIL | |
| @@ -71,3 +70,4 @@ _none_ | |||
| 71 | | 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | | 70 | | 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | |
| 72 | | 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS | | 71 | | 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS | |
| 73 | | 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS | | 72 | | 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS | |
| 73 | +| 31 | 2026-11-26T07:11:39Z | 0 | 0 | 0 | 546 | PASS | | ||
modified
.vscode/launch.json +6 -6 | @@ -4,21 +4,21 @@ | ||
| 4 | 4 | "type": "swift", |
| 5 | 5 | "request": "launch", |
| 6 | 6 | "args": [], |
| 7 | - "cwd": "${workspaceFolder:razorbill}/samples/01-query-model", | |
| 8 | - "name": "Debug query-model (samples/01-query-model)", | |
| 7 | + "cwd": "${workspaceFolder:razorbill}/experiments/01-query-model", | |
| 8 | + "name": "Debug query-model (experiments/01-query-model)", | |
| 9 | 9 | "target": "query-model", |
| 10 | 10 | "configuration": "debug", |
| 11 | - "preLaunchTask": "swift: Build Debug query-model (samples/01-query-model)" | |
| 11 | + "preLaunchTask": "swift: Build Debug query-model (experiments/01-query-model)" | |
| 12 | 12 | }, |
| 13 | 13 | { |
| 14 | 14 | "type": "swift", |
| 15 | 15 | "request": "launch", |
| 16 | 16 | "args": [], |
| 17 | - "cwd": "${workspaceFolder:razorbill}/samples/01-query-model", | |
| 18 | - "name": "Release query-model (samples/01-query-model)", | |
| 17 | + "cwd": "${workspaceFolder:razorbill}/experiments/01-query-model", | |
| 18 | + "name": "Release query-model (experiments/01-query-model)", | |
| 19 | 19 | "target": "query-model", |
| 20 | 20 | "configuration": "release", |
| 21 | - "preLaunchTask": "swift: Build Release query-model (samples/01-query-model)" | |
| 21 | + "preLaunchTask": "swift: Build Release query-model (experiments/01-query-model)" | |
| 22 | 22 | }, |
| 23 | 23 | { |
| 24 | 24 | "type": "swift", |
| @@ -4,21 +4,21 @@ | |||
| 4 | "type": "swift", | 4 | "type": "swift", |
| 5 | "request": "launch", | 5 | "request": "launch", |
| 6 | "args": [], | 6 | "args": [], |
| 7 | - "cwd": "${workspaceFolder:razorbill}/samples/01-query-model", | 7 | + "cwd": "${workspaceFolder:razorbill}/experiments/01-query-model", |
| 8 | - "name": "Debug query-model (samples/01-query-model)", | 8 | + "name": "Debug query-model (experiments/01-query-model)", |
| 9 | "target": "query-model", | 9 | "target": "query-model", |
| 10 | "configuration": "debug", | 10 | "configuration": "debug", |
| 11 | - "preLaunchTask": "swift: Build Debug query-model (samples/01-query-model)" | 11 | + "preLaunchTask": "swift: Build Debug query-model (experiments/01-query-model)" |
| 12 | }, | 12 | }, |
| 13 | { | 13 | { |
| 14 | "type": "swift", | 14 | "type": "swift", |
| 15 | "request": "launch", | 15 | "request": "launch", |
| 16 | "args": [], | 16 | "args": [], |
| 17 | - "cwd": "${workspaceFolder:razorbill}/samples/01-query-model", | 17 | + "cwd": "${workspaceFolder:razorbill}/experiments/01-query-model", |
| 18 | - "name": "Release query-model (samples/01-query-model)", | 18 | + "name": "Release query-model (experiments/01-query-model)", |
| 19 | "target": "query-model", | 19 | "target": "query-model", |
| 20 | "configuration": "release", | 20 | "configuration": "release", |
| 21 | - "preLaunchTask": "swift: Build Release query-model (samples/01-query-model)" | 21 | + "preLaunchTask": "swift: Build Release query-model (experiments/01-query-model)" |
| 22 | }, | 22 | }, |
| 23 | { | 23 | { |
| 24 | "type": "swift", | 24 | "type": "swift", |
modified
README.md +2 -1 | @@ -128,7 +128,8 @@ Step by step: [Develop from a Linux sandbox](docs/en/how-to/develop-from-a-sandb | ||
| 128 | 128 | | `Sources/rzb` | The executable: registers the engines and starts the command line. | |
| 129 | 129 | | `Tests/` | Unit tests (Swift Testing); `Tests/Compatibility`: the OpenAI compatibility suite (pytest). | |
| 130 | 130 | | `examples/server.yaml` | Commented server configuration. | |
| 131 | -| `samples/01-query-model` | Standalone sample: send one prompt to one MLX model. | | |
| 131 | +| `experiments/01-query-model` | Development experiment, standalone package: sends one prompt to one MLX model with mlx-swift-lm, no server; first check of MLX on the Mac (#1). | | |
| 132 | +| `experiments/02-kv-cache-reuse` | Development experiment, standalone package: measures KV-cache reuse between stateless requests (#47), which led to the server's prompt cache (#48). | | |
| 132 | 133 | | `tools/host-runner` | Build, test and run on the Mac from the sandbox. | |
| 133 | 134 | | `.tickets/` | Issues, epics and milestones (IssueSpec YAML format). | |
| 134 | 135 | | `docs/` | User documentation, English and French ([diagram of the modules](docs/diagrams/packages.drawio)). | |
| @@ -128,7 +128,8 @@ Step by step: [Develop from a Linux sandbox](docs/en/how-to/develop-from-a-sandb | |||
| 128 | | `Sources/rzb` | The executable: registers the engines and starts the command line. | | 128 | | `Sources/rzb` | The executable: registers the engines and starts the command line. | |
| 129 | | `Tests/` | Unit tests (Swift Testing); `Tests/Compatibility`: the OpenAI compatibility suite (pytest). | | 129 | | `Tests/` | Unit tests (Swift Testing); `Tests/Compatibility`: the OpenAI compatibility suite (pytest). | |
| 130 | | `examples/server.yaml` | Commented server configuration. | | 130 | | `examples/server.yaml` | Commented server configuration. | |
| 131 | -| `samples/01-query-model` | Standalone sample: send one prompt to one MLX model. | | 131 | +| `experiments/01-query-model` | Development experiment, standalone package: sends one prompt to one MLX model with mlx-swift-lm, no server; first check of MLX on the Mac (#1). | |
| 132 | +| `experiments/02-kv-cache-reuse` | Development experiment, standalone package: measures KV-cache reuse between stateless requests (#47), which led to the server's prompt cache (#48). | | ||
| 132 | | `tools/host-runner` | Build, test and run on the Mac from the sandbox. | | 133 | | `tools/host-runner` | Build, test and run on the Mac from the sandbox. | |
| 133 | | `.tickets/` | Issues, epics and milestones (IssueSpec YAML format). | | 134 | | `.tickets/` | Issues, epics and milestones (IssueSpec YAML format). | |
| 134 | | `docs/` | User documentation, English and French ([diagram of the modules](docs/diagrams/packages.drawio)). | | 135 | | `docs/` | User documentation, English and French ([diagram of the modules](docs/diagrams/packages.drawio)). | |
modified
docs/en/how-to/develop-from-a-sandbox.md +2 -2 | @@ -53,13 +53,13 @@ The script's exit code is the command's exit code on the Mac, so it can be chain | ||
| 53 | 53 | ## Limits |
| 54 | 54 | |
| 55 | 55 | - `host.sh run` has no terminal, and waits for the command to end: do not use it for `rzb serve`. Killing `host.sh` in the sandbox does not stop the server on the Mac, and host-runner then answers 409 to everything until you stop `rzb serve` on the Mac. Start the server in a terminal on the Mac instead; the sandbox reaches it at `http://host.docker.internal:8080/v1` (allow it once with `sbx policy allow network localhost:8080`). |
| 56 | -- host-runner runs one command at a time (a second request gets HTTP 409) and only knows `list`, `build`, `test`, `run`, `resolve` and `clean`, on `.` or `samples/<name>`. | |
| 56 | +- host-runner runs one command at a time (a second request gets HTTP 409) and only knows `list`, `build`, `test`, `run`, `resolve` and `clean`, on `.` or `experiments/<name>`. | |
| 57 | 57 | - Models are downloaded into the **Mac's** Hugging Face cache; the sandbox cannot see it. |
| 58 | 58 | |
| 59 | 59 | ## Variants |
| 60 | 60 | |
| 61 | 61 | - **Quality tools in the sandbox**: `swiftlint` and `qlty` are not part of the Swift toolchain kit. Install them as the [`quality` skill](../../../.claude/skills/quality/SKILL.md) describes (section 0). What is installed outside `$HOME` disappears when the sandbox is recreated (`--force`); to keep them, add them to a kit listed under `kits:` in `sbxenv.yaml` (for example a new version of `swift-toolchain-kit`). |
| 62 | -- **A sample instead of the package**: `tools/host-runner/host.sh build samples/01-query-model query-model`. | |
| 62 | +- **An experiment instead of the package**: `tools/host-runner/host.sh build experiments/01-query-model query-model`. | |
| 63 | 63 | |
| 64 | 64 | ## See also |
| 65 | 65 | |
| @@ -53,13 +53,13 @@ The script's exit code is the command's exit code on the Mac, so it can be chain | |||
| 53 | ## Limits | 53 | ## Limits |
| 54 | 54 | ||
| 55 | - `host.sh run` has no terminal, and waits for the command to end: do not use it for `rzb serve`. Killing `host.sh` in the sandbox does not stop the server on the Mac, and host-runner then answers 409 to everything until you stop `rzb serve` on the Mac. Start the server in a terminal on the Mac instead; the sandbox reaches it at `http://host.docker.internal:8080/v1` (allow it once with `sbx policy allow network localhost:8080`). | 55 | - `host.sh run` has no terminal, and waits for the command to end: do not use it for `rzb serve`. Killing `host.sh` in the sandbox does not stop the server on the Mac, and host-runner then answers 409 to everything until you stop `rzb serve` on the Mac. Start the server in a terminal on the Mac instead; the sandbox reaches it at `http://host.docker.internal:8080/v1` (allow it once with `sbx policy allow network localhost:8080`). |
| 56 | -- host-runner runs one command at a time (a second request gets HTTP 409) and only knows `list`, `build`, `test`, `run`, `resolve` and `clean`, on `.` or `samples/<name>`. | 56 | +- host-runner runs one command at a time (a second request gets HTTP 409) and only knows `list`, `build`, `test`, `run`, `resolve` and `clean`, on `.` or `experiments/<name>`. |
| 57 | - Models are downloaded into the **Mac's** Hugging Face cache; the sandbox cannot see it. | 57 | - Models are downloaded into the **Mac's** Hugging Face cache; the sandbox cannot see it. |
| 58 | 58 | ||
| 59 | ## Variants | 59 | ## Variants |
| 60 | 60 | ||
| 61 | - **Quality tools in the sandbox**: `swiftlint` and `qlty` are not part of the Swift toolchain kit. Install them as the [`quality` skill](../../../.claude/skills/quality/SKILL.md) describes (section 0). What is installed outside `$HOME` disappears when the sandbox is recreated (`--force`); to keep them, add them to a kit listed under `kits:` in `sbxenv.yaml` (for example a new version of `swift-toolchain-kit`). | 61 | - **Quality tools in the sandbox**: `swiftlint` and `qlty` are not part of the Swift toolchain kit. Install them as the [`quality` skill](../../../.claude/skills/quality/SKILL.md) describes (section 0). What is installed outside `$HOME` disappears when the sandbox is recreated (`--force`); to keep them, add them to a kit listed under `kits:` in `sbxenv.yaml` (for example a new version of `swift-toolchain-kit`). |
| 62 | -- **A sample instead of the package**: `tools/host-runner/host.sh build samples/01-query-model query-model`. | 62 | +- **An experiment instead of the package**: `tools/host-runner/host.sh build experiments/01-query-model query-model`. |
| 63 | 63 | ||
| 64 | ## See also | 64 | ## See also |
| 65 | 65 | ||
modified
docs/fr/how-to/developper-depuis-une-sandbox.md +2 -2 | @@ -53,13 +53,13 @@ Le code de sortie du script est celui de la commande sur le Mac : on peut l'ench | ||
| 53 | 53 | ## Limites |
| 54 | 54 | |
| 55 | 55 | - `host.sh run` n'a pas de terminal et attend la fin de la commande : ne l'utilisez pas pour `rzb serve`. Tuer `host.sh` dans la sandbox n'arrête pas le serveur sur le Mac, et host-runner répond alors 409 à tout jusqu'à ce que vous arrêtiez `rzb serve` sur le Mac. Démarrez plutôt le serveur dans un terminal du Mac ; la sandbox le joint à `http://host.docker.internal:8080/v1` (autorisez-le une fois avec `sbx policy allow network localhost:8080`). |
| 56 | -- host-runner lance une commande à la fois (une deuxième requête reçoit HTTP 409) et ne connaît que `list`, `build`, `test`, `run`, `resolve` et `clean`, sur `.` ou `samples/<nom>`. | |
| 56 | +- host-runner lance une commande à la fois (une deuxième requête reçoit HTTP 409) et ne connaît que `list`, `build`, `test`, `run`, `resolve` et `clean`, sur `.` ou `experiments/<nom>`. | |
| 57 | 57 | - Les modèles sont téléchargés dans le cache Hugging Face **du Mac** ; la sandbox ne le voit pas. |
| 58 | 58 | |
| 59 | 59 | ## Variantes |
| 60 | 60 | |
| 61 | 61 | - **Les outils qualité dans la sandbox** : `swiftlint` et `qlty` ne font pas partie du kit de la chaîne d'outils Swift. Installez-les comme le décrit le [skill `quality`](../../../.claude/skills/quality/SKILL.md) (section 0). Ce qui est installé hors de `$HOME` disparaît quand la sandbox est recréée (`--force`) ; pour les garder, ajoutez-les à un kit listé sous `kits:` dans `sbxenv.yaml` (par exemple une nouvelle version de `swift-toolchain-kit`). |
| 62 | -- **Un exemple au lieu du package** : `tools/host-runner/host.sh build samples/01-query-model query-model`. | |
| 62 | +- **Une expérience au lieu du package** : `tools/host-runner/host.sh build experiments/01-query-model query-model`. | |
| 63 | 63 | |
| 64 | 64 | ## Voir aussi |
| 65 | 65 | |
| @@ -53,13 +53,13 @@ Le code de sortie du script est celui de la commande sur le Mac : on peut l'ench | |||
| 53 | ## Limites | 53 | ## Limites |
| 54 | 54 | ||
| 55 | - `host.sh run` n'a pas de terminal et attend la fin de la commande : ne l'utilisez pas pour `rzb serve`. Tuer `host.sh` dans la sandbox n'arrête pas le serveur sur le Mac, et host-runner répond alors 409 à tout jusqu'à ce que vous arrêtiez `rzb serve` sur le Mac. Démarrez plutôt le serveur dans un terminal du Mac ; la sandbox le joint à `http://host.docker.internal:8080/v1` (autorisez-le une fois avec `sbx policy allow network localhost:8080`). | 55 | - `host.sh run` n'a pas de terminal et attend la fin de la commande : ne l'utilisez pas pour `rzb serve`. Tuer `host.sh` dans la sandbox n'arrête pas le serveur sur le Mac, et host-runner répond alors 409 à tout jusqu'à ce que vous arrêtiez `rzb serve` sur le Mac. Démarrez plutôt le serveur dans un terminal du Mac ; la sandbox le joint à `http://host.docker.internal:8080/v1` (autorisez-le une fois avec `sbx policy allow network localhost:8080`). |
| 56 | -- host-runner lance une commande à la fois (une deuxième requête reçoit HTTP 409) et ne connaît que `list`, `build`, `test`, `run`, `resolve` et `clean`, sur `.` ou `samples/<nom>`. | 56 | +- host-runner lance une commande à la fois (une deuxième requête reçoit HTTP 409) et ne connaît que `list`, `build`, `test`, `run`, `resolve` et `clean`, sur `.` ou `experiments/<nom>`. |
| 57 | - Les modèles sont téléchargés dans le cache Hugging Face **du Mac** ; la sandbox ne le voit pas. | 57 | - Les modèles sont téléchargés dans le cache Hugging Face **du Mac** ; la sandbox ne le voit pas. |
| 58 | 58 | ||
| 59 | ## Variantes | 59 | ## Variantes |
| 60 | 60 | ||
| 61 | - **Les outils qualité dans la sandbox** : `swiftlint` et `qlty` ne font pas partie du kit de la chaîne d'outils Swift. Installez-les comme le décrit le [skill `quality`](../../../.claude/skills/quality/SKILL.md) (section 0). Ce qui est installé hors de `$HOME` disparaît quand la sandbox est recréée (`--force`) ; pour les garder, ajoutez-les à un kit listé sous `kits:` dans `sbxenv.yaml` (par exemple une nouvelle version de `swift-toolchain-kit`). | 61 | - **Les outils qualité dans la sandbox** : `swiftlint` et `qlty` ne font pas partie du kit de la chaîne d'outils Swift. Installez-les comme le décrit le [skill `quality`](../../../.claude/skills/quality/SKILL.md) (section 0). Ce qui est installé hors de `$HOME` disparaît quand la sandbox est recréée (`--force`) ; pour les garder, ajoutez-les à un kit listé sous `kits:` dans `sbxenv.yaml` (par exemple une nouvelle version de `swift-toolchain-kit`). |
| 62 | -- **Un exemple au lieu du package** : `tools/host-runner/host.sh build samples/01-query-model query-model`. | 62 | +- **Une expérience au lieu du package** : `tools/host-runner/host.sh build experiments/01-query-model query-model`. |
| 63 | 63 | ||
| 64 | ## Voir aussi | 64 | ## Voir aussi |
| 65 | 65 | ||
renamed
experiments/01-query-model/.gitignore +0 -0 | similarity index 100% | ||
| rename from samples/01-query-model/.gitignore | ||
| rename to experiments/01-query-model/.gitignore |
| similarity index 100% | |||
| rename from samples/01-query-model/.gitignore | |||
| rename to experiments/01-query-model/.gitignore |
renamed
experiments/01-query-model/.swift-format +0 -0 | similarity index 100% | ||
| rename from samples/01-query-model/.swift-format | ||
| rename to experiments/01-query-model/.swift-format |
| similarity index 100% | |||
| rename from samples/01-query-model/.swift-format | |||
| rename to experiments/01-query-model/.swift-format |
renamed
experiments/01-query-model/Package.resolved +0 -0 | similarity index 100% | ||
| rename from samples/01-query-model/Package.resolved | ||
| rename to experiments/01-query-model/Package.resolved |
| similarity index 100% | |||
| rename from samples/01-query-model/Package.resolved | |||
| rename to experiments/01-query-model/Package.resolved |
renamed
experiments/01-query-model/Package.swift +0 -0 | similarity index 100% | ||
| rename from samples/01-query-model/Package.swift | ||
| rename to experiments/01-query-model/Package.swift |
| similarity index 100% | |||
| rename from samples/01-query-model/Package.swift | |||
| rename to experiments/01-query-model/Package.swift |
renamed
experiments/01-query-model/README.md +4 -4 | similarity index 94% | ||
| rename from samples/01-query-model/README.md | ||
| rename to experiments/01-query-model/README.md | ||
| @@ -1,4 +1,4 @@ | ||
| 1 | -# Sample 01 — query a specific model | |
| 1 | +# Experiment 01 — query a specific model | |
| 2 | 2 | |
| 3 | 3 | A minimal command-line program that sends **one prompt** to **one specific MLX model** |
| 4 | 4 | and streams the answer, using [`mlx-swift-lm`](https://github.com/ml-explore/mlx-swift-lm) |
| @@ -18,7 +18,7 @@ on the GPU (Metal). It is the first building block of razorbill (see ticket #1). | ||
| 18 | 18 | - Network access to `huggingface.co` on the first run (the model is downloaded once, |
| 19 | 19 | then read from the Hugging Face cache, `~/.cache/huggingface/hub`). |
| 20 | 20 | |
| 21 | -> This sample does **not** build or run on Linux: MLX needs Metal. | |
| 21 | +> This experiment does **not** build or run on Linux: MLX needs Metal. | |
| 22 | 22 | |
| 23 | 23 | ## Build |
| 24 | 24 | |
| @@ -26,7 +26,7 @@ The SwiftPM command line (`swift build`) cannot compile MLX's Metal shaders, so | ||
| 26 | 26 | with `xcodebuild`: |
| 27 | 27 | |
| 28 | 28 | ```bash |
| 29 | -cd samples/01-query-model | |
| 29 | +cd experiments/01-query-model | |
| 30 | 30 | xcodebuild build \ |
| 31 | 31 | -scheme query-model \ |
| 32 | 32 | -destination 'platform=macOS' \ |
| @@ -49,7 +49,7 @@ You can also open the folder in Xcode (`xed .`), pick the `query-model` scheme a | ||
| 49 | 49 | ### Building from the Linux sandbox |
| 50 | 50 | |
| 51 | 51 | With `tools/host-runner/host_runner.py` running on the Mac, the sandbox can build and run |
| 52 | -the sample remotely: `tools/host-runner/host.sh build samples/01-query-model query-model` (see | |
| 52 | +the experiment remotely: `tools/host-runner/host.sh build experiments/01-query-model query-model` (see | |
| 53 | 53 | `tools/host-runner/README.md`). |
| 54 | 54 | |
| 55 | 55 | ## Run |
| similarity index 94% | |||
| rename from samples/01-query-model/README.md | |||
| rename to experiments/01-query-model/README.md | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | -# Sample 01 — query a specific model | 1 | +# Experiment 01 — query a specific model |
| 2 | 2 | ||
| 3 | A minimal command-line program that sends **one prompt** to **one specific MLX model** | 3 | A minimal command-line program that sends **one prompt** to **one specific MLX model** |
| 4 | and streams the answer, using [`mlx-swift-lm`](https://github.com/ml-explore/mlx-swift-lm) | 4 | and streams the answer, using [`mlx-swift-lm`](https://github.com/ml-explore/mlx-swift-lm) |
| @@ -18,7 +18,7 @@ on the GPU (Metal). It is the first building block of razorbill (see ticket #1). | |||
| 18 | - Network access to `huggingface.co` on the first run (the model is downloaded once, | 18 | - Network access to `huggingface.co` on the first run (the model is downloaded once, |
| 19 | then read from the Hugging Face cache, `~/.cache/huggingface/hub`). | 19 | then read from the Hugging Face cache, `~/.cache/huggingface/hub`). |
| 20 | 20 | ||
| 21 | -> This sample does **not** build or run on Linux: MLX needs Metal. | 21 | +> This experiment does **not** build or run on Linux: MLX needs Metal. |
| 22 | 22 | ||
| 23 | ## Build | 23 | ## Build |
| 24 | 24 | ||
| @@ -26,7 +26,7 @@ The SwiftPM command line (`swift build`) cannot compile MLX's Metal shaders, so | |||
| 26 | with `xcodebuild`: | 26 | with `xcodebuild`: |
| 27 | 27 | ||
| 28 | ```bash | 28 | ```bash |
| 29 | -cd samples/01-query-model | 29 | +cd experiments/01-query-model |
| 30 | xcodebuild build \ | 30 | xcodebuild build \ |
| 31 | -scheme query-model \ | 31 | -scheme query-model \ |
| 32 | -destination 'platform=macOS' \ | 32 | -destination 'platform=macOS' \ |
| @@ -49,7 +49,7 @@ You can also open the folder in Xcode (`xed .`), pick the `query-model` scheme a | |||
| 49 | ### Building from the Linux sandbox | 49 | ### Building from the Linux sandbox |
| 50 | 50 | ||
| 51 | With `tools/host-runner/host_runner.py` running on the Mac, the sandbox can build and run | 51 | With `tools/host-runner/host_runner.py` running on the Mac, the sandbox can build and run |
| 52 | -the sample remotely: `tools/host-runner/host.sh build samples/01-query-model query-model` (see | 52 | +the experiment remotely: `tools/host-runner/host.sh build experiments/01-query-model query-model` (see |
| 53 | `tools/host-runner/README.md`). | 53 | `tools/host-runner/README.md`). |
| 54 | 54 | ||
| 55 | ## Run | 55 | ## Run |
renamed
experiments/01-query-model/Sources/QueryModel/QueryModel.swift +0 -0 | similarity index 100% | ||
| rename from samples/01-query-model/Sources/QueryModel/QueryModel.swift | ||
| rename to experiments/01-query-model/Sources/QueryModel/QueryModel.swift |
| similarity index 100% | |||
| rename from samples/01-query-model/Sources/QueryModel/QueryModel.swift | |||
| rename to experiments/01-query-model/Sources/QueryModel/QueryModel.swift |
renamed
experiments/02-kv-cache-reuse/.gitignore +0 -0 | similarity index 100% | ||
| rename from samples/02-kv-cache-reuse/.gitignore | ||
| rename to experiments/02-kv-cache-reuse/.gitignore |
| similarity index 100% | |||
| rename from samples/02-kv-cache-reuse/.gitignore | |||
| rename to experiments/02-kv-cache-reuse/.gitignore |
renamed
experiments/02-kv-cache-reuse/Package.resolved +0 -0 | similarity index 100% | ||
| rename from samples/02-kv-cache-reuse/Package.resolved | ||
| rename to experiments/02-kv-cache-reuse/Package.resolved |
| similarity index 100% | |||
| rename from samples/02-kv-cache-reuse/Package.resolved | |||
| rename to experiments/02-kv-cache-reuse/Package.resolved |
renamed
experiments/02-kv-cache-reuse/Package.swift +0 -0 | similarity index 100% | ||
| rename from samples/02-kv-cache-reuse/Package.swift | ||
| rename to experiments/02-kv-cache-reuse/Package.swift |
| similarity index 100% | |||
| rename from samples/02-kv-cache-reuse/Package.swift | |||
| rename to experiments/02-kv-cache-reuse/Package.swift |
renamed
experiments/02-kv-cache-reuse/README.md +4 -4 | similarity index 90% | ||
| rename from samples/02-kv-cache-reuse/README.md | ||
| rename to experiments/02-kv-cache-reuse/README.md | ||
| @@ -1,4 +1,4 @@ | ||
| 1 | -# Sample 02 — KV-cache prefix reuse between stateless requests | |
| 1 | +# Experiment 02 — KV-cache prefix reuse between stateless requests | |
| 2 | 2 | |
| 3 | 3 | A measurement program for spike #47. An OpenAI client resends the whole conversation with every request, so a server that starts each request from an empty KV cache prefills the full history every time. This program plays the same conversation twice and compares: |
| 4 | 4 | |
| @@ -11,15 +11,15 @@ The conversation is a system prompt followed by notes and acknowledgements until | ||
| 11 | 11 | |
| 12 | 12 | ## Build |
| 13 | 13 | |
| 14 | -macOS and Apple Silicon only, built like [sample 01](../01-query-model/README.md): | |
| 14 | +macOS and Apple Silicon only, built like [experiment 01](../01-query-model/README.md): | |
| 15 | 15 | |
| 16 | 16 | ```bash |
| 17 | -cd samples/02-kv-cache-reuse | |
| 17 | +cd experiments/02-kv-cache-reuse | |
| 18 | 18 | xcodebuild build -scheme kv-cache-reuse -destination 'platform=macOS' -configuration Release \ |
| 19 | 19 | -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation |
| 20 | 20 | ``` |
| 21 | 21 | |
| 22 | -From the Linux sandbox: `tools/host-runner/host.sh build samples/02-kv-cache-reuse kv-cache-reuse`. | |
| 22 | +From the Linux sandbox: `tools/host-runner/host.sh build experiments/02-kv-cache-reuse kv-cache-reuse`. | |
| 23 | 23 | |
| 24 | 24 | ## Run |
| 25 | 25 | |
| similarity index 90% | |||
| rename from samples/02-kv-cache-reuse/README.md | |||
| rename to experiments/02-kv-cache-reuse/README.md | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | -# Sample 02 — KV-cache prefix reuse between stateless requests | 1 | +# Experiment 02 — KV-cache prefix reuse between stateless requests |
| 2 | 2 | ||
| 3 | A measurement program for spike #47. An OpenAI client resends the whole conversation with every request, so a server that starts each request from an empty KV cache prefills the full history every time. This program plays the same conversation twice and compares: | 3 | A measurement program for spike #47. An OpenAI client resends the whole conversation with every request, so a server that starts each request from an empty KV cache prefills the full history every time. This program plays the same conversation twice and compares: |
| 4 | 4 | ||
| @@ -11,15 +11,15 @@ The conversation is a system prompt followed by notes and acknowledgements until | |||
| 11 | 11 | ||
| 12 | ## Build | 12 | ## Build |
| 13 | 13 | ||
| 14 | -macOS and Apple Silicon only, built like [sample 01](../01-query-model/README.md): | 14 | +macOS and Apple Silicon only, built like [experiment 01](../01-query-model/README.md): |
| 15 | 15 | ||
| 16 | ```bash | 16 | ```bash |
| 17 | -cd samples/02-kv-cache-reuse | 17 | +cd experiments/02-kv-cache-reuse |
| 18 | xcodebuild build -scheme kv-cache-reuse -destination 'platform=macOS' -configuration Release \ | 18 | xcodebuild build -scheme kv-cache-reuse -destination 'platform=macOS' -configuration Release \ |
| 19 | -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation | 19 | -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation |
| 20 | ``` | 20 | ``` |
| 21 | 21 | ||
| 22 | -From the Linux sandbox: `tools/host-runner/host.sh build samples/02-kv-cache-reuse kv-cache-reuse`. | 22 | +From the Linux sandbox: `tools/host-runner/host.sh build experiments/02-kv-cache-reuse kv-cache-reuse`. |
| 23 | 23 | ||
| 24 | ## Run | 24 | ## Run |
| 25 | 25 | ||
renamed
experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift +0 -0 | similarity index 100% | ||
| rename from samples/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | ||
| rename to experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift |
| similarity index 100% | |||
| rename from samples/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | |||
| rename to experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift |
modified
tools/host-runner/README.md +7 -7 | @@ -1,6 +1,6 @@ | ||
| 1 | 1 | # host-runner — build, test and run razorbill on the Mac from the Linux sandbox |
| 2 | 2 | |
| 3 | -MLX needs Metal, so razorbill's MLX engine and the samples build and run only on the Mac. `host_runner.py` is a tiny HTTP service that runs **on the Mac**. The sandbox calls it through the sbx proxy (`http://host.docker.internal:7777`), and it runs `xcodebuild` (or the built binary) in a *project* — `.` (the razorbill package at the repository root) or `samples/<name>` — streaming the output back. | |
| 3 | +MLX needs Metal, so razorbill's MLX engine and the experiments build and run only on the Mac. `host_runner.py` is a tiny HTTP service that runs **on the Mac**. The sandbox calls it through the sbx proxy (`http://host.docker.internal:7777`), and it runs `xcodebuild` (or the built binary) in a *project* — `.` (the razorbill package at the repository root) or `experiments/<name>` — streaming the output back. | |
| 4 | 4 | |
| 5 | 5 | The repository is mounted at the same path on the Mac and in the sandbox, so files |
| 6 | 6 | edited in the sandbox are what the Mac builds. |
| @@ -26,10 +26,10 @@ tools/host-runner/host.sh build . razorbill # the package's only Xcode schem | ||
| 26 | 26 | tools/host-runner/host.sh test . razorbill # Debug configuration |
| 27 | 27 | tools/host-runner/host.sh run . rzb run "Why is the sky blue?" |
| 28 | 28 | |
| 29 | -# a sample | |
| 30 | -tools/host-runner/host.sh build samples/01-query-model query-model | |
| 31 | -tools/host-runner/host.sh run samples/01-query-model query-model "Why is the sky blue?" | |
| 32 | -tools/host-runner/host.sh clean samples/01-query-model query-model | |
| 29 | +# an experiment | |
| 30 | +tools/host-runner/host.sh build experiments/01-query-model query-model | |
| 31 | +tools/host-runner/host.sh run experiments/01-query-model query-model "Why is the sky blue?" | |
| 32 | +tools/host-runner/host.sh clean experiments/01-query-model query-model | |
| 33 | 33 | ``` |
| 34 | 34 | |
| 35 | 35 | The script's exit code is the command's exit code on the Mac. `run` cannot provide an interactive terminal: use it for `rzb run`, not for `rzb chat` or `rzb tui`. |
| @@ -43,10 +43,10 @@ python3 -m unittest discover -s tools/host-runner | ||
| 43 | 43 | ## What it allows (and does not) |
| 44 | 44 | |
| 45 | 45 | - Actions: `list` (xcodebuild -list), `build`, `test`, `run`, `resolve`, `clean`, plus `GET /health`. Nothing else. |
| 46 | -- Only the repository root (`.`) and directories directly under `samples/` that contain a `Package.swift`. | |
| 46 | +- Only the repository root (`.`) and directories directly under `experiments/` that contain a `Package.swift`. | |
| 47 | 47 | - Commands are executed without a shell (arguments are passed as a list), one at a |
| 48 | 48 | time (a second request gets HTTP 409). |
| 49 | 49 | - It listens on `127.0.0.1` only: it is not reachable from the network, only from |
| 50 | 50 | processes on the Mac, including the sbx proxy. |
| 51 | -- `run` executes the binary the sample builds, so it runs code from this repository | |
| 51 | +- `run` executes the binary the experiment builds, so it runs code from this repository | |
| 52 | 52 | on the Mac, as your user. Stop the service when you do not need it. |
| @@ -1,6 +1,6 @@ | |||
| 1 | # host-runner — build, test and run razorbill on the Mac from the Linux sandbox | 1 | # host-runner — build, test and run razorbill on the Mac from the Linux sandbox |
| 2 | 2 | ||
| 3 | -MLX needs Metal, so razorbill's MLX engine and the samples build and run only on the Mac. `host_runner.py` is a tiny HTTP service that runs **on the Mac**. The sandbox calls it through the sbx proxy (`http://host.docker.internal:7777`), and it runs `xcodebuild` (or the built binary) in a *project* — `.` (the razorbill package at the repository root) or `samples/<name>` — streaming the output back. | 3 | +MLX needs Metal, so razorbill's MLX engine and the experiments build and run only on the Mac. `host_runner.py` is a tiny HTTP service that runs **on the Mac**. The sandbox calls it through the sbx proxy (`http://host.docker.internal:7777`), and it runs `xcodebuild` (or the built binary) in a *project* — `.` (the razorbill package at the repository root) or `experiments/<name>` — streaming the output back. |
| 4 | 4 | ||
| 5 | The repository is mounted at the same path on the Mac and in the sandbox, so files | 5 | The repository is mounted at the same path on the Mac and in the sandbox, so files |
| 6 | edited in the sandbox are what the Mac builds. | 6 | edited in the sandbox are what the Mac builds. |
| @@ -26,10 +26,10 @@ tools/host-runner/host.sh build . razorbill # the package's only Xcode schem | |||
| 26 | tools/host-runner/host.sh test . razorbill # Debug configuration | 26 | tools/host-runner/host.sh test . razorbill # Debug configuration |
| 27 | tools/host-runner/host.sh run . rzb run "Why is the sky blue?" | 27 | tools/host-runner/host.sh run . rzb run "Why is the sky blue?" |
| 28 | 28 | ||
| 29 | -# a sample | 29 | +# an experiment |
| 30 | -tools/host-runner/host.sh build samples/01-query-model query-model | 30 | +tools/host-runner/host.sh build experiments/01-query-model query-model |
| 31 | -tools/host-runner/host.sh run samples/01-query-model query-model "Why is the sky blue?" | 31 | +tools/host-runner/host.sh run experiments/01-query-model query-model "Why is the sky blue?" |
| 32 | -tools/host-runner/host.sh clean samples/01-query-model query-model | 32 | +tools/host-runner/host.sh clean experiments/01-query-model query-model |
| 33 | ``` | 33 | ``` |
| 34 | 34 | ||
| 35 | The script's exit code is the command's exit code on the Mac. `run` cannot provide an interactive terminal: use it for `rzb run`, not for `rzb chat` or `rzb tui`. | 35 | The script's exit code is the command's exit code on the Mac. `run` cannot provide an interactive terminal: use it for `rzb run`, not for `rzb chat` or `rzb tui`. |
| @@ -43,10 +43,10 @@ python3 -m unittest discover -s tools/host-runner | |||
| 43 | ## What it allows (and does not) | 43 | ## What it allows (and does not) |
| 44 | 44 | ||
| 45 | - Actions: `list` (xcodebuild -list), `build`, `test`, `run`, `resolve`, `clean`, plus `GET /health`. Nothing else. | 45 | - Actions: `list` (xcodebuild -list), `build`, `test`, `run`, `resolve`, `clean`, plus `GET /health`. Nothing else. |
| 46 | -- Only the repository root (`.`) and directories directly under `samples/` that contain a `Package.swift`. | 46 | +- Only the repository root (`.`) and directories directly under `experiments/` that contain a `Package.swift`. |
| 47 | - Commands are executed without a shell (arguments are passed as a list), one at a | 47 | - Commands are executed without a shell (arguments are passed as a list), one at a |
| 48 | time (a second request gets HTTP 409). | 48 | time (a second request gets HTTP 409). |
| 49 | - It listens on `127.0.0.1` only: it is not reachable from the network, only from | 49 | - It listens on `127.0.0.1` only: it is not reachable from the network, only from |
| 50 | processes on the Mac, including the sbx proxy. | 50 | processes on the Mac, including the sbx proxy. |
| 51 | -- `run` executes the binary the sample builds, so it runs code from this repository | 51 | +- `run` executes the binary the experiment builds, so it runs code from this repository |
| 52 | on the Mac, as your user. Stop the service when you do not need it. | 52 | on the Mac, as your user. Stop the service when you do not need it. |
modified
tools/host-runner/host.sh +2 -2 | old mode 100755 | ||
| new mode 100644 | ||
| @@ -9,7 +9,7 @@ | ||
| 9 | 9 | # tools/host-runner/host.sh resolve <project> <scheme> |
| 10 | 10 | # tools/host-runner/host.sh clean <project> <scheme> |
| 11 | 11 | # |
| 12 | -# <project> is "." (the razorbill package) or "samples/<name>". | |
| 12 | +# <project> is "." (the razorbill package) or "experiments/<name>". | |
| 13 | 13 | # |
| 14 | 14 | # Exit code = the exit code of the command run on the Mac. |
| 15 | 15 | set -euo pipefail |
| @@ -21,7 +21,7 @@ if [[ "$action" == "health" ]]; then | ||
| 21 | 21 | exec curl -fsS -m 5 "$URL/health" |
| 22 | 22 | fi |
| 23 | 23 | |
| 24 | -project="${2:?project required: . or samples/<name>}" | |
| 24 | +project="${2:?project required: . or experiments/<name>}" | |
| 25 | 25 | if [[ "$action" == "list" ]]; then |
| 26 | 26 | scheme="" |
| 27 | 27 | shift 2 |
| old mode 100755 | |||
| new mode 100644 | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | # tools/host-runner/host.sh resolve <project> <scheme> | 9 | # tools/host-runner/host.sh resolve <project> <scheme> |
| 10 | # tools/host-runner/host.sh clean <project> <scheme> | 10 | # tools/host-runner/host.sh clean <project> <scheme> |
| 11 | # | 11 | # |
| 12 | -# <project> is "." (the razorbill package) or "samples/<name>". | 12 | +# <project> is "." (the razorbill package) or "experiments/<name>". |
| 13 | # | 13 | # |
| 14 | # Exit code = the exit code of the command run on the Mac. | 14 | # Exit code = the exit code of the command run on the Mac. |
| 15 | set -euo pipefail | 15 | set -euo pipefail |
| @@ -21,7 +21,7 @@ if [[ "$action" == "health" ]]; then | |||
| 21 | exec curl -fsS -m 5 "$URL/health" | 21 | exec curl -fsS -m 5 "$URL/health" |
| 22 | fi | 22 | fi |
| 23 | 23 | ||
| 24 | -project="${2:?project required: . or samples/<name>}" | 24 | +project="${2:?project required: . or experiments/<name>}" |
| 25 | if [[ "$action" == "list" ]]; then | 25 | if [[ "$action" == "list" ]]; then |
| 26 | scheme="" | 26 | scheme="" |
| 27 | shift 2 | 27 | shift 2 |
modified
tools/host-runner/host_runner.py +7 -7 | old mode 100755 | ||
| new mode 100644 | ||
| @@ -7,8 +7,8 @@ Run it ON THE MAC (not in the sandbox), from anywhere: | ||
| 7 | 7 | |
| 8 | 8 | The sandbox reaches it through the sbx proxy at http://host.docker.internal:7777 |
| 9 | 9 | (see tools/host-runner/README.md). It only accepts a fixed set of actions on the |
| 10 | -package at the repository root (project ".") or on a sample (project | |
| 11 | -"samples/<name>"), runs them without a shell, one at a time, and streams the | |
| 10 | +package at the repository root (project ".") or on an experiment (project | |
| 11 | +"experiments/<name>"), runs them without a shell, one at a time, and streams the | |
| 12 | 12 | output back. Python standard library only. |
| 13 | 13 | """ |
| 14 | 14 | |
| @@ -22,23 +22,23 @@ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer | ||
| 22 | 22 | from pathlib import Path |
| 23 | 23 | |
| 24 | 24 | REPO = Path(__file__).resolve().parents[2] |
| 25 | -SAMPLES = REPO / "samples" | |
| 25 | +EXPERIMENTS = REPO / "experiments" | |
| 26 | 26 | DERIVED = ".build/xcode" |
| 27 | 27 | LOCK = threading.Lock() |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | def project_dir(name: str) -> Path: |
| 31 | - """Resolve a project name: "." (the package at the repo root) or "samples/<name>". | |
| 31 | + """Resolve a project name: "." (the package at the repo root) or "experiments/<name>". | |
| 32 | 32 | |
| 33 | 33 | Anything else, including paths escaping the repository, is refused. |
| 34 | 34 | """ |
| 35 | 35 | if name == ".": |
| 36 | 36 | return REPO |
| 37 | - if name.startswith("samples/"): | |
| 37 | + if name.startswith("experiments/"): | |
| 38 | 38 | path = (REPO / name).resolve() |
| 39 | - if path.parent == SAMPLES.resolve() and (path / "Package.swift").is_file(): | |
| 39 | + if path.parent == EXPERIMENTS.resolve() and (path / "Package.swift").is_file(): | |
| 40 | 40 | return path |
| 41 | - raise ValueError(f"unknown project: {name!r} (use '.' or 'samples/<name>')") | |
| 41 | + raise ValueError(f"unknown project: {name!r} (use '.' or 'experiments/<name>')") | |
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | def xcodebuild(action: str, scheme: str) -> list[str]: |
| old mode 100755 | |||
| new mode 100644 | |||
| @@ -7,8 +7,8 @@ Run it ON THE MAC (not in the sandbox), from anywhere: | |||
| 7 | 7 | ||
| 8 | The sandbox reaches it through the sbx proxy at http://host.docker.internal:7777 | 8 | The sandbox reaches it through the sbx proxy at http://host.docker.internal:7777 |
| 9 | (see tools/host-runner/README.md). It only accepts a fixed set of actions on the | 9 | (see tools/host-runner/README.md). It only accepts a fixed set of actions on the |
| 10 | -package at the repository root (project ".") or on a sample (project | 10 | +package at the repository root (project ".") or on an experiment (project |
| 11 | -"samples/<name>"), runs them without a shell, one at a time, and streams the | 11 | +"experiments/<name>"), runs them without a shell, one at a time, and streams the |
| 12 | output back. Python standard library only. | 12 | output back. Python standard library only. |
| 13 | """ | 13 | """ |
| 14 | 14 | ||
| @@ -22,23 +22,23 @@ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer | |||
| 22 | from pathlib import Path | 22 | from pathlib import Path |
| 23 | 23 | ||
| 24 | REPO = Path(__file__).resolve().parents[2] | 24 | REPO = Path(__file__).resolve().parents[2] |
| 25 | -SAMPLES = REPO / "samples" | 25 | +EXPERIMENTS = REPO / "experiments" |
| 26 | DERIVED = ".build/xcode" | 26 | DERIVED = ".build/xcode" |
| 27 | LOCK = threading.Lock() | 27 | LOCK = threading.Lock() |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | def project_dir(name: str) -> Path: | 30 | def project_dir(name: str) -> Path: |
| 31 | - """Resolve a project name: "." (the package at the repo root) or "samples/<name>". | 31 | + """Resolve a project name: "." (the package at the repo root) or "experiments/<name>". |
| 32 | 32 | ||
| 33 | Anything else, including paths escaping the repository, is refused. | 33 | Anything else, including paths escaping the repository, is refused. |
| 34 | """ | 34 | """ |
| 35 | if name == ".": | 35 | if name == ".": |
| 36 | return REPO | 36 | return REPO |
| 37 | - if name.startswith("samples/"): | 37 | + if name.startswith("experiments/"): |
| 38 | path = (REPO / name).resolve() | 38 | path = (REPO / name).resolve() |
| 39 | - if path.parent == SAMPLES.resolve() and (path / "Package.swift").is_file(): | 39 | + if path.parent == EXPERIMENTS.resolve() and (path / "Package.swift").is_file(): |
| 40 | return path | 40 | return path |
| 41 | - raise ValueError(f"unknown project: {name!r} (use '.' or 'samples/<name>')") | 41 | + raise ValueError(f"unknown project: {name!r} (use '.' or 'experiments/<name>')") |
| 42 | 42 | ||
| 43 | 43 | ||
| 44 | def xcodebuild(action: str, scheme: str) -> list[str]: | 44 | def xcodebuild(action: str, scheme: str) -> list[str]: |
modified
tools/host-runner/test_host_runner.py +6 -6 | @@ -10,20 +10,20 @@ class ProjectDirTests(unittest.TestCase): | ||
| 10 | 10 | def test_dot_is_the_repository_root(self): |
| 11 | 11 | self.assertEqual(runner.project_dir("."), runner.REPO) |
| 12 | 12 | |
| 13 | - def test_existing_sample_is_accepted(self): | |
| 13 | + def test_existing_experiment_is_accepted(self): | |
| 14 | 14 | self.assertEqual( |
| 15 | - runner.project_dir("samples/01-query-model"), | |
| 16 | - runner.REPO / "samples" / "01-query-model", | |
| 15 | + runner.project_dir("experiments/01-query-model"), | |
| 16 | + runner.REPO / "experiments" / "01-query-model", | |
| 17 | 17 | ) |
| 18 | 18 | |
| 19 | 19 | def test_paths_escaping_the_repository_are_refused(self): |
| 20 | - for name in ["..", "/etc", "samples/../..", "samples/../../etc", "tools", ""]: | |
| 20 | + for name in ["..", "/etc", "experiments/../..", "experiments/../../etc", "tools", ""]: | |
| 21 | 21 | with self.subTest(name=name), self.assertRaises(ValueError): |
| 22 | 22 | runner.project_dir(name) |
| 23 | 23 | |
| 24 | - def test_unknown_sample_is_refused(self): | |
| 24 | + def test_unknown_experiment_is_refused(self): | |
| 25 | 25 | with self.assertRaises(ValueError): |
| 26 | - runner.project_dir("samples/does-not-exist") | |
| 26 | + runner.project_dir("experiments/does-not-exist") | |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | class CommandForTests(unittest.TestCase): |
| @@ -10,20 +10,20 @@ class ProjectDirTests(unittest.TestCase): | |||
| 10 | def test_dot_is_the_repository_root(self): | 10 | def test_dot_is_the_repository_root(self): |
| 11 | self.assertEqual(runner.project_dir("."), runner.REPO) | 11 | self.assertEqual(runner.project_dir("."), runner.REPO) |
| 12 | 12 | ||
| 13 | - def test_existing_sample_is_accepted(self): | 13 | + def test_existing_experiment_is_accepted(self): |
| 14 | self.assertEqual( | 14 | self.assertEqual( |
| 15 | - runner.project_dir("samples/01-query-model"), | 15 | + runner.project_dir("experiments/01-query-model"), |
| 16 | - runner.REPO / "samples" / "01-query-model", | 16 | + runner.REPO / "experiments" / "01-query-model", |
| 17 | ) | 17 | ) |
| 18 | 18 | ||
| 19 | def test_paths_escaping_the_repository_are_refused(self): | 19 | def test_paths_escaping_the_repository_are_refused(self): |
| 20 | - for name in ["..", "/etc", "samples/../..", "samples/../../etc", "tools", ""]: | 20 | + for name in ["..", "/etc", "experiments/../..", "experiments/../../etc", "tools", ""]: |
| 21 | with self.subTest(name=name), self.assertRaises(ValueError): | 21 | with self.subTest(name=name), self.assertRaises(ValueError): |
| 22 | runner.project_dir(name) | 22 | runner.project_dir(name) |
| 23 | 23 | ||
| 24 | - def test_unknown_sample_is_refused(self): | 24 | + def test_unknown_experiment_is_refused(self): |
| 25 | with self.assertRaises(ValueError): | 25 | with self.assertRaises(ValueError): |
| 26 | - runner.project_dir("samples/does-not-exist") | 26 | + runner.project_dir("experiments/does-not-exist") |
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | class CommandForTests(unittest.TestCase): | 29 | class CommandForTests(unittest.TestCase): |