title: UCCA — Cloudflare Recon Brief — runtime, cost, jurisdiction, LLM layer doc_id: UCCA-RECON-CF-01 type: recon brief — instructions for a read-and-report audit. NOT a build spec. layer: ground (true-today; findings will go stale — date everything) canonical: false authored: 2026-07-02 NYC (UCCA session, ratified by Tim; relayed to Alex) relates_to: UCCA-CONTRACT-PACK-01 v1.0 FROZEN (the build this recon serves) · ADR-0002 (gate neutrality) · ADR-0003 (corporate/account boundary) · UCCA-TM-2026-07-02-TECH (repo state this recon extends) discipline: recon reports findings; it decides nothing. Any finding that touches the frozen contract is flagged as a v1.1 candidate, never resolved in the recon. Nothing deploys. Nothing is purchased or applied for. The drift-check applies to every observation: "does this only work because the client is VET?"
UCCA — Cloudflare Recon Brief¶
Purpose. Before the input-path build commits to a production runtime, verify whether the entire spine — gate (Worker), queue, Python body (Container), job state (D1), artefacts (R2), signing (keys worker), and the test-phase LLM (Workers AI) — can live in the one UCCA Cloudflare account, at what cost, and under what jurisdiction. Output is a findings report, not a decision. The decision is Tim's, made on the findings.
Account discipline: all recon runs in the UCCA account only. Verify
CF_ACCOUNT_ID before every action (ADR-0003; the three standing traps apply:
account-ID pin, export-don't-source, wire-by-UUID). Read-only wherever possible;
anything that must be created to test (a throwaway container, a diag route) is
namespaced, documented, and torn down.
1. Containers fit — can the Python body live in a Cloudflare Container?¶
Verify against the real generator footprint, not the docs' promises:
1.1 Instance sizing. Measure the generator's actual memory, CPU, and disk profile on a representative run (the CHCPRT025 bundle is the reference). Map against current Container instance types (dev / basic / standard — pull live limits, they moved in Sept 2025). Report headroom or shortfall.
1.2 Image size. Build (or size-estimate) the Docker image with the generator's full dependency tree. Report against Container image-size limits.
1.3 Job duration vs container lifecycle. Default idle shutdown is 10 minutes; keepAlive exists but requires explicit destroy. Map a real job's wall-clock (including LLM-call wait time) against this. Recommend the invocation pattern: Queue consumer → container per job? Long-lived container draining a queue? Workflows?
1.4 The fossil import. Contextualisation code still imports from the pre-extraction fossil directory (standing flag: "re-source on any rebuild"). Containerising IS the rebuild. Report what the import actually pulls and what re-sourcing it cleanly requires. Do not fix it in recon; size it.
1.5 Egress path. Confirm the container can reach: R2 (bindings or S3 API), D1, the keys worker, and external LLM APIs (for the direct-wire path). Note any binding limitations container-side vs worker-side.
2. Cost profile — the one-page table Tim puts a thumb on¶
Three scenarios, each priced two ways, plus the LLM line item:
| Scenario | Definition |
|---|---|
| Dev | current build phase; jobs per week, single digits |
| Client-one steady | RTOpacks live; estimate jobs/month from their brief's volumes |
| Ten clients | same job mix ×10 (crude is fine; it's a shape check) |
Price each as: - (a) CF consumption — Workers + Queues + Container active-CPU + D1 + R2 + Workers AI, WITH a stated job-concurrency cap (propose one; 2 is a fine starting number) and the computed worst-case monthly ceiling that cap implies. The ceiling is the headline number: consumption-with-a-cap = fixed-with-a-ceiling. - (b) Fixed external container — one honest comparator (Fly.io machine or Cloud Run min-instance or a plain VM), monthly price, PLUS the ops overhead named honestly (patching, uptime, secrets on the box, the network hop from edge to external host). - LLM line item per scenario — dominant cost either way; use GLM-5.2 rates for test phase and a frontier-model rate as the sensitivity case.
Credit mechanics to state in the table's footnotes: startup credits are valid one year from approval (clock starts on approval, NOT usage — application is deliberately deferred until ground is broken); R2 covered to a $10k cap; Workers AI covered to a $50k cap; AI Gateway currently NOT covered by credits.
3. Jurisdiction and residency — findings for the legal ledger, not blockers¶
3.1 Container region controls. What region pinning/affinity is actually available at our (non-Enterprise) tier? Is an Australia/Oceania placement possible, or is residency assurance an Enterprise-paper matter? Report what's configurable vs what's contractual.
3.2 R2 jurisdiction. Confirm available R2 location hints / jurisdiction options for the UCCA account's buckets.
3.3 Workers AI hosting jurisdiction. For @cf/zai-org/glm-5.2 served by CF:
where does inference run, and does using CF-hosted weights avoid the Z.ai
cloud-API-is-subject-to-Chinese-law exposure? Report what CF states, not what we hope.
(Context: test phase is synthetic payloads only, so nothing blocks; this feeds
STRATEGY-01's legal ledger — DPA wording, cross-border/residency.)
4. LLM adapter layer — audit and interface spec¶
4.1 Audit the existing Claude-API client code. Locate it, date it, report: SDK version/wire format, how outdated, and document the existing cost-request pattern in the calls (it's the right instinct — preserve the pattern, modernise the plumbing).
4.2 Spec the model-adapter interface (spec only; build lands with the input path). Requirements: - Provider-agnostic call surface; per-call model selection. - Usage capture built into the interface from day one: tokens in, tokens out, model ID, reasoning-effort/mode, latency, and the job-id it served. First-party store (D1). This is future client-billing data — it must be engine-owned. - Direct-wire policy: frontier and external models are called at their own APIs with our keys. No AI Gateway middleware — the 5% unified-billing fee buys nothing we don't already have to build, and provenance requires unmediated calls (no silent caching/retry/reroute between reasoner and model; every call is part of the job's record). Workers AI models are called via the binding — that's the host, not middleware. - Two switchers, one built now: engine-internal model selection surfaces in admin.ucca.online (audit what admin's backend needs to expose this). Client-facing thinking-tiers touch the job contract → file as a named v1.1 / UCCA-INTAKE-01 candidate, NOT built, NOT leaked into the frozen v1.0 surface.
4.3 Anthropic-compatible fallback. Confirm Z.ai's Anthropic-compatible endpoint as the direct-wire fallback path for GLM-5.2 (base URL + key swap against the existing client code) so the adapter's first two providers are cheap to stand up.
5. GLM-5.2 on Workers AI — live verification (ground truth, not pages)¶
5.1 Price. GLM-5.2 is live in the model catalogue but ABSENT from the official pricing table (checked 2026-07-02). Determine the real cost: run a small call from the UCCA account, read the neurons drawn from the dashboard, and check the model page / dashboard for a stated rate. Possibilities to confirm or kill: page lag; unpriced launch/beta period (historically free); price stated elsewhere. Third-party listings claim $1.40/$4.40 parity with Z.ai direct — treat as unverified until the dashboard says so.
5.2 Context and modes. Confirm the 262,144-token context cap on the CF deployment (vs the model's native 1M) and which reasoning modes (High/Max) are exposed through the binding. Irrelevant to payload sizes today; write it down anyway.
5.3 Free daily allocation. Confirm the 10,000 neurons/day free tier applies and what a representative generation job would draw against it — the mechanics-test phase may be literally free.
Deliverable¶
One findings report: §1 fit verdict (fits / fits-with-conditions / doesn't fit, with the conditions named), §2 the cost table with the concurrency-cap ceiling as the headline number, §3 jurisdiction findings for the legal ledger, §4 audit results + adapter interface spec, §5 GLM-5.2 ground truth. Anything discovered that the frozen pack didn't decide → flagged as a v1.1 clarification candidate, not resolved. Recommendation permitted; decision reserved to Tim. If findings support it, the runtime choice gets drafted as a Class B ADR (binds on ruling, mints when the proof job runs on it).
Explicitly out of scope: deploying anything persistent, applying for startup credits (deferred until ground broken — the one-year clock starts on approval), touching the RTOpacks account or repo, and any change to the frozen contract.
Recon brief. Five questions: does the body fit the container, what does the roof cost with a ceiling on it, whose law applies, what does the adapter need to be, and what does GLM-5.2 actually draw. Findings on paper, decision to Tim, drift-check on everything.