bots-garden/razorbillpublic Fork
⑂ cb5dd12
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/razorbill.git
git clone ssh://git@rickub.com/bots-garden/razorbill.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

🛟 Updated.

k33g committed 2026-11-27T09:14:19+01:00 Browse files
cb5dd12 parent: 872a940
modified .memory/handoffs/2026-11-27-v1-0-0-local-ci.md +1 -1
@@ -12,5 +12,5 @@
1212
1313 ## Watch out for
1414 - Unverified: Rickub Actions for the razorbill repo (step 04 needs a CI job), CI_TOKEN rights on razorbill, notarization of the folder (bundles signed without runtime).
15-- Sandbox: Swift toolchain broken (libxml2.so.16), no swiftlint/qlty; `swift format lint` prints 10 warnings on untouched files — 01 may fail on them on the Mac if they are real there.
15+- Sandbox: Swift toolchain broken (libxml2.so.16), no swiftlint/qlty. The swift-format warnings the user hit in 01 are fixed (5 files); swiftlint on those edits not run yet — 01 on the Mac will tell.
1616 - Never `git stash` here (sbxenv.yaml busy mount).
@@ -12,5 +12,5 @@
12 12
13 ## Watch out for13 ## Watch out for
14 - Unverified: Rickub Actions for the razorbill repo (step 04 needs a CI job), CI_TOKEN rights on razorbill, notarization of the folder (bundles signed without runtime).14 - Unverified: Rickub Actions for the razorbill repo (step 04 needs a CI job), CI_TOKEN rights on razorbill, notarization of the folder (bundles signed without runtime).
15-- Sandbox: Swift toolchain broken (libxml2.so.16), no swiftlint/qlty; `swift format lint` prints 10 warnings on untouched files — 01 may fail on them on the Mac if they are real there.15+- Sandbox: Swift toolchain broken (libxml2.so.16), no swiftlint/qlty. The swift-format warnings the user hit in 01 are fixed (5 files); swiftlint on those edits not run yet — 01 on the Mac will tell.
16 - Never `git stash` here (sbxenv.yaml busy mount).16 - Never `git stash` here (sbxenv.yaml busy mount).
modified .memory/history.md +1 -0
@@ -571,3 +571,4 @@ open, a comment on each. main fast-forwarded.
571571 - **Checks**: shellcheck clean on all scripts; doc links OK; dry runs: 03 notes (LOCAL_CI_PRINT_NOTES), 01 refuses a mismatched TAG, 02 refuses Linux. NOT run: unit tests (Swift toolchain broken in the sandbox: libxml2.so.16), swiftlint, quality gate (qlty absent), anything on the Mac (host runner down).
572572 - **Trap**: `git stash` breaks here — `sbxenv.yaml` is a busy mount, stash saved but reset half-failed and reverted tracked files; recovered with `git checkout stash@{0} -- <files but sbxenv.yaml>`. Do not use stash in this sandbox.
573573 - **Next**: user commits + pushes from the Mac, then `scripts/check-hardened-runtime.sh`, `local-ci-01…05` (06 optional). Milestone v1.0.0 stays open until #52 task 2 is confirmed.
574+- Later the same session: the user pasted the `swift format lint` warnings (6, the same as the sandbox's swift-format 6.4.2): fixed in PromptCache, MLXSession, OpenAIError, ServerConfigLoader, ServerTests (wrapped by `swift format -i`, then the test's `@Test` put on its own line and the long `#expect` split with a local, to keep swiftlint's brace rule). `swift format lint -r Sources Tests` now prints nothing; swiftlint and the tests not re-run (not available here).
@@ -571,3 +571,4 @@ open, a comment on each. main fast-forwarded.
571 - **Checks**: shellcheck clean on all scripts; doc links OK; dry runs: 03 notes (LOCAL_CI_PRINT_NOTES), 01 refuses a mismatched TAG, 02 refuses Linux. NOT run: unit tests (Swift toolchain broken in the sandbox: libxml2.so.16), swiftlint, quality gate (qlty absent), anything on the Mac (host runner down).571 - **Checks**: shellcheck clean on all scripts; doc links OK; dry runs: 03 notes (LOCAL_CI_PRINT_NOTES), 01 refuses a mismatched TAG, 02 refuses Linux. NOT run: unit tests (Swift toolchain broken in the sandbox: libxml2.so.16), swiftlint, quality gate (qlty absent), anything on the Mac (host runner down).
572 - **Trap**: `git stash` breaks here — `sbxenv.yaml` is a busy mount, stash saved but reset half-failed and reverted tracked files; recovered with `git checkout stash@{0} -- <files but sbxenv.yaml>`. Do not use stash in this sandbox.572 - **Trap**: `git stash` breaks here — `sbxenv.yaml` is a busy mount, stash saved but reset half-failed and reverted tracked files; recovered with `git checkout stash@{0} -- <files but sbxenv.yaml>`. Do not use stash in this sandbox.
573 - **Next**: user commits + pushes from the Mac, then `scripts/check-hardened-runtime.sh`, `local-ci-01…05` (06 optional). Milestone v1.0.0 stays open until #52 task 2 is confirmed.573 - **Next**: user commits + pushes from the Mac, then `scripts/check-hardened-runtime.sh`, `local-ci-01…05` (06 optional). Milestone v1.0.0 stays open until #52 task 2 is confirmed.
574+- Later the same session: the user pasted the `swift format lint` warnings (6, the same as the sandbox's swift-format 6.4.2): fixed in PromptCache, MLXSession, OpenAIError, ServerConfigLoader, ServerTests (wrapped by `swift format -i`, then the test's `@Test` put on its own line and the long `#expect` split with a local, to keep swiftlint's brace rule). `swift format lint -r Sources Tests` now prints nothing; swiftlint and the tests not re-run (not available here).
modified .memory/summary.md +2 -2
@@ -349,8 +349,8 @@ bump must be verified with the Mac smoke tests (real Qwen3): Linux cannot compil
349349 whether Rickub Actions runs the upload job for the razorbill repo, whether `CI_TOKEN` (copied from
350350 mini-me) has rights on razorbill.
351351 - 2026-11-27: in this sandbox `swift build`/`swift test` fail (`libxml2.so.16` missing; the image has
352- `.so.2`), swiftlint and qlty are not installed, and `swift format lint -r Sources Tests` prints 10
353- warnings on files untouched since 0.3.0 (possibly another swift-format version than before).
352+ `.so.2`), swiftlint and qlty are not installed. swift-format 6.4.2 (sandbox and the user's Mac)
353+ flagged 6 line-length / line-break warnings on 0.3.0 code; fixed the same day, lint now silent.
354354
355355 - `rzb serve` on the Mac answers over HTTP (user, 2026-11-26: Qwen3.5-9B-MLX-4bit streamed through
356356 `demos/test-qwen`, ~15–20 tok/s, reasoning ok). The speed drop across runs (20.1 → 18.3 → 14.6
@@ -349,8 +349,8 @@ bump must be verified with the Mac smoke tests (real Qwen3): Linux cannot compil
349 whether Rickub Actions runs the upload job for the razorbill repo, whether `CI_TOKEN` (copied from349 whether Rickub Actions runs the upload job for the razorbill repo, whether `CI_TOKEN` (copied from
350 mini-me) has rights on razorbill.350 mini-me) has rights on razorbill.
351 - 2026-11-27: in this sandbox `swift build`/`swift test` fail (`libxml2.so.16` missing; the image has351 - 2026-11-27: in this sandbox `swift build`/`swift test` fail (`libxml2.so.16` missing; the image has
352- `.so.2`), swiftlint and qlty are not installed, and `swift format lint -r Sources Tests` prints 10352+ `.so.2`), swiftlint and qlty are not installed. swift-format 6.4.2 (sandbox and the user's Mac)
353- warnings on files untouched since 0.3.0 (possibly another swift-format version than before).353+ flagged 6 line-length / line-break warnings on 0.3.0 code; fixed the same day, lint now silent.
354 354
355 - `rzb serve` on the Mac answers over HTTP (user, 2026-11-26: Qwen3.5-9B-MLX-4bit streamed through355 - `rzb serve` on the Mac answers over HTTP (user, 2026-11-26: Qwen3.5-9B-MLX-4bit streamed through
356 `demos/test-qwen`, ~15–20 tok/s, reasoning ok). The speed drop across runs (20.1 → 18.3 → 14.6356 `demos/test-qwen`, ~15–20 tok/s, reasoning ok). The speed drop across runs (20.1 → 18.3 → 14.6
modified Sources/RazorbillCore/Config/ServerConfigLoader.swift +2 -1
@@ -134,7 +134,8 @@ private struct Context {
134134 repetitionPenalty: number(
135135 mapping, "repetition_penalty", path: path, rule: "must be above 0"
136136 ) { $0 > 0 },
137- repetitionContextSize: whole(mapping, "repetition_context_size", path: path, atLeast: 1))
137+ repetitionContextSize: whole(mapping, "repetition_context_size", path: path, atLeast: 1)
138+ )
138139 }
139140
140141 func limits(_ mapping: Node.Mapping, path: String) -> ServerLimits {
@@ -134,7 +134,8 @@ private struct Context {
134 repetitionPenalty: number(134 repetitionPenalty: number(
135 mapping, "repetition_penalty", path: path, rule: "must be above 0"135 mapping, "repetition_penalty", path: path, rule: "must be above 0"
136 ) { $0 > 0 },136 ) { $0 > 0 },
137- repetitionContextSize: whole(mapping, "repetition_context_size", path: path, atLeast: 1))137+ repetitionContextSize: whole(mapping, "repetition_context_size", path: path, atLeast: 1)
138+ )
138 }139 }
139 140
140 func limits(_ mapping: Node.Mapping, path: String) -> ServerLimits {141 func limits(_ mapping: Node.Mapping, path: String) -> ServerLimits {
modified Sources/RazorbillMLX/MLXSession.swift +2 -1
@@ -77,7 +77,8 @@ final class MLXSession: EngineSession, @unchecked Sendable {
7777
7878 /// Passes `events` on and returns the answer text they carry.
7979 private static func yield(
80- _ events: [EngineEvent], to continuation: AsyncThrowingStream<EngineEvent, Error>.Continuation
80+ _ events: [EngineEvent],
81+ to continuation: AsyncThrowingStream<EngineEvent, Error>.Continuation
8182 ) -> String {
8283 var text = ""
8384 for event in events {
@@ -77,7 +77,8 @@ final class MLXSession: EngineSession, @unchecked Sendable {
77 77
78 /// Passes `events` on and returns the answer text they carry.78 /// Passes `events` on and returns the answer text they carry.
79 private static func yield(79 private static func yield(
80- _ events: [EngineEvent], to continuation: AsyncThrowingStream<EngineEvent, Error>.Continuation80+ _ events: [EngineEvent],
81+ to continuation: AsyncThrowingStream<EngineEvent, Error>.Continuation
81 ) -> String {82 ) -> String {
82 var text = ""83 var text = ""
83 for event in events {84 for event in events {
modified Sources/RazorbillMLX/PromptCache.swift +2 -1
@@ -76,7 +76,8 @@ final class PromptCache: @unchecked Sendable {
7676 }
7777
7878 private static func trim(_ cache: [KVCache], by count: Int) -> Bool {
79- count == 0 || (canTrimPromptCache(cache) && trimPromptCache(cache, numTokens: count) == count)
79+ count == 0
80+ || (canTrimPromptCache(cache) && trimPromptCache(cache, numTokens: count) == count)
8081 }
8182 }
8283 #endif
@@ -76,7 +76,8 @@ final class PromptCache: @unchecked Sendable {
76 }76 }
77 77
78 private static func trim(_ cache: [KVCache], by count: Int) -> Bool {78 private static func trim(_ cache: [KVCache], by count: Int) -> Bool {
79- count == 0 || (canTrimPromptCache(cache) && trimPromptCache(cache, numTokens: count) == count)79+ count == 0
80+ || (canTrimPromptCache(cache) && trimPromptCache(cache, numTokens: count) == count)
80 }81 }
81 }82 }
82 #endif83 #endif
modified Sources/RazorbillServer/OpenAIError.swift +2 -1
@@ -109,7 +109,8 @@ extension OpenAIError {
109109 static func unknownRoute(_ request: Request) -> OpenAIError {
110110 var message = "Invalid URL (\(request.method) \(request.uri.path))"
111111 if baseURLPaths.contains(request.uri.path) {
112- message += ". /v1 is the base URL of the API: clients add the endpoint to it,"
112+ message +=
113+ ". /v1 is the base URL of the API: clients add the endpoint to it,"
113114 + " e.g. GET /v1/models or POST /v1/chat/completions."
114115 }
115116 return OpenAIError(.notFound, message: message, code: "unknown_url")
@@ -109,7 +109,8 @@ extension OpenAIError {
109 static func unknownRoute(_ request: Request) -> OpenAIError {109 static func unknownRoute(_ request: Request) -> OpenAIError {
110 var message = "Invalid URL (\(request.method) \(request.uri.path))"110 var message = "Invalid URL (\(request.method) \(request.uri.path))"
111 if baseURLPaths.contains(request.uri.path) {111 if baseURLPaths.contains(request.uri.path) {
112- message += ". /v1 is the base URL of the API: clients add the endpoint to it,"112+ message +=
113+ ". /v1 is the base URL of the API: clients add the endpoint to it,"
113 + " e.g. GET /v1/models or POST /v1/chat/completions."114 + " e.g. GET /v1/models or POST /v1/chat/completions."
114 }115 }
115 return OpenAIError(.notFound, message: message, code: "unknown_url")116 return OpenAIError(.notFound, message: message, code: "unknown_url")
modified Tests/RazorbillServerTests/ServerTests.swift +4 -2
@@ -80,13 +80,15 @@ struct ErrorBody: Decodable {
8080 }
8181 }
8282
83- @Test(arguments: ["/", "/v1", "/v1/"]) func theBaseURLAnswersWithAHint(path: String) async throws {
83+ @Test(arguments: ["/", "/v1", "/v1/"])
84+ func theBaseURLAnswersWithAHint(path: String) async throws {
8485 try await withLiveServer { client in
8586 try await client.execute(uri: path, method: .get) { response in
8687 #expect(response.status == .notFound)
8788 let body = try ErrorBody(response)
8889 #expect(body.error.code == "unknown_url")
89- #expect(body.error.message.hasPrefix("Invalid URL (GET \(path)). /v1 is the base URL"))
90+ let hint = "Invalid URL (GET \(path)). /v1 is the base URL"
91+ #expect(body.error.message.hasPrefix(hint))
9092 #expect(body.error.message.contains("GET /v1/models"))
9193 }
9294 }
@@ -80,13 +80,15 @@ struct ErrorBody: Decodable {
80 }80 }
81 }81 }
82 82
83- @Test(arguments: ["/", "/v1", "/v1/"]) func theBaseURLAnswersWithAHint(path: String) async throws {83+ @Test(arguments: ["/", "/v1", "/v1/"])
84+ func theBaseURLAnswersWithAHint(path: String) async throws {
84 try await withLiveServer { client in85 try await withLiveServer { client in
85 try await client.execute(uri: path, method: .get) { response in86 try await client.execute(uri: path, method: .get) { response in
86 #expect(response.status == .notFound)87 #expect(response.status == .notFound)
87 let body = try ErrorBody(response)88 let body = try ErrorBody(response)
88 #expect(body.error.code == "unknown_url")89 #expect(body.error.code == "unknown_url")
89- #expect(body.error.message.hasPrefix("Invalid URL (GET \(path)). /v1 is the base URL"))90+ let hint = "Invalid URL (GET \(path)). /v1 is the base URL"
91+ #expect(body.error.message.hasPrefix(hint))
90 #expect(body.error.message.contains("GET /v1/models"))92 #expect(body.error.message.contains("GET /v1/models"))
91 }93 }
92 }94 }