On first launch, when no database file exists at the configured application data path, the system shall create the local database, apply the current schema version, and create a default local clinic record that serves as the container for locally-created patient records.
The initialisation establishes the minimum persistent state required for any subsequent clinical operation — without it, patient records cannot be stored and recording sessions cannot be attached to a patient.
functional
true
73a53a6ea2b4546ac329d96363bd39c5485b220a390076754e0ecc52644acf7b
@DougYoungberg
coverage-plan: ST on clean install — fresh workstation, first launch, verify the database file exists at the expected path.
-
reviewedPassed1. First-launch DB initialisation UID: IT-001 RELATIONS (Parent): STATEMENT: Instantiate AppDatabase against a temporary filesystem path at which no database file exists. Trigger the initialisation pathway by performing any query that forces Drift's onCreate migration to run. Inspect the resulting state of the database on disk and of the seeded tables.
TEST_METHOD: automated
TEST_TOOL: flutter_test
ACCEPTANCE_CRITERIA: The database file exists at the temporary path after the first query. PRAGMA user_version on the opened database equals the value of AppDatabase.schemaVersion declared in application code. The clinics table contains at least one row whose origin is "local", confirming that the bootstrap seed step executed.
ACTIVE: true
REVIEWED_HASH: e3247b36656d8bfbc5165d261120954881338cfa7421592f73f5a18dd55acbb0
REVIEWED_BY: @DougYoungberg
NOTES: Test harness couples to the StrictDoc item via tags: ['IT-001'] on the flutter_test test entry. Test file location: test/integration/first_launch_db_initialization_integration_test.dart.
-
reviewedPassed1. Local clinic visible in Patients menu UID: ST-001 RELATIONS (Parent): STATEMENT: With the application launched on a workstation that has no pre-existing BioFlow data directory, navigate to the Patients menu and open the clinics dropdown. The local clinic entry shall be visible in the dropdown.
TEST_METHOD: automated
TEST_TOOL: VisionTrace
ACCEPTANCE_CRITERIA: Preconditions: application is launched on a clean workstation (no prior data directory); the main screen is visible. Steps: navigate to the Patients menu; open the clinics dropdown. Verification: a VisionTrace AI agent.verify(...) call confirms the local clinic is visible in the dropdown. No error dialog appears during launch or navigation.
ACTIVE: true
REVIEWED_HASH: e9d48e5587c7b709d4a995e682d3054cf55a5cab9240ad3b468778b91a742eec
REVIEWED_BY: @DougYoungberg
NOTES: Launching the application on a clean workstation is a test precondition handled by the VisionTrace app_session fixture, not a step in the test body. Test code lives in this repo at visiontrace_tests/bioflow/st001/, decorated with @visiontrace_test_case("ST-001"). The agent.verify(...) call takes a screenshot of the current UI and asks an AI model to confirm the described condition — for this test, that the local clinic is present in the dropdown. Running this test in CI requires VisionTrace to be installed in the CI environment and a Windows runner with a usable desktop session.