feat(dawarich): fetch daily movement values from a Dawarich instance

Connect, status, places, settings, test, sync and disconnect replace their
stubs. A nightly job (03:20) and the connect backfill read the timeline,
visits and residency endpoints through safeFetch and store one row of daily
values per local day: distances, places visited, minutes away from the home
place and the sealed country with its travel-day verdict. A private instance
needs its exact origin in DAWARICH_PRIVATE_ORIGINS.

The connection joins the shared ledger and the connection health model,
watched for errors only. The day carries a movement block, the model
projection drops the travel country, the two movement channels join the
correlation matrix under the environment module, travel days become trip
suggestions, and the days travel in the environment backup section.
This commit is contained in:
Marc-André Bombeck committed 2026-10-16 01:20:53 +02:00
1 parent 1e7fc08f57
commit b838ed4403
95 files changed
+4466 -158

No files matched your search

@@ -56,6 +56,8 @@ import { SUMMARY_TYPE_MODULE } from "@/lib/dashboard/widget-modules";
import { ENVIRONMENT_FIELDS } from "@/lib/environment/fields";
import {
DISCOVERY_BEHAVIOURS,
MOVEMENT_AWAY_CHANNEL_KEY,
MOVEMENT_DISTANCE_CHANNEL_KEY,
DISCOVERY_OUTCOMES,
FACTOR_CHANNEL_PREFIX,
} from "@/lib/insights/correlation-discovery";
@@ -179,11 +181,13 @@ describe("every surface id names a surface that exists", () => {
}
});
it("correlation: a discovery channel, a weather field or the lab pass", () => {
it("correlation: a discovery channel, a weather field, a movement channel or the lab pass", () => {
const channels = new Set<string>([
...DISCOVERY_BEHAVIOURS,
...DISCOVERY_OUTCOMES,
...ENVIRONMENT_FIELDS.map((f) => f.key),
MOVEMENT_AWAY_CHANNEL_KEY,
MOVEMENT_DISTANCE_CHANNEL_KEY,
"LAB_DRAWS",
]);
for (const id of localIds("correlation")) {
+3
View File
@@ -217,6 +217,9 @@ const STATIC_SURFACE_MODULE = {
"correlation:SYMPTOM_SEVERITY": "illness",
// The labs ↔ outcome pass over lab draws.
"correlation:LAB_DRAWS": "labs",
// v1.43 — the Dawarich movement channels ride the environment module.
"correlation:MOVEMENT_AWAY": "environment",
"correlation:MOVEMENT_DISTANCE": "environment",
// ── Day view sections (v1.42) ──
// The readings carry no owner here: each value follows its own type's