diff --git a/src/admin/AdminSeedPanel.test.tsx b/src/admin/AdminSeedPanel.test.tsx index e4423bc..3e14184 100644 --- a/src/admin/AdminSeedPanel.test.tsx +++ b/src/admin/AdminSeedPanel.test.tsx @@ -130,9 +130,10 @@ describe("AdminSeedPanel - Load Hollow demo", () => { // population + 4 resources + 3 baselines + 4 fairshare.need + 1 wallet.issue // + 1 wallet.transfer + skillHolder seeds + 1 housing.assignment cycle // + 1 wallet.issue credit per housing resident + 1 marker - // + 4 waterwatch.reading.report + 2 water corroboration settlement - // (seed.resource.water credit + fairshare.allocation.cycle, only the 4th - // reading reaches "alert") + 1 tunnelsafety.hazard.report + // + 1 tunnelsafety.hazard.report (no Water Watch readings: this app has + // no real sensor network, so the demo seed deliberately leaves it at its + // honest "No sensor readings yet" empty state rather than injecting + // fixture data standing in for hardware that doesn't exist) // + 2 farms settlement (seed.resource.food credit + fairshare.allocation.cycle) // + 1 mentor.skillReview const expectedCount = @@ -145,8 +146,6 @@ describe("AdminSeedPanel - Load Hollow demo", () => { 1 + housingResidentCount + 1 + - 4 + - 2 + 1 + 2 + 1; diff --git a/src/admin/AdminSeedPanel.tsx b/src/admin/AdminSeedPanel.tsx index dae2dd9..b1efaf1 100644 --- a/src/admin/AdminSeedPanel.tsx +++ b/src/admin/AdminSeedPanel.tsx @@ -12,10 +12,8 @@ import { import { computeGdd, settleFarmsForecast, solveFarmsPlantingOptimizer } from "../lib/farms"; import { reportHazard } from "../lib/tunnelsafety"; import { DEFAULT_ASSEMBLY_DB_NAME, getAssemblyEngine } from "../miniapps/assembly/useAssemblyEngine"; -import { createCorroborationGate } from "../miniapps/waterwatch/corroboration"; import { postSkillReview } from "../miniapps/mentor/mentorEvents"; import { Rating } from "../lib/mentorSchedule"; -import { reportWaterReading, settleCorroboratedReading } from "../miniapps/waterwatch/corroboration"; import { toAccountId } from "../shell/accountId"; import { AdminAggregatePanel } from "./AdminAggregatePanel"; import { @@ -37,7 +35,6 @@ import { HOLLOW_DEMO_PROPOSAL, HOLLOW_DEMO_ROSTER, HOLLOW_DEMO_VOTES, - HOLLOW_DEMO_WATER_READINGS, hasDemoFixtureBeenLoaded, validateSeedInput, type ResourceType, @@ -162,27 +159,15 @@ export function AdminSeedPanel({ assemblyDbName, aggregateEndpoint }: AdminSeedP }); } - // Two independently-corroborating Water Watch readings (plan: richer - // demo data), run through the SAME real corroboration gate - // DeviceMonitor itself replays over (createCorroborationGate + - // reportWaterReading + settleCorroboratedReading) - so the gate's own - // state machine, not a hand-set status, decides "alert". Each raw - // reading is persisted regardless of its gate verdict, exactly like a - // live resident submission, so a cold reload replays the identical - // sequence DeviceMonitor would reconstruct on its own. - const waterGate = createCorroborationGate({ gate: { warmupSamples: 1 } }); - const waterBaseTime = Date.now(); - for (const reading of HOLLOW_DEMO_WATER_READINGS) { - const fullReading = { - sensorId: reading.sensorId, - channel: reading.channel, - value: reading.value, - timestamp: waterBaseTime + reading.timestampOffsetMs, - }; - const gateEvent = waterGate.ingest(fullReading); - await reportWaterReading(fullReading); - await settleCorroboratedReading(gateEvent); - } + // Water Watch deliberately gets NO seeded reading: its sensorId field + // names a resident-chosen tap label typed through the real + // ReportReadingForm, never a literal hardware device - this app has + // no actual sensor network, so a seed fixture that injects + // "kiosk-1"/"kiosk-2" readings would imply equipment that doesn't + // exist. Water Watch honestly starts at "No sensor readings yet"; the + // real corroboration mechanism (two independent reports agreeing) is + // demonstrated live by actually using the form, not by admin-injected + // fixture data standing in for a device that was never built. // One real hazard report (plan: richer demo data), through the same // reportHazard() path ReportHazardForm uses - Tunnel Safety's map and diff --git a/src/admin/seedEvents.ts b/src/admin/seedEvents.ts index 353843f..679c331 100644 --- a/src/admin/seedEvents.ts +++ b/src/admin/seedEvents.ts @@ -13,7 +13,6 @@ import type { MiniappManifest } from "../lib/miniappManifest"; import type { ProposalRecord, RosterEntry } from "../lib/assembly"; import type { HousingPreference, HousingSlot, SolveHousingInput } from "../lib/housing"; -import type { WaterReading } from "../miniapps/waterwatch/corroboration"; import type { HazardReportInput } from "../lib/tunnelsafety"; import type { PlantingPlot, CropMaturityWindow, TemperatureEntry } from "../lib/farms"; @@ -310,27 +309,6 @@ export function buildDemoSkillHolderPayloads(): DemoSkillHolderPayload[] { })); } -/** - * A real, independently-corroborated Water Watch alert for the Hollow demo - * fixture: two distinct sensors (`kiosk-1`/`kiosk-2`) each report a - * baseline-establishing pH reading, then both report the same extreme - * contaminated value in sequence - the exact real `reportWaterReading`/ - * `createCorroborationGate` path independently verified to produce a - * genuine "alert" `GateEvent` on the 4th reading (two independent sensors - * agreeing is the whole mechanism this mini-app demonstrates; this is not - * a fabricated alert state, it is replayed through the same corroboration - * gate DeviceMonitor itself uses). Timestamps are relative offsets the - * caller adds to `Date.now()` at load time, keeping every reading inside - * the gate's default 5-minute corroboration window regardless of when the - * demo is actually loaded. - */ -export const HOLLOW_DEMO_WATER_READINGS: ReadonlyArray & { timestampOffsetMs: number }> = [ - { sensorId: "kiosk-1", channel: "pH", value: 7.1, timestampOffsetMs: 0 }, - { sensorId: "kiosk-2", channel: "pH", value: 7.0, timestampOffsetMs: 1_000 }, - { sensorId: "kiosk-1", channel: "pH", value: 2.0, timestampOffsetMs: 2_000 }, - { sensorId: "kiosk-2", channel: "pH", value: 2.0, timestampOffsetMs: 3_000 }, -]; - /** * One real hazard report for the Hollow demo fixture, appended through the * same real `reportHazard()` path `ReportHazardForm` uses - so Tunnel