Skip to content
AskFlorence
Main Navigation ArchitectureFlorence AIAgentsMembersAgent PlatformValidationInfrastructure

Appearance

Sidebar Navigation

Overview

Home

Glossary

System Architecture

Consumer & Agent Flow

Florence AI

Overview

Principles

Runtime

Tool surface

Adding a tool

Tool registry

Knowledge: SBC scenarios & CSR

Voice

Evals & observability

Provider risk & portability

Outage playbook

Roadmap

Build plan

Agents

Overview

Workflows & pain points

Members

Overview

Medicaid coverage gap

Carriers

Overview

Marketplaces

Overview

Agency

Overview

Regulations

Overview

Agent Platform

Overview

Auth Architecture

MongoDB Permissioning

Compliance Model

Data Models

Data Sources

Overview

CMS Marketplace API

CMS dependency map

PUF Data

State Subsidies

SBE Ingestion Playbook

SBE State Watchouts + Decisions

CA Phase C/D Playbook

NY Phase C/D Playbook

Validation

Overview

Methodology

APTC Formula

California 2026

New York 2026

CAPS Formula

Scenario Results

Infrastructure

Account Inventory

AWS Setup Runbook

AWS Organizations

CloudTrail

GuardDuty

Security Hub

Config

CloudFront + WAFv2

Data sources & ingest

Phase 4 DNS

Change Log

Vulnerability Management

MongoDB Setup

Access Control

Data Classification

Documentation Hosting

Post-deploy Smoke

Development

Preflight (local CI mirror)

Testing strategy

Compliance

Overview (auditor entry point)

SOC 2 Control Mapping

HIPAA Control Mapping

CMS EDE Appendix A Mapping

Risk Assessment

Encryption Policy

Data Retention Policy

Privacy Impact Assessment

Consent Capture & Versioning

Incident Response Plan

Access Control Policy

Marketing vs. Portal Analytics

Vendor / Subprocessor Register

Dependency Vulnerability Policy

BAA / Compliance Evidence

Compliance-Automation Integration

Compliance-Automation Vendor Evaluation

Penetration Test Reports

Architecture

Portal entry handoff

Mobile app strategy

Deferred architecture decisions

Session cookie architecture

Share flows

Decisions (ADRs)

Index

0001 — Atlas project isolation

0002 — Append-only audit log

0003 — Narrow-scoped Mongo users

0004 — Cross-cluster Atlas PrivateLink

0005 — Delayed-job architecture

0006 — Mongo user simplification

0007 — Terraform owns ECS task def

0008 — E2E testing strategy

0009 — Self-hosted analytics + observability (superseded)

0010 — PostHog HIPAA Cloud (supersedes 0009)

Runbooks

Security Incident Response

Break-Glass Root Login

Onboard Team Member

Offboard Team Member

Atlas user provisioning

Deploy via Terraform (ENG-277)

Rollback via Terraform (ENG-277)

S3 data bucket migration (planned Phase 11)

Access Reviews

2026-Q2 Review

Session log

Index

2026-04-23 — Phase 10 DNS cutover

2026-04-22 — Phase 8 prod AWS mirror

2026-04-22 — Phase 7 Atlas VPC peering

2026-04-22 — Phase 6 CloudFront + WAF

2026-04-21 — Phase 5 staging go-live

2026-04-17 — Atlas staging

Briefs

Index

Member portal plan (ENG-187)

2026-04-16/17 handoff

2026-04-17 Atlas handoff

System briefing (2026-04-17)

Creative AdBundance proposal brief

Creative AdBundance analytics brief

ElevenLabs RN integration research

Policies

Overview

On this page

Preflight ​

The single command developers run before opening or updating a PR.

bash
npm run preflight

What it does ​

Runs the same checks PR-time CI runs, locally. Faster feedback (~30s for the quick subset) than waiting for a GitHub Actions round trip (~3 min).

Three modes:

ModeWhat runsWhen to use
--quickTypeScript strict + 3 audit scriptsHusky pre-push hook (auto). Sub-30s.
defaultquick + Next.js build + docs buildBefore opening or updating a PR. ~3-4 min.
--fulldefault + HTTP smoke against --base-urlBefore merging anything risky. Adds ~30s + writes synthetic test data.

Default mode ​

bash
npm run preflight

Runs:

  1. npx tsc --noEmit — strict TypeScript check across the whole repo.
  2. npm run audit:atlas-env-vars — Mongo URI manifest ↔ Terraform check.
  3. npm run audit:ecs-task-def — non-Mongo secret manifest ↔ Terraform check.
  4. npm run audit:ebs-resources — code references EBS Scheduler ↔ matching Terraform exists in both staging and prod.
  5. npm run build — Next.js production build.
  6. cd docs && npm run build — VitePress docs build (catches dead links).

Quick mode (pre-push hook) ​

bash
npm run preflight -- --quick

Skips the two builds. Sub-30s. Husky runs this automatically on git push.

Full mode (HTTP smoke + Playwright E2E) ​

bash
npm run preflight -- --full

Adds two checks on top of the default mode:

  1. HTTP smoke — scripts/audit/post-deploy-smoke.ts against http://localhost:3004 (default). Writes synthetic test rows (taha+ci-smoke-<runId>-<checkN>@askflorence.health) and cleans up.
  2. Playwright E2E (ENG-304) — 4 stable-surface specs running in Chromium against the same baseUrl. ~30s for the whole suite. Writes synthetic test rows (taha+playwright-<spec>-<runId>-<checkN>@askflorence.health) with afterEach cleanup + end-of-run orphan sweep.

Override the target with --base-url:

bash
npm run preflight -- --base-url=https://stage.askflorence.health --full

Playwright requires Chromium installed locally. First run:

bash
npx playwright install chromium

For the testing strategy + decision rationale (why Playwright vs ephemeral PR previews), see testing-strategy.md + ADR 0008.

Why this exists ​

Two precedents in the same week:

  • ENG-272 — RESUME_TOKEN_SECRET was added to src/lib/agent-resume-token.ts (which throws on missing) but never wired into infra/envs/{staging,prod}/ecs.tf. The first partial save on /agent-discovery threw, the try/catch swallowed it, and the resume email never sent for weeks.
  • ENG-274 — SCHEDULER_* env vars referenced in src/lib/agent-reminder-schedule.ts (which silently no-ops on missing) but never wired in Terraform. 15-minute reminders never fired for any agent who signed up between 2026-05-08 and 2026-05-12.
  • v0.29.9 — TypeScript strict error at src/app/_home/components/LandingCalculator.tsx:541 slipped through review because no PR check ran tsc. Broke Deploy prod workflow at run 25153366332.

All three would have been caught by npm run preflight running locally before push. PR CI also runs the same checks server-side as a backstop, so the gate is enforced even if a contributor skips preflight.

How big OSS projects handle the same constraint ​

ProjectPattern
Rustbors / homu merge queue runs expensive tests once per merge group
Next.jspnpm test aggregates lint + typecheck + build
Astropnpm preflight is the canonical pre-PR command
KubernetesProw runs all required tests per PR with smart triggering

AskFlorence's pattern: developers run npm run preflight locally; husky pre-push enforces the quick subset; PR CI re-runs the same audits server-side. No HMAC attestation or signed-commit machinery — the audits ARE the attestation, run twice.

State file ​

On every run, preflight writes .preflight-state.json in the repo root (gitignored) with the HEAD SHA, timestamp, mode, and per-check timings. Purely for the developer's own reference. Inspect with:

bash
jq < .preflight-state.json

Extending preflight ​

When a new audit script lands, add it to scripts/preflight.ts's quick array. When a new long-running test suite lands (e.g., Phase 3a Playwright UI flow tests), add it to the --full chain. The shape is designed to grow without restructuring.

Failure handling ​

Preflight runs every check even after one fails — you see ALL failures in a single run, not one at a time. The exit code is non-zero if any check failed.

For each failure, the summary prints the exact npm command to re-run that check in isolation. Fix the failure, run that command to confirm, then re-run npm run preflight end-to-end before pushing.

Bypassing the pre-push hook ​

Husky's pre-push hook calls npm run preflight -- --quick. To skip it (emergencies only):

bash
git push --no-verify

PR CI still runs the same checks server-side, so --no-verify won't help you merge — it just lets you push the branch faster when you're confident.

Related ​

  • Testing strategy — the four-layer overview + decision history for why we run things where
  • ADR 0008 — decision narrative (Playwright + PR-CI against staging; defer ephemeral PR previews)
  • scripts/preflight.ts — the orchestrator (repo root)
  • .husky/pre-push — the hook that runs --quick (repo root)
  • .github/workflows/build-check.yml — PR-time mirror (repo root)
  • infra/secrets/manifest.ts — non-Mongo secrets manifest (repo root)
  • infra/atlas/access-matrix.ts — Mongo URI manifest (repo root)
  • ENG-284 — the issue that shipped this harness
Pager
Previous pagePost-deploy Smoke
Next pageTesting strategy

AskFlorence Internal Documentation. Not for public distribution.

AskFlorence

Internal Documentation

Access restricted. Not for public distribution.