Repository navigation
ci(cloud-brain): deploy the shared brain with the site, and test it in CI (CB5) - #55
Conversation
…n CI (CB5) deploy.yml builds the Rust Worker with its pinned toolchain (a composite action: the Rust beta, worker-build 0.8.7 and its Emscripten, cached) and deploys it as vectorvroom-brain (vectorvroom-brain-pr-<n> for a PR). The page gets the Worker's origin in cloud/config.json only when /health says ok, brain on, limits bound and the page's protocol, and /v1/stats answers the site with CORS; otherwise Shared stays hidden and the run fails after Pages is published. wrangler.jsonc sets limits.cpu_ms (30 s) for the Workers Paid plan (D2): a cold start rebuilds the index in about a second. cloud-brain.yml runs the native tests, the Emscripten build, the Worker under wrangler dev and the page against it. The runbook covers the breaker, limits, rollback, the CF-Connecting-IP check, training, forget, fuzzing and preview cleanup.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAdds cached Cloud Brain toolchain setup and CI, production and preview Worker deployment with health checks, endpoint configuration, and operational documentation. ChangesCloud Brain deployment
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant DeployWorkflow
participant CloudBrainWorker
participant HealthCheck
participant StaticSite
DeployWorkflow->>CloudBrainWorker: Deploy named Worker and capture URL
DeployWorkflow->>HealthCheck: Check the Worker URL
HealthCheck->>CloudBrainWorker: Request /health and /v1/stats
HealthCheck-->>DeployWorkflow: Return check result
DeployWorkflow->>StaticSite: Write HTTPS brain URL or null endpoint
Merge Risk: ⚪ Minimal · up to The shared Brain endpoint is published only after deployment and health checks succeed. No concrete merge-blocking issue is established; merge after normal build and CI checks pass. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The endpoint checks protect newly published pages, but do not undo a Worker deployment that fails validation. Preview Workers also share production rate-limit budgets for the same source addresses. These create meaningful release-containment and environment-isolation risks, although preview data is separated and no new credential compromise was established. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (6 skipped: 6 unsupported.)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…aker that needs no build From review: production deploys only from main, after the native and Worker tests (a migration cannot be rolled back); a run that cannot deploy keeps the running production brain if it still answers; the build never sees the Cloudflare credentials; /health reports the commit built, so the health check waits for the new version, and it also sends a recall as the page does. The breaker is a DISABLE_BRAIN secret (tried on the preview). Cache keys per job; the CI skips docs-only changes and cancels superseded runs. Browser stage 7 waits out A's send backoff (A and B share one address in CI).
…de did not change since its commit
…nd says the client's state when it fails
…e back to a seed (sessions run every second)
deploy.yml builds the Rust Worker with its pinned toolchain (a composite
action: the Rust beta, worker-build 0.8.7 and its Emscripten, cached) and
deploys it as vectorvroom-brain (vectorvroom-brain-pr- for a PR). The
page gets the Worker's origin in cloud/config.json only when /health says
ok, brain on, limits bound and the page's protocol, and /v1/stats answers
the site with CORS; otherwise Shared stays hidden and the run fails after
Pages is published.
wrangler.jsonc sets limits.cpu_ms (30 s) for the Workers Paid plan (D2):
a cold start rebuilds the index in about a second. cloud-brain.yml runs the
native tests, the Emscripten build, the Worker under wrangler dev and the
page against it. The runbook covers the breaker, limits, rollback, the
CF-Connecting-IP check, training, forget, fuzzing and preview cleanup.
Summary by CodeRabbit
Confidence
Verbatim from /ship's Phase 2 confidence gate — per-axis score (0–25), the
evidence used, and the self-critique. Treat anything below 20 as a known soft
spot to verify before relying on it.
Requirements Fit: 24/25
deploy.ymldeploysvectorvroom-brain(frommain) andvectorvroom-brain-pr-<n>with a cached toolchain, and writes the endpoint intocloud/config.json;cloud-brain.ymlCI; the runbook; D2 Paid throughlimits.cpu_ms(the account accepted it).CF-Connecting-IPrefused at the edge (403),/healthlimits:true, fuzzing in the runbook.Functional Robustness: 23/25
mainand after its tests; the build never sees the credentials; the health check is tied to the commit built; the fallback keeps the running brain only when the page's cloud code is unchanged since its commit, else Shared is hidden; the breaker is a Worker secret.Verification Evidence: 24/25
CF-Connecting-IPrefused (403); a burst refused (429).mainrun's test gate and the production health check pass.System Safety & Integration: 24/25
mainwith required checks (the owner's settings).Total: 95/100. Gate (≥95 AND no axis <15): PASS