Skip to main content

App development

All Flutter commands run from the app/ directory.
cd app
flutter pub get
flutter analyze
flutter test
Code generation after schema or provider changes:
dart run build_runner build --delete-conflicting-outputs

Testing tiers

Canthus uses layered tests so mana math, persistence, and UI flows stay aligned with docs without running everything on a device.
TierLocationRunnerWhat it validates
Engineapp/test/domain/mana/flutter test test/domain/mana/Mana formulas and surfacing rules vs docs via ManaFixtureBuilder
Pipeline flowsapp/test/flows/pipeline/flutter test test/flows/pipeline/Real in-memory Drift + live mana pipeline; doc-oracle scenarios (check-in inflation, completion, severe surfacing, watch stability)
UI flowsapp/test/ui/flows/flutter test test/ui/flows/Full AppShell with real DB and mana pipeline; daily-loop UX (surfacing, check-in, completion, FAB, orchard, temporal copy)
Widget (mocked)app/test/ui/flutter test test/ui/Screen/widget behavior with overridden providers
Integration smokeapp/integration_test/flutter test integration_test/ -d <device>Thin device/emulator smoke on real bindings; 1–2 mana assertions on check-in and completion
Shared synthetic harness code lives in app/test/support/ (DriftScenarioSeeder, SyntheticAppHarness, ScenarioCatalog, mana_flow_assertions.dart). Integration tests import the same seeder via integration_test/support/fixtures.dart.

Fast CI subset

CI runs analyze, architecture checks, and both flow tiers:
cd app
flutter analyze
flutter test test/architecture/
flutter test test/flows/pipeline/
flutter test test/ui/flows/

Integration tests locally

Requires a booted simulator or device:
cd app
make itest SIM="iPhone 17 Pro"
# or a single flow:
make itest-file FILE=check_in_flow_test.dart SIM="iPhone 17 Pro"
Prefer fixed-duration pumps over pumpAndSettle() in flow tests that mount the live mana stream provider.

Docs site preview

Documentation lives in docs/ and uses Mintlify.
1

Install the Mintlify CLI

npm i -g mint
2

Preview locally

From the docs/ directory:
mint dev
A local preview is available at http://localhost:3000.

Evidence registry

User-facing claims must cite code and docs in evidence/registry/. Flow tests that lock behavior to docs can be cited as additional code refs (see evidence/registry/mana.yaml). Validate before opening a PR:
dart run tools/evidence/validate.dart