HF-24: onboard hospital-fabric to observe.gmac.io analytics #12

Merged
gmackie merged 1 commit from feat/HF-24-observe-analytics into main 2026-11-07 07:24:15 +00:00
Owner

Issue: HF-24 (https://tasks.gmac.io/gmacko/issue/HF-24)

Summary

Sends privacy-conservative pageview analytics to the shared Dataflare deployment at https://observe.gmac.io (project hospital-fabric), so per-app session journeys and Sankeys work.

  • apps/hospital/dataflare.js is embedded by scripts/build-console.mjs as DATAFLARE_JS and served at GET /dataflare.js only in the cloud (public synthetic demo) profile. Site and local profiles return 404, so on-premise hospital fleets never load analytics.
  • Mounted once on the public pages: the hospital simulation shell (/ and /hospital) and the delivery lab (/delivery-lab). It is not added to the operator console.
  • CSP changes:
    • Hospital pages: https://observe.gmac.io added to script-src and connect-src.
    • Delivery lab: 'self' https://observe.gmac.io added to script-src and https://observe.gmac.io to connect-src. The page already allowed 'unsafe-inline' scripts, so 'self' adds no meaningful exposure.
  • The public synthetic demo only. med.gmac.io 301s to hospital.gmac.io.

Privacy

  • Pageviews only, reported as fixed screen categories (home, hospital, delivery-lab, other). No ids, query strings, titles or referrers are sent.
  • Do Not Track and Global Privacy Control are honored: the loader exits before s.js is fetched.
  • No session replay, click, error, web-vitals or feature-flag capture.
  • .glass/ comes from dataflare client-init --local and holds no secrets.

Observe project

Registered hospital-fabric with allowed origins: https://hospital.gmac.io, https://med.gmac.io.

Checks

  • npm run check:sql: pass.
  • node --check on scripts/build-console.mjs and apps/worker/src/api/router.ts: ok.
  • npm run typecheck and npm test were not run locally: the build host disk was full (ENOSPC during npm ci). Existing CSP assertions (toContain("script-src 'self'"), /connect-src 'self'/) still hold.

Acceptance

  • A pageview from the production origin is visible in observe.gmac.io for project hospital-fabric.
  • The session Sankey renders for project hospital-fabric.

Delivery target: production

🤖 Generated with Claude Code

Issue: HF-24 (https://tasks.gmac.io/gmacko/issue/HF-24) ## Summary Sends privacy-conservative pageview analytics to the shared Dataflare deployment at https://observe.gmac.io (project `hospital-fabric`), so per-app session journeys and Sankeys work. - `apps/hospital/dataflare.js` is embedded by `scripts/build-console.mjs` as `DATAFLARE_JS` and served at `GET /dataflare.js` **only in the cloud (public synthetic demo) profile**. Site and local profiles return 404, so on-premise hospital fleets never load analytics. - Mounted once on the public pages: the hospital simulation shell (`/` and `/hospital`) and the delivery lab (`/delivery-lab`). It is not added to the operator console. - CSP changes: - Hospital pages: `https://observe.gmac.io` added to `script-src` and `connect-src`. - Delivery lab: `'self' https://observe.gmac.io` added to `script-src` and `https://observe.gmac.io` to `connect-src`. The page already allowed `'unsafe-inline'` scripts, so `'self'` adds no meaningful exposure. - The public synthetic demo only. med.gmac.io 301s to hospital.gmac.io. ## Privacy - Pageviews only, reported as fixed screen categories (home, hospital, delivery-lab, other). No ids, query strings, titles or referrers are sent. - Do Not Track and Global Privacy Control are honored: the loader exits before s.js is fetched. - No session replay, click, error, web-vitals or feature-flag capture. - `.glass/` comes from `dataflare client-init --local` and holds no secrets. ## Observe project Registered `hospital-fabric` with allowed origins: https://hospital.gmac.io, https://med.gmac.io. ## Checks - `npm run check:sql`: pass. - `node --check` on `scripts/build-console.mjs` and `apps/worker/src/api/router.ts`: ok. - `npm run typecheck` and `npm test` were **not run locally**: the build host disk was full (ENOSPC during `npm ci`). Existing CSP assertions (`toContain("script-src 'self'")`, `/connect-src 'self'/`) still hold. ## Acceptance - A pageview from the production origin is visible in observe.gmac.io for project `hospital-fabric`. - The session Sankey renders for project `hospital-fabric`. Delivery target: production 🤖 Generated with [Claude Code](https://claude.com/claude-code)
HF-24: onboard hospital-fabric to observe.gmac.io analytics
All checks were successful
Scaffold conformance / test (pull_request) Successful in 2m2s
forgegraph/ci CI passed
Scaffold conformance / forgegraph-report (pull_request) Successful in 12s
004bfac7a2
Pageview-only Dataflare loader (public dataflare.js) mounted once in the
HTML shell, reporting fixed top-level screen categories to
https://observe.gmac.io (project hospital-fabric). DNT/GPC honored; no replay,
clicks, errors, web vitals or flags. Generated with dataflare client-init
(.glass/ holds no secrets).

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!12
No description provided.