mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 22:32:04 +00:00
test(guards): ratchet source size, test realism and version-stamp comments
Add a ratchet mechanism (helpers/ratchet.ts): per-key counts against a JSON
baseline under src/__tests__/baselines/. A new key or a higher count fails;
a lower count fails until it is written back with
`RATCHET_WRITE=1 pnpm vitest run <guard>`, which only ever lowers numbers.
Raising one is a hand edit in a reviewed change. The baselines are
machine-written, so prettier leaves them alone.
helpers/source-metrics.ts measures the production tree through the
TypeScript compiler: the file list (dot directories included, tests and
generated code out), line counts, every function node with a stable
"outer > inner" name and its length, and the runtime import graph.
Guards and their baselines, measured on this tree:
- source-size-ratchet: 129 files over 800 lines and 415 functions over 200
lines (catalog and data files exempt, each named with its reason; slack
25 and 10 lines before a shrink must be written back).
- test-realism-ratchet: 321 route tests mocking @/lib/db wholesale, 138
stubbing @/lib/api-handler, 6014 `as never` casts in 570 test files, and
400 test files that read a source file by path (reads through readSource
are not counted).
- version-stamp-ratchet: 10634 comment lines in 2985 files that open with a
release version; none may be added.
Proof each can fail: a planted 953-line file with a 253-line function failed
both size ratchets, and one line appended to app/page-client.tsx failed the
file ratchet (2326 → 2327); a planted route test with vi.mock("@/lib/db")
and one `as never` failed both of those ratchets; a planted comment
"// v1.45.0 — probe stamp" failed the stamp ratchet. Raising one as-never
baseline entry by 5 failed with the write-back message, and RATCHET_WRITE=1
restored the file byte for byte. All probes were removed again.
This commit is contained in:
1 parent
f3d7ab31e2
commit
2604c3e3c6
13 files changed
+5988
No files matched your search
@@ -16,3 +16,8 @@ docs/api/openapi.yaml
|
||||
|
||||
# Build-generated service worker (the PWA build emits it).
|
||||
public/sw.js
|
||||
|
||||
# Ratchet baselines, written by the guards themselves (RATCHET_WRITE=1). The
|
||||
# writer's JSON layout is the canonical one, so a write-back never fails the
|
||||
# format check.
|
||||
src/__tests__/baselines
|
||||
@@ -0,0 +1,328 @@
|
||||
{
|
||||
"$comment": "route tests that mock @/lib/db wholesale, per test file under src/. Maintained by src/__tests__/test-realism-ratchet.test.ts.",
|
||||
"count": 321,
|
||||
"total": 321,
|
||||
"entries": {
|
||||
"app/api/account/grants/__tests__/invite-access-level.test.ts": 1,
|
||||
"app/api/account/grants/__tests__/invite-recent-proof.test.ts": 1,
|
||||
"app/api/account/grants/__tests__/invite-scope-and-manage.test.ts": 1,
|
||||
"app/api/activity/__tests__/routes.test.ts": 1,
|
||||
"app/api/admin/ai-settings/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/audit-log/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/audit-log/actions/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/backups/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/backups/[id]/summary/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/import-apple-health-export/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/maintenance/measurements/__tests__/status.test.ts": 1,
|
||||
"app/api/admin/maintenance/pulse-day-mean/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/notifications/diagnostic/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/notifications/health/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/notifications/reminder-check/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/notifications/test/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/provider-health/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/settings/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/settings/assistant-flags/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/settings/module-availability/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/settings/web-push-vapid/generate/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/status/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/support-report/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/users/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/users/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/analytics/__tests__/route.test.ts": 1,
|
||||
"app/api/anamnesis/facts/__tests__/idempotency-conflict.test.ts": 1,
|
||||
"app/api/anamnesis/facts/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/claim/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/login/__tests__/constant-work.test.ts": 1,
|
||||
"app/api/auth/login/__tests__/native-token.test.ts": 1,
|
||||
"app/api/auth/login/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/login/__tests__/trusted-device.test.ts": 1,
|
||||
"app/api/auth/me/ai-usage/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/coach-prefs/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/devices/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/devices/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/diabetes/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/disable-coach/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/disable-coach/__tests__/unknown-key-strict.test.ts": 1,
|
||||
"app/api/auth/me/documents-auto-ai-read/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/glucose-unit/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/health-score-config/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/mfa/disable/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/mfa/webauthn/register/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/modules/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/notification-prefs/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/security-activity/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/sessions/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/source-priority/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/timezone/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/unit-preference/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/workout-routes/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/mfa/webauthn/verify/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/native/complete/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/native/login/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/native/token/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/oidc/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/oidc/native/token/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/passkey/login-verify/__tests__/native-token.test.ts": 1,
|
||||
"app/api/auth/passkey/login-verify/__tests__/oidc-only.test.ts": 1,
|
||||
"app/api/auth/passkey/login-verify/__tests__/refusals.test.ts": 1,
|
||||
"app/api/auth/passkeys/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/passkeys/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/password/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/register/__tests__/route.test.ts": 1,
|
||||
"app/api/biomarkers/__tests__/error-contract.test.ts": 1,
|
||||
"app/api/biomarkers/[id]/__tests__/delete-record-auth.test.ts": 1,
|
||||
"app/api/biomarkers/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/c/[token]/unlock/__tests__/route.test.ts": 1,
|
||||
"app/api/coach/about-me/__tests__/route-concurrency.test.ts": 1,
|
||||
"app/api/coach/about-me/__tests__/route-module-gate.test.ts": 1,
|
||||
"app/api/coach/about-me/adopt/__tests__/route.test.ts": 1,
|
||||
"app/api/coach/plans/__tests__/route.test.ts": 1,
|
||||
"app/api/coach/reminders/__tests__/route.test.ts": 1,
|
||||
"app/api/coach/suggested-actions/__tests__/route.test.ts": 1,
|
||||
"app/api/consent/ai/__tests__/route.test.ts": 1,
|
||||
"app/api/consent/ai/latest/__tests__/route.test.ts": 1,
|
||||
"app/api/custom-metrics/__tests__/route.test.ts": 1,
|
||||
"app/api/custom-metrics/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/custom-metrics/[id]/entries/__tests__/note-encryption.test.ts": 1,
|
||||
"app/api/custom-metrics/[id]/entries/__tests__/route.test.ts": 1,
|
||||
"app/api/custom-metrics/[id]/entries/__tests__/soft-delete-restore.test.ts": 1,
|
||||
"app/api/cycle/__tests__/external-id-floor.test.ts": 1,
|
||||
"app/api/cycle/calendar/__tests__/day-entries.test.ts": 1,
|
||||
"app/api/cycle/calendar/__tests__/verdict-round-trip.test.ts": 1,
|
||||
"app/api/cycle/day-logs/bulk/__tests__/route.test.ts": 1,
|
||||
"app/api/cycle/insights/__tests__/route-locale.test.ts": 1,
|
||||
"app/api/cycle/symptoms/custom/__tests__/custom-crud.test.ts": 1,
|
||||
"app/api/daily/digest/__tests__/route.test.ts": 1,
|
||||
"app/api/daily/digest/dismiss/__tests__/route.test.ts": 1,
|
||||
"app/api/dashboard/chart-overlay-prefs/__tests__/route.test.ts": 1,
|
||||
"app/api/dashboard/snapshot/__tests__/route.test.ts": 1,
|
||||
"app/api/dashboard/summary/__tests__/module-gate.test.ts": 1,
|
||||
"app/api/dashboard/summary/__tests__/route.test.ts": 1,
|
||||
"app/api/dashboard/widgets/__tests__/route.test.ts": 1,
|
||||
"app/api/dawarich/places/__tests__/route.test.ts": 1,
|
||||
"app/api/devices/__tests__/route.test.ts": 1,
|
||||
"app/api/devices/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/[id]/chat/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/[id]/extract/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/[id]/index/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/[id]/original/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/[id]/suggest/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/[id]/summary/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/[id]/thumbnail/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/layout/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/reindex/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/usage/__tests__/route.test.ts": 1,
|
||||
"app/api/encounters/procedures/__tests__/route.test.ts": 1,
|
||||
"app/api/environment/backfill/__tests__/route.test.ts": 1,
|
||||
"app/api/export/__tests__/measurement-streaming.test.ts": 1,
|
||||
"app/api/export/__tests__/per-type-routes.test.ts": 1,
|
||||
"app/api/export/__tests__/soft-delete-filter.test.ts": 1,
|
||||
"app/api/export/encrypted/__tests__/route.test.ts": 1,
|
||||
"app/api/export/health-record/__tests__/route.test.ts": 1,
|
||||
"app/api/feature-flags/__tests__/route.test.ts": 1,
|
||||
"app/api/fhir/__tests__/capability-and-everything.test.ts": 1,
|
||||
"app/api/fhir/__tests__/module-gate.test.ts": 1,
|
||||
"app/api/fitbit/connect/__tests__/route.test.ts": 1,
|
||||
"app/api/fitbit/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/gamification/achievements/__tests__/hidden-redaction.test.ts": 1,
|
||||
"app/api/gamification/achievements/__tests__/ios-format.test.ts": 1,
|
||||
"app/api/gamification/achievements/__tests__/module-gate.test.ts": 1,
|
||||
"app/api/gamification/achievements/__tests__/writes-nothing.test.ts": 1,
|
||||
"app/api/google-health/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/health/__tests__/route.test.ts": 1,
|
||||
"app/api/illness/episodes/[id]/__tests__/body-site.test.ts": 1,
|
||||
"app/api/illness/episodes/[id]/day-logs/__tests__/route.test.ts": 1,
|
||||
"app/api/illness/episodes/[id]/restore/__tests__/route.test.ts": 1,
|
||||
"app/api/import/__tests__/route.test.ts": 1,
|
||||
"app/api/import/apple-health-export/__tests__/route.test.ts": 1,
|
||||
"app/api/import/apple-health-export/[jobId]/status/__tests__/route.test.ts": 1,
|
||||
"app/api/import/csv/__tests__/route.test.ts": 1,
|
||||
"app/api/import/health-connect-export/__tests__/route.test.ts": 1,
|
||||
"app/api/ingest/medication/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/biomarker-assessment/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/blood-pressure-status/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/cards/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/golden-transcripts.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-activity.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-cancelled-turn.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-capability-gate.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-fence-guard.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-followups.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-guard-activation.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-guard-ledger.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-guard.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-list-query.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-snapshot-once.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-tool-mode.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-workout-scope.test.ts": 1,
|
||||
"app/api/insights/chat/[id]/attachments/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/chat/[id]/messages/[messageId]/trail/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/chat/fenced/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/coach-read/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/coach/facts/__tests__/route-memory.test.ts": 1,
|
||||
"app/api/insights/coach/facts/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/coach/nudge-status/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/comprehensive/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/correlations/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/derived/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/derived/batch/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/ecg/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/ecg/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/generate/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/glp1-timeline/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/layout/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/metric-status/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/mood-status/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/patterns/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/patterns/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/pregenerate/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/provider-chain/__tests__/put.test.ts": 1,
|
||||
"app/api/insights/provider-chain/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/rhythm-events/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/targets/__tests__/route.test.ts": 1,
|
||||
"app/api/integrations/fitbit/test/__tests__/route.test.ts": 1,
|
||||
"app/api/integrations/healthkit/__tests__/route.test.ts": 1,
|
||||
"app/api/integrations/status/__tests__/route.test.ts": 1,
|
||||
"app/api/integrations/whoop/test/__tests__/route.test.ts": 1,
|
||||
"app/api/integrations/withings/test/__tests__/route.test.ts": 1,
|
||||
"app/api/internal/deploy-webhook/__tests__/route.test.ts": 1,
|
||||
"app/api/labs/__tests__/error-contract.test.ts": 1,
|
||||
"app/api/labs/ocr/commit/__tests__/route.test.ts": 1,
|
||||
"app/api/labs/ocr/extract/__tests__/route.test.ts": 1,
|
||||
"app/api/labs/restore/__tests__/route.test.ts": 1,
|
||||
"app/api/mcp/oauth/__tests__/authorize.test.ts": 1,
|
||||
"app/api/mcp/oauth/__tests__/token.test.ts": 1,
|
||||
"app/api/mcp/tokens/__tests__/route.test.ts": 1,
|
||||
"app/api/measurement-reminders/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/measurement-reminders/[id]/__tests__/skip-snooze-history.test.ts": 1,
|
||||
"app/api/measurement-reminders/[id]/complete/__tests__/route.test.ts": 1,
|
||||
"app/api/measurement-reminders/[id]/satisfy/__tests__/route.test.ts": 1,
|
||||
"app/api/measurements/__tests__/arrival-wiring.test.ts": 1,
|
||||
"app/api/measurements/__tests__/group-by-day.test.ts": 1,
|
||||
"app/api/measurements/__tests__/put-duplicate-timestamp.test.ts": 1,
|
||||
"app/api/measurements/__tests__/range-aggregation-route.test.ts": 1,
|
||||
"app/api/measurements/__tests__/zod-multi-issue.test.ts": 1,
|
||||
"app/api/measurements/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/aggregated-hr-wire.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/duplicate-prefilter.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/hr-bucket-observability.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/insert-returning-arrivals.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/issue-paths.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/pr-detection-hook.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/refusal-detail.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/sync-trigger.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/timestamp-plausibility.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/unstable-external-id.test.ts": 1,
|
||||
"app/api/measurements/bulk-delete/__tests__/route.test.ts": 1,
|
||||
"app/api/measurements/by-external-ids/__tests__/route.test.ts": 1,
|
||||
"app/api/measurements/restore/__tests__/route.test.ts": 1,
|
||||
"app/api/measurements/series/__tests__/route.test.ts": 1,
|
||||
"app/api/measurements/series/__tests__/unknown-query-param-open.test.ts": 1,
|
||||
"app/api/medications/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/cadence/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/compliance/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/dose-history/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/glp1/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/intake/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/intake/__tests__/source-provenance.test.ts": 1,
|
||||
"app/api/medications/[id]/intake/[eventId]/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/intake/bulk-delete/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/intake/import/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/intake/import/[jobId]/status/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/intake/purge/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/inventory/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/inventory/[itemId]/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/phase-config/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/schedule-revisions/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/[id]/side-effects/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/compliance/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/intake/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/intake/bulk/__tests__/dose-arrival-scope.test.ts": 1,
|
||||
"app/api/medications/intake/bulk/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/intake/dose-history-import/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/layout/__tests__/route.test.ts": 1,
|
||||
"app/api/mental-health/assessments/__tests__/route.test.ts": 1,
|
||||
"app/api/mental-health/assessments/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/meta/capabilities/__tests__/route.test.ts": 1,
|
||||
"app/api/monitoring/glitchtip/__tests__/route.test.ts": 1,
|
||||
"app/api/mood-entries/__tests__/route.test.ts": 1,
|
||||
"app/api/mood-entries/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/mood-entries/bulk-delete/__tests__/route.test.ts": 1,
|
||||
"app/api/mood-entries/bulk/__tests__/route.test.ts": 1,
|
||||
"app/api/mood-entries/restore/__tests__/route.test.ts": 1,
|
||||
"app/api/mood/analytics/__tests__/route.test.ts": 1,
|
||||
"app/api/mood/tags/__tests__/custom-crud.test.ts": 1,
|
||||
"app/api/mood/tags/__tests__/groups-crud.test.ts": 1,
|
||||
"app/api/mood/tags/__tests__/layout.test.ts": 1,
|
||||
"app/api/mood/tags/__tests__/route.test.ts": 1,
|
||||
"app/api/mood/tags/layout/__tests__/route.test.ts": 1,
|
||||
"app/api/nightscout/connect/__tests__/route.test.ts": 1,
|
||||
"app/api/notifications/action/[token]/__tests__/route.test.ts": 1,
|
||||
"app/api/notifications/status/__tests__/route.test.ts": 1,
|
||||
"app/api/notifications/web-push/__tests__/route.test.ts": 1,
|
||||
"app/api/notifications/web-push/test/__tests__/route.test.ts": 1,
|
||||
"app/api/nutrients/__tests__/route.test.ts": 1,
|
||||
"app/api/nutrients/batch/__tests__/route.test.ts": 1,
|
||||
"app/api/nutrients/daily/__tests__/route.test.ts": 1,
|
||||
"app/api/nutrients/water/__tests__/route.test.ts": 1,
|
||||
"app/api/onboarding/__tests__/error-contract.test.ts": 1,
|
||||
"app/api/onboarding/complete/__tests__/route.test.ts": 1,
|
||||
"app/api/oura/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/oura/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/oura/disconnect/__tests__/route.test.ts": 1,
|
||||
"app/api/oura/status/__tests__/route.test.ts": 1,
|
||||
"app/api/personal-records/__tests__/route.test.ts": 1,
|
||||
"app/api/polar/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/polar/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/polar/disconnect/__tests__/route.test.ts": 1,
|
||||
"app/api/polar/status/__tests__/route.test.ts": 1,
|
||||
"app/api/search/__tests__/route.test.ts": 1,
|
||||
"app/api/settings/__tests__/channel-enabled-routes.test.ts": 1,
|
||||
"app/api/settings/__tests__/channel-global-switch-refusal.test.ts": 1,
|
||||
"app/api/settings/__tests__/email-test-route.test.ts": 1,
|
||||
"app/api/settings/__tests__/private-origin-routes.test.ts": 1,
|
||||
"app/api/settings/__tests__/telegram-test-locale.test.ts": 1,
|
||||
"app/api/settings/__tests__/webhook-format-route.test.ts": 1,
|
||||
"app/api/settings/reminder-thresholds/__tests__/route.test.ts": 1,
|
||||
"app/api/settings/webhook/test/__tests__/route.test.ts": 1,
|
||||
"app/api/share-links/__tests__/route.test.ts": 1,
|
||||
"app/api/sleep/night/__tests__/route.test.ts": 1,
|
||||
"app/api/sleep/rhythm/__tests__/route.test.ts": 1,
|
||||
"app/api/strava/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/strava/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/strava/disconnect/__tests__/route.test.ts": 1,
|
||||
"app/api/sync/changes/__tests__/module-gate.test.ts": 1,
|
||||
"app/api/sync/state/__tests__/route.test.ts": 1,
|
||||
"app/api/telegram/webhook/__tests__/route.test.ts": 1,
|
||||
"app/api/tokens/__tests__/route.test.ts": 1,
|
||||
"app/api/tokens/documents/__tests__/route.test.ts": 1,
|
||||
"app/api/tokens/measurements/__tests__/route.test.ts": 1,
|
||||
"app/api/tokens/workouts/__tests__/route.test.ts": 1,
|
||||
"app/api/user/ai-provider/__tests__/legacy-private-host.test.ts": 1,
|
||||
"app/api/user/ai-provider/__tests__/route.test.ts": 1,
|
||||
"app/api/user/avatar/__tests__/route.test.ts": 1,
|
||||
"app/api/user/avatar/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/user/profile/__tests__/route.test.ts": 1,
|
||||
"app/api/user/thresholds/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/connect/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/disconnect/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/status/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/webhook/[token]/__tests__/route.test.ts": 1,
|
||||
"app/api/withings/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/withings/connect/__tests__/route.test.ts": 1,
|
||||
"app/api/withings/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/withings/webhook/__tests__/route.test.ts": 1,
|
||||
"app/api/withings/webhook/[token]/__tests__/route.test.ts": 1,
|
||||
"app/api/workouts/__tests__/batch-create.test.ts": 1,
|
||||
"app/api/workouts/__tests__/batch-scope.test.ts": 1,
|
||||
"app/api/workouts/__tests__/canonical-dedup.test.ts": 1,
|
||||
"app/api/workouts/__tests__/delete.test.ts": 1,
|
||||
"app/api/workouts/__tests__/detail.test.ts": 1,
|
||||
"app/api/workouts/batch/__tests__/unstable-external-id.test.ts": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
{
|
||||
"$comment": "route tests that stub @/lib/api-handler, per test file under src/. Maintained by src/__tests__/test-realism-ratchet.test.ts.",
|
||||
"count": 138,
|
||||
"total": 138,
|
||||
"entries": {
|
||||
"app/api/account/grants/__tests__/invite-access-level.test.ts": 1,
|
||||
"app/api/account/grants/__tests__/invite-scope-and-manage.test.ts": 1,
|
||||
"app/api/activity/__tests__/routes.test.ts": 1,
|
||||
"app/api/admin/ai-settings/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/app-logs/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/audit-log/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/audit-log/actions/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/backups/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/backups/[id]/summary/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/notifications/diagnostic/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/notifications/health/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/notifications/reminder-check/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/notifications/test/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/provider-health/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/settings/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/settings/web-push-vapid/generate/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/status/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/support-report/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/users/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/users/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/ai/test/__tests__/route.test.ts": 1,
|
||||
"app/api/anamnesis/facts/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/mfa/disable/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/me/mfa/webauthn/register/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/mfa/webauthn/verify/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/native/complete/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/native/login/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/native/token/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/oidc/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/oidc/login/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/oidc/native/token/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/passkeys/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/passkeys/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/auth/password/__tests__/route.test.ts": 1,
|
||||
"app/api/biomarkers/[id]/__tests__/delete-record-auth.test.ts": 1,
|
||||
"app/api/coach/about-me/__tests__/route-concurrency.test.ts": 1,
|
||||
"app/api/coach/about-me/__tests__/route-module-gate.test.ts": 1,
|
||||
"app/api/coach/about-me/adopt/__tests__/route.test.ts": 1,
|
||||
"app/api/coach/about-me/questions/__tests__/route-module-gate.test.ts": 1,
|
||||
"app/api/dawarich/places/__tests__/route.test.ts": 1,
|
||||
"app/api/documents/inbound/usage/__tests__/route.test.ts": 1,
|
||||
"app/api/encounters/procedures/__tests__/route.test.ts": 1,
|
||||
"app/api/environment/backfill/__tests__/route.test.ts": 1,
|
||||
"app/api/fitbit/connect/__tests__/route.test.ts": 1,
|
||||
"app/api/fitbit/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/fitbit/sync/__tests__/route.test.ts": 1,
|
||||
"app/api/google-health/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/google-health/sync/__tests__/route.test.ts": 1,
|
||||
"app/api/google-health/sync/status/__tests__/route.test.ts": 1,
|
||||
"app/api/health/__tests__/route.test.ts": 1,
|
||||
"app/api/import/__tests__/record-csv-routes.test.ts": 1,
|
||||
"app/api/import/__tests__/route.test.ts": 1,
|
||||
"app/api/import/csv/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/golden-transcripts.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-activity.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-cancelled-turn.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-capability-gate.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-fence-guard.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-followups.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-guard-activation.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-guard-ledger.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-guard.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-list-query.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-snapshot-once.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-tool-mode.test.ts": 1,
|
||||
"app/api/insights/chat/__tests__/route-workout-scope.test.ts": 1,
|
||||
"app/api/insights/chat/[id]/__tests__/route-patch.test.ts": 1,
|
||||
"app/api/insights/chat/[id]/messages/[messageId]/results/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/chat/[id]/messages/[messageId]/trail/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/coach/nudge-status/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/generate/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/glp1-timeline/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/provider-chain/__tests__/put.test.ts": 1,
|
||||
"app/api/insights/provider-chain/__tests__/route.test.ts": 1,
|
||||
"app/api/integrations/fitbit/test/__tests__/route.test.ts": 1,
|
||||
"app/api/integrations/status/__tests__/route.test.ts": 1,
|
||||
"app/api/integrations/whoop/test/__tests__/route.test.ts": 1,
|
||||
"app/api/integrations/withings/resume/__tests__/route.test.ts": 1,
|
||||
"app/api/integrations/withings/test/__tests__/route.test.ts": 1,
|
||||
"app/api/internal/deploy-webhook/__tests__/route.test.ts": 1,
|
||||
"app/api/labs/ocr/extract/__tests__/route.test.ts": 1,
|
||||
"app/api/measurement-reminders/[id]/__tests__/route.test.ts": 1,
|
||||
"app/api/measurement-reminders/[id]/__tests__/skip-snooze-history.test.ts": 1,
|
||||
"app/api/measurement-reminders/[id]/complete/__tests__/route.test.ts": 1,
|
||||
"app/api/measurement-reminders/[id]/satisfy/__tests__/route.test.ts": 1,
|
||||
"app/api/measurements/__tests__/arrival-wiring.test.ts": 1,
|
||||
"app/api/medications/extract/__tests__/route.test.ts": 1,
|
||||
"app/api/medications/intake/bulk/__tests__/dose-arrival-scope.test.ts": 1,
|
||||
"app/api/monitoring/glitchtip/__tests__/route.test.ts": 1,
|
||||
"app/api/monitoring/umami-script/__tests__/route.test.ts": 1,
|
||||
"app/api/monitoring/umami/[...path]/__tests__/route.test.ts": 1,
|
||||
"app/api/nightscout/connect/__tests__/route.test.ts": 1,
|
||||
"app/api/nightscout/sync/__tests__/route.test.ts": 1,
|
||||
"app/api/notifications/web-push/__tests__/route.test.ts": 1,
|
||||
"app/api/notifications/web-push/test/__tests__/route.test.ts": 1,
|
||||
"app/api/oura/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/oura/connect/__tests__/route.test.ts": 1,
|
||||
"app/api/oura/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/oura/disconnect/__tests__/route.test.ts": 1,
|
||||
"app/api/oura/status/__tests__/route.test.ts": 1,
|
||||
"app/api/oura/sync/__tests__/route.test.ts": 1,
|
||||
"app/api/polar/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/polar/connect/__tests__/route.test.ts": 1,
|
||||
"app/api/polar/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/polar/disconnect/__tests__/route.test.ts": 1,
|
||||
"app/api/polar/status/__tests__/route.test.ts": 1,
|
||||
"app/api/polar/sync/__tests__/route.test.ts": 1,
|
||||
"app/api/record-settings/integrations/[provider]/__tests__/route.test.ts": 1,
|
||||
"app/api/search/__tests__/route.test.ts": 1,
|
||||
"app/api/settings/__tests__/telegram-test-locale.test.ts": 1,
|
||||
"app/api/strava/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/strava/connect/__tests__/route.test.ts": 1,
|
||||
"app/api/strava/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/strava/disconnect/__tests__/route.test.ts": 1,
|
||||
"app/api/strava/sync/__tests__/route.test.ts": 1,
|
||||
"app/api/sync/state/__tests__/route.test.ts": 1,
|
||||
"app/api/telegram/webhook/__tests__/route.test.ts": 1,
|
||||
"app/api/tokens/__tests__/route.test.ts": 1,
|
||||
"app/api/tokens/documents/__tests__/route.test.ts": 1,
|
||||
"app/api/tokens/measurements/__tests__/route.test.ts": 1,
|
||||
"app/api/tokens/workouts/__tests__/route.test.ts": 1,
|
||||
"app/api/user/ai-provider/__tests__/legacy-private-host.test.ts": 1,
|
||||
"app/api/user/ai-provider/__tests__/route.test.ts": 1,
|
||||
"app/api/version/__tests__/route.test.ts": 1,
|
||||
"app/api/version/check-updates/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/connect/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/connect/ticket/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/disconnect/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/status/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/sync/__tests__/route.test.ts": 1,
|
||||
"app/api/whoop/webhook/[token]/__tests__/route.test.ts": 1,
|
||||
"app/api/withings/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/withings/connect/__tests__/route.test.ts": 1,
|
||||
"app/api/withings/sync/__tests__/route.test.ts": 1,
|
||||
"app/api/withings/webhook/__tests__/route.test.ts": 1,
|
||||
"app/api/withings/webhook/[token]/__tests__/route.test.ts": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
{
|
||||
"$comment": "Production files over 800 lines and their length. Maintained by src/__tests__/source-size-ratchet.test.ts.",
|
||||
"count": 129,
|
||||
"total": 156466,
|
||||
"entries": {
|
||||
"app/api/dashboard/summary/route.ts": 1032,
|
||||
"app/api/documents/inbound/route.ts": 811,
|
||||
"app/api/insights/generate/route.ts": 1209,
|
||||
"app/api/measurements/batch/route.ts": 1576,
|
||||
"app/api/measurements/route.ts": 938,
|
||||
"app/api/measurements/series/route.ts": 879,
|
||||
"app/api/medications/[id]/route.ts": 1281,
|
||||
"app/api/medications/intake/bulk/route.ts": 1044,
|
||||
"app/api/workouts/batch/route.ts": 971,
|
||||
"app/medications/page-client.tsx": 839,
|
||||
"app/page-client.tsx": 2326,
|
||||
"components/admin/backups-section.tsx": 1462,
|
||||
"components/charts/health-chart.tsx": 2517,
|
||||
"components/charts/mood-chart.tsx": 1166,
|
||||
"components/cycle/log-day-sheet.tsx": 1639,
|
||||
"components/documents/document-detail-sheet.tsx": 1305,
|
||||
"components/documents/documents-view.tsx": 1212,
|
||||
"components/insights/coach-panel/chat-bubble.tsx": 888,
|
||||
"components/insights/coach-panel/coach-conversation.tsx": 1286,
|
||||
"components/insights/coach-panel/use-coach.ts": 1486,
|
||||
"components/insights/derived/vitals-dashboard.tsx": 1033,
|
||||
"components/insights/health-score-card.tsx": 1023,
|
||||
"components/insights/insights-tab-strip.tsx": 1086,
|
||||
"components/layout/sidebar-nav.tsx": 858,
|
||||
"components/measurement-reminders/vorsorge-section.tsx": 1536,
|
||||
"components/measurements/measurement-form.tsx": 815,
|
||||
"components/measurements/measurement-list.tsx": 2019,
|
||||
"components/medications/detail/medication-detail-tabs.tsx": 1176,
|
||||
"components/medications/dose-history-ledger.tsx": 1052,
|
||||
"components/medications/medication-table.tsx": 853,
|
||||
"components/medications/wizard/wizard-payload.ts": 1414,
|
||||
"components/mood/mood-list.tsx": 1408,
|
||||
"components/records/life-circumstances-manager.tsx": 1080,
|
||||
"components/settings/dashboard-layout-section.tsx": 1033,
|
||||
"components/settings/managed-record-settings-section.tsx": 1164,
|
||||
"components/timeline/timeline-chart.tsx": 1174,
|
||||
"components/timeline/timeline-geometry.ts": 1395,
|
||||
"lib/ai/anthropic-client.ts": 804,
|
||||
"lib/ai/coach/about-me.ts": 1012,
|
||||
"lib/ai/coach/coach-prose-grounding.ts": 1148,
|
||||
"lib/ai/coach/persistence.ts": 1219,
|
||||
"lib/ai/coach/results/metric-table-tool.ts": 1102,
|
||||
"lib/ai/coach/snapshot.ts": 1362,
|
||||
"lib/ai/coach/stream-events.ts": 817,
|
||||
"lib/ai/coach/tools/executor.ts": 1523,
|
||||
"lib/ai/coach/turn/model.ts": 820,
|
||||
"lib/ai/coach/types.ts": 1011,
|
||||
"lib/ai/codex-client.ts": 1094,
|
||||
"lib/ai/prompts/insight-generator.ts": 1121,
|
||||
"lib/ai/provider.ts": 1644,
|
||||
"lib/ai/safety/outbound-screen.ts": 1463,
|
||||
"lib/analytics/score/reader.ts": 998,
|
||||
"lib/analytics/sleep-night.ts": 1345,
|
||||
"lib/analytics/summaries-slice.ts": 1314,
|
||||
"lib/api-handler.ts": 1978,
|
||||
"lib/auth/session.ts": 811,
|
||||
"lib/cache/server-cache.ts": 851,
|
||||
"lib/cycle/prediction.ts": 883,
|
||||
"lib/daily/digest.ts": 1317,
|
||||
"lib/daily/load-digest.ts": 1000,
|
||||
"lib/daily/today-overview.ts": 838,
|
||||
"lib/dashboard-layout.ts": 971,
|
||||
"lib/dashboard/snapshot.ts": 1549,
|
||||
"lib/day/records.ts": 1175,
|
||||
"lib/doctor-report/collect.ts": 803,
|
||||
"lib/export/backup-plan.ts": 1089,
|
||||
"lib/export/coach-backup.ts": 1070,
|
||||
"lib/export/full-backup-payload.ts": 1520,
|
||||
"lib/export/profile-backup.ts": 1019,
|
||||
"lib/export/records-backup.ts": 834,
|
||||
"lib/export/restore-backup.ts": 3208,
|
||||
"lib/fitbit/client.ts": 1529,
|
||||
"lib/fitbit/sync-core.ts": 968,
|
||||
"lib/gamification/achievements-result.ts": 1094,
|
||||
"lib/gamification/achievements.ts": 913,
|
||||
"lib/google-health/client.ts": 1875,
|
||||
"lib/google-health/mappers.ts": 1295,
|
||||
"lib/google-health/sync-core.ts": 1634,
|
||||
"lib/idempotency.ts": 879,
|
||||
"lib/illness/correlation.ts": 1059,
|
||||
"lib/import/health-connect/import.ts": 1689,
|
||||
"lib/import/unzip-export-xml.ts": 825,
|
||||
"lib/insights/comprehensive-aggregator.ts": 943,
|
||||
"lib/insights/comprehensive-generate.ts": 1669,
|
||||
"lib/insights/correlation-channel-series.ts": 1339,
|
||||
"lib/insights/correlation-discovery.ts": 1240,
|
||||
"lib/insights/correlations.ts": 1026,
|
||||
"lib/insights/features.ts": 2009,
|
||||
"lib/insights/mood-aggregates.ts": 1055,
|
||||
"lib/insights/mood-status.ts": 814,
|
||||
"lib/insights/status-cache.ts": 812,
|
||||
"lib/insights/strain-score.ts": 832,
|
||||
"lib/integrations/status.ts": 1445,
|
||||
"lib/jobs/apple-health-import-worker.ts": 863,
|
||||
"lib/jobs/backup-restore.ts": 888,
|
||||
"lib/jobs/coach-nudge.ts": 1089,
|
||||
"lib/jobs/insight-pregenerate.ts": 1266,
|
||||
"lib/jobs/medication-intake-import.ts": 822,
|
||||
"lib/jobs/offhost-backup.ts": 1168,
|
||||
"lib/jobs/reaction-line.ts": 824,
|
||||
"lib/jobs/reminder/medication-reminder-check.ts": 818,
|
||||
"lib/jobs/reminder/register-integration-sync.ts": 1051,
|
||||
"lib/jobs/reminder/register-maintenance.ts": 2197,
|
||||
"lib/jobs/reminder/register-rollup.ts": 1156,
|
||||
"lib/jobs/reminder/register-status.ts": 878,
|
||||
"lib/managed-profiles/handover.ts": 986,
|
||||
"lib/mcp/record-search.ts": 1467,
|
||||
"lib/mcp/rich-reads.ts": 1468,
|
||||
"lib/mcp/tools.ts": 2654,
|
||||
"lib/measurements/dense-intraday-retention.ts": 1057,
|
||||
"lib/measurements/import-apple-health-export.ts": 1729,
|
||||
"lib/medications/scheduling/cadence.ts": 978,
|
||||
"lib/medications/scheduling/recurrence.ts": 1108,
|
||||
"lib/medications/scheduling/slot-upsert.ts": 926,
|
||||
"lib/notifications/senders/apns.ts": 1100,
|
||||
"lib/oura/client.ts": 1360,
|
||||
"lib/oura/sync.ts": 917,
|
||||
"lib/polar/client.ts": 1010,
|
||||
"lib/rollups/measurement-rollups.ts": 1496,
|
||||
"lib/search/search-records.ts": 996,
|
||||
"lib/sharing/grants.ts": 1046,
|
||||
"lib/support/report.ts": 905,
|
||||
"lib/telegram-webhook-handlers.ts": 1384,
|
||||
"lib/validations/backup.ts": 2418,
|
||||
"lib/validations/inbound-documents.ts": 1130,
|
||||
"lib/whoop/client.ts": 917,
|
||||
"lib/withings/sync-sleep.ts": 903,
|
||||
"lib/withings/sync.ts": 978,
|
||||
"proxy.ts": 870
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,422 @@
|
||||
{
|
||||
"$comment": "Production functions over 200 lines, keyed \"file :: name\", and their length. Maintained by src/__tests__/source-size-ratchet.test.ts.",
|
||||
"count": 415,
|
||||
"total": 154643,
|
||||
"entries": {
|
||||
"app/achievements/page.tsx :: AchievementsPage": 206,
|
||||
"app/api/admin/backups/upload/route.ts :: apiHandler(arg)": 314,
|
||||
"app/api/admin/notifications/reminder-check/route.ts :: apiHandler(arg)": 208,
|
||||
"app/api/admin/settings/route.ts :: apiHandler(arg) #2": 217,
|
||||
"app/api/analytics/route.ts :: buildAnalyticsResponse": 446,
|
||||
"app/api/auth/login/route.ts :: apiHandler(arg)": 262,
|
||||
"app/api/auth/me/route.ts :: apiHandler(arg)": 386,
|
||||
"app/api/auth/oidc/callback/route.ts :: apiHandler(arg)": 499,
|
||||
"app/api/auth/register/route.ts :: apiHandler(arg)": 275,
|
||||
"app/api/coach/about-me/route.ts :: apiHandler(arg) #2": 309,
|
||||
"app/api/cycle/calendar/route.ts :: apiHandler(arg)": 230,
|
||||
"app/api/cycle/day-logs/bulk/route.ts :: postBulk": 213,
|
||||
"app/api/cycle/insights/route.ts :: apiHandler(arg)": 226,
|
||||
"app/api/dashboard/summary/route.ts :: buildDashboardSummary": 606,
|
||||
"app/api/devices/route.ts :: apiHandler(arg)": 237,
|
||||
"app/api/documents/inbound/bulk/route.ts :: apiHandler(arg)": 212,
|
||||
"app/api/documents/inbound/route.ts :: processUpload": 309,
|
||||
"app/api/encounters/[id]/route.ts :: apiHandler(arg) #2": 275,
|
||||
"app/api/environment/route.ts :: apiHandler(arg)": 201,
|
||||
"app/api/export/health-record/route.ts :: apiHandler(arg)": 246,
|
||||
"app/api/import/csv/route.ts :: apiHandler(arg)": 407,
|
||||
"app/api/import/route.ts :: apiHandler(arg)": 364,
|
||||
"app/api/ingest/medication/route.ts :: apiHandler(arg)": 269,
|
||||
"app/api/insights/cards/route.ts :: apiHandler(arg)": 211,
|
||||
"app/api/insights/comprehensive/route.ts :: buildComprehensiveResponse": 505,
|
||||
"app/api/insights/generate/route.ts :: apiHandler(arg) #2": 862,
|
||||
"app/api/insights/generate/route.ts :: apiHandler(arg) > withFeatureCacheScope(arg)": 858,
|
||||
"app/api/integrations/status/route.ts :: apiHandler(arg)": 451,
|
||||
"app/api/labs/[id]/route.ts :: apiHandler(arg) #2": 244,
|
||||
"app/api/labs/ocr/commit/route.ts :: commitOcrRows": 290,
|
||||
"app/api/labs/route.ts :: postLabResult": 248,
|
||||
"app/api/mcp/oauth/token/route.ts :: POST": 250,
|
||||
"app/api/mcp/oauth/token/route.ts :: POST > withBackgroundEvent(arg)": 248,
|
||||
"app/api/measurement-reminders/[id]/route.ts :: apiHandler(arg) #2": 240,
|
||||
"app/api/measurements/[id]/route.ts :: apiHandler(arg) #2": 203,
|
||||
"app/api/measurements/batch/route.ts :: postBatch": 1277,
|
||||
"app/api/measurements/route.ts :: apiHandler(arg)": 286,
|
||||
"app/api/measurements/route.ts :: postMeasurement": 377,
|
||||
"app/api/measurements/series/route.ts :: apiHandler(arg)": 670,
|
||||
"app/api/medications/[id]/dose-history/route.ts :: apiHandler(arg)": 256,
|
||||
"app/api/medications/[id]/intake/[eventId]/route.ts :: apiHandler(arg)": 390,
|
||||
"app/api/medications/[id]/intake/route.ts :: postIntake": 607,
|
||||
"app/api/medications/[id]/inventory/[itemId]/route.ts :: apiHandler(arg)": 210,
|
||||
"app/api/medications/[id]/route.ts :: apiHandler(arg)": 214,
|
||||
"app/api/medications/[id]/route.ts :: apiHandler(arg) #2": 892,
|
||||
"app/api/medications/[id]/route.ts :: apiHandler(arg) > prisma.$transaction(arg)": 293,
|
||||
"app/api/medications/[id]/schedule-revisions/[revisionId]/route.ts :: apiHandler(arg)": 254,
|
||||
"app/api/medications/extract/route.ts :: handleExtract": 203,
|
||||
"app/api/medications/intake/bulk/route.ts :: postBulk": 846,
|
||||
"app/api/medications/intake/route.ts :: apiHandler(arg) #2": 432,
|
||||
"app/api/medications/route.ts :: postMedication": 403,
|
||||
"app/api/mental-health/assessments/route.ts :: postAssessment": 267,
|
||||
"app/api/mood-entries/[id]/route.ts :: apiHandler(arg) #2": 302,
|
||||
"app/api/mood-entries/bulk/route.ts :: postBulk": 479,
|
||||
"app/api/mood-entries/route.ts :: postMoodEntry": 329,
|
||||
"app/api/nutrients/batch/route.ts :: postBatch": 304,
|
||||
"app/api/onboarding/complete/route.ts :: completeNeedsFlow": 218,
|
||||
"app/api/record-settings/[family]/route.ts :: apiHandler(arg) #2": 262,
|
||||
"app/api/sync/changes/route.ts :: apiHandler(arg)": 427,
|
||||
"app/api/user/ai-provider/route.ts :: apiHandler(arg) #2": 252,
|
||||
"app/api/withings/callback/route.ts :: apiHandler(arg)": 247,
|
||||
"app/api/workouts/[id]/route.ts :: apiHandler(arg)": 313,
|
||||
"app/api/workouts/batch/route.ts :: postBatch": 722,
|
||||
"app/auth/login/page.tsx :: LoginPage": 576,
|
||||
"app/auth/register/page.tsx :: RegisterPage": 285,
|
||||
"app/coach/conversations/page.tsx :: CoachConversationsBody": 249,
|
||||
"app/coach/plans/page.tsx :: CoachPlansBody": 216,
|
||||
"app/insights/catalog/page.tsx :: MetricCatalogPage": 204,
|
||||
"app/insights/medications/page.tsx :: InsightsMedikamentePage": 265,
|
||||
"app/insights/page-client.tsx :: InsightsPageClient": 376,
|
||||
"app/labs/page.tsx :: LabsPage": 228,
|
||||
"app/medications/page-client.tsx :: MedicationsPageClient": 591,
|
||||
"app/notifications/page.tsx :: NotificationsPage": 327,
|
||||
"app/page-client.tsx :: DashboardPageClient": 2133,
|
||||
"app/page-client.tsx :: DashboardPageClient > (anonymous)": 1279,
|
||||
"components/activity/activity-calendar-card.tsx :: ActivityCalendarCard": 470,
|
||||
"components/admin/admin-shell.tsx :: AdminShell": 254,
|
||||
"components/admin/api-token-overview-section.tsx :: ApiTokenOverviewSection": 212,
|
||||
"components/admin/app-log-preview-section.tsx :: AppLogPreviewSection": 341,
|
||||
"components/admin/backups-section.tsx :: BackupsSection": 618,
|
||||
"components/admin/backups-section.tsx :: RestoreRowDialog": 226,
|
||||
"components/admin/central-codex-section.tsx :: CentralCodexSection": 241,
|
||||
"components/admin/encryption-section.tsx :: EncryptionSection": 303,
|
||||
"components/admin/general-settings-section.tsx :: GeneralSettingsSection": 220,
|
||||
"components/admin/glitchtip-section.tsx :: GlitchtipSection": 233,
|
||||
"components/admin/host-metrics-chart.tsx :: HostMetricsChart": 232,
|
||||
"components/admin/invite-tokens-section.tsx :: InviteTokensSection": 525,
|
||||
"components/admin/key-backup-card.tsx :: KeyBackupCard": 238,
|
||||
"components/admin/login-overview-section.tsx :: LoginOverviewSection": 520,
|
||||
"components/admin/pulse-day-mean-card.tsx :: PulseDayMeanCard": 305,
|
||||
"components/admin/reminders-section.tsx :: RemindersSection": 309,
|
||||
"components/admin/user-management-section.tsx :: UserManagementSection": 634,
|
||||
"components/admin/web-push-vapid-section.tsx :: WebPushVapidSection": 217,
|
||||
"components/auth/claim-profile.tsx :: ClaimProfile": 429,
|
||||
"components/auth/mfa-login-step.tsx :: MfaLoginStep": 217,
|
||||
"components/charts/compliance-heatmap.tsx :: ComplianceHeatmap": 325,
|
||||
"components/charts/health-chart.tsx :: HealthChart": 1929,
|
||||
"components/charts/medication-compliance-chart.tsx :: MedicationComplianceChart": 543,
|
||||
"components/charts/mood-chart.tsx :: MoodChart": 896,
|
||||
"components/charts/mood-heatmap.tsx :: MoodHeatmap": 296,
|
||||
"components/charts/trend-card.tsx :: TrendCard": 365,
|
||||
"components/clinician/clinician-view.tsx :: ClinicianView": 223,
|
||||
"components/command-palette/command-palette.tsx :: PaletteBody": 333,
|
||||
"components/custom-metrics/custom-metric-chart.tsx :: CustomMetricChart": 231,
|
||||
"components/custom-metrics/custom-metric-detail.tsx :: CustomMetricDetail": 277,
|
||||
"components/custom-metrics/custom-metric-form.tsx :: CustomMetricForm": 214,
|
||||
"components/custom-metrics/custom-metric-history-list.tsx :: CustomMetricHistoryList": 302,
|
||||
"components/cycle/bbt-chart.tsx :: BbtChart": 244,
|
||||
"components/cycle/cycle-calendar.tsx :: CycleCalendar": 303,
|
||||
"components/cycle/cycle-settings.tsx :: CycleSettings": 228,
|
||||
"components/cycle/cycle-view.tsx :: CycleView": 408,
|
||||
"components/cycle/log-day-sheet.tsx :: LogDaySheet": 753,
|
||||
"components/daily/today-hero.tsx :: TodayHero": 490,
|
||||
"components/dashboard/dashboard-header.tsx :: DashboardHeader": 215,
|
||||
"components/dashboard/medication-intake-quick-add.tsx :: MedicationIntakeQuickAdd": 384,
|
||||
"components/day/day-layer.tsx :: DayLayer": 375,
|
||||
"components/day/day-view.tsx :: DayView": 300,
|
||||
"components/documents/document-ai-section.tsx :: DocumentAiSection": 262,
|
||||
"components/documents/document-bulk-bar.tsx :: DocumentBulkBar": 204,
|
||||
"components/documents/document-card.tsx :: DocumentCard": 354,
|
||||
"components/documents/document-detail-sheet.tsx :: DocumentDetailSheet": 936,
|
||||
"components/documents/document-facts-review.tsx :: DocumentFactsSection": 252,
|
||||
"components/documents/document-facts-review.tsx :: FactRow": 262,
|
||||
"components/documents/document-filter-bar.tsx :: DocumentFilterBar": 348,
|
||||
"components/documents/document-record-links.tsx :: DocumentRecordLinks": 202,
|
||||
"components/documents/document-timeline.tsx :: DocumentTimeline": 314,
|
||||
"components/documents/documents-view.tsx :: DocumentsView": 964,
|
||||
"components/documents/sources/document-source-picker.tsx :: DocumentSourcePicker": 565,
|
||||
"components/illness/log-day-sheet.tsx :: LogDaySheet": 265,
|
||||
"components/illness/new-episode-sheet.tsx :: NewEpisodeSheet": 264,
|
||||
"components/insights/coach-panel/attachment-picker.tsx :: AttachmentPicker": 208,
|
||||
"components/insights/coach-panel/chat-bubble.tsx :: ChatBubbleImpl": 419,
|
||||
"components/insights/coach-panel/coach-conversation.tsx :: CoachConversation": 1012,
|
||||
"components/insights/coach-panel/coach-input.tsx :: CoachInput": 259,
|
||||
"components/insights/coach-panel/coach-model-picker.tsx :: CoachModelPicker": 212,
|
||||
"components/insights/coach-panel/conversations-panel.tsx :: ConversationsPanel": 317,
|
||||
"components/insights/coach-panel/message-thread.tsx :: MessageThread": 390,
|
||||
"components/insights/coach-panel/sources-rail.tsx :: SourcesRail": 203,
|
||||
"components/insights/coach-panel/use-coach.ts :: useSendCoachMessage": 436,
|
||||
"components/insights/coach-panel/use-coach.ts :: useSendCoachMessage > useCallback(arg) #2": 340,
|
||||
"components/insights/daily-briefing.tsx :: DailyBriefing": 224,
|
||||
"components/insights/derived/coach-read-strip.tsx :: CoachReadStrip": 202,
|
||||
"components/insights/derived/composite-score-anatomy.tsx :: CompositeScoreAnatomy": 251,
|
||||
"components/insights/derived/score-trend-chart.tsx :: ScoreTrendChart": 255,
|
||||
"components/insights/derived/vitals-dashboard.tsx :: VitalsDashboard": 239,
|
||||
"components/insights/derived/wellness-scores.tsx :: WellnessScores": 273,
|
||||
"components/insights/glucose/glucose-clinical-panel.tsx :: GlucoseClinicalPanel": 213,
|
||||
"components/insights/health-score-card.tsx :: HealthScoreCard": 561,
|
||||
"components/insights/healthkit-metric-page.tsx :: HealthKitMetricPage": 322,
|
||||
"components/insights/insight-status-card.tsx :: InsightStatusCard": 205,
|
||||
"components/insights/insights-edit-mode.tsx :: InsightsEditMode": 270,
|
||||
"components/insights/insights-tab-strip.tsx :: InsightsTabStripImpl": 410,
|
||||
"components/insights/intraday-pulse-chart.tsx :: IntradayPulseChart": 283,
|
||||
"components/insights/layout-coach-fab.tsx :: LayoutCoachFab": 230,
|
||||
"components/insights/metric-target-summary.tsx :: TargetReferencePanel": 223,
|
||||
"components/insights/mood/mood-dimension-trends.tsx :: MoodDimensionTrends": 227,
|
||||
"components/insights/sleep-stage-stacked-bar.tsx :: SleepStageStackedBar": 354,
|
||||
"components/insights/sub-page-shell.tsx :: SubPageShell": 266,
|
||||
"components/insights/trends-row.tsx :: TrendsRow": 215,
|
||||
"components/labs/biomarker-form.tsx :: BiomarkerForm": 244,
|
||||
"components/labs/biomarker-manager.tsx :: BiomarkerManager": 242,
|
||||
"components/labs/biomarker-merge-sheet.tsx :: BiomarkerMergeSheet": 250,
|
||||
"components/labs/lab-biomarker-chart.tsx :: LabBiomarkerChart": 370,
|
||||
"components/labs/lab-biomarker-detail.tsx :: LabBiomarkerDetail": 481,
|
||||
"components/labs/lab-form.tsx :: LabForm": 473,
|
||||
"components/labs/lab-history-list.tsx :: LabHistoryList": 534,
|
||||
"components/labs/lab-list.tsx :: LabList": 308,
|
||||
"components/labs/ocr-review-dialog.tsx :: OcrReviewDialog": 359,
|
||||
"components/labs/ocr-row-editor.tsx :: OcrRowEditor": 393,
|
||||
"components/layout/auth-shell.tsx :: AuthShell": 520,
|
||||
"components/layout/bottom-nav.tsx :: BottomNav": 260,
|
||||
"components/layout/capture-picker.tsx :: CapturePicker": 235,
|
||||
"components/layout/sidebar-nav.tsx :: SidebarNav": 372,
|
||||
"components/layout/top-bar.tsx :: TopBar": 212,
|
||||
"components/links/entity-link-picker.tsx :: EntityLinkPicker": 392,
|
||||
"components/measurement-reminders/vorsorge-dashboard-card.tsx :: VorsorgeDashboardCard": 215,
|
||||
"components/measurement-reminders/vorsorge-section.tsx :: VorsorgeCard": 635,
|
||||
"components/measurement-reminders/vorsorge-section.tsx :: VorsorgeSection": 618,
|
||||
"components/measurements/measurement-form.tsx :: MeasurementForm": 500,
|
||||
"components/measurements/measurement-list.tsx :: MeasurementList": 1586,
|
||||
"components/measurements/measurement-list.tsx :: MeasurementList > data.measurements.map(arg)": 223,
|
||||
"components/measurements/measurement-list.tsx :: MeasurementList > data.measurements.map(arg) #2": 229,
|
||||
"components/medications/detail/efficacy/efficacy-chart.tsx :: EfficacyChart": 361,
|
||||
"components/medications/detail/medication-detail-tabs.tsx :: MedicationDetailTabs": 787,
|
||||
"components/medications/dose-history-add-dialog.tsx :: LedgerAddDialog": 223,
|
||||
"components/medications/dose-history-ledger.tsx :: DoseHistoryLedger": 404,
|
||||
"components/medications/dose-history-ledger.tsx :: LedgerRowItem": 314,
|
||||
"components/medications/dose-strength-curve.tsx :: DoseStrengthCurve": 266,
|
||||
"components/medications/glp1-medication-card.tsx :: Glp1MedicationCard": 405,
|
||||
"components/medications/injection-site-picker.tsx :: InjectionSitePicker": 287,
|
||||
"components/medications/intake-history-editable.tsx :: IntakeHistoryEditable": 224,
|
||||
"components/medications/intake-history-list-v2.tsx :: IntakeHistoryListV2": 435,
|
||||
"components/medications/intake-import-dialog.tsx :: IntakeImportDialog": 208,
|
||||
"components/medications/log-intake-dialog.tsx :: LogIntakeDialog": 267,
|
||||
"components/medications/medication-card.tsx :: MedicationCard": 413,
|
||||
"components/medications/medication-table.tsx :: MedicationTableRowItem": 377,
|
||||
"components/medications/scheduling/natural-language-extractor.tsx :: NaturalLanguageExtractor": 214,
|
||||
"components/medications/scheduling/schedule-history-timeline.tsx :: EraDialog": 219,
|
||||
"components/medications/scheduling/schedule-history-timeline.tsx :: ScheduleHistoryTimeline": 256,
|
||||
"components/medications/sections/api-tokens-row.tsx :: ApiTokensRow": 296,
|
||||
"components/medications/sections/composition-section.tsx :: CompositionEditor": 362,
|
||||
"components/medications/sections/inventory-dialogs.tsx :: AddInventoryDialog": 238,
|
||||
"components/medications/sections/inventory-section.tsx :: InventorySection": 368,
|
||||
"components/medications/side-effects-section.tsx :: SideEffectsSection": 516,
|
||||
"components/medications/wizard/medication-wizard-dialog.tsx :: WizardDialogShell": 516,
|
||||
"components/medications/wizard/steps/step3-dose.tsx :: Step3Dose": 222,
|
||||
"components/medications/wizard/steps/step8-summary.tsx :: Step8Summary": 230,
|
||||
"components/mental-health/check-in-wizard.tsx :: CheckInWizard": 214,
|
||||
"components/mental-health/mental-wellbeing.tsx :: MentalWellbeing": 210,
|
||||
"components/mood/manage/tag-groups-card.tsx :: TagGroupsCard": 256,
|
||||
"components/mood/manage/tag-manager-card.tsx :: TagManagerCard": 270,
|
||||
"components/mood/mood-form.tsx :: MoodForm": 513,
|
||||
"components/mood/mood-list.tsx :: MoodList": 1109,
|
||||
"components/mood/mood-tag-picker.tsx :: MoodTagPicker": 257,
|
||||
"components/onboarding/confirm-screen.tsx :: ConfirmScreen": 255,
|
||||
"components/onboarding/done-screen.tsx :: DoneScreen": 408,
|
||||
"components/onboarding/getting-started-checklist.tsx :: GettingStartedChecklist": 425,
|
||||
"components/onboarding/tour.tsx :: OnboardingTour": 544,
|
||||
"components/practitioners/practitioner-list.tsx :: PractitionerList": 230,
|
||||
"components/provenance/source-provenance-view.tsx :: SourceProvenanceView": 363,
|
||||
"components/records/allergy-form.tsx :: AllergyForm": 225,
|
||||
"components/records/audit-c-panel.tsx :: AuditCPanel": 285,
|
||||
"components/records/life-circumstances-manager.tsx :: SectionBody": 482,
|
||||
"components/settings/about-section.tsx :: AboutSection": 236,
|
||||
"components/settings/access/grant-invite-card.tsx :: GrantInviteCard": 311,
|
||||
"components/settings/access/managed-profile-create-form.tsx :: ManagedProfileCreateForm": 235,
|
||||
"components/settings/access/managed-profile-edit-form.tsx :: ManagedProfileEditFields": 208,
|
||||
"components/settings/access/managed-profile-guardians.tsx :: ManagedProfileGuardians": 234,
|
||||
"components/settings/account-section/index.tsx :: AccountSection": 659,
|
||||
"components/settings/ai/codex-provider-form.tsx :: CodexProviderForm": 281,
|
||||
"components/settings/ai/fallback-chain-card.tsx :: FallbackChainCard": 228,
|
||||
"components/settings/ai/runtime-actions-row.tsx :: RuntimeActionsRow": 282,
|
||||
"components/settings/api-section.tsx :: ApiTokensCard": 366,
|
||||
"components/settings/coach-nudge-card.tsx :: CoachNudgeCard": 251,
|
||||
"components/settings/coach-prefs-section.tsx :: CoachPrefsSection": 350,
|
||||
"components/settings/dashboard-layout-section.tsx :: DashboardLayoutSection": 620,
|
||||
"components/settings/environment-section.tsx :: EnvironmentSection": 666,
|
||||
"components/settings/import-panel/apple-health-import-card.tsx :: AppleHealthImportCard": 298,
|
||||
"components/settings/import-panel/csv-import-card.tsx :: CsvImportCard": 212,
|
||||
"components/settings/import-panel/dose-history-import-card.tsx :: DoseHistoryImportCard": 225,
|
||||
"components/settings/import-panel/health-connect-import-card.tsx :: HealthConnectImportCard": 293,
|
||||
"components/settings/import-panel/json-import-card.tsx :: JsonImportCard": 223,
|
||||
"components/settings/import-panel/record-csv-import-card.tsx :: RecordCsvImportSheet": 460,
|
||||
"components/settings/insights-pill-order-section.tsx :: InsightsPillOrderSection": 255,
|
||||
"components/settings/integrations/connections-panel.tsx :: ConnectionsPanel": 236,
|
||||
"components/settings/integrations/document-sources-card.tsx :: SourceForm": 306,
|
||||
"components/settings/integrations/google-health-card.tsx :: GoogleHealthCard": 300,
|
||||
"components/settings/integrations/integration-card.tsx :: IntegrationCard": 209,
|
||||
"components/settings/integrations/oauth-integration-card.tsx :: OAuthIntegrationCardView": 321,
|
||||
"components/settings/low-stock-card.tsx :: LowStockCard": 296,
|
||||
"components/settings/mcp-section.tsx :: McpTokensCard": 257,
|
||||
"components/settings/mood-reminder-card.tsx :: MoodReminderCard": 234,
|
||||
"components/settings/report-selection/selection-panel.tsx :: HealthRecordExportPanel": 370,
|
||||
"components/settings/score-section.tsx :: ScoreSection": 383,
|
||||
"components/settings/security-section/passkey-list-section.tsx :: PasskeyListSection": 410,
|
||||
"components/settings/security-section/security-keys-card.tsx :: SecurityKeysCard": 288,
|
||||
"components/settings/security-section/totp-card.tsx :: TotpCard": 533,
|
||||
"components/settings/security-sessions-card.tsx :: SecuritySessionsCard": 245,
|
||||
"components/settings/settings-shell.tsx :: SettingsShell": 254,
|
||||
"components/settings/share-link-create-form.tsx :: ShareLinkCreateForm": 451,
|
||||
"components/settings/sharing-section.tsx :: ShareLinksCard": 260,
|
||||
"components/settings/sources-section.tsx :: SourcesSection": 601,
|
||||
"components/settings/thresholds-editor-section.tsx :: MetricRow": 241,
|
||||
"components/settings/web-push-card.tsx :: WebPushCard": 215,
|
||||
"components/symptoms/symptom-entry-form.tsx :: SymptomEntryForm": 317,
|
||||
"components/symptoms/symptoms-section.tsx :: SymptomsSection": 205,
|
||||
"components/targets/range-bar.tsx :: RangeBar": 220,
|
||||
"components/targets/target-edit-sheet.tsx :: TargetEditSheetBody": 474,
|
||||
"components/timeline/life-event-form.tsx :: LifeEventForm": 281,
|
||||
"components/timeline/series-point-tips.tsx :: SeriesPointTips": 212,
|
||||
"components/timeline/timeline-chart.tsx :: ChartBody": 243,
|
||||
"components/timeline/timeline-chronicle.tsx :: TimelineChronicle": 274,
|
||||
"components/timeline/timeline-view.tsx :: TimelineView": 502,
|
||||
"components/ui/responsive-sheet.tsx :: ResponsiveSheet": 237,
|
||||
"components/vaccinations/catalog-picker.tsx :: CatalogPicker": 221,
|
||||
"components/vaccinations/custom-vaccine-sheet.tsx :: CustomVaccineSheet": 246,
|
||||
"components/vaccinations/vaccination-form.tsx :: VaccinationForm": 218,
|
||||
"components/workouts/manual-workout-form.tsx :: ManualWorkoutForm": 323,
|
||||
"lib/activity/calendar-math.ts :: buildActivityCalendar": 204,
|
||||
"lib/ai/anthropic-client.ts :: generateCompletion": 294,
|
||||
"lib/ai/coach/cycle-snapshot.ts :: buildCycleSnapshotBlock": 218,
|
||||
"lib/ai/coach/glp1-snapshot.ts :: buildGlp1SnapshotBlock": 218,
|
||||
"lib/ai/coach/snapshot.ts :: buildCoachSnapshotImpl": 898,
|
||||
"lib/ai/coach/tools/loop.ts :: runCoachToolLoop": 438,
|
||||
"lib/ai/coach/turn/model.ts :: runTurnModel": 560,
|
||||
"lib/ai/coach/turn/pipeline.ts :: runTurn": 274,
|
||||
"lib/ai/coach/turn/reply-guards.ts :: guardReply": 331,
|
||||
"lib/ai/codex-client.ts :: parseResponse": 302,
|
||||
"lib/ai/local-client.ts :: generateCompletionStream": 288,
|
||||
"lib/ai/openai-client.ts :: generateCompletion": 346,
|
||||
"lib/ai/safety/outbound-screen.ts :: buildDoseChangeClass": 275,
|
||||
"lib/analytics/bp-in-target-fast-path.ts :: computeFromRollups": 203,
|
||||
"lib/analytics/compliance/display.ts :: calculateCompliance": 212,
|
||||
"lib/analytics/correlations-fast-path.ts :: computeCorrelationHypothesesFastPath": 256,
|
||||
"lib/analytics/intraday-pulse-io.ts :: loadIntradayPulse": 206,
|
||||
"lib/analytics/score/reader.ts :: computeUserHealthScore": 324,
|
||||
"lib/analytics/summaries-slice.ts :: computeFromRollups": 441,
|
||||
"lib/api-handler.ts :: apiHandler": 207,
|
||||
"lib/api-handler.ts :: apiHandler > wrapped": 201,
|
||||
"lib/auth/profile-update.ts :: applyProfileUpdate": 353,
|
||||
"lib/cache/server-cache.ts :: createServerCaches": 230,
|
||||
"lib/cycle/backup.ts :: restoreCycleData": 243,
|
||||
"lib/cycle/day-log-write.ts :: writeDayLog": 311,
|
||||
"lib/daily/digest.ts :: buildDailyDigest": 227,
|
||||
"lib/daily/load-digest.ts :: loadDailyDigest": 452,
|
||||
"lib/dashboard/snapshot.ts :: buildDashboardSnapshot": 312,
|
||||
"lib/dashboard/snapshot.ts :: buildExtras": 240,
|
||||
"lib/day/records.ts :: medicationsPart": 306,
|
||||
"lib/doctor-report-pdf/clinical-records-notes-section.ts :: buildClinicalRecordsNotesSection": 648,
|
||||
"lib/doctor-report-pdf/measurements-charts-section.ts :: buildMeasurementsChartsSection": 398,
|
||||
"lib/doctor-report-pdf/medication-mood-wellness-section.ts :: buildMedicationMoodWellnessSection": 509,
|
||||
"lib/doctor-report/collect.ts :: collectDoctorReportData": 678,
|
||||
"lib/doctor-report/dense-buckets.ts :: loadDenseMeasurementBuckets": 210,
|
||||
"lib/documents/fenced-chat.ts :: streamFencedReply": 309,
|
||||
"lib/documents/ingest.ts :: ingestDocument": 272,
|
||||
"lib/export/backup-json-scan.ts :: scanBackupJson": 225,
|
||||
"lib/export/full-backup-payload.ts :: buildFullBackupPayload": 804,
|
||||
"lib/export/full-backup-payload.ts :: buildFullBackupPayload > medications.map(arg) #3": 268,
|
||||
"lib/export/profile-backup.ts :: buildProfileBackupSection": 270,
|
||||
"lib/export/profile-backup.ts :: restoreProfileData": 291,
|
||||
"lib/export/records-backup.ts :: buildRecordsBackupSection": 308,
|
||||
"lib/export/restore-backup.ts :: restoreBackup": 2833,
|
||||
"lib/export/restore-backup.ts :: restoreBackup > prisma.$transaction(arg)": 2163,
|
||||
"lib/export/vaccinations-backup.ts :: restoreVaccinationsData": 216,
|
||||
"lib/export/visits-backup.ts :: restoreVisitsData": 261,
|
||||
"lib/fhir/build-bundle.ts :: buildFhirDocumentBundle": 363,
|
||||
"lib/fitbit/sync-core.ts :: upsertFitbitMeasurements": 370,
|
||||
"lib/gamification/achievements-result.ts :: buildAchievementsResult": 586,
|
||||
"lib/google-health/client.ts :: forEachDataPointPage": 288,
|
||||
"lib/google-health/client.ts :: forEachDataPointPage > walk": 223,
|
||||
"lib/google-health/sync-core.ts :: upsertGoogleHealthMeasurements": 463,
|
||||
"lib/google-health/sync.ts :: runGoogleHealthSyncCycle": 203,
|
||||
"lib/illness/correlation.ts :: computeIllnessCorrelation": 233,
|
||||
"lib/import/labs-csv.ts :: importLabsCsv": 309,
|
||||
"lib/import/labs-csv.ts :: importLabsCsv > flush": 231,
|
||||
"lib/insights/biomarker-status.ts :: generateBiomarkerStatus": 290,
|
||||
"lib/insights/blood-pressure-status.ts :: prepareBloodPressureStatusForUser": 635,
|
||||
"lib/insights/bmi-status.ts :: prepareBmiStatusForUser": 387,
|
||||
"lib/insights/comprehensive-aggregator.ts :: buildFromRollups": 220,
|
||||
"lib/insights/comprehensive-generate.ts :: generateComprehensiveInsight": 872,
|
||||
"lib/insights/features.ts :: extractFeatures": 796,
|
||||
"lib/insights/general-status.ts :: prepareGeneralStatusForUser": 449,
|
||||
"lib/insights/medication-compliance-status.ts :: prepareMedicationComplianceStatusForUser": 485,
|
||||
"lib/insights/metric-status.ts :: generateMetricStatus": 477,
|
||||
"lib/insights/mood-aggregates.ts :: fetchMoodAggregates": 246,
|
||||
"lib/insights/mood-status.ts :: prepareMoodStatusForUser": 646,
|
||||
"lib/insights/pulse-status.ts :: preparePulseStatusForUser": 414,
|
||||
"lib/insights/status-provider.ts :: runStatusCompletion": 241,
|
||||
"lib/insights/weight-status.ts :: prepareWeightStatusForUser": 598,
|
||||
"lib/integrations/connection-health-load.ts :: loadConnectionFacts": 227,
|
||||
"lib/integrations/status.ts :: recordSyncFailure": 292,
|
||||
"lib/jobs/apple-health-import-worker.ts :: handleAppleHealthImport": 357,
|
||||
"lib/jobs/coach-nudge.ts :: findTriggerForUser": 279,
|
||||
"lib/jobs/coach-nudge.ts :: runCoachNudgeTick": 292,
|
||||
"lib/jobs/coach-reminder-sweep.ts :: runCoachReminderSweep": 222,
|
||||
"lib/jobs/cycle-reminder.ts :: runCycleReminderTick": 243,
|
||||
"lib/jobs/document-summary.ts :: runDocumentSummaryJob": 239,
|
||||
"lib/jobs/google-health-backfill.ts :: runGoogleHealthBackfillForUser": 276,
|
||||
"lib/jobs/insight-pregenerate.ts :: forceWarmUser": 282,
|
||||
"lib/jobs/insight-pregenerate.ts :: forceWarmUser > withFeatureCacheScope(arg)": 252,
|
||||
"lib/jobs/insight-pregenerate.ts :: runInsightPregenerate": 383,
|
||||
"lib/jobs/insight-pregenerate.ts :: runInsightPregenerate > pregenerateCandidate": 233,
|
||||
"lib/jobs/measurement-reminder.ts :: runMeasurementReminderTick": 286,
|
||||
"lib/jobs/medication-intake-import.ts :: processNextChunk": 220,
|
||||
"lib/jobs/medication-intake-import.ts :: processNextChunk > client.$transaction(arg)": 212,
|
||||
"lib/jobs/medication-low-stock.ts :: runMedicationLowStockTick": 286,
|
||||
"lib/jobs/oura-backfill.ts :: runOuraBackfillForUser": 236,
|
||||
"lib/jobs/reaction-line.ts :: runReactionLine": 337,
|
||||
"lib/jobs/reminder/medication-reminder-check.ts :: handleReminderCheck": 619,
|
||||
"lib/jobs/reminder/medication-reminder-check.ts :: handleReminderCheck > withBackgroundEvent(arg)": 614,
|
||||
"lib/jobs/reminder/register-integration-sync.ts :: enqueueIntegrationSyncBootDiscovery": 224,
|
||||
"lib/jobs/reminder/register-integration-sync.ts :: registerIntegrationSyncQueues": 320,
|
||||
"lib/jobs/reminder/register-maintenance.ts :: enqueueMaintenanceBootDiscovery": 232,
|
||||
"lib/jobs/reminder/register-maintenance.ts :: registerMaintenanceQueues": 997,
|
||||
"lib/jobs/reminder/register-rollup.ts :: enqueueRollupBootDiscovery": 238,
|
||||
"lib/jobs/reminder/register-rollup.ts :: registerRollupQueues": 616,
|
||||
"lib/jobs/reminder/register-status.ts :: registerStatusQueues": 542,
|
||||
"lib/jobs/workout-insight-generate.ts :: runWorkoutInsightGenerate": 324,
|
||||
"lib/labs/biomarker-merge.ts :: runMerge": 254,
|
||||
"lib/labs/ocr-extract.ts :: runOcrExtraction": 207,
|
||||
"lib/labs/ocr-run.ts :: executeOcrExtraction": 206,
|
||||
"lib/mcp/tools.ts :: searchAndFetchTools": 421,
|
||||
"lib/mcp/tools.ts :: searchAndFetchTools > run": 205,
|
||||
"lib/measurements/consolidate-daily-mean.ts :: consolidateDailyMean": 278,
|
||||
"lib/measurements/consolidate-legacy-steps.ts :: consolidateLegacySteps": 263,
|
||||
"lib/measurements/dense-intraday-retention.ts :: runDenseIntradayRetention": 537,
|
||||
"lib/measurements/dense-intraday-retention.ts :: runDenseIntradayRetention > walkSource": 447,
|
||||
"lib/measurements/dense-intraday-retention.ts :: runDenseIntradayRetention > walkSource > writeDay": 373,
|
||||
"lib/measurements/dense-intraday-retention.ts :: runDenseIntradayRetention > walkSource > writeDay > foldOnce": 212,
|
||||
"lib/measurements/drain-per-sample-cumulative.ts :: drainPerSampleCumulative": 344,
|
||||
"lib/measurements/drain-per-sample-cumulative.ts :: drainPerSampleCumulative > writeDay": 205,
|
||||
"lib/measurements/import-apple-health-export.ts :: streamParseExportXml": 1256,
|
||||
"lib/measurements/import-apple-health-export.ts :: streamParseExportXml > (anonymous) #2": 323,
|
||||
"lib/medications/efficacy/build-efficacy.ts :: buildMedicationEfficacy": 268,
|
||||
"lib/medications/intake-slot-dedup.ts :: dedupeUserIntakeSlots": 321,
|
||||
"lib/medications/list-read.ts :: buildMedicationsList": 310,
|
||||
"lib/medications/scheduling/dose-history.ts :: reconstructDoseHistory": 218,
|
||||
"lib/multipart/stream-to-disk.ts :: streamMultipartToDisk": 272,
|
||||
"lib/notifications/dispatcher.ts :: dispatchNotification": 378,
|
||||
"lib/notifications/senders/apns.ts :: sendViaApns": 299,
|
||||
"lib/notifications/senders/web-push.ts :: sendViaWebPush": 268,
|
||||
"lib/personal-records/pr-detection-worker.ts :: detectPersonalRecordsForUser": 239,
|
||||
"lib/personal-records/pr-direction.ts :: getPRDirection": 202,
|
||||
"lib/record-activity/activity-verb.ts :: recordActivityVerbLine": 395,
|
||||
"lib/strava/sync.ts :: runStravaSync": 219,
|
||||
"lib/support/report.ts :: collectSupportReportFacts": 332,
|
||||
"lib/targets/build-response.ts :: buildTargetsResponse": 330,
|
||||
"lib/targets/vitals-builder.ts :: buildVitalTargets": 324,
|
||||
"lib/telegram-webhook-handlers.ts :: handleCallback": 599,
|
||||
"lib/telegram-webhook-handlers.ts :: handleTextMessage": 337,
|
||||
"lib/withings/sync-activity.ts :: syncUserActivity": 391,
|
||||
"lib/withings/sync-ecg.ts :: syncUserEcg": 213,
|
||||
"lib/withings/sync-sleep.ts :: syncUserSleep": 429,
|
||||
"lib/withings/sync.ts :: syncUserMeasurements": 373,
|
||||
"proxy.ts :: proxy": 499
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,577 @@
|
||||
{
|
||||
"$comment": "as never casts in tests, per test file under src/. Maintained by src/__tests__/test-realism-ratchet.test.ts.",
|
||||
"count": 570,
|
||||
"total": 6014,
|
||||
"entries": {
|
||||
"__tests__/api/auth/login/mfa-branch.test.ts": 10,
|
||||
"__tests__/api/auth/mfa/verify.test.ts": 9,
|
||||
"__tests__/api/auth/registration-status/route.test.ts": 4,
|
||||
"__tests__/derived-wellness-value-contract.test.ts": 2,
|
||||
"__tests__/notification-delivery-identity.test.ts": 13,
|
||||
"__tests__/profile-email-rate-limit-contract.test.ts": 3,
|
||||
"__tests__/record-write-rate-limit-contract.test.ts": 3,
|
||||
"__tests__/shared-record-navigation.test.tsx": 2,
|
||||
"__tests__/sharing-legacy-client-contract.test.ts": 2,
|
||||
"__tests__/tz-day-paths-harness.test.ts": 12,
|
||||
"app/api/account/grants/__tests__/invite-access-level.test.ts": 2,
|
||||
"app/api/account/grants/__tests__/invite-recent-proof.test.ts": 4,
|
||||
"app/api/account/grants/__tests__/invite-scope-and-manage.test.ts": 2,
|
||||
"app/api/admin/ai-settings/__tests__/route.test.ts": 9,
|
||||
"app/api/admin/app-logs/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/audit-log/__tests__/route.test.ts": 1,
|
||||
"app/api/admin/audit-log/actions/__tests__/route.test.ts": 2,
|
||||
"app/api/admin/import-apple-health-export/__tests__/route.test.ts": 5,
|
||||
"app/api/admin/maintenance/measurements/__tests__/status.test.ts": 11,
|
||||
"app/api/admin/maintenance/pulse-day-mean/__tests__/route.test.ts": 7,
|
||||
"app/api/admin/notifications/diagnostic/__tests__/route.test.ts": 15,
|
||||
"app/api/admin/notifications/health/__tests__/route.test.ts": 5,
|
||||
"app/api/admin/notifications/reminder-check/__tests__/route.test.ts": 4,
|
||||
"app/api/admin/notifications/test/__tests__/route.test.ts": 15,
|
||||
"app/api/admin/provider-health/__tests__/route.test.ts": 29,
|
||||
"app/api/admin/settings/__tests__/route.test.ts": 12,
|
||||
"app/api/admin/settings/assistant-flags/__tests__/route.test.ts": 21,
|
||||
"app/api/admin/settings/module-availability/__tests__/route.test.ts": 13,
|
||||
"app/api/admin/settings/web-push-vapid/generate/__tests__/route.test.ts": 4,
|
||||
"app/api/admin/status/__tests__/route.test.ts": 3,
|
||||
"app/api/admin/users/__tests__/route.test.ts": 3,
|
||||
"app/api/admin/users/[id]/__tests__/route.test.ts": 8,
|
||||
"app/api/ai/test/__tests__/route.test.ts": 26,
|
||||
"app/api/analytics/__tests__/route.test.ts": 25,
|
||||
"app/api/auth/claim/__tests__/route.test.ts": 13,
|
||||
"app/api/auth/login/__tests__/constant-work.test.ts": 4,
|
||||
"app/api/auth/login/__tests__/native-token.test.ts": 8,
|
||||
"app/api/auth/login/__tests__/route.test.ts": 5,
|
||||
"app/api/auth/login/__tests__/trusted-device.test.ts": 2,
|
||||
"app/api/auth/me/ai-usage/__tests__/route.test.ts": 3,
|
||||
"app/api/auth/me/coach-prefs/__tests__/route.test.ts": 9,
|
||||
"app/api/auth/me/devices/__tests__/route.test.ts": 8,
|
||||
"app/api/auth/me/devices/[id]/__tests__/route.test.ts": 13,
|
||||
"app/api/auth/me/diabetes/__tests__/route.test.ts": 13,
|
||||
"app/api/auth/me/disable-coach/__tests__/route.test.ts": 19,
|
||||
"app/api/auth/me/disable-coach/__tests__/unknown-key-strict.test.ts": 2,
|
||||
"app/api/auth/me/documents-auto-ai-read/__tests__/route.test.ts": 5,
|
||||
"app/api/auth/me/glucose-unit/__tests__/route.test.ts": 19,
|
||||
"app/api/auth/me/health-score-config/__tests__/route.test.ts": 25,
|
||||
"app/api/auth/me/mfa/disable/__tests__/route.test.ts": 7,
|
||||
"app/api/auth/me/mfa/webauthn/register/__tests__/route.test.ts": 8,
|
||||
"app/api/auth/me/modules/__tests__/route.test.ts": 29,
|
||||
"app/api/auth/me/notification-prefs/__tests__/route.test.ts": 44,
|
||||
"app/api/auth/me/security-activity/__tests__/route.test.ts": 2,
|
||||
"app/api/auth/me/sessions/__tests__/route.test.ts": 13,
|
||||
"app/api/auth/me/source-priority/__tests__/route.test.ts": 11,
|
||||
"app/api/auth/me/timezone/__tests__/route.test.ts": 15,
|
||||
"app/api/auth/me/unit-preference/__tests__/route.test.ts": 19,
|
||||
"app/api/auth/me/workout-routes/__tests__/route.test.ts": 3,
|
||||
"app/api/auth/mfa/webauthn/verify/__tests__/route.test.ts": 11,
|
||||
"app/api/auth/native/complete/__tests__/route.test.ts": 2,
|
||||
"app/api/auth/native/login/__tests__/route.test.ts": 2,
|
||||
"app/api/auth/native/token/__tests__/route.test.ts": 12,
|
||||
"app/api/auth/oidc/callback/__tests__/route.test.ts": 18,
|
||||
"app/api/auth/oidc/login/__tests__/route.test.ts": 4,
|
||||
"app/api/auth/oidc/native/token/__tests__/route.test.ts": 11,
|
||||
"app/api/auth/passkey/login-options/__tests__/oidc-only.test.ts": 2,
|
||||
"app/api/auth/passkey/login-verify/__tests__/native-token.test.ts": 7,
|
||||
"app/api/auth/passkey/login-verify/__tests__/oidc-only.test.ts": 4,
|
||||
"app/api/auth/passkey/login-verify/__tests__/refusals.test.ts": 6,
|
||||
"app/api/auth/passkeys/__tests__/route.test.ts": 3,
|
||||
"app/api/auth/passkeys/[id]/__tests__/route.test.ts": 17,
|
||||
"app/api/auth/password/__tests__/route.test.ts": 5,
|
||||
"app/api/auth/register/__tests__/route.test.ts": 25,
|
||||
"app/api/biomarkers/__tests__/error-contract.test.ts": 3,
|
||||
"app/api/biomarkers/[id]/__tests__/delete-record-auth.test.ts": 3,
|
||||
"app/api/biomarkers/[id]/__tests__/route.test.ts": 23,
|
||||
"app/api/coach/plans/__tests__/route.test.ts": 23,
|
||||
"app/api/coach/reminders/__tests__/route.test.ts": 15,
|
||||
"app/api/coach/suggested-actions/__tests__/route.test.ts": 7,
|
||||
"app/api/consent/ai/__tests__/route.test.ts": 10,
|
||||
"app/api/consent/ai/latest/__tests__/route.test.ts": 42,
|
||||
"app/api/consent/ai/web/__tests__/route.test.ts": 6,
|
||||
"app/api/custom-metrics/__tests__/route.test.ts": 14,
|
||||
"app/api/custom-metrics/[id]/__tests__/route.test.ts": 23,
|
||||
"app/api/custom-metrics/[id]/entries/__tests__/note-encryption.test.ts": 13,
|
||||
"app/api/custom-metrics/[id]/entries/__tests__/route.test.ts": 12,
|
||||
"app/api/custom-metrics/[id]/entries/__tests__/soft-delete-restore.test.ts": 6,
|
||||
"app/api/cycle/__tests__/external-id-floor.test.ts": 9,
|
||||
"app/api/cycle/calendar/__tests__/day-entries.test.ts": 9,
|
||||
"app/api/cycle/calendar/__tests__/verdict-round-trip.test.ts": 26,
|
||||
"app/api/cycle/day-logs/bulk/__tests__/route.test.ts": 6,
|
||||
"app/api/cycle/symptoms/custom/__tests__/custom-crud.test.ts": 4,
|
||||
"app/api/daily/digest/__tests__/route.test.ts": 2,
|
||||
"app/api/daily/digest/dismiss/__tests__/route.test.ts": 2,
|
||||
"app/api/dashboard/chart-overlay-prefs/__tests__/route.test.ts": 2,
|
||||
"app/api/dashboard/snapshot/__tests__/route.test.ts": 5,
|
||||
"app/api/dashboard/summary/__tests__/module-gate.test.ts": 6,
|
||||
"app/api/dashboard/summary/__tests__/route.test.ts": 86,
|
||||
"app/api/dashboard/widgets/__tests__/route.test.ts": 49,
|
||||
"app/api/devices/__tests__/route.test.ts": 32,
|
||||
"app/api/devices/[id]/__tests__/route.test.ts": 10,
|
||||
"app/api/documents/inbound/__tests__/route.test.ts": 62,
|
||||
"app/api/documents/inbound/[id]/__tests__/route.test.ts": 56,
|
||||
"app/api/documents/inbound/[id]/chat/__tests__/route.test.ts": 42,
|
||||
"app/api/documents/inbound/[id]/extract/__tests__/route.test.ts": 38,
|
||||
"app/api/documents/inbound/[id]/index/__tests__/route.test.ts": 40,
|
||||
"app/api/documents/inbound/[id]/original/__tests__/route.test.ts": 7,
|
||||
"app/api/documents/inbound/[id]/suggest/__tests__/route.test.ts": 12,
|
||||
"app/api/documents/inbound/[id]/summary/__tests__/route.test.ts": 31,
|
||||
"app/api/documents/inbound/[id]/thumbnail/__tests__/route.test.ts": 5,
|
||||
"app/api/documents/inbound/layout/__tests__/route.test.ts": 11,
|
||||
"app/api/documents/inbound/reindex/__tests__/route.test.ts": 9,
|
||||
"app/api/export/__tests__/measurement-streaming.test.ts": 9,
|
||||
"app/api/export/__tests__/per-type-routes.test.ts": 100,
|
||||
"app/api/export/__tests__/soft-delete-filter.test.ts": 39,
|
||||
"app/api/export/encrypted/__tests__/route.test.ts": 20,
|
||||
"app/api/export/health-record/__tests__/route.test.ts": 32,
|
||||
"app/api/feature-flags/__tests__/route.test.ts": 6,
|
||||
"app/api/fhir/__tests__/capability-and-everything.test.ts": 4,
|
||||
"app/api/fhir/__tests__/module-gate.test.ts": 6,
|
||||
"app/api/fhir/__tests__/observation-series.test.ts": 8,
|
||||
"app/api/fhir/__tests__/route.test.ts": 9,
|
||||
"app/api/fitbit/connect/__tests__/route.test.ts": 4,
|
||||
"app/api/gamification/achievements/__tests__/hidden-redaction.test.ts": 12,
|
||||
"app/api/gamification/achievements/__tests__/ios-format.test.ts": 13,
|
||||
"app/api/gamification/achievements/__tests__/module-gate.test.ts": 17,
|
||||
"app/api/gamification/achievements/__tests__/writes-nothing.test.ts": 1,
|
||||
"app/api/google-health/credentials/__tests__/route.test.ts": 1,
|
||||
"app/api/google-health/sync/__tests__/route.test.ts": 3,
|
||||
"app/api/google-health/sync/status/__tests__/route.test.ts": 1,
|
||||
"app/api/illness/episodes/[id]/__tests__/body-site.test.ts": 9,
|
||||
"app/api/illness/episodes/[id]/day-logs/__tests__/route.test.ts": 8,
|
||||
"app/api/illness/episodes/[id]/restore/__tests__/route.test.ts": 9,
|
||||
"app/api/import/__tests__/route.test.ts": 47,
|
||||
"app/api/import/apple-health-export/__tests__/route.test.ts": 8,
|
||||
"app/api/import/apple-health-export/[jobId]/status/__tests__/route.test.ts": 4,
|
||||
"app/api/import/csv/__tests__/route.test.ts": 4,
|
||||
"app/api/import/health-connect-export/__tests__/route.test.ts": 2,
|
||||
"app/api/ingest/medication/__tests__/route.test.ts": 28,
|
||||
"app/api/insights/biomarker-assessment/__tests__/route.test.ts": 6,
|
||||
"app/api/insights/blood-pressure-status/__tests__/route.test.ts": 3,
|
||||
"app/api/insights/cards/__tests__/route.test.ts": 18,
|
||||
"app/api/insights/chat/[id]/attachments/__tests__/route.test.ts": 23,
|
||||
"app/api/insights/chat/fenced/__tests__/route.test.ts": 18,
|
||||
"app/api/insights/coach/facts/__tests__/route-memory.test.ts": 9,
|
||||
"app/api/insights/coach/facts/__tests__/route.test.ts": 12,
|
||||
"app/api/insights/comprehensive/__tests__/route.test.ts": 20,
|
||||
"app/api/insights/correlations/__tests__/route.test.ts": 12,
|
||||
"app/api/insights/derived/__tests__/route.test.ts": 12,
|
||||
"app/api/insights/derived/batch/__tests__/route.test.ts": 21,
|
||||
"app/api/insights/ecg/__tests__/route.test.ts": 5,
|
||||
"app/api/insights/ecg/[id]/__tests__/route.test.ts": 5,
|
||||
"app/api/insights/generate/__tests__/route.test.ts": 54,
|
||||
"app/api/insights/layout/__tests__/route.test.ts": 23,
|
||||
"app/api/insights/metric-status/__tests__/route.test.ts": 7,
|
||||
"app/api/insights/mood-status/__tests__/route.test.ts": 10,
|
||||
"app/api/insights/patterns/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/patterns/[id]/__tests__/route.test.ts": 4,
|
||||
"app/api/insights/pregenerate/__tests__/route.test.ts": 4,
|
||||
"app/api/insights/provider-chain/__tests__/put.test.ts": 4,
|
||||
"app/api/insights/provider-chain/__tests__/route.test.ts": 13,
|
||||
"app/api/insights/rhythm-events/__tests__/route.test.ts": 5,
|
||||
"app/api/insights/targets/__tests__/route.test.ts": 1,
|
||||
"app/api/integrations/fitbit/test/__tests__/route.test.ts": 18,
|
||||
"app/api/integrations/healthkit/__tests__/route.test.ts": 48,
|
||||
"app/api/integrations/status/__tests__/route.test.ts": 1,
|
||||
"app/api/integrations/whoop/test/__tests__/route.test.ts": 15,
|
||||
"app/api/integrations/withings/resume/__tests__/route.test.ts": 2,
|
||||
"app/api/integrations/withings/test/__tests__/route.test.ts": 9,
|
||||
"app/api/internal/deploy-webhook/__tests__/route.test.ts": 9,
|
||||
"app/api/labs/__tests__/error-contract.test.ts": 4,
|
||||
"app/api/labs/ocr/commit/__tests__/route.test.ts": 9,
|
||||
"app/api/labs/ocr/extract/__tests__/route.test.ts": 17,
|
||||
"app/api/labs/restore/__tests__/route.test.ts": 5,
|
||||
"app/api/mcp/oauth/__tests__/authorize.test.ts": 29,
|
||||
"app/api/mcp/oauth/__tests__/register.test.ts": 8,
|
||||
"app/api/mcp/oauth/__tests__/token.test.ts": 14,
|
||||
"app/api/mcp/tokens/__tests__/route.test.ts": 3,
|
||||
"app/api/measurement-categories/__tests__/route.test.ts": 3,
|
||||
"app/api/measurements/__tests__/arrival-wiring.test.ts": 7,
|
||||
"app/api/measurements/__tests__/group-by-day.test.ts": 10,
|
||||
"app/api/measurements/__tests__/put-duplicate-timestamp.test.ts": 9,
|
||||
"app/api/measurements/__tests__/range-aggregation-route.test.ts": 10,
|
||||
"app/api/measurements/__tests__/zod-multi-issue.test.ts": 2,
|
||||
"app/api/measurements/[id]/__tests__/route.test.ts": 8,
|
||||
"app/api/measurements/batch/__tests__/aggregated-hr-wire.test.ts": 9,
|
||||
"app/api/measurements/batch/__tests__/duplicate-prefilter.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/hr-bucket-observability.test.ts": 3,
|
||||
"app/api/measurements/batch/__tests__/insert-returning-arrivals.test.ts": 2,
|
||||
"app/api/measurements/batch/__tests__/issue-paths.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/pr-detection-hook.test.ts": 3,
|
||||
"app/api/measurements/batch/__tests__/refusal-detail.test.ts": 1,
|
||||
"app/api/measurements/batch/__tests__/sync-trigger.test.ts": 6,
|
||||
"app/api/measurements/batch/__tests__/timestamp-plausibility.test.ts": 2,
|
||||
"app/api/measurements/batch/__tests__/unstable-external-id.test.ts": 2,
|
||||
"app/api/measurements/bulk-delete/__tests__/route.test.ts": 10,
|
||||
"app/api/measurements/by-external-ids/__tests__/route.test.ts": 6,
|
||||
"app/api/measurements/restore/__tests__/route.test.ts": 10,
|
||||
"app/api/measurements/series-batch/__tests__/route.test.ts": 10,
|
||||
"app/api/measurements/series/__tests__/route.test.ts": 96,
|
||||
"app/api/measurements/series/__tests__/unknown-query-param-open.test.ts": 6,
|
||||
"app/api/medications/__tests__/route.test.ts": 43,
|
||||
"app/api/medications/[id]/__tests__/route.test.ts": 52,
|
||||
"app/api/medications/[id]/cadence/__tests__/route.test.ts": 12,
|
||||
"app/api/medications/[id]/compliance/__tests__/route.test.ts": 18,
|
||||
"app/api/medications/[id]/dose-history/__tests__/route.test.ts": 15,
|
||||
"app/api/medications/[id]/glp1/__tests__/route.test.ts": 47,
|
||||
"app/api/medications/[id]/intake/__tests__/route.test.ts": 45,
|
||||
"app/api/medications/[id]/intake/__tests__/source-provenance.test.ts": 12,
|
||||
"app/api/medications/[id]/intake/[eventId]/__tests__/route.test.ts": 63,
|
||||
"app/api/medications/[id]/intake/bulk-delete/__tests__/route.test.ts": 13,
|
||||
"app/api/medications/[id]/intake/import/__tests__/route.test.ts": 9,
|
||||
"app/api/medications/[id]/intake/import/[jobId]/status/__tests__/route.test.ts": 2,
|
||||
"app/api/medications/[id]/intake/purge/__tests__/route.test.ts": 4,
|
||||
"app/api/medications/[id]/inventory/__tests__/route.test.ts": 45,
|
||||
"app/api/medications/[id]/inventory/[itemId]/__tests__/route.test.ts": 12,
|
||||
"app/api/medications/[id]/phase-config/__tests__/route.test.ts": 2,
|
||||
"app/api/medications/[id]/schedule-revisions/__tests__/route.test.ts": 24,
|
||||
"app/api/medications/[id]/side-effects/__tests__/route.test.ts": 32,
|
||||
"app/api/medications/compliance/__tests__/route.test.ts": 10,
|
||||
"app/api/medications/extract/__tests__/route.test.ts": 38,
|
||||
"app/api/medications/intake/__tests__/route.test.ts": 59,
|
||||
"app/api/medications/intake/bulk/__tests__/dose-arrival-scope.test.ts": 9,
|
||||
"app/api/medications/intake/bulk/__tests__/route.test.ts": 68,
|
||||
"app/api/medications/intake/dose-history-import/__tests__/route.test.ts": 7,
|
||||
"app/api/medications/layout/__tests__/route.test.ts": 17,
|
||||
"app/api/mental-health/assessments/__tests__/route.test.ts": 12,
|
||||
"app/api/mental-health/assessments/[id]/__tests__/route.test.ts": 7,
|
||||
"app/api/meta/capabilities/__tests__/route.test.ts": 1,
|
||||
"app/api/monitoring/glitchtip/__tests__/route.test.ts": 2,
|
||||
"app/api/monitoring/umami-script/__tests__/route.test.ts": 2,
|
||||
"app/api/monitoring/umami/[...path]/__tests__/route.test.ts": 4,
|
||||
"app/api/mood-entries/__tests__/route.test.ts": 6,
|
||||
"app/api/mood-entries/[id]/__tests__/route.test.ts": 8,
|
||||
"app/api/mood-entries/bulk-delete/__tests__/route.test.ts": 10,
|
||||
"app/api/mood-entries/bulk/__tests__/route.test.ts": 17,
|
||||
"app/api/mood-entries/restore/__tests__/route.test.ts": 11,
|
||||
"app/api/mood/analytics/__tests__/route.test.ts": 15,
|
||||
"app/api/mood/insights/__tests__/route.test.ts": 3,
|
||||
"app/api/mood/tags/__tests__/custom-crud.test.ts": 2,
|
||||
"app/api/mood/tags/__tests__/groups-crud.test.ts": 1,
|
||||
"app/api/mood/tags/__tests__/layout.test.ts": 1,
|
||||
"app/api/mood/tags/__tests__/route.test.ts": 1,
|
||||
"app/api/mood/tags/layout/__tests__/route.test.ts": 11,
|
||||
"app/api/nightscout/sync/__tests__/route.test.ts": 3,
|
||||
"app/api/notifications/action/[token]/__tests__/route.test.ts": 5,
|
||||
"app/api/notifications/status/__tests__/route.test.ts": 4,
|
||||
"app/api/notifications/web-push/__tests__/route.test.ts": 5,
|
||||
"app/api/notifications/web-push/test/__tests__/route.test.ts": 9,
|
||||
"app/api/nutrients/__tests__/route.test.ts": 5,
|
||||
"app/api/nutrients/batch/__tests__/route.test.ts": 11,
|
||||
"app/api/nutrients/daily/__tests__/route.test.ts": 7,
|
||||
"app/api/nutrients/water/__tests__/route.test.ts": 8,
|
||||
"app/api/onboarding/__tests__/error-contract.test.ts": 1,
|
||||
"app/api/onboarding/complete/__tests__/route.test.ts": 4,
|
||||
"app/api/oura/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/oura/sync/__tests__/route.test.ts": 3,
|
||||
"app/api/personal-records/__tests__/route.test.ts": 15,
|
||||
"app/api/polar/callback/__tests__/route.test.ts": 1,
|
||||
"app/api/polar/sync/__tests__/route.test.ts": 3,
|
||||
"app/api/settings/__tests__/channel-enabled-routes.test.ts": 14,
|
||||
"app/api/settings/__tests__/channel-global-switch-refusal.test.ts": 15,
|
||||
"app/api/settings/__tests__/email-test-route.test.ts": 2,
|
||||
"app/api/settings/__tests__/private-origin-routes.test.ts": 4,
|
||||
"app/api/settings/__tests__/telegram-test-locale.test.ts": 9,
|
||||
"app/api/settings/__tests__/webhook-format-route.test.ts": 4,
|
||||
"app/api/settings/reminder-thresholds/__tests__/route.test.ts": 7,
|
||||
"app/api/settings/webhook/test/__tests__/route.test.ts": 2,
|
||||
"app/api/share-links/__tests__/route.test.ts": 19,
|
||||
"app/api/sleep/night/__tests__/route.test.ts": 24,
|
||||
"app/api/sleep/rhythm/__tests__/route.test.ts": 6,
|
||||
"app/api/strava/sync/__tests__/route.test.ts": 3,
|
||||
"app/api/sync/changes/__tests__/module-gate.test.ts": 7,
|
||||
"app/api/sync/state/__tests__/route.test.ts": 8,
|
||||
"app/api/telegram/webhook/__tests__/route.test.ts": 43,
|
||||
"app/api/tokens/__tests__/route.test.ts": 5,
|
||||
"app/api/tokens/documents/__tests__/route.test.ts": 25,
|
||||
"app/api/tokens/measurements/__tests__/route.test.ts": 25,
|
||||
"app/api/tokens/workouts/__tests__/route.test.ts": 25,
|
||||
"app/api/user/ai-provider/__tests__/legacy-private-host.test.ts": 2,
|
||||
"app/api/user/ai-provider/__tests__/route.test.ts": 12,
|
||||
"app/api/user/avatar/__tests__/route.test.ts": 13,
|
||||
"app/api/user/avatar/[id]/__tests__/route.test.ts": 5,
|
||||
"app/api/user/profile/__tests__/route.test.ts": 29,
|
||||
"app/api/user/thresholds/__tests__/route.test.ts": 7,
|
||||
"app/api/whoop/callback/__tests__/route.test.ts": 2,
|
||||
"app/api/whoop/webhook/[token]/__tests__/route.test.ts": 5,
|
||||
"app/api/withings/callback/__tests__/route.test.ts": 9,
|
||||
"app/api/withings/connect/__tests__/route.test.ts": 4,
|
||||
"app/api/withings/credentials/__tests__/route.test.ts": 4,
|
||||
"app/api/withings/webhook/__tests__/route.test.ts": 26,
|
||||
"app/api/withings/webhook/[token]/__tests__/route.test.ts": 8,
|
||||
"app/api/workouts/__tests__/batch-create.test.ts": 14,
|
||||
"app/api/workouts/__tests__/batch-scope.test.ts": 10,
|
||||
"app/api/workouts/__tests__/canonical-dedup.test.ts": 20,
|
||||
"app/api/workouts/__tests__/delete.test.ts": 7,
|
||||
"app/api/workouts/__tests__/detail.test.ts": 36,
|
||||
"app/api/workouts/batch/__tests__/unstable-external-id.test.ts": 4,
|
||||
"app/c/[token]/__tests__/report-download.test.ts": 11,
|
||||
"app/c/[token]/d/[id]/__tests__/route.test.ts": 8,
|
||||
"app/mcp/__tests__/route.test.ts": 1,
|
||||
"components/day/__tests__/day-view.test.tsx": 1,
|
||||
"components/documents/__tests__/document-record-links.test.tsx": 1,
|
||||
"components/insights/__tests__/coincident-deviation-card.test.tsx": 1,
|
||||
"components/insights/coach-panel/__tests__/chat-bubble-memo.test.tsx": 1,
|
||||
"components/insights/coach-panel/__tests__/message-thread.test.tsx": 1,
|
||||
"components/insights/coach-panel/__tests__/open-at-end.test.ts": 1,
|
||||
"components/insights/coach-panel/__tests__/result-chart-compare.test.tsx": 2,
|
||||
"components/insights/coach-panel/__tests__/turn-activity.test.tsx": 1,
|
||||
"components/links/__tests__/vault-document-options.test.ts": 1,
|
||||
"components/measurements/__tests__/measurement-list-url-sync.test.tsx": 1,
|
||||
"components/medications/__tests__/side-effects-section.test.tsx": 3,
|
||||
"components/medications/__tests__/use-medication-intake.test.ts": 1,
|
||||
"components/medications/detail/efficacy/__tests__/change-at-start-summary.test.tsx": 1,
|
||||
"components/mood/__tests__/mood-list-url-sync.test.tsx": 1,
|
||||
"components/settings/__tests__/settings-shell.test.tsx": 1,
|
||||
"components/settings/integrations/__tests__/dawarich-card.test.tsx": 1,
|
||||
"components/timeline/__tests__/medication-rows.test.ts": 1,
|
||||
"lib/__tests__/acting-account-resolver.test.ts": 5,
|
||||
"lib/__tests__/auth-error-codes.test.ts": 7,
|
||||
"lib/__tests__/db.test.ts": 2,
|
||||
"lib/__tests__/doctor-report-data.test.ts": 2,
|
||||
"lib/__tests__/doctor-report-module-backstop.test.ts": 3,
|
||||
"lib/__tests__/doctor-report-recovery-canonical.test.ts": 1,
|
||||
"lib/__tests__/idempotency.test.ts": 29,
|
||||
"lib/__tests__/rate-limit-auth-surface.test.ts": 3,
|
||||
"lib/__tests__/require-auth-bearer.test.ts": 20,
|
||||
"lib/__tests__/require-fresh-mfa-if-enrolled.test.ts": 11,
|
||||
"lib/__tests__/require-fresh-mfa-or-elevation-if-enrolled.test.ts": 15,
|
||||
"lib/__tests__/require-fresh-mfa.test.ts": 32,
|
||||
"lib/__tests__/require-recent-proof.test.ts": 16,
|
||||
"lib/__tests__/require-record-auth-scope.test.ts": 8,
|
||||
"lib/ai/__tests__/briefing-grounding.test.ts": 9,
|
||||
"lib/ai/__tests__/codex-oauth.test.ts": 5,
|
||||
"lib/ai/__tests__/openai-compatible-provider.test.ts": 2,
|
||||
"lib/ai/__tests__/provider-admin-host.test.ts": 2,
|
||||
"lib/ai/__tests__/provider-health-ledger.test.ts": 5,
|
||||
"lib/ai/__tests__/provider-legacy-private-host.test.ts": 3,
|
||||
"lib/ai/__tests__/provider-presence.test.ts": 2,
|
||||
"lib/ai/__tests__/provider-reasoning-effort.test.ts": 5,
|
||||
"lib/ai/__tests__/provider-response-timeout.test.ts": 2,
|
||||
"lib/ai/__tests__/provider.test.ts": 35,
|
||||
"lib/ai/__tests__/resolve-chain.test.ts": 12,
|
||||
"lib/ai/__tests__/server-provider-health.test.ts": 1,
|
||||
"lib/ai/capabilities/__tests__/egress.test.ts": 1,
|
||||
"lib/ai/capabilities/__tests__/gate.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/budget.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/coach-memory-refresh-worker.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/context-reminders.test.ts": 5,
|
||||
"lib/ai/coach/__tests__/conversation-summary.test.ts": 2,
|
||||
"lib/ai/coach/__tests__/facts-deterministic.test.ts": 3,
|
||||
"lib/ai/coach/__tests__/persistence-trail.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/plans.test.ts": 6,
|
||||
"lib/ai/coach/__tests__/reminders.test.ts": 2,
|
||||
"lib/ai/coach/__tests__/series-long-window.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/suggest-gate.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/tools-executor.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/tools-inventory.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/tools-loop.test.ts": 1,
|
||||
"lib/ai/coach/results/__tests__/project.test.ts": 2,
|
||||
"lib/ai/coach/snapshot-blocks/__tests__/core-metrics-pulse-day.test.ts": 2,
|
||||
"lib/ai/coach/turn/__tests__/ledger-reasoning.test.ts": 2,
|
||||
"lib/ai/coach/turn/__tests__/model-stable-prefix.test.ts": 2,
|
||||
"lib/ai/prompts/__tests__/output-language-adoption.test.ts": 1,
|
||||
"lib/ai/safety/__tests__/outbound-screen-guard2.test.ts": 1,
|
||||
"lib/analytics/__tests__/mood-series.test.ts": 5,
|
||||
"lib/analytics/__tests__/sleep-stage-composition.test.ts": 2,
|
||||
"lib/analytics/score/__tests__/config-change-is-not-a-health-event.test.ts": 1,
|
||||
"lib/analytics/score/__tests__/record.test.ts": 2,
|
||||
"lib/apple-health/__tests__/route-import.test.ts": 4,
|
||||
"lib/arrivals/__tests__/reaction-line-shared.test.ts": 1,
|
||||
"lib/auth/__tests__/audit.test.ts": 2,
|
||||
"lib/auth/__tests__/bearer.test.ts": 16,
|
||||
"lib/auth/__tests__/enrollment-proof-second-factor.test.ts": 12,
|
||||
"lib/auth/__tests__/login-alert.test.ts": 9,
|
||||
"lib/auth/__tests__/login-throttle.test.ts": 4,
|
||||
"lib/auth/__tests__/mfa-enrollment.test.ts": 8,
|
||||
"lib/auth/__tests__/native-handoff-flow.test.ts": 10,
|
||||
"lib/auth/__tests__/oidc-native-handoff.test.ts": 13,
|
||||
"lib/auth/__tests__/oidc.test.ts": 5,
|
||||
"lib/auth/__tests__/passkey.test.ts": 7,
|
||||
"lib/auth/__tests__/profile-update-email-limit.test.ts": 5,
|
||||
"lib/auth/__tests__/profile-update.test.ts": 4,
|
||||
"lib/auth/__tests__/session-locale-reconcile.test.ts": 1,
|
||||
"lib/auth/__tests__/session.test.ts": 15,
|
||||
"lib/auth/__tests__/trusted-device.test.ts": 10,
|
||||
"lib/auth/__tests__/webauthn-library-contract.test.ts": 5,
|
||||
"lib/auth/mfa/__tests__/challenge.test.ts": 14,
|
||||
"lib/auth/mfa/__tests__/recovery-codes.test.ts": 8,
|
||||
"lib/auth/mfa/__tests__/verify-factor.test.ts": 1,
|
||||
"lib/cache/__tests__/server-cache.test.ts": 2,
|
||||
"lib/consent/__tests__/receipts.test.ts": 11,
|
||||
"lib/consent/__tests__/web-grant.test.ts": 9,
|
||||
"lib/consent/__tests__/withdrawal.test.ts": 4,
|
||||
"lib/cycle/__tests__/backup.test.ts": 3,
|
||||
"lib/cycle/__tests__/prediction-refresh.test.ts": 9,
|
||||
"lib/daily/__tests__/load-digest.test.ts": 32,
|
||||
"lib/dashboard/__tests__/snapshot.test.ts": 1,
|
||||
"lib/devices/__tests__/revoke.test.ts": 17,
|
||||
"lib/doctor-report/__tests__/leaf-gating-sweep.test.ts": 2,
|
||||
"lib/documents/__tests__/assist-kinds.test.ts": 1,
|
||||
"lib/documents/__tests__/commit.test.ts": 9,
|
||||
"lib/documents/__tests__/fenced-chat-pipeline.test.ts": 6,
|
||||
"lib/documents/__tests__/index-document.test.ts": 23,
|
||||
"lib/documents/__tests__/index-outcome-record.test.ts": 14,
|
||||
"lib/documents/__tests__/prepare-vision-raster-failure.test.ts": 6,
|
||||
"lib/documents/__tests__/provider-order.test.ts": 1,
|
||||
"lib/documents/__tests__/rasterize-pdf-font-data.test.ts": 1,
|
||||
"lib/documents/__tests__/upload-policy.test.ts": 8,
|
||||
"lib/ecg/__tests__/persist-recording.test.ts": 7,
|
||||
"lib/export/__tests__/account-settings-backup.test.ts": 1,
|
||||
"lib/export/__tests__/coach-backup-title.test.ts": 3,
|
||||
"lib/export/__tests__/full-backup-payload.test.ts": 25,
|
||||
"lib/export/__tests__/intraday-profile-backup.test.ts": 3,
|
||||
"lib/export/__tests__/paged-measurements.test.ts": 4,
|
||||
"lib/export/__tests__/profile-backup-decrypt-failures.test.ts": 1,
|
||||
"lib/export/__tests__/records-backup.test.ts": 8,
|
||||
"lib/export/__tests__/reminders-backup-appointment-address.test.ts": 1,
|
||||
"lib/export/__tests__/restore-backup-owner-mismatch.test.ts": 4,
|
||||
"lib/export/__tests__/restore-backup-round-trip.test.ts": 5,
|
||||
"lib/fhir/__tests__/conformance.test.ts": 3,
|
||||
"lib/fhir/__tests__/rest-module-backstop.test.ts": 4,
|
||||
"lib/fitbit/__tests__/sync-dead-token.test.ts": 10,
|
||||
"lib/google-health/__tests__/sync-failsoft.test.ts": 6,
|
||||
"lib/illness/__tests__/red-flag-notify.test.ts": 2,
|
||||
"lib/import/__tests__/record-import-route.test.ts": 1,
|
||||
"lib/insights/__tests__/background-reasoning-wire.test.ts": 2,
|
||||
"lib/insights/__tests__/biomarker-status.test.ts": 23,
|
||||
"lib/insights/__tests__/blood-pressure-status.test.ts": 32,
|
||||
"lib/insights/__tests__/bmi-status.test.ts": 21,
|
||||
"lib/insights/__tests__/briefing-provider-budget.test.ts": 2,
|
||||
"lib/insights/__tests__/comprehensive-briefing-reroll.test.ts": 1,
|
||||
"lib/insights/__tests__/comprehensive-generate-force.test.ts": 2,
|
||||
"lib/insights/__tests__/feature-cache.test.ts": 2,
|
||||
"lib/insights/__tests__/general-status.test.ts": 30,
|
||||
"lib/insights/__tests__/glp1-plateau.test.ts": 17,
|
||||
"lib/insights/__tests__/locale-pipeline.test.ts": 6,
|
||||
"lib/insights/__tests__/medication-compliance-status.test.ts": 19,
|
||||
"lib/insights/__tests__/memory.test.ts": 5,
|
||||
"lib/insights/__tests__/metric-correlation-context.test.ts": 10,
|
||||
"lib/insights/__tests__/metric-status.test.ts": 30,
|
||||
"lib/insights/__tests__/mood-status.test.ts": 14,
|
||||
"lib/insights/__tests__/payload-budget.test.ts": 13,
|
||||
"lib/insights/__tests__/pulse-status-timeout.test.ts": 8,
|
||||
"lib/insights/__tests__/pulse-status.test.ts": 33,
|
||||
"lib/insights/__tests__/status-batch.test.ts": 33,
|
||||
"lib/insights/__tests__/status-cache-delegated.test.ts": 2,
|
||||
"lib/insights/__tests__/status-cache.test.ts": 39,
|
||||
"lib/insights/__tests__/status-provider-budget.test.ts": 4,
|
||||
"lib/insights/__tests__/unit-change-refresh.test.ts": 4,
|
||||
"lib/insights/__tests__/weight-status.test.ts": 33,
|
||||
"lib/insights/derived/__tests__/baseline.test.ts": 3,
|
||||
"lib/insights/derived/__tests__/coach-read.test.ts": 1,
|
||||
"lib/insights/derived/__tests__/derived-assessment-ai.test.ts": 3,
|
||||
"lib/insights/derived/__tests__/recovery-resolve.test.ts": 1,
|
||||
"lib/insights/derived/__tests__/sleep-score-oura-rhythm.test.ts": 2,
|
||||
"lib/insights/derived/__tests__/sleep-score.test.ts": 3,
|
||||
"lib/insights/derived/__tests__/trajectory.test.ts": 2,
|
||||
"lib/insights/derived/__tests__/wellness-scores.test.ts": 2,
|
||||
"lib/insights/narrative/__tests__/period-narrative-deterministic.test.ts": 1,
|
||||
"lib/insights/narrative/__tests__/period-narrative-locale.test.ts": 3,
|
||||
"lib/integrations/__tests__/admin-alert.test.ts": 5,
|
||||
"lib/integrations/__tests__/apple-health-progress.test.ts": 2,
|
||||
"lib/integrations/__tests__/sources-in-use.test.ts": 4,
|
||||
"lib/integrations/__tests__/status.test.ts": 85,
|
||||
"lib/jobs/__tests__/achievement-unlock-sweep.test.ts": 11,
|
||||
"lib/jobs/__tests__/apple-health-import-reconcile.test.ts": 4,
|
||||
"lib/jobs/__tests__/async-state-contract.test.ts": 32,
|
||||
"lib/jobs/__tests__/coach-nudge.test.ts": 15,
|
||||
"lib/jobs/__tests__/coach-reminder-sweep.test.ts": 11,
|
||||
"lib/jobs/__tests__/compaction-tombstone-purge-failure.test.ts": 4,
|
||||
"lib/jobs/__tests__/cycle-prediction-refresh.test.ts": 3,
|
||||
"lib/jobs/__tests__/data-arrival-worker.test.ts": 18,
|
||||
"lib/jobs/__tests__/document-ai-run.test.ts": 1,
|
||||
"lib/jobs/__tests__/document-content-index-backfill.test.ts": 29,
|
||||
"lib/jobs/__tests__/document-index.test.ts": 6,
|
||||
"lib/jobs/__tests__/document-summary-reaper.test.ts": 1,
|
||||
"lib/jobs/__tests__/document-summary.test.ts": 19,
|
||||
"lib/jobs/__tests__/geo-backfill.test.ts": 1,
|
||||
"lib/jobs/__tests__/insight-pregenerate.test.ts": 45,
|
||||
"lib/jobs/__tests__/insight-status-generate.test.ts": 2,
|
||||
"lib/jobs/__tests__/measurement-maintenance-schedule.test.ts": 2,
|
||||
"lib/jobs/__tests__/measurement-reminder-byhour.test.ts": 2,
|
||||
"lib/jobs/__tests__/measurement-reminder.test.ts": 33,
|
||||
"lib/jobs/__tests__/medication-intake-import.test.ts": 1,
|
||||
"lib/jobs/__tests__/medication-reminder-check.test.ts": 27,
|
||||
"lib/jobs/__tests__/mood-reminder.test.ts": 15,
|
||||
"lib/jobs/__tests__/morning-digest-refresh.test.ts": 6,
|
||||
"lib/jobs/__tests__/oauth-callback-claim-cleanup.test.ts": 1,
|
||||
"lib/jobs/__tests__/offhost-backup.test.ts": 5,
|
||||
"lib/jobs/__tests__/offhost-purge.test.ts": 14,
|
||||
"lib/jobs/__tests__/pr-detection.test.ts": 2,
|
||||
"lib/jobs/__tests__/pulse-day-mean-rebuild-state.test.ts": 1,
|
||||
"lib/jobs/__tests__/reminder-satisfy.test.ts": 9,
|
||||
"lib/jobs/__tests__/workout-insight-generate-shared.test.ts": 2,
|
||||
"lib/jobs/__tests__/workout-insight-generate.test.ts": 37,
|
||||
"lib/jobs/__tests__/workout-insight-no-backfill-spend.test.ts": 3,
|
||||
"lib/jobs/reminder/__tests__/queue-retention.test.ts": 2,
|
||||
"lib/jobs/reminder/__tests__/registrar-shared.test.ts": 5,
|
||||
"lib/labs/__tests__/ocr-capability.test.ts": 4,
|
||||
"lib/labs/__tests__/ocr-rate-limit.test.ts": 1,
|
||||
"lib/labs/__tests__/ocr-run.test.ts": 17,
|
||||
"lib/labs/__tests__/reading-conversion.test.ts": 3,
|
||||
"lib/labs/__tests__/resolve-or-mint-biomarker.test.ts": 1,
|
||||
"lib/life-events/__tests__/service.test.ts": 1,
|
||||
"lib/mcp/__tests__/admin-boundary.test.ts": 1,
|
||||
"lib/mcp/__tests__/auth.test.ts": 1,
|
||||
"lib/mcp/__tests__/nutrients-read.test.ts": 6,
|
||||
"lib/mcp/__tests__/prompts.test.ts": 16,
|
||||
"lib/mcp/__tests__/resource-templates.test.ts": 17,
|
||||
"lib/mcp/__tests__/resources.test.ts": 8,
|
||||
"lib/mcp/__tests__/rich-reads.test.ts": 1,
|
||||
"lib/mcp/__tests__/search-fetch.test.ts": 12,
|
||||
"lib/mcp/__tests__/server-resources.test.ts": 3,
|
||||
"lib/mcp/__tests__/server-write-registration.test.ts": 3,
|
||||
"lib/mcp/__tests__/tools.test.ts": 64,
|
||||
"lib/mcp/__tests__/writes.test.ts": 1,
|
||||
"lib/mcp/oauth/__tests__/connections.test.ts": 13,
|
||||
"lib/measurement-reminders/__tests__/resolve.test.ts": 7,
|
||||
"lib/measurement-reminders/__tests__/satisfy.test.ts": 18,
|
||||
"lib/measurements/__tests__/categories.test.ts": 1,
|
||||
"lib/measurements/__tests__/pick-canonical-workout-rows.test.ts": 2,
|
||||
"lib/measurements/__tests__/series-canonical.test.ts": 1,
|
||||
"lib/medications/__tests__/compliance-payload-heatmap.test.ts": 1,
|
||||
"lib/medications/__tests__/compliance-payload-pre-creation.test.ts": 1,
|
||||
"lib/medications/__tests__/intake-import-job-status.test.ts": 2,
|
||||
"lib/medications/__tests__/intake-slot-dedup-converge.test.ts": 12,
|
||||
"lib/medications/__tests__/intake-slot-dedup-inventory.test.ts": 7,
|
||||
"lib/medications/__tests__/intake-slot-dedup-isolation.test.ts": 9,
|
||||
"lib/medications/__tests__/intake-slot-dedup-pin.test.ts": 8,
|
||||
"lib/medications/efficacy/__tests__/segmented-effect.test.ts": 1,
|
||||
"lib/medications/ingredients/__tests__/label-extract.test.ts": 2,
|
||||
"lib/medications/inventory/__tests__/consumption.test.ts": 8,
|
||||
"lib/medications/inventory/__tests__/service.test.ts": 3,
|
||||
"lib/medications/inventory/__tests__/summary.test.ts": 1,
|
||||
"lib/medications/scheduling/__tests__/band-minter.test.ts": 1,
|
||||
"lib/medications/scheduling/__tests__/dose-history.test.ts": 1,
|
||||
"lib/medications/scheduling/__tests__/pin-conflict.test.ts": 2,
|
||||
"lib/modules/__tests__/measurement-scope.test.ts": 3,
|
||||
"lib/notifications/__tests__/admin-locale.test.ts": 7,
|
||||
"lib/notifications/__tests__/client-managed-apns.test.ts": 9,
|
||||
"lib/notifications/__tests__/dispatch-localised-cache.test.ts": 5,
|
||||
"lib/notifications/__tests__/dispatcher-global-channel-switch.test.ts": 8,
|
||||
"lib/notifications/__tests__/dispatcher.test.ts": 23,
|
||||
"lib/notifications/__tests__/event-defaults.test.ts": 2,
|
||||
"lib/notifications/__tests__/reminder-dedup.test.ts": 2,
|
||||
"lib/notifications/senders/__tests__/apns.test.ts": 24,
|
||||
"lib/notifications/senders/__tests__/ntfy.test.ts": 1,
|
||||
"lib/notifications/senders/__tests__/push-attempt-record.test.ts": 14,
|
||||
"lib/notifications/senders/__tests__/webhook.test.ts": 1,
|
||||
"lib/onboarding/__tests__/first-result-config.test.ts": 1,
|
||||
"lib/oura/__tests__/client.test.ts": 3,
|
||||
"lib/polar/__tests__/client.test.ts": 2,
|
||||
"lib/profile/__tests__/health-facts.test.ts": 1,
|
||||
"lib/queries/__tests__/use-medication-list-layout.test.ts": 5,
|
||||
"lib/sharing/__tests__/account-access.test.ts": 5,
|
||||
"lib/sharing/__tests__/record-session-fence.test.ts": 1,
|
||||
"lib/tz/__tests__/resolver.test.ts": 14,
|
||||
"lib/vaccinations/__tests__/document-suggestion.test.ts": 1,
|
||||
"lib/whoop/__tests__/sync-dead-token.test.ts": 6,
|
||||
"lib/withings/__tests__/subscription-state.test.ts": 8,
|
||||
"lib/withings/__tests__/sync-activity.test.ts": 37,
|
||||
"lib/withings/__tests__/sync-ecg.test.ts": 12,
|
||||
"lib/withings/__tests__/sync-measure-watermark.test.ts": 14,
|
||||
"lib/withings/__tests__/sync-plan.test.ts": 13,
|
||||
"lib/withings/__tests__/sync-plausibility.test.ts": 10,
|
||||
"lib/withings/__tests__/sync-sleep.test.ts": 23,
|
||||
"lib/withings/__tests__/sync-typed-classification.test.ts": 1,
|
||||
"lib/workouts/__tests__/climb-backfill.test.ts": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,407 @@
|
||||
{
|
||||
"$comment": "tests that read a source file by path, per test file under src/. Maintained by src/__tests__/test-realism-ratchet.test.ts.",
|
||||
"count": 400,
|
||||
"total": 400,
|
||||
"entries": {
|
||||
"__tests__/account-payload-consumer-guard.test.ts": 1,
|
||||
"__tests__/acting-account-boundary-guard.test.ts": 1,
|
||||
"__tests__/admin-data-wipe-completeness.test.ts": 1,
|
||||
"__tests__/aging-fixture-dates-guard.test.ts": 1,
|
||||
"__tests__/ai-call-timeout-guard.test.ts": 1,
|
||||
"__tests__/ai-capability-surface-guard.test.ts": 1,
|
||||
"__tests__/ai-consent-enforcement-guard.test.ts": 1,
|
||||
"__tests__/ai-egress-capability-guard.test.ts": 1,
|
||||
"__tests__/ai-reasoning-admin-guard.test.ts": 1,
|
||||
"__tests__/ai-reasoning-effort-guard.test.ts": 1,
|
||||
"__tests__/analysis-depth-no-ai-guard.test.ts": 1,
|
||||
"__tests__/api-errors-leaf-guard.test.ts": 1,
|
||||
"__tests__/apple-health-unit-audit-guard.test.ts": 1,
|
||||
"__tests__/backfill-preserves-updated-at-guard.test.ts": 1,
|
||||
"__tests__/background-reasoning-inventory.test.ts": 1,
|
||||
"__tests__/background-task-settle-guard.test.ts": 1,
|
||||
"__tests__/backup-plan-classification.test.ts": 1,
|
||||
"__tests__/backup-readers-stream-guard.test.ts": 1,
|
||||
"__tests__/backup-schema-lazy-guard.test.ts": 1,
|
||||
"__tests__/bearer-scope-enforcement-guard.test.ts": 1,
|
||||
"__tests__/client-bundle-server-import-guard.test.ts": 1,
|
||||
"__tests__/client-fetch-limit-guard.test.ts": 1,
|
||||
"__tests__/client-poll-inventory-guard.test.ts": 1,
|
||||
"__tests__/client-random-id-guard.test.ts": 1,
|
||||
"__tests__/client-route-zod-guard.test.ts": 1,
|
||||
"__tests__/client-threshold-literal-guard.test.ts": 1,
|
||||
"__tests__/coach-focus-ring-guard.test.ts": 1,
|
||||
"__tests__/coach-stream-lifecycle-guard.test.ts": 1,
|
||||
"__tests__/coach-usage-owner-columns-guard.test.ts": 1,
|
||||
"__tests__/compose-env-whitelist-guard.test.ts": 1,
|
||||
"__tests__/confirm-destructive-style-guard.test.ts": 1,
|
||||
"__tests__/consent-grant-explicit-guard.test.ts": 1,
|
||||
"__tests__/container-scripts-ship-guard.test.ts": 1,
|
||||
"__tests__/contract-stub-inventory.test.ts": 1,
|
||||
"__tests__/copy-matches-behaviour-guard.test.ts": 1,
|
||||
"__tests__/correlation-single-implementation-guard.test.ts": 1,
|
||||
"__tests__/customize-shortcut-guard.test.ts": 1,
|
||||
"__tests__/cycle-verdict-single-decider-guard.test.ts": 1,
|
||||
"__tests__/daily-reads-refetch-guard.test.ts": 1,
|
||||
"__tests__/dashboard-summary-read-plan-guard.test.ts": 1,
|
||||
"__tests__/dashboard-tile-eligibility-bucket-guard.test.ts": 1,
|
||||
"__tests__/date-order-explicit-formatter-guard.test.ts": 1,
|
||||
"__tests__/datetime-helper-guard.test.ts": 1,
|
||||
"__tests__/dawarich-backup-completeness.test.ts": 1,
|
||||
"__tests__/dense-measurement-read-guard.test.ts": 1,
|
||||
"__tests__/derived-response-consumer-guard.test.ts": 1,
|
||||
"__tests__/destructive-control-guard.test.ts": 1,
|
||||
"__tests__/discovery-matrix-guard.test.ts": 1,
|
||||
"__tests__/display-transform-rounding-guard.test.ts": 1,
|
||||
"__tests__/doctor-report-control-gating-guard.test.ts": 1,
|
||||
"__tests__/document-sources-owner-only-guard.test.ts": 1,
|
||||
"__tests__/domain-write-support-guard.test.ts": 1,
|
||||
"__tests__/dose-ledger-single-source-guard.test.ts": 1,
|
||||
"__tests__/dynamic-key-exhaustiveness.test.ts": 1,
|
||||
"__tests__/e2e-conditional-skip-guard.test.ts": 1,
|
||||
"__tests__/e2e-measurement-gating-guard.test.ts": 1,
|
||||
"__tests__/e2e-route-cleanup-guard.test.ts": 1,
|
||||
"__tests__/e2e-shared-session-guard.test.ts": 1,
|
||||
"__tests__/empty-state-ratchet.test.ts": 1,
|
||||
"__tests__/encounter-reminder-exclusion.test.ts": 1,
|
||||
"__tests__/env-empty-is-unset-guard.test.ts": 1,
|
||||
"__tests__/environment-backup-completeness.test.ts": 1,
|
||||
"__tests__/error-code-catalogue.test.ts": 1,
|
||||
"__tests__/error-display-helper-guard.test.ts": 1,
|
||||
"__tests__/error-level-discipline-guard.test.ts": 1,
|
||||
"__tests__/external-id-stability-guard.test.ts": 1,
|
||||
"__tests__/factor-verification-surface-guard.test.ts": 1,
|
||||
"__tests__/feature-flags-mock-guard.test.ts": 1,
|
||||
"__tests__/greeting-hour-single-source.test.ts": 1,
|
||||
"__tests__/guard-floor-guard.test.ts": 1,
|
||||
"__tests__/healthcheck-boot-storm.test.ts": 1,
|
||||
"__tests__/i18n-call-site-coverage.test.ts": 1,
|
||||
"__tests__/i18n-catalog-cache-key.test.ts": 1,
|
||||
"__tests__/i18n-english-leak-guard.test.ts": 1,
|
||||
"__tests__/i18n-reverse-coverage.test.ts": 1,
|
||||
"__tests__/idempotency-contract-publication.test.ts": 1,
|
||||
"__tests__/inline-action-guard.test.ts": 1,
|
||||
"__tests__/insights-cached-text-access-guard.test.ts": 1,
|
||||
"__tests__/insights-unit-literal-guard.test.ts": 1,
|
||||
"__tests__/intake-toast-single-decision.test.ts": 1,
|
||||
"__tests__/integration-callback-url-guard.test.ts": 1,
|
||||
"__tests__/integration-failure-response-consumer-guard.test.ts": 1,
|
||||
"__tests__/inventory-write-isolation.test.ts": 1,
|
||||
"__tests__/job-locale-resolution-guard.test.ts": 1,
|
||||
"__tests__/job-queue-runtime-guard.test.ts": 1,
|
||||
"__tests__/job-retention-floor-guard.test.ts": 1,
|
||||
"__tests__/key-mismatch-refusal-guard.test.ts": 1,
|
||||
"__tests__/latest-per-type-read-guard.test.ts": 1,
|
||||
"__tests__/linear-fit-single-implementation-guard.test.ts": 1,
|
||||
"__tests__/list-cap-reader-guard.test.ts": 1,
|
||||
"__tests__/list-page-guard.test.ts": 1,
|
||||
"__tests__/malformed-json-status-guard.test.ts": 1,
|
||||
"__tests__/manage-activity-inventory.test.ts": 1,
|
||||
"__tests__/managed-profile-contract.test.ts": 1,
|
||||
"__tests__/measurement-backup-completeness.test.ts": 1,
|
||||
"__tests__/measurement-write-plausibility-guard.test.ts": 1,
|
||||
"__tests__/measurement-write-tail-guard.test.ts": 1,
|
||||
"__tests__/medication-ingredient-backup-completeness.test.ts": 1,
|
||||
"__tests__/medication-intake-tracking-guard.test.ts": 1,
|
||||
"__tests__/memory-block-egress-guard.test.ts": 1,
|
||||
"__tests__/migration-lock-timeout-guard.test.ts": 1,
|
||||
"__tests__/module-gate-record-scoped.test.ts": 1,
|
||||
"__tests__/mood-backup-completeness.test.ts": 1,
|
||||
"__tests__/mood-prediction-write-surface-guard.test.ts": 1,
|
||||
"__tests__/moodlog-removal-guard.test.ts": 1,
|
||||
"__tests__/no-control-bytes-guard.test.ts": 1,
|
||||
"__tests__/no-server-actions-guard.test.ts": 1,
|
||||
"__tests__/oauth-kit-guard.test.ts": 1,
|
||||
"__tests__/oidc-native-error-reasons-documented.test.ts": 1,
|
||||
"__tests__/openapi-account-sharing-components.test.ts": 1,
|
||||
"__tests__/openapi-route-coverage-guard.test.ts": 1,
|
||||
"__tests__/openapi-sharing-denial.test.ts": 1,
|
||||
"__tests__/page-header-h1-guard.test.ts": 1,
|
||||
"__tests__/page-walk-guard.test.ts": 1,
|
||||
"__tests__/password-breach-check-switch.test.ts": 1,
|
||||
"__tests__/prefetch-page-caching-guard.test.ts": 1,
|
||||
"__tests__/prisma-enum-mapping-guard.test.ts": 1,
|
||||
"__tests__/profile-rejection-surface-guard.test.ts": 1,
|
||||
"__tests__/provider-rounding-guard.test.ts": 1,
|
||||
"__tests__/proxy-body-limit.test.ts": 1,
|
||||
"__tests__/proxy-demo-mode-allowlist.test.ts": 1,
|
||||
"__tests__/proxy-page-marker.test.ts": 1,
|
||||
"__tests__/proxy-relative-redirect-guard.test.ts": 1,
|
||||
"__tests__/published-env-reaches-the-container.test.ts": 1,
|
||||
"__tests__/pulse-day-mean-reader-guard.test.ts": 1,
|
||||
"__tests__/pwa-mobile-shell-guard.test.ts": 1,
|
||||
"__tests__/query-error-error-prop-guard.test.ts": 1,
|
||||
"__tests__/read-failure-markup-guard.test.ts": 1,
|
||||
"__tests__/read-over-post-guard.test.ts": 1,
|
||||
"__tests__/recent-proof-surface-guard.test.ts": 1,
|
||||
"__tests__/record-fence-headerless-transport-guard.test.ts": 1,
|
||||
"__tests__/record-session-fence-acceptance-map.test.ts": 1,
|
||||
"__tests__/record-session-fence-compat.test.ts": 1,
|
||||
"__tests__/record-session-fence-guard.test.ts": 1,
|
||||
"__tests__/record-settings-route-guard.test.ts": 1,
|
||||
"__tests__/record-settings-ui.test.tsx": 1,
|
||||
"__tests__/record-write-rate-limit-contract.test.ts": 1,
|
||||
"__tests__/recurrence-course-anchor-guard.test.ts": 1,
|
||||
"__tests__/relation-links-backup-completeness.test.ts": 1,
|
||||
"__tests__/report-selection-egress-guard.test.ts": 1,
|
||||
"__tests__/resolved-field-consumer-guard.test.ts": 1,
|
||||
"__tests__/restore-lock-consolidation-guard.test.ts": 1,
|
||||
"__tests__/rotation-walk-keyset-guard.test.ts": 1,
|
||||
"__tests__/score-pill-guard.test.ts": 1,
|
||||
"__tests__/self-gating-child-frame-guard.test.ts": 1,
|
||||
"__tests__/service-worker-version-anchor.test.ts": 1,
|
||||
"__tests__/service-worker.test.ts": 1,
|
||||
"__tests__/session-surface-guard.test.ts": 1,
|
||||
"__tests__/session-user-projection-guard.test.ts": 1,
|
||||
"__tests__/settings-legacy-routes.test.ts": 1,
|
||||
"__tests__/sharing-accessibility-states.test.tsx": 1,
|
||||
"__tests__/sharing-native-client-contract.test.ts": 1,
|
||||
"__tests__/sharing-record-fence-contract.test.ts": 1,
|
||||
"__tests__/sharing-recoverable-errors.test.tsx": 1,
|
||||
"__tests__/sharing-surface-guard.test.ts": 1,
|
||||
"__tests__/spread-single-implementation-guard.test.ts": 1,
|
||||
"__tests__/sql-now-utc-guard.test.ts": 1,
|
||||
"__tests__/step-up-elevation-guard.test.ts": 1,
|
||||
"__tests__/step-up-web-caller-guard.test.ts": 1,
|
||||
"__tests__/success-affordance-guard.test.ts": 1,
|
||||
"__tests__/sw-security-hardening.test.ts": 1,
|
||||
"__tests__/text-field-focus-guard.test.ts": 1,
|
||||
"__tests__/timezone-explicit-formatter-guard.test.ts": 1,
|
||||
"__tests__/tombstone-read-guard.test.ts": 1,
|
||||
"__tests__/translate-probe-guard.test.ts": 1,
|
||||
"__tests__/ui-code-no-dash-separator.test.ts": 1,
|
||||
"__tests__/unit-preference-display-guard.test.ts": 1,
|
||||
"__tests__/unit-suite-browser-install-guard.test.ts": 1,
|
||||
"__tests__/utc-day-key-allowlist-guard.test.ts": 1,
|
||||
"__tests__/v1341-locale-parity.test.ts": 1,
|
||||
"__tests__/visit-link-guard.test.ts": 1,
|
||||
"__tests__/vorsorge-due-bucket-single-home-guard.test.ts": 1,
|
||||
"__tests__/weight-tile-direction-guard.test.ts": 1,
|
||||
"__tests__/workout-canonical-identity-guard.test.ts": 1,
|
||||
"__tests__/workout-sport-provenance-guard.test.ts": 1,
|
||||
"__tests__/write-rate-limit-guard.test.ts": 1,
|
||||
"__tests__/written-outcome-response-consumer-guard.test.ts": 1,
|
||||
"__tests__/zod-refusal-issue-list-guard.test.ts": 1,
|
||||
"app/__tests__/dashboard-analytics-split.test.ts": 1,
|
||||
"app/__tests__/dashboard-chart-reveal.test.tsx": 1,
|
||||
"app/__tests__/dashboard-demo-checklist.test.ts": 1,
|
||||
"app/__tests__/dashboard-hero-wiring.test.ts": 1,
|
||||
"app/__tests__/dashboard-hrv-rmssd-fallback.test.tsx": 1,
|
||||
"app/__tests__/dashboard-suspense-boundaries.test.ts": 1,
|
||||
"app/__tests__/dashboard-tile-strip-skeleton.test.ts": 1,
|
||||
"app/__tests__/i18n-boot-script-strategy.test.ts": 1,
|
||||
"app/__tests__/insights-b3-wiring.test.ts": 1,
|
||||
"app/__tests__/insights-polish.test.ts": 1,
|
||||
"app/__tests__/not-found-copy.test.ts": 1,
|
||||
"app/__tests__/quick-add-labels.test.ts": 1,
|
||||
"app/__tests__/root-loading-silhouette.test.tsx": 1,
|
||||
"app/api/__tests__/ai-capability-route-inventory.test.ts": 1,
|
||||
"app/api/__tests__/inline-schema-strictness-inventory.test.ts": 1,
|
||||
"app/api/__tests__/module-route-gate-inventory.test.ts": 1,
|
||||
"app/api/__tests__/read-routes-write-nothing.test.ts": 1,
|
||||
"app/api/__tests__/webhook-verb-rate-limit-guard.test.ts": 1,
|
||||
"app/api/auth/native/__tests__/invariants.test.ts": 1,
|
||||
"app/api/auth/passkeys/__tests__/route.test.ts": 1,
|
||||
"app/api/insights/__tests__/coach-route-gate-inventory.test.ts": 1,
|
||||
"app/api/mood-entries/__tests__/bulk-dimension-bounds.test.ts": 1,
|
||||
"app/api/polar/sync/__tests__/route.test.ts": 1,
|
||||
"app/api/settings/__tests__/private-origin-routes.test.ts": 1,
|
||||
"app/api/user/thresholds/__tests__/route.test.ts": 1,
|
||||
"app/insights/__tests__/assessment-spine-order.test.ts": 1,
|
||||
"app/insights/__tests__/explainer-metric-keys.test.ts": 1,
|
||||
"app/insights/__tests__/header-add-pattern.test.ts": 1,
|
||||
"app/insights/__tests__/page-skeletons.test.ts": 1,
|
||||
"app/insights/sleep/__tests__/empty-state-href.test.ts": 1,
|
||||
"app/measurements/__tests__/add-token-resolution.test.ts": 1,
|
||||
"app/medications/__tests__/detail-page-history-surface.test.ts": 1,
|
||||
"components/__tests__/design-consistency-guards.test.tsx": 1,
|
||||
"components/__tests__/failed-read-never-empty.test.tsx": 1,
|
||||
"components/__tests__/motion-reduce-spin-coverage.test.ts": 1,
|
||||
"components/admin/__tests__/admin-shell.test.tsx": 1,
|
||||
"components/admin/__tests__/notification-test-failures.test.ts": 1,
|
||||
"components/charts/__tests__/chart-error-state.test.tsx": 1,
|
||||
"components/charts/__tests__/health-chart-overlay-defaults.test.tsx": 1,
|
||||
"components/charts/__tests__/health-chart-target-link-removed.test.ts": 1,
|
||||
"components/charts/__tests__/mood-chart-polish.test.tsx": 1,
|
||||
"components/charts/__tests__/touch-action-guard.test.ts": 1,
|
||||
"components/cycle/__tests__/use-cycle-ring-has-dial.test.tsx": 1,
|
||||
"components/dashboard/__tests__/medication-intake-quick-add.test.tsx": 1,
|
||||
"components/dashboard/__tests__/tile-destinations.test.ts": 1,
|
||||
"components/day/__tests__/day-door-coverage-guard.test.ts": 1,
|
||||
"components/day/__tests__/day-not-here-guard.test.ts": 1,
|
||||
"components/documents/__tests__/document-coach-launch-wiring.test.ts": 1,
|
||||
"components/documents/__tests__/document-detail-download.test.ts": 1,
|
||||
"components/documents/__tests__/documents-delete-confirm-guard.test.ts": 1,
|
||||
"components/forms/__tests__/use-seeded-form-dismissal.test.ts": 1,
|
||||
"components/i18n/__tests__/maintainership-banner.test.tsx": 1,
|
||||
"components/insights/__tests__/coach-metric-scope-inventory.test.ts": 1,
|
||||
"components/insights/__tests__/correlation-card-skeleton.test.ts": 1,
|
||||
"components/insights/__tests__/health-score-card-geometry.test.tsx": 1,
|
||||
"components/insights/__tests__/health-score-coverage-axis-guard.test.tsx": 1,
|
||||
"components/insights/__tests__/insight-section-card.test.tsx": 1,
|
||||
"components/insights/__tests__/sleep-overview-empty-href.test.ts": 1,
|
||||
"components/insights/__tests__/tile-header-wrap.test.tsx": 1,
|
||||
"components/insights/coach-panel/__tests__/coach-settings-overlay.test.tsx": 1,
|
||||
"components/insights/coach-panel/__tests__/conversations-panel-fold.test.tsx": 1,
|
||||
"components/insights/coach-panel/__tests__/message-thread.test.tsx": 1,
|
||||
"components/insights/coach-panel/__tests__/open-at-end.test.ts": 1,
|
||||
"components/insights/coach-panel/__tests__/panel-touch-targets.test.ts": 1,
|
||||
"components/insights/coach-panel/__tests__/scroll-to-bottom-button.test.tsx": 1,
|
||||
"components/insights/mood/__tests__/mood-notes-timeline-removed.test.ts": 1,
|
||||
"components/layout/__tests__/auth-shell-coach-hoist.test.ts": 1,
|
||||
"components/layout/__tests__/auth-shell-shared-record-doors.test.tsx": 1,
|
||||
"components/layout/__tests__/offline-banner.test.tsx": 1,
|
||||
"components/layout/__tests__/sidebar-nav.test.tsx": 1,
|
||||
"components/measurements/__tests__/duration-read-as.test.tsx": 1,
|
||||
"components/measurements/__tests__/measurement-form-glucose-unit.test.tsx": 1,
|
||||
"components/measurements/__tests__/measurement-list-glucose-unit.test.tsx": 1,
|
||||
"components/medications/__tests__/add-inventory-dialog.test.tsx": 1,
|
||||
"components/medications/__tests__/detail-page-cascade.test.tsx": 1,
|
||||
"components/medications/__tests__/inventory-section-dates.test.tsx": 1,
|
||||
"components/medications/__tests__/log-injection-site-dialog.test.tsx": 1,
|
||||
"components/medications/__tests__/medication-order-editor.test.tsx": 1,
|
||||
"components/medications/__tests__/medication-table.test.tsx": 1,
|
||||
"components/medications/__tests__/take-all-due.test.tsx": 1,
|
||||
"components/mood/__tests__/linked-day-timezone.test.ts": 1,
|
||||
"components/mood/__tests__/mood-note-fulltext.test.tsx": 1,
|
||||
"components/mood/__tests__/mood-qol-fixes.test.tsx": 1,
|
||||
"components/onboarding/__tests__/tour-launcher-gate.test.ts": 1,
|
||||
"components/records/__tests__/emergency-profile-save.test.tsx": 1,
|
||||
"components/settings/__tests__/action-feedback.test.ts": 1,
|
||||
"components/settings/__tests__/card-description-length.test.ts": 1,
|
||||
"components/settings/__tests__/confirm-style-guard.test.ts": 1,
|
||||
"components/settings/__tests__/dashboard-layout-snapshot-invalidation.test.ts": 1,
|
||||
"components/settings/__tests__/destructive-controls-confirm.test.tsx": 1,
|
||||
"components/settings/__tests__/glucose-unit-select.test.tsx": 1,
|
||||
"components/settings/__tests__/kept-grant-revoke-confirm.test.ts": 1,
|
||||
"components/settings/__tests__/module-description-length.test.ts": 1,
|
||||
"components/settings/__tests__/mood-reminder-card.test.tsx": 1,
|
||||
"components/settings/__tests__/oauth-return-outcome.test.ts": 1,
|
||||
"components/settings/__tests__/one-piece-anatomy.test.tsx": 1,
|
||||
"components/settings/__tests__/password-card-placement.test.tsx": 1,
|
||||
"components/settings/__tests__/save-model-guard.test.ts": 1,
|
||||
"components/settings/__tests__/score-refusal-consumer-guard.test.ts": 1,
|
||||
"components/settings/__tests__/settings-card-header-coverage.test.ts": 1,
|
||||
"components/settings/__tests__/settings-shell.test.tsx": 1,
|
||||
"components/settings/__tests__/test-connection-button-response.test.tsx": 1,
|
||||
"components/settings/__tests__/token-revoke-labels.test.ts": 1,
|
||||
"components/settings/access/__tests__/grant-access-level.test.tsx": 1,
|
||||
"components/settings/access/__tests__/grant-invite-expiry.test.tsx": 1,
|
||||
"components/settings/access/__tests__/grant-invite-scope.test.tsx": 1,
|
||||
"components/settings/access/__tests__/managed-profile-affordances.test.tsx": 1,
|
||||
"components/settings/account-section/__tests__/account-section-field-error-clearing.test.ts": 1,
|
||||
"components/settings/account-section/__tests__/display-name-field.test.tsx": 1,
|
||||
"components/settings/account-section/__tests__/display-preferences-card.test.tsx": 1,
|
||||
"components/settings/import-panel/__tests__/import-docs-link.test.ts": 1,
|
||||
"components/settings/integrations/__tests__/cards-render-health.test.ts": 1,
|
||||
"components/settings/integrations/__tests__/google-health-card.test.tsx": 1,
|
||||
"components/settings/security-section/__tests__/factor-enrollment-reauth.test.tsx": 1,
|
||||
"components/settings/security-section/__tests__/passkey-enrollment-reauth.test.tsx": 1,
|
||||
"components/settings/security-section/__tests__/passkey-removal-step-up.test.tsx": 1,
|
||||
"components/settings/security-section/__tests__/recent-proof-callers.test.tsx": 1,
|
||||
"components/settings/security-section/__tests__/totp-card.test.tsx": 1,
|
||||
"components/timeline/__tests__/label-keys.test.ts": 1,
|
||||
"components/timeline/__tests__/no-template-key-guard.test.ts": 1,
|
||||
"components/ui/__tests__/card-density.test.tsx": 1,
|
||||
"components/ui/__tests__/card-header-rows.test.ts": 1,
|
||||
"components/ui/__tests__/filter-bar.test.tsx": 1,
|
||||
"components/ui/__tests__/segmented.test.tsx": 1,
|
||||
"hooks/__tests__/use-insight-status.test.ts": 1,
|
||||
"lib/__tests__/geo-offline-detection.test.ts": 1,
|
||||
"lib/__tests__/query-keys.test.ts": 1,
|
||||
"lib/__tests__/ssrf-pin-inventory.test.ts": 1,
|
||||
"lib/ai/__tests__/provider-state-never-persisted.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/coach-availability-window-honesty.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/coach-history-reach-guard.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/coach-locale-no-german-default.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/data-field-injection.test.ts": 1,
|
||||
"lib/ai/coach/__tests__/snapshot.test.ts": 1,
|
||||
"lib/ai/coach/memory/__tests__/contract.test.ts": 1,
|
||||
"lib/ai/coach/tools/__tests__/turn-budget.test.ts": 1,
|
||||
"lib/ai/coach/turn/__tests__/steps.test.ts": 1,
|
||||
"lib/analytics/__tests__/glucose-panel-window.test.ts": 1,
|
||||
"lib/analytics/compliance/__tests__/as-needed-compliance-exclusion.test.ts": 1,
|
||||
"lib/analytics/mood-prognosis/__tests__/gates.test.ts": 1,
|
||||
"lib/analytics/score/__tests__/reference-citation-guard.test.ts": 1,
|
||||
"lib/auth/__tests__/step-up.test.ts": 1,
|
||||
"lib/charts/__tests__/axis-unit.test.ts": 1,
|
||||
"lib/charts/__tests__/data-ready-latch.test.ts": 1,
|
||||
"lib/charts/__tests__/fetch-window.test.ts": 1,
|
||||
"lib/command-palette/__tests__/settings-cards.test.ts": 1,
|
||||
"lib/crypto/__tests__/encrypted-column-writers.test.ts": 1,
|
||||
"lib/crypto/__tests__/encrypted-columns.test.ts": 1,
|
||||
"lib/dashboard/__tests__/snapshot.test.ts": 1,
|
||||
"lib/documents/__tests__/fenced-chat-module-graph.test.ts": 1,
|
||||
"lib/documents/__tests__/rasterize-pdf-font-data.test.ts": 1,
|
||||
"lib/export/__tests__/full-backup-stream-heap-gauge.test.ts": 1,
|
||||
"lib/export/__tests__/intraday-profile-backup.test.ts": 1,
|
||||
"lib/feature-flags/__tests__/no-dead-assistant-flag.test.ts": 1,
|
||||
"lib/fitbit/__tests__/sync-module-graph.test.ts": 1,
|
||||
"lib/format/__tests__/bytes.test.ts": 1,
|
||||
"lib/google-health/__tests__/sync-module-graph.test.ts": 1,
|
||||
"lib/http/__tests__/deprecation.test.ts": 1,
|
||||
"lib/i18n/__tests__/locale-first-paint-single-write.test.tsx": 1,
|
||||
"lib/i18n/__tests__/plural-locale-completeness.test.ts": 1,
|
||||
"lib/import/__tests__/record-import-rows.test.ts": 1,
|
||||
"lib/insights/__tests__/prompt-soft-delete-filter.test.ts": 1,
|
||||
"lib/insights/eval/__tests__/tone-harness.test.ts": 1,
|
||||
"lib/jobs/__tests__/ai-job-capability-inventory.test.ts": 1,
|
||||
"lib/jobs/__tests__/apple-health-import-ecg.test.ts": 1,
|
||||
"lib/jobs/__tests__/apple-health-import-export-date.test.ts": 1,
|
||||
"lib/jobs/__tests__/apple-health-import-reconcile.test.ts": 1,
|
||||
"lib/jobs/__tests__/apple-health-import-send-policy.test.ts": 1,
|
||||
"lib/jobs/__tests__/coach-memory-refresh-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/coach-message-cleanup-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/cumulative-pr-rederive-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/cycle-reminder-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/daily-briefing.test.ts": 1,
|
||||
"lib/jobs/__tests__/data-arrival-provider-isolation.test.ts": 1,
|
||||
"lib/jobs/__tests__/data-arrival-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/data-backup-send-policy.test.ts": 1,
|
||||
"lib/jobs/__tests__/drain-cumulative-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/fitbit-queues.test.ts": 1,
|
||||
"lib/jobs/__tests__/geo-backfill.test.ts": 1,
|
||||
"lib/jobs/__tests__/geolite2-fetch-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/google-health-queues.test.ts": 1,
|
||||
"lib/jobs/__tests__/insight-pregenerate.test.ts": 1,
|
||||
"lib/jobs/__tests__/insight-status-generate.test.ts": 1,
|
||||
"lib/jobs/__tests__/intake-slot-dedup-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/integration-backfill-admission.test.ts": 1,
|
||||
"lib/jobs/__tests__/job-failures-retention.test.ts": 1,
|
||||
"lib/jobs/__tests__/job-outcome-source-inventory.test.ts": 1,
|
||||
"lib/jobs/__tests__/mcp-token-cleanup-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/mean-consolidation-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/measurement-reminder-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/measurement-tombstone-cleanup.test.ts": 1,
|
||||
"lib/jobs/__tests__/nightscout-queues.test.ts": 1,
|
||||
"lib/jobs/__tests__/period-narrative-warm.test.ts": 1,
|
||||
"lib/jobs/__tests__/queue-policy-tables.test.ts": 1,
|
||||
"lib/jobs/__tests__/read-side-effect-queues.test.ts": 1,
|
||||
"lib/jobs/__tests__/recovery-score-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/sleep-timeline-queues.test.ts": 1,
|
||||
"lib/jobs/__tests__/status-cron-candidates.test.ts": 1,
|
||||
"lib/jobs/__tests__/step-consolidation-repair-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/stress-strain-retention-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/subsystem-surface.test.ts": 1,
|
||||
"lib/jobs/__tests__/tls-pin-monitor-queue.test.ts": 1,
|
||||
"lib/jobs/__tests__/whoop-queues.test.ts": 1,
|
||||
"lib/jobs/__tests__/withings-ecg-worker.test.ts": 1,
|
||||
"lib/jobs/__tests__/withings-queues.test.ts": 1,
|
||||
"lib/jobs/__tests__/workout-insight-queue.test.ts": 1,
|
||||
"lib/jobs/reminder/__tests__/integration-cohort-outcomes.test.ts": 1,
|
||||
"lib/labs/__tests__/local-ocr.test.ts": 1,
|
||||
"lib/links/__tests__/link-surface-guard.test.ts": 1,
|
||||
"lib/links/__tests__/relation-matrix.test.ts": 1,
|
||||
"lib/medications/__tests__/auto-mark-taken.test.ts": 1,
|
||||
"lib/medications/__tests__/glp1-knowledge-drift.test.ts": 1,
|
||||
"lib/medications/inventory/__tests__/summary.test.ts": 1,
|
||||
"lib/modules/__tests__/surface-module-registry.test.ts": 1,
|
||||
"lib/mood/__tests__/context-vocabulary.test.ts": 1,
|
||||
"lib/notifications/__tests__/event-defaults.test.ts": 1,
|
||||
"lib/pwa/__tests__/sw-cache-policy.test.ts": 1,
|
||||
"lib/record-activity/__tests__/verb-map-covers-routes.test.ts": 1,
|
||||
"lib/sharing/__tests__/record-session-fence.test.ts": 1,
|
||||
"lib/sources/__tests__/source-priority-whoop-applehealth.test.ts": 1,
|
||||
"lib/whoop/__tests__/sync-module-graph.test.ts": 1,
|
||||
"lib/whoop/__tests__/sync-user-whoop.test.ts": 1
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,151 @@
|
||||
/**
|
||||
* A ratchet: a committed baseline of counts that may only fall.
|
||||
*
|
||||
* Each ratchet guard measures something per key (lines per file, `as never`
|
||||
* per test file, one per file on a list) and compares it with a JSON baseline
|
||||
* under `src/__tests__/baselines/`. Three things fail:
|
||||
*
|
||||
* - a key that is not in the baseline (a new offender);
|
||||
* - a key whose value rose above its baseline (an offender that grew);
|
||||
* - a key that fell below its baseline by more than the ratchet's `slack`,
|
||||
* or disappeared (an improvement nobody wrote down).
|
||||
*
|
||||
* The third is what makes it a ratchet rather than a ceiling: an improvement
|
||||
* that is not written back leaves room for the next regression to hide in.
|
||||
* Writing back is one command, printed in every failure:
|
||||
*
|
||||
* RATCHET_WRITE=1 pnpm vitest run <guard file>
|
||||
*
|
||||
* which rewrites the baseline with the lower of the recorded and the
|
||||
* measured value for every key, drops keys that reached zero, and never
|
||||
* raises anything. Raising a value, or adding a key, is a hand edit of the
|
||||
* JSON in a reviewed change, with the reason in the PR.
|
||||
*/
|
||||
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
export const BASELINE_DIR = join(process.cwd(), "src/__tests__/baselines");
|
||||
|
||||
export interface RatchetBaseline {
|
||||
$comment: string;
|
||||
/** Number of keys, kept in the file so a reader sees the headline. */
|
||||
count: number;
|
||||
/** Sum of `entries`. */
|
||||
total: number;
|
||||
entries: Record<string, number>;
|
||||
}
|
||||
|
||||
export interface RatchetResult {
|
||||
count: number;
|
||||
total: number;
|
||||
baselineCount: number;
|
||||
baselineTotal: number;
|
||||
/** New keys and keys above their baseline, as readable lines. */
|
||||
grew: string[];
|
||||
/** Keys that fell below their baseline beyond the slack, or vanished. */
|
||||
stale: string[];
|
||||
}
|
||||
|
||||
function sum(entries: Record<string, number>): number {
|
||||
return Object.values(entries).reduce((a, b) => a + b, 0);
|
||||
}
|
||||
|
||||
export function readBaseline(file: string): RatchetBaseline {
|
||||
return JSON.parse(
|
||||
readFileSync(join(BASELINE_DIR, file), "utf8"),
|
||||
) as RatchetBaseline;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare measured counts against the baseline in `file`. With
|
||||
* `RATCHET_WRITE=1` in the environment the lower numbers are written back
|
||||
* first, so the comparison that follows passes on everything but growth.
|
||||
*/
|
||||
export function runRatchet(
|
||||
file: string,
|
||||
measured: Record<string, number>,
|
||||
options: { slack?: number; comment?: string } = {},
|
||||
): RatchetResult {
|
||||
const slack = options.slack ?? 0;
|
||||
const current = Object.fromEntries(
|
||||
Object.entries(measured).filter(([, v]) => v > 0),
|
||||
);
|
||||
const write = process.env.RATCHET_WRITE === "1";
|
||||
// The one case where writing records the measured numbers as they are: a
|
||||
// baseline that does not exist yet. Deleting a baseline to re-seed it
|
||||
// higher shows up as a whole-file diff in review.
|
||||
if (write && !existsSync(join(BASELINE_DIR, file))) {
|
||||
mkdirSync(BASELINE_DIR, { recursive: true });
|
||||
writeFileSync(
|
||||
join(BASELINE_DIR, file),
|
||||
`${JSON.stringify({ $comment: options.comment ?? "", count: 0, total: 0, entries: current }, null, 2)}\n`,
|
||||
);
|
||||
}
|
||||
let baseline = readBaseline(file);
|
||||
|
||||
if (write) {
|
||||
const lowered: Record<string, number> = {};
|
||||
for (const [key, recorded] of Object.entries(baseline.entries)) {
|
||||
const now = current[key] ?? 0;
|
||||
const value = Math.min(recorded, now);
|
||||
if (value > 0) lowered[key] = value;
|
||||
}
|
||||
const sorted = Object.fromEntries(
|
||||
Object.entries(lowered).sort(([a], [b]) => a.localeCompare(b)),
|
||||
);
|
||||
baseline = {
|
||||
$comment: baseline.$comment,
|
||||
count: Object.keys(sorted).length,
|
||||
total: sum(sorted),
|
||||
entries: sorted,
|
||||
};
|
||||
writeFileSync(
|
||||
join(BASELINE_DIR, file),
|
||||
`${JSON.stringify(baseline, null, 2)}\n`,
|
||||
);
|
||||
}
|
||||
|
||||
const grew: string[] = [];
|
||||
const stale: string[] = [];
|
||||
for (const [key, value] of Object.entries(current)) {
|
||||
const recorded = baseline.entries[key];
|
||||
if (recorded === undefined) grew.push(`${key}: new, ${value}`);
|
||||
else if (value > recorded) grew.push(`${key}: ${recorded} → ${value}`);
|
||||
}
|
||||
for (const [key, recorded] of Object.entries(baseline.entries)) {
|
||||
const value = current[key] ?? 0;
|
||||
if (value < recorded - slack) stale.push(`${key}: ${recorded} → ${value}`);
|
||||
}
|
||||
return {
|
||||
count: Object.keys(current).length,
|
||||
total: sum(current),
|
||||
baselineCount: baseline.count,
|
||||
baselineTotal: baseline.total,
|
||||
grew: grew.sort(),
|
||||
stale: stale.sort(),
|
||||
};
|
||||
}
|
||||
|
||||
export function writeBackHint(guardFile: string): string {
|
||||
return (
|
||||
`The baseline records a higher number than the tree now has. Write the ` +
|
||||
`lower numbers back so the ratchet tightens: ` +
|
||||
`RATCHET_WRITE=1 pnpm vitest run ${guardFile}`
|
||||
);
|
||||
}
|
||||
|
||||
/** Read a baseline of another shape than counts per key, or null if absent. */
|
||||
export function readBaselineJson<T>(file: string): T | null {
|
||||
const path = join(BASELINE_DIR, file);
|
||||
return existsSync(path)
|
||||
? (JSON.parse(readFileSync(path, "utf8")) as T)
|
||||
: null;
|
||||
}
|
||||
|
||||
export function writeBaselineJson(file: string, value: unknown): void {
|
||||
mkdirSync(BASELINE_DIR, { recursive: true });
|
||||
writeFileSync(
|
||||
join(BASELINE_DIR, file),
|
||||
`${JSON.stringify(value, null, 2)}\n`,
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,376 @@
|
||||
/**
|
||||
* Measurements over the production source tree, shared by the ratchet
|
||||
* guards: which files count as production code, how long each file and each
|
||||
* function is, and the value-import graph between modules.
|
||||
*
|
||||
* Everything is read through the TypeScript compiler, not grepped, so a
|
||||
* function is a function node (declaration, expression, arrow, method,
|
||||
* constructor, accessor) and an import's kind is the parser's answer, not a
|
||||
* regex's guess. `typescript` is already a dependency; nothing new is pulled
|
||||
* in.
|
||||
*
|
||||
* Production code means every `.ts`/`.tsx` file under `src/` outside
|
||||
* `src/generated/`, test files, `__tests__/`, `__mocks__/`, `test-utils` and
|
||||
* declaration files. The walk goes through `walkSourceFiles`, so dot-prefixed
|
||||
* directories (`app/.well-known/`) are included and an empty walk throws.
|
||||
*/
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
import ts from "typescript";
|
||||
|
||||
import { requireFloor, walkSourceFiles } from "./source-files";
|
||||
|
||||
export const SRC = join(process.cwd(), "src");
|
||||
|
||||
const TEST_PATH =
|
||||
/(^|\/)__tests__\/|(^|\/)__mocks__\/|\.(test|spec)\.tsx?$|(^|\/)test-utils(\/|\.)/;
|
||||
|
||||
export function isTestPath(rel: string): boolean {
|
||||
return TEST_PATH.test(rel);
|
||||
}
|
||||
|
||||
/** Production source files, relative to `src/`, sorted. */
|
||||
export function productionSources(): string[] {
|
||||
const files = walkSourceFiles(SRC, { floor: 3000 }).filter(
|
||||
(rel) =>
|
||||
!rel.startsWith("generated/") &&
|
||||
!rel.endsWith(".d.ts") &&
|
||||
!isTestPath(rel),
|
||||
);
|
||||
return requireFloor("production source files", files, 3000) as string[];
|
||||
}
|
||||
|
||||
/** Test files under `src/`, relative to `src/`, sorted. */
|
||||
export function testSources(): string[] {
|
||||
const files = walkSourceFiles(SRC, { floor: 3000 }).filter(
|
||||
(rel) => !rel.startsWith("generated/") && /\.(test|spec)\.tsx?$/.test(rel),
|
||||
);
|
||||
return requireFloor("test files", files, 2000) as string[];
|
||||
}
|
||||
|
||||
export function readSrc(rel: string): string {
|
||||
return readFileSync(join(SRC, rel), "utf8");
|
||||
}
|
||||
|
||||
/** Line count the way an editor shows it: a trailing newline adds none. */
|
||||
export function lineCount(text: string): number {
|
||||
if (text.length === 0) return 0;
|
||||
const lines = text.split("\n").length;
|
||||
return text.endsWith("\n") ? lines - 1 : lines;
|
||||
}
|
||||
|
||||
export function parse(rel: string, text: string): ts.SourceFile {
|
||||
return ts.createSourceFile(
|
||||
rel,
|
||||
text,
|
||||
ts.ScriptTarget.Latest,
|
||||
true,
|
||||
rel.endsWith(".tsx") ? ts.ScriptKind.TSX : ts.ScriptKind.TS,
|
||||
);
|
||||
}
|
||||
|
||||
type FunctionNode =
|
||||
| ts.FunctionDeclaration
|
||||
| ts.FunctionExpression
|
||||
| ts.ArrowFunction
|
||||
| ts.MethodDeclaration
|
||||
| ts.ConstructorDeclaration
|
||||
| ts.GetAccessorDeclaration
|
||||
| ts.SetAccessorDeclaration;
|
||||
|
||||
function isFunctionNode(node: ts.Node): node is FunctionNode {
|
||||
return (
|
||||
ts.isFunctionDeclaration(node) ||
|
||||
ts.isFunctionExpression(node) ||
|
||||
ts.isArrowFunction(node) ||
|
||||
ts.isMethodDeclaration(node) ||
|
||||
ts.isConstructorDeclaration(node) ||
|
||||
ts.isGetAccessorDeclaration(node) ||
|
||||
ts.isSetAccessorDeclaration(node)
|
||||
);
|
||||
}
|
||||
|
||||
function propertyNameText(name: ts.PropertyName): string | null {
|
||||
if (
|
||||
ts.isIdentifier(name) ||
|
||||
ts.isStringLiteral(name) ||
|
||||
ts.isNumericLiteral(name) ||
|
||||
ts.isPrivateIdentifier(name)
|
||||
) {
|
||||
return name.text;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function calleeText(call: ts.CallExpression, sf: ts.SourceFile): string {
|
||||
const text = call.expression.getText(sf).replace(/\s+/g, "");
|
||||
return text.length > 40 ? `${text.slice(0, 40)}…` : text;
|
||||
}
|
||||
|
||||
/**
|
||||
* A readable, stable name for a function node: its own name, the variable or
|
||||
* property it is assigned to, or the call it is passed to
|
||||
* (`apiHandler(arg)`, `$transaction(arg)`). Positions are deliberately not
|
||||
* part of it, so an edit above a function does not rename it.
|
||||
*/
|
||||
function ownName(node: FunctionNode, sf: ts.SourceFile): string {
|
||||
if (ts.isConstructorDeclaration(node)) return "constructor";
|
||||
if (
|
||||
(ts.isFunctionDeclaration(node) ||
|
||||
ts.isFunctionExpression(node) ||
|
||||
ts.isMethodDeclaration(node) ||
|
||||
ts.isGetAccessorDeclaration(node) ||
|
||||
ts.isSetAccessorDeclaration(node)) &&
|
||||
node.name
|
||||
) {
|
||||
const text = ts.isIdentifier(node.name)
|
||||
? node.name.text
|
||||
: propertyNameText(node.name as ts.PropertyName);
|
||||
if (text) return text;
|
||||
}
|
||||
const parent = node.parent;
|
||||
if (ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name)) {
|
||||
return parent.name.text;
|
||||
}
|
||||
if (ts.isPropertyAssignment(parent)) {
|
||||
return propertyNameText(parent.name) ?? "(property)";
|
||||
}
|
||||
if (ts.isPropertyDeclaration(parent)) {
|
||||
return propertyNameText(parent.name) ?? "(property)";
|
||||
}
|
||||
if (ts.isExportAssignment(parent)) return "default";
|
||||
if (ts.isCallExpression(parent)) return `${calleeText(parent, sf)}(arg)`;
|
||||
if (ts.isJsxExpression(parent)) return "(jsx callback)";
|
||||
return "(anonymous)";
|
||||
}
|
||||
|
||||
export interface MeasuredFunction {
|
||||
/** `outer > inner` chain of names, unique within the file. */
|
||||
name: string;
|
||||
/** 1-based first line. */
|
||||
line: number;
|
||||
lines: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Every function in the file with its length in lines, nested functions
|
||||
* included (a 2,800-line function holding a 2,100-line callback reports
|
||||
* both). Names that collide within a file get a `#2`, `#3` suffix in source
|
||||
* order.
|
||||
*/
|
||||
export function measureFunctions(sf: ts.SourceFile): MeasuredFunction[] {
|
||||
const out: MeasuredFunction[] = [];
|
||||
const seen = new Map<string, number>();
|
||||
const visit = (node: ts.Node, chain: string[]): void => {
|
||||
let next = chain;
|
||||
if (isFunctionNode(node)) {
|
||||
const base = [...chain, ownName(node, sf)].join(" > ");
|
||||
const n = (seen.get(base) ?? 0) + 1;
|
||||
seen.set(base, n);
|
||||
const name = n === 1 ? base : `${base} #${n}`;
|
||||
const start = sf.getLineAndCharacterOfPosition(node.getStart(sf)).line;
|
||||
const end = sf.getLineAndCharacterOfPosition(node.getEnd()).line;
|
||||
out.push({ name, line: start + 1, lines: end - start + 1 });
|
||||
next = [...chain, ownName(node, sf)];
|
||||
}
|
||||
ts.forEachChild(node, (child) => visit(child, next));
|
||||
};
|
||||
visit(sf, []);
|
||||
return out;
|
||||
}
|
||||
|
||||
// ── Value-import graph ──────────────────────────────────────────────────────
|
||||
|
||||
const COMPILER_OPTIONS: ts.CompilerOptions = {
|
||||
baseUrl: process.cwd(),
|
||||
paths: { "@/*": ["./src/*"] },
|
||||
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
||||
module: ts.ModuleKind.ESNext,
|
||||
jsx: ts.JsxEmit.ReactJSX,
|
||||
resolveJsonModule: true,
|
||||
allowJs: true,
|
||||
};
|
||||
|
||||
export interface ModuleImports {
|
||||
/** Specifiers this module evaluates at runtime, static and dynamic. */
|
||||
value: string[];
|
||||
/** True when every statement is an `export … from` (or an import). */
|
||||
reexportOnly: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* The specifiers a module needs at runtime: static imports and re-exports
|
||||
* that are not type-only, side-effect imports, and dynamic `import("…")`
|
||||
* with a literal specifier. `import type`, `export type` and lists whose
|
||||
* every name is `type` are erased by the compiler and left out.
|
||||
*/
|
||||
export function moduleImports(sf: ts.SourceFile): ModuleImports {
|
||||
const value: string[] = [];
|
||||
let reexports = 0;
|
||||
let other = 0;
|
||||
for (const st of sf.statements) {
|
||||
if (ts.isImportDeclaration(st)) {
|
||||
const clause = st.importClause;
|
||||
const typeOnly =
|
||||
!!clause &&
|
||||
(clause.isTypeOnly ||
|
||||
(!clause.name &&
|
||||
!!clause.namedBindings &&
|
||||
ts.isNamedImports(clause.namedBindings) &&
|
||||
clause.namedBindings.elements.length > 0 &&
|
||||
clause.namedBindings.elements.every((e) => e.isTypeOnly)));
|
||||
if (!typeOnly && ts.isStringLiteral(st.moduleSpecifier)) {
|
||||
value.push(st.moduleSpecifier.text);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (ts.isExportDeclaration(st) && st.moduleSpecifier) {
|
||||
reexports += 1;
|
||||
const typeOnly =
|
||||
st.isTypeOnly ||
|
||||
(!!st.exportClause &&
|
||||
ts.isNamedExports(st.exportClause) &&
|
||||
st.exportClause.elements.length > 0 &&
|
||||
st.exportClause.elements.every((e) => e.isTypeOnly));
|
||||
if (!typeOnly && ts.isStringLiteral(st.moduleSpecifier)) {
|
||||
value.push(st.moduleSpecifier.text);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
other += 1;
|
||||
}
|
||||
const visit = (node: ts.Node): void => {
|
||||
if (
|
||||
ts.isCallExpression(node) &&
|
||||
node.expression.kind === ts.SyntaxKind.ImportKeyword &&
|
||||
node.arguments[0] &&
|
||||
ts.isStringLiteralLike(node.arguments[0])
|
||||
) {
|
||||
value.push(node.arguments[0].text);
|
||||
}
|
||||
ts.forEachChild(node, visit);
|
||||
};
|
||||
visit(sf);
|
||||
return { value, reexportOnly: reexports > 0 && other === 0 };
|
||||
}
|
||||
|
||||
export interface ImportGraph {
|
||||
/** Module → modules it imports at runtime, both relative to `src/`. */
|
||||
edges: Map<string, string[]>;
|
||||
/** Modules whose every statement is a re-export. */
|
||||
reexportOnly: string[];
|
||||
/** Specifiers resolved to a module inside `src/`. */
|
||||
resolved: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The runtime import graph over the production sources, resolved with the
|
||||
* compiler's own module resolution under the app's `@/*` path mapping.
|
||||
* Imports of `src/generated/` and of packages are not edges.
|
||||
*/
|
||||
export function buildImportGraph(files: readonly string[]): ImportGraph {
|
||||
const cache = ts.createModuleResolutionCache(
|
||||
process.cwd(),
|
||||
(x) => x,
|
||||
COMPILER_OPTIONS,
|
||||
);
|
||||
const known = new Set(files);
|
||||
const edges = new Map<string, string[]>();
|
||||
const reexportOnly: string[] = [];
|
||||
let resolved = 0;
|
||||
for (const rel of files) {
|
||||
const abs = join(SRC, rel);
|
||||
const sf = parse(rel, readFileSync(abs, "utf8"));
|
||||
const imports = moduleImports(sf);
|
||||
if (imports.reexportOnly) reexportOnly.push(rel);
|
||||
const deps = new Set<string>();
|
||||
for (const spec of imports.value) {
|
||||
const hit = ts.resolveModuleName(
|
||||
spec,
|
||||
abs,
|
||||
COMPILER_OPTIONS,
|
||||
ts.sys,
|
||||
cache,
|
||||
).resolvedModule;
|
||||
if (!hit || hit.isExternalLibraryImport) continue;
|
||||
const target = hit.resolvedFileName;
|
||||
if (!target.startsWith(`${SRC}/`)) continue;
|
||||
const targetRel = target.slice(SRC.length + 1);
|
||||
if (!known.has(targetRel)) continue;
|
||||
deps.add(targetRel);
|
||||
resolved += 1;
|
||||
}
|
||||
edges.set(rel, [...deps].sort());
|
||||
}
|
||||
return { edges, reexportOnly, resolved };
|
||||
}
|
||||
|
||||
/** Strongly connected components with more than one module, or a self-loop. */
|
||||
export function stronglyConnected(edges: Map<string, string[]>): string[][] {
|
||||
let index = 0;
|
||||
const idx = new Map<string, number>();
|
||||
const low = new Map<string, number>();
|
||||
const onStack = new Set<string>();
|
||||
const stack: string[] = [];
|
||||
const out: string[][] = [];
|
||||
|
||||
const strong = (v: string): void => {
|
||||
idx.set(v, index);
|
||||
low.set(v, index);
|
||||
index += 1;
|
||||
stack.push(v);
|
||||
onStack.add(v);
|
||||
for (const w of edges.get(v) ?? []) {
|
||||
if (!idx.has(w)) {
|
||||
strong(w);
|
||||
low.set(v, Math.min(low.get(v)!, low.get(w)!));
|
||||
} else if (onStack.has(w)) {
|
||||
low.set(v, Math.min(low.get(v)!, idx.get(w)!));
|
||||
}
|
||||
}
|
||||
if (low.get(v) === idx.get(v)) {
|
||||
const component: string[] = [];
|
||||
let w: string;
|
||||
do {
|
||||
w = stack.pop()!;
|
||||
onStack.delete(w);
|
||||
component.push(w);
|
||||
} while (w !== v);
|
||||
if (component.length > 1 || (edges.get(v) ?? []).includes(v)) {
|
||||
out.push(component.sort());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
for (const v of [...edges.keys()].sort()) if (!idx.has(v)) strong(v);
|
||||
return out.sort((a, b) => a[0].localeCompare(b[0]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Cycles the way a depth-first walk in sorted order meets them: one cycle
|
||||
* per back edge, each listed from the module the walk re-entered. This is
|
||||
* the count `madge --circular` reports, so the number reads the same as the
|
||||
* audits that measured it.
|
||||
*/
|
||||
export function backEdgeCycles(edges: Map<string, string[]>): string[][] {
|
||||
const visited = new Set<string>();
|
||||
const cycles: string[][] = [];
|
||||
const path: string[] = [];
|
||||
const onPath = new Set<string>();
|
||||
const walk = (v: string): void => {
|
||||
if (onPath.has(v)) {
|
||||
cycles.push([...path.slice(path.indexOf(v)), v]);
|
||||
return;
|
||||
}
|
||||
if (visited.has(v)) return;
|
||||
visited.add(v);
|
||||
path.push(v);
|
||||
onPath.add(v);
|
||||
for (const w of edges.get(v) ?? []) walk(w);
|
||||
path.pop();
|
||||
onPath.delete(v);
|
||||
};
|
||||
for (const v of [...edges.keys()].sort()) walk(v);
|
||||
return cycles;
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
/**
|
||||
* File and function size may only shrink.
|
||||
*
|
||||
* Two caps over the production source (see `helpers/source-metrics.ts` for
|
||||
* what counts): a file over 800 lines, and a function over 200 lines. Most of
|
||||
* the large files are one large function, so both are measured, through the
|
||||
* TypeScript compiler.
|
||||
*
|
||||
* Every file and function over its cap today is in a baseline under
|
||||
* `baselines/` with its current length. From here:
|
||||
*
|
||||
* - a new file or function over the cap fails;
|
||||
* - a baselined one that grows past its recorded length fails. If the
|
||||
* growth is deliberate, raising the number is a hand edit of the JSON in
|
||||
* a reviewed change, with the reason in the PR;
|
||||
* - a baselined one that shrank by more than the slack (or fell under the
|
||||
* cap) fails until the lower number is written back with
|
||||
* `RATCHET_WRITE=1 pnpm vitest run src/__tests__/source-size-ratchet.test.ts`.
|
||||
* The slack (25 lines for a file, 10 for a function) keeps a small edit
|
||||
* from forcing a baseline commit; a real split always crosses it.
|
||||
*
|
||||
* Catalog and data files are exempt from both caps: their length is the
|
||||
* length of the thing they list, and splitting them changes navigation, not
|
||||
* cohesion. Each is named below with its reason, and a named file that no
|
||||
* longer exists fails, so the list cannot outlive its entries.
|
||||
*/
|
||||
import { existsSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { requireFloor } from "./helpers/source-files";
|
||||
import {
|
||||
SRC,
|
||||
lineCount,
|
||||
measureFunctions,
|
||||
parse,
|
||||
productionSources,
|
||||
readSrc,
|
||||
} from "./helpers/source-metrics";
|
||||
import { runRatchet, writeBackHint } from "./helpers/ratchet";
|
||||
|
||||
const FILE_CAP = 800;
|
||||
const FUNCTION_CAP = 200;
|
||||
const GUARD = "src/__tests__/source-size-ratchet.test.ts";
|
||||
|
||||
/**
|
||||
* Exempt from both caps. A key ending in `/` covers the folder. Paths are
|
||||
* relative to `src/`.
|
||||
*/
|
||||
const CATALOGS: Readonly<Record<string, string>> = {
|
||||
"lib/openapi/routes/":
|
||||
"the OpenAPI contract: one schema and one path entry per route, grows with the API surface",
|
||||
"lib/signals/registry.ts": "the SIGNALS record, one entry per signal",
|
||||
"lib/ai/coach/eval/golden-cases.ts": "Coach evaluation fixtures",
|
||||
"lib/ai/coach/system-prompt.ts": "prompt text",
|
||||
"lib/measurements/apple-health-mapping.ts":
|
||||
"the HealthKit identifier mapping table",
|
||||
"lib/labs/biomarker-catalog.ts": "the biomarker catalogue",
|
||||
"app/privacy/page.tsx":
|
||||
"legal copy rendered as React text, one long static component",
|
||||
};
|
||||
|
||||
function isCatalog(rel: string): boolean {
|
||||
return Object.keys(CATALOGS).some((key) =>
|
||||
key.endsWith("/") ? rel.startsWith(key) : rel === key,
|
||||
);
|
||||
}
|
||||
|
||||
function measure() {
|
||||
const files = productionSources();
|
||||
const fileLines: Record<string, number> = {};
|
||||
const functionLines: Record<string, number> = {};
|
||||
let functionsSeen = 0;
|
||||
for (const rel of files) {
|
||||
if (isCatalog(rel)) continue;
|
||||
const text = readSrc(rel);
|
||||
const lines = lineCount(text);
|
||||
if (lines > FILE_CAP) fileLines[rel] = lines;
|
||||
for (const fn of measureFunctions(parse(rel, text))) {
|
||||
functionsSeen += 1;
|
||||
if (fn.lines > FUNCTION_CAP)
|
||||
functionLines[`${rel} :: ${fn.name}`] = fn.lines;
|
||||
}
|
||||
}
|
||||
return { files: files.length, functionsSeen, fileLines, functionLines };
|
||||
}
|
||||
|
||||
describe("source size ratchet", () => {
|
||||
const m = measure();
|
||||
|
||||
it("reads the whole tree", () => {
|
||||
expect(m.files).toBeGreaterThan(3000);
|
||||
expect(m.functionsSeen).toBeGreaterThan(20_000);
|
||||
requireFloor("files over the cap", Object.keys(m.fileLines), 100);
|
||||
requireFloor("functions over the cap", Object.keys(m.functionLines), 300);
|
||||
});
|
||||
|
||||
it(`no file over ${FILE_CAP} lines grows, and none is added`, () => {
|
||||
const r = runRatchet("source-file-lines.json", m.fileLines, {
|
||||
slack: 25,
|
||||
comment: `Production files over ${FILE_CAP} lines and their length. Maintained by ${GUARD}.`,
|
||||
});
|
||||
expect(
|
||||
r.grew,
|
||||
`Files over ${FILE_CAP} lines that are new or longer than their baseline. Split the file, or raise its number in src/__tests__/baselines/source-file-lines.json in a reviewed change with the reason.`,
|
||||
).toEqual([]);
|
||||
expect(r.stale, writeBackHint(GUARD)).toEqual([]);
|
||||
});
|
||||
|
||||
it(`no function over ${FUNCTION_CAP} lines grows, and none is added`, () => {
|
||||
const r = runRatchet("source-function-lines.json", m.functionLines, {
|
||||
slack: 10,
|
||||
comment: `Production functions over ${FUNCTION_CAP} lines, keyed "file :: name", and their length. Maintained by ${GUARD}.`,
|
||||
});
|
||||
expect(
|
||||
r.grew,
|
||||
`Functions over ${FUNCTION_CAP} lines that are new or longer than their baseline. Extract a part, or raise its number in src/__tests__/baselines/source-function-lines.json in a reviewed change with the reason.`,
|
||||
).toEqual([]);
|
||||
expect(r.stale, writeBackHint(GUARD)).toEqual([]);
|
||||
});
|
||||
|
||||
it("names no catalog that is gone", () => {
|
||||
const missing = Object.keys(CATALOGS).filter(
|
||||
(key) => !existsSync(join(SRC, key)),
|
||||
);
|
||||
expect(missing).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("the function measure", () => {
|
||||
const fns = (text: string) => measureFunctions(parse("probe.ts", text));
|
||||
|
||||
it("names declarations, assignments, methods and call arguments", () => {
|
||||
const names = fns(
|
||||
[
|
||||
"export function a() {}",
|
||||
"const b = () => {};",
|
||||
"const o = { c() {}, d: function () {} };",
|
||||
"class K { constructor() {} e() {} }",
|
||||
"wrap(async () => {});",
|
||||
"function f() { return () => 1; }",
|
||||
].join("\n"),
|
||||
).map((f) => f.name);
|
||||
expect(names).toEqual([
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
"d",
|
||||
"constructor",
|
||||
"e",
|
||||
"wrap(arg)",
|
||||
"f",
|
||||
"f > (anonymous)",
|
||||
]);
|
||||
});
|
||||
|
||||
it("counts lines from the first to the last line of the node", () => {
|
||||
const [fn] = fns("function a() {\n x();\n y();\n}\n");
|
||||
expect(fn.lines).toBe(4);
|
||||
expect(fn.line).toBe(1);
|
||||
});
|
||||
|
||||
it("keeps two same-named functions apart", () => {
|
||||
const names = fns("call(() => 1);\ncall(() => 2);").map((f) => f.name);
|
||||
expect(names).toEqual(["call(arg)", "call(arg) #2"]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,196 @@
|
||||
/**
|
||||
* Test shapes that cannot see the bugs this repo keeps shipping may only
|
||||
* become rarer.
|
||||
*
|
||||
* Four ratchets over the test files under `src/`, each against a baseline in
|
||||
* `baselines/` (see `helpers/ratchet.ts` for the mechanics):
|
||||
*
|
||||
* - route tests that replace the database client wholesale
|
||||
* (`vi.mock("@/lib/db", …)`): they assert the query the route sends, not
|
||||
* what Postgres does with it, so a `where` that matches the wrong rows
|
||||
* passes. Behaviour belongs in `tests/integration/`;
|
||||
* - route tests that stub `@/lib/api-handler`: they skip auth, scope, the
|
||||
* envelope and idempotency, which is where the handler arity class hid;
|
||||
* - `as never` casts in tests: they switch the type checker off for exactly
|
||||
* the fixture rows that would otherwise drift loudly when a model
|
||||
* changes;
|
||||
* - tests that read a source file by path and assert on its text. A split
|
||||
* or rename leaves such a test reading the wrong file, and a negative
|
||||
* assertion then passes for the wrong reason. New ones go through
|
||||
* `readSource(path, anchors)` or `readSourceFolder(dir, { floor })` in
|
||||
* `helpers/source-files.ts`, which this count does not include.
|
||||
*
|
||||
* A new offender fails; one that disappears (or loses casts) fails until
|
||||
* the lower number is written back with
|
||||
* `RATCHET_WRITE=1 pnpm vitest run src/__tests__/test-realism-ratchet.test.ts`.
|
||||
*
|
||||
* Limits, stated: the database mock is matched on `vi.mock`/`vi.doMock` with
|
||||
* the `@/lib/db` specifier or a relative path ending in `lib/db`; a mock of
|
||||
* the Prisma client entry itself, or a spy on every delegate, is not a
|
||||
* pattern in use and is not matched. The source-read check is a text
|
||||
* heuristic: a file that calls `readFileSync`/`readFile` and names a source
|
||||
* path (a literal ending in `.ts`, `.tsx`, `.js` or `.mjs`).
|
||||
*/
|
||||
import { describe, expect, it } from "vitest";
|
||||
import ts from "typescript";
|
||||
|
||||
import { requireFloor } from "./helpers/source-files";
|
||||
import { parse, readSrc, testSources } from "./helpers/source-metrics";
|
||||
import { runRatchet, writeBackHint } from "./helpers/ratchet";
|
||||
|
||||
const GUARD = "src/__tests__/test-realism-ratchet.test.ts";
|
||||
|
||||
const DB_MOCK =
|
||||
/vi\.(?:do)?[mM]ock\(\s*["'`](?:@\/lib\/db|(?:\.\.?\/)+(?:[\w-]+\/)*lib\/db)["'`]/;
|
||||
const HANDLER_STUB = /vi\.(?:do)?[mM]ock\(\s*["'`]@\/lib\/api-handler["'`]/;
|
||||
const READS_FILE = /\b(?:readFileSync|readFile)\s*\(/;
|
||||
const SOURCE_PATH = /["'`][^"'`\n]*\.(?:tsx?|mjs|js)["'`]/;
|
||||
|
||||
function asNeverCount(rel: string, text: string): number {
|
||||
if (!text.includes("as never")) return 0;
|
||||
let n = 0;
|
||||
const visit = (node: ts.Node): void => {
|
||||
if (
|
||||
ts.isAsExpression(node) &&
|
||||
node.type.kind === ts.SyntaxKind.NeverKeyword
|
||||
) {
|
||||
n += 1;
|
||||
}
|
||||
ts.forEachChild(node, visit);
|
||||
};
|
||||
visit(parse(rel, text));
|
||||
return n;
|
||||
}
|
||||
|
||||
function classifyTest(rel: string, text: string) {
|
||||
const routeTest = rel.startsWith("app/api/");
|
||||
return {
|
||||
dbMock: routeTest && DB_MOCK.test(text),
|
||||
handlerStub: routeTest && HANDLER_STUB.test(text),
|
||||
asNever: asNeverCount(rel, text),
|
||||
sourceRead: READS_FILE.test(text) && SOURCE_PATH.test(text),
|
||||
};
|
||||
}
|
||||
|
||||
function measure() {
|
||||
const tests = testSources();
|
||||
const dbMocks: Record<string, number> = {};
|
||||
const handlerStubs: Record<string, number> = {};
|
||||
const asNever: Record<string, number> = {};
|
||||
const sourceReads: Record<string, number> = {};
|
||||
let routeTests = 0;
|
||||
for (const rel of tests) {
|
||||
const c = classifyTest(rel, readSrc(rel));
|
||||
if (rel.startsWith("app/api/")) routeTests += 1;
|
||||
if (c.dbMock) dbMocks[rel] = 1;
|
||||
if (c.handlerStub) handlerStubs[rel] = 1;
|
||||
if (c.asNever > 0) asNever[rel] = c.asNever;
|
||||
if (c.sourceRead) sourceReads[rel] = 1;
|
||||
}
|
||||
return {
|
||||
tests: tests.length,
|
||||
routeTests,
|
||||
dbMocks,
|
||||
handlerStubs,
|
||||
asNever,
|
||||
sourceReads,
|
||||
};
|
||||
}
|
||||
|
||||
describe("test realism ratchet", () => {
|
||||
const m = measure();
|
||||
|
||||
it("reads the whole test tree", () => {
|
||||
expect(m.tests).toBeGreaterThan(2000);
|
||||
expect(m.routeTests).toBeGreaterThan(300);
|
||||
requireFloor("route tests mocking the db", Object.keys(m.dbMocks), 100);
|
||||
requireFloor("test files with as never", Object.keys(m.asNever), 100);
|
||||
requireFloor("source-reading tests", Object.keys(m.sourceReads), 100);
|
||||
});
|
||||
|
||||
it.each([
|
||||
[
|
||||
"route tests that mock @/lib/db wholesale",
|
||||
"route-test-db-mocks.json",
|
||||
"dbMocks",
|
||||
"Drive the route against Postgres in tests/integration/ instead.",
|
||||
],
|
||||
[
|
||||
"route tests that stub @/lib/api-handler",
|
||||
"route-test-handler-stubs.json",
|
||||
"handlerStubs",
|
||||
"Call the real handler, so auth, scope and the envelope run.",
|
||||
],
|
||||
[
|
||||
"as never casts in tests",
|
||||
"test-as-never.json",
|
||||
"asNever",
|
||||
"Type the fixture (a typed builder or the Prisma payload type) instead of casting it away.",
|
||||
],
|
||||
[
|
||||
"tests that read a source file by path",
|
||||
"test-source-reads.json",
|
||||
"sourceReads",
|
||||
"Read through readSource(path, anchors) or readSourceFolder(dir, { floor }) from src/__tests__/helpers/source-files.ts.",
|
||||
],
|
||||
] as const)("%s only become rarer", (label, file, key, advice) => {
|
||||
const r = runRatchet(file, m[key], {
|
||||
comment: `${label}, per test file under src/. Maintained by ${GUARD}.`,
|
||||
});
|
||||
expect(r.grew, `New or grown: ${label}. ${advice}`).toEqual([]);
|
||||
expect(r.stale, writeBackHint(GUARD)).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
const READ_CALL = ["read", "File", "Sync"].join("");
|
||||
|
||||
describe("the classifier", () => {
|
||||
it("sees the shapes it counts", () => {
|
||||
const c = classifyTest(
|
||||
"app/api/x/__tests__/route.test.ts",
|
||||
[
|
||||
'vi.mock("@/lib/db", () => ({ prisma: {} }));',
|
||||
'vi.mock("@/lib/api-handler", () => ({}));',
|
||||
"const a = {} as never; const b = [] as never;",
|
||||
// Split so this file does not count itself as a source reader.
|
||||
`const src = ${READ_CALL}(join(ROOT, "src/app/api/x/route.ts"), "utf8");`,
|
||||
].join("\n"),
|
||||
);
|
||||
expect(c).toEqual({
|
||||
dbMock: true,
|
||||
handlerStub: true,
|
||||
asNever: 2,
|
||||
sourceRead: true,
|
||||
});
|
||||
});
|
||||
|
||||
it("ignores neighbours that only look alike", () => {
|
||||
const c = classifyTest(
|
||||
"app/api/x/__tests__/route.test.ts",
|
||||
[
|
||||
'vi.mock("@/lib/db-compat", () => ({}));',
|
||||
"// cast with as never is banned",
|
||||
'const s = "as never";',
|
||||
`const fixture = ${READ_CALL}(join(DIR, "sample.xml"), "utf8");`,
|
||||
].join("\n"),
|
||||
);
|
||||
expect(c).toEqual({
|
||||
dbMock: false,
|
||||
handlerStub: false,
|
||||
asNever: 0,
|
||||
sourceRead: false,
|
||||
});
|
||||
});
|
||||
|
||||
it("counts a relative database mock and only under app/api", () => {
|
||||
expect(
|
||||
classifyTest(
|
||||
"app/api/x/__tests__/a.test.ts",
|
||||
'vi.mock("../../../lib/db")',
|
||||
).dbMock,
|
||||
).toBe(true);
|
||||
expect(
|
||||
classifyTest("lib/x/__tests__/a.test.ts", 'vi.mock("@/lib/db")').dbMock,
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,85 @@
|
||||
/**
|
||||
* No new comment that opens with a release version.
|
||||
*
|
||||
* `// v1.4.39.1 — wipe the rollup partition … Pre-fix the partition kept …`
|
||||
* is a history note: it describes a state of the code the reader cannot see,
|
||||
* and it repeats what CHANGELOG and `git log` already hold. About ten
|
||||
* thousand comment lines in the tree open that way. They stay until their
|
||||
* file is split or rewritten anyway; a mass edit would be churn. New ones do
|
||||
* not get added: say what the code does and why, and leave when it changed
|
||||
* to the history.
|
||||
*
|
||||
* A comment line counts when, after its marker (`//`, `/*`, or the `*` of a
|
||||
* block comment), it opens with `vMAJOR.MINOR[.PATCH…]`. A version later in
|
||||
* the sentence ("since v1.39 the gate …") is not an opener and is not
|
||||
* counted. The count is per file, against `baselines/version-stamp-comments.json`:
|
||||
* a file that gains one fails, a new file with one fails, and a file that
|
||||
* sheds some fails until the lower count is written back with
|
||||
* `RATCHET_WRITE=1 pnpm vitest run src/__tests__/version-stamp-ratchet.test.ts`.
|
||||
*
|
||||
* Limit, stated: it reads lines, not the parse tree, so a line inside a
|
||||
* template string that happens to start with `* v1.2` would count. None does
|
||||
* today.
|
||||
*/
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { requireFloor, walkSourceFiles } from "./helpers/source-files";
|
||||
import { SRC, readSrc } from "./helpers/source-metrics";
|
||||
import { runRatchet, writeBackHint } from "./helpers/ratchet";
|
||||
|
||||
const GUARD = "src/__tests__/version-stamp-ratchet.test.ts";
|
||||
|
||||
const STAMP_OPENER = /^\s*(?:\/\/+|\/\*+|\*+)\s*\(?v\d+\.\d+(?:\.\d+){0,3}\b/;
|
||||
|
||||
function stampCount(text: string): number {
|
||||
let n = 0;
|
||||
for (const line of text.split("\n")) if (STAMP_OPENER.test(line)) n += 1;
|
||||
return n;
|
||||
}
|
||||
|
||||
describe("version-stamp comments", () => {
|
||||
const files = walkSourceFiles(SRC, { floor: 5000 }).filter(
|
||||
(rel) => !rel.startsWith("generated/") && !rel.endsWith(".d.ts"),
|
||||
);
|
||||
const counts: Record<string, number> = {};
|
||||
for (const rel of files) {
|
||||
const n = stampCount(readSrc(rel));
|
||||
if (n > 0) counts[rel] = n;
|
||||
}
|
||||
|
||||
it("finds the stamps that are there", () => {
|
||||
requireFloor("files with a version-stamp opener", Object.keys(counts), 500);
|
||||
});
|
||||
|
||||
it("gains none, and records every one that goes", () => {
|
||||
const r = runRatchet("version-stamp-comments.json", counts, {
|
||||
comment: `Comment lines that open with a release version, per file under src/. Maintained by ${GUARD}.`,
|
||||
});
|
||||
expect(
|
||||
r.grew,
|
||||
"New comment lines opening with a release version. Say what the code does and why; when it changed belongs in CHANGELOG and git.",
|
||||
).toEqual([]);
|
||||
expect(r.stale, writeBackHint(GUARD)).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("the opener matcher", () => {
|
||||
it.each([
|
||||
"// v1.4.39.1 — wipe the partition",
|
||||
" // v1.23: notes are encrypted",
|
||||
" * v1.37.19 (#219 parity) — per-slot units",
|
||||
"/* v1.5.0 — one-shot backfill */",
|
||||
"/** v1.16.12 — stale window widened */",
|
||||
])("counts %s", (line) => {
|
||||
expect(stampCount(line)).toBe(1);
|
||||
});
|
||||
|
||||
it.each([
|
||||
"// Since v1.39 every AI decision is one resolution",
|
||||
"const v = 'v1.2.3';",
|
||||
"// version 1.2",
|
||||
"// ve1.2",
|
||||
])("does not count %s", (line) => {
|
||||
expect(stampCount(line)).toBe(0);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user