Repository navigation
Conversation
Companion to the unified architecture spec (PR #11). Moves the host from the Tailscale-only Debian box to one Worker path-mounted behind cail-doorway, replaces local accounts with doorway identity JWTs verified via @cuny-ai-lab/cail-identity, routes model calls through cail-model-api with the doorway-minted gateway JWT (no provider keys in the app), keeps per-deck state in a SQLite Durable Object, account tables in D1, uploads in R2, and deploys with Wrangler from CI. Grounded in the deployed cail-cadavre, cail-model-api, cail-doorway, cail-tools-admission and Kale bundles and the cail-doorway, cail-deploy and cail-identity repositories. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015B7qW78KqCz7p1Po2Q9bXE
szweibel
left a comment
There was a problem hiding this comment.
Two platform assumptions need correction before this becomes an accepted implementation plan. The existing SSRF guard uses node:dns/promises.lookup, which Workers documents as unimplemented; it cannot move unchanged under nodejs_compat (https://developers.cloudflare.com/workers/runtime-apis/nodejs/dns/). Rate Limiting bindings are per Cloudflare location and permissive/eventually consistent, not a global hard limit (https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/). Also resolve mutation-log version PRIMARY KEY versus the companion design incrementing version once per multi-mutation batch. The proposed local admin-subject list needs reconciliation with Admission-owned administrator authorization. This is a design review, not approval for account migration, infrastructure changes, or deployment.
Address the review on PR #12: - SSRF guard: node:dns lookup throws "Not implemented" on Workers; the guard is rewritten on resolve4/resolve6 with the same private-range policy and rebinding re-check, and the residual time-of-check gap is stated honestly (new section 2.10). - Rate Limiting bindings are per-location and approximate, not a global hard limit; they are now throttles only, and every limit that must be exact is listed with the strongly consistent store that enforces it. - DeckRoom log uses the commit-per-batch version semantics of PR #11 (one row per batch, version incremented once per commit), replacing the per-mutation version primary key. - Administrator authorization comes from admission's AdmissionResolver over a service binding, replacing the local admin-subject list; if admission declines the binding the app has no admin surface. - State the review scope: not approval for account migration, infrastructure changes, or deployment; each phase names what it needs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015B7qW78KqCz7p1Po2Q9bXE
|
Revised in 89af32f to address the review:
Generated by Claude Code |
szweibel
left a comment
There was a problem hiding this comment.
Reviewed the revision at 89af32f. The DNS compatibility and Rate Limiting descriptions now address the earlier findings. Administrator authorization defers to Admission with an explicit steward decision on the binding and an operator-script alternative; the ordinary batch-log semantics now match #11.
One identity-transition gap remains, noted inline: the limits table says there are no passwords, but the legacy claim still verifies an old password during the grace period. Please specify claim-specific attempt controls through retirement, or use operator-only linking. Companion #11 also needs its import/version collision resolved.
This is review of the revised design and earlier findings, not migration execution or deployed acceptance. The next step is the proposal author's revision. Acceptance of an Admission binding and any infrastructure or data migration remain separate decisions.
| | Chat spend | `cail-model-api` spend limits per person | AI Gateway enforces in dollars, upstream of the app | | ||
| | 10 MB per file, 50 MB per deck | The `uploaded_files` sum read inside the D1 upload transaction | one row set, one transaction | | ||
| | 60 slides per deck, lock ownership, `baseVersion` check | `DeckRoom.apply` | single-writer object | | ||
| | Login attempts | Nothing | no passwords | |
There was a problem hiding this comment.
[P2] Retain attempt controls for the legacy password claim. Line 227 keeps an email/password verification path for linking old accounts during the grace period. An admitted user can therefore still guess another legacy account's password; CUNY sign-in does not remove that target. Specify claim-specific attempt controls until the path is retired, or choose the operator-only linking route, and make this table agree with that decision.
Summary
Adds
docs/superpowers/specs/2026-09-03-cloudflare-transition-design.md, a design proposal that pairs with the unified architecture spec in #11. Where #11 makes the app portable (one core, thin hosts), this document chooses the host: one Cloudflare Worker behind the lab's CUNY-login doorway, with model access through the lab's model gateway, configured the way the lab's own apps are configured today.What it proposes
cail-slide-maker) serving the SvelteKitadapter-staticbuild as assets and the Hono API, path-mounted behindcail-doorwayattools.ailab.gc.cuny.edu/slide-maker/(the app already implements that base path). Deployed with Wrangler from GitHub Actions; staging and production Workers; release stamped at deploy.x-cail-identity-jwtper request, verified with@cuny-ai-lab/cail-identity; users keyed bycail-subject; admission is the allow-list. Deletes registration, verification email, admin approval, password reset, argon2, Lucia sessions, and SES. Includes a one-time legacy claim for existing accounts and share-by-name / capability links (the identity carries no email).GATEWAYservice binding tocail-model-apiwith the doorway-minted gateway JWT as bearer,x-cail-appandx-cail-session-idheaders, model list from/v1/modelsfiltered by function-calling capability, usage from the stream, budgets enforced by the gateway's per-person spend limits. No provider keys in the app. Direct Anthropic/Bedrock/OpenRouter adapters remain for local development only.env.AI.toMarkdown()for PDF/DOCX extraction;fflatefor export.Sources
Read from the deployed Worker bundles on the CUNY AI Lab Cloudflare account on 2026-09-03 (
cail-cadavre,cail-model-api,cail-model-access-api,cail-doorway,cail-tools-admission,cail-deploy-service,agent-studio) and from thecail-doorway,cail-deploy, andcail-identityrepositories. The spec states where something could not be determined from those sources.Relationship to #11
#11 is the precondition: the reducer and document make the deck Durable Object a thin shell, the render package makes SSR export host-neutral, and the AI package's event contract is what the gateway adapter implements. The two can be reviewed independently and land in order.
This is a proposal document for discussion and planning; no code changes are included.
🤖 Generated with Claude Code
https://claude.ai/code/session_015B7qW78KqCz7p1Po2Q9bXE
Generated by Claude Code