HF-13: site and cloud deployment profiles over one bundle #6

Merged
gmackie merged 1 commit from feat/HF-13-site-cloud-profiles into main 2026-11-04 10:23:41 +00:00
Owner

HF-13 (Phase R): deployment profiles for the dual reference deployment.

  • apps/worker/src/profile.ts: HF_PROFILE = local | site | cloud selects the served surfaces at runtime, never by hostname. PUBLIC_DEMO=1 without a profile still maps to cloud (med.gmac.io). An unknown profile, or PUBLIC_DEMO with a non-cloud profile, returns 503.
  • apps/worker/src/adapters/registry.ts: dispatch resolves the lab adapter from the operation's target_system row in component_instances. A missing, disabled or unsupported component blocks the order for review before any remote call. Real products are allowed only in site; no real worker-side adapter is registered yet (real OpenELIS delivery still runs from deploy/real host scripts).
  • wrangler.cloud.jsonc: hospital-fabric-cloud on hospital.gmac.io, new D1 databases hospital-fabric-cloud-core / -lis, separate from med.gmac.io.
  • wrangler.site.jsonc: for celld deploy; no routes (celld doesn't support them).

Verification

  • npm test: 57/57, including three new tests (profile chosen by config on one hostname; registry blocks before sending; site/cloud config parity). Typecheck and check:sql clean.
  • wrangler deploy --dry-run with the cloud config: bindings resolve.
  • celld deploy --dry-run with the site config on labnuc (celld 0.6.3): accepted, version 4db52689589a907a.
  • Both deployers rebundle main; the shared input is dist/index.mjs (sha256 ab8d20a6… at this head), which deployment evidence will record.
  • smoke:workerd fails locally with kill EPERM on this Mac, and fails the same way on unchanged main, so it is environmental; CI runs it on Linux.

Not deployed by this PR: the celld systemd node, the hospital.gmac.io Worker and routes come next.

🤖 Generated with Claude Code

HF-13 (Phase R): deployment profiles for the dual reference deployment. - `apps/worker/src/profile.ts`: `HF_PROFILE` = `local` | `site` | `cloud` selects the served surfaces at runtime, never by hostname. `PUBLIC_DEMO=1` without a profile still maps to `cloud` (med.gmac.io). An unknown profile, or `PUBLIC_DEMO` with a non-cloud profile, returns 503. - `apps/worker/src/adapters/registry.ts`: dispatch resolves the lab adapter from the operation's `target_system` row in `component_instances`. A missing, disabled or unsupported component blocks the order for review before any remote call. Real products are allowed only in `site`; no real worker-side adapter is registered yet (real OpenELIS delivery still runs from `deploy/real` host scripts). - `wrangler.cloud.jsonc`: `hospital-fabric-cloud` on `hospital.gmac.io`, new D1 databases `hospital-fabric-cloud-core` / `-lis`, separate from med.gmac.io. - `wrangler.site.jsonc`: for `celld deploy`; no routes (celld doesn't support them). Verification - `npm test`: 57/57, including three new tests (profile chosen by config on one hostname; registry blocks before sending; site/cloud config parity). Typecheck and `check:sql` clean. - `wrangler deploy --dry-run` with the cloud config: bindings resolve. - `celld deploy --dry-run` with the site config on labnuc (celld 0.6.3): accepted, version `4db52689589a907a`. - Both deployers rebundle `main`; the shared input is `dist/index.mjs` (sha256 `ab8d20a6…` at this head), which deployment evidence will record. - `smoke:workerd` fails locally with `kill EPERM` on this Mac, and fails the same way on unchanged main, so it is environmental; CI runs it on Linux. Not deployed by this PR: the celld systemd node, the hospital.gmac.io Worker and routes come next. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
HF-13: site and cloud deployment profiles over one bundle
All checks were successful
Scaffold conformance / test (pull_request) Successful in 1m47s
forgegraph/ci CI passed
Scaffold conformance / forgegraph-report (pull_request) Successful in 4s
4ea08c85d0
HF_PROFILE (local, site, cloud) now decides which surfaces the Worker
serves; PUBLIC_DEMO=1 without a profile still means cloud for med.gmac.io.
An unknown profile, or PUBLIC_DEMO with a non-cloud profile, returns 503.

The dispatcher resolves its lab adapter from the operation's target
component_instances row instead of always using the simulator. A
missing, disabled or unsupported component blocks the order for review
before any remote call. Real products are permitted only in the site
profile; no real worker-side adapter is registered yet.

wrangler.cloud.jsonc targets hospital.gmac.io with new D1 databases
hospital-fabric-cloud-core/-lis. wrangler.site.jsonc is for celld deploy
(dry-run accepted by celld 0.6.3 on labnuc). Both use the same
dist/index.mjs, triggers and D1 binding layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gmackie/hospital-fabric!6
No description provided.