Jump to content

Formicarium/SPEC

From MindAttic Docs

Formicarium — Product specification

The complete product, written down before it is built (owner, 2026-11-30, MAT-T360). Every epic, feature and story the finished product will have is listed here, built or not. The ticket tree mirrors this file one to one: every ID below is a ticket. Nothing gets built unless it is here, and anything taken out of here is closed wont-do in the tree. docs/RELEASE.md says which part of this the current milestone delivers.

1. Product definition

Place in the ecosystem: a hardware product (docs/ECOSYSTEM.md §2.2); its dashboard uses the platform for settings (Vault) and shipping (the shared run menu).

Formicarium is a self-regulating habitat for one Tetramorium immigrans colony: a rigid 8 x 8 x 26 in acrylic column (ballasted base, Ytong nest, electronics bay with a drawer, outworld, vented lid) with ESP32 firmware in C# on .NET nanoFramework and a local Blazor dashboard. The finished product keeps a growing colony warm, humid, ventilated, fed with sugar water and safe without daily care, runs a closed-loop colour experiment at the riser mouths, and gives the colony a second chamber when it outgrows the first. It is for the owner, on the owner's desk.

2. Scope boundary

2.1 In the product

  • The column: base, nest, bay and drawer, outworld, lid, three load-bearing risers, Fluon barrier, moat tray.
  • Climate: external heating cable, two-zone ventilation, passive float-switch hydration.
  • Safety: cross-probe over-temperature cutout, safe boot, fail-off, invalid-never-stale readings.
  • Feeding: daily automatic sugar-water dose; protein by hand.
  • Traffic and light: one IR break-beam and one RGB ring per riser; the colour experiment.
  • Camera: IR ONVIF/RTSP feed in the dashboard.
  • Dashboard: Home, History, Traffic, Camera, Build; simulator; settings in MindAttic Vault; local SQL Server.
  • Expansion: one chamber connected through the capped nest-wall port.

2.2 Never in the product

  • A powered gate between nest and outworld: no firmware can tell a closed gate from a stuck one (design record).
  • Pumping water into the nest: only the reservoir is filled; it wicks (FOR-LAW-4).
  • Automated protein feeding: a jammed feeder rots in the dish.
  • Public hosting of the dashboard (auth, TLS, remote reach, Hetzner, Azure): the dashboard is local (BIBLE §3).
  • Cooling or diapause: the species needs neither.
  • Broad unit-test backfill of the dashboard and repo-wide bughunt or cleanup sweeps: real defects found on the hardware are filed as fix tasks (portfolio reset, FOR-T4..T11, FOR-T16/T17/T35).

3. Users and roles

  • The owner builds the column, cares for the colony, reads the dashboard and runs the experiment.
  • The colony is the other user: its needs (79-83 °F nest, humidity, food, room to grow) set the requirements.
  • An agent works the software tasks; every "Owner hands-on" task needs the owner's hands.

4. Requirements

Status is built (closed ticket, with evidence) or MS-n: the milestone in §7 that delivers it. Every unbuilt story is approved and prioritised in build order; the planner splits a story into tasks when the queue reaches it.

E1. Self-regulating control core — FOR-T65 — built

The hardware-free Core/ control loop shared by firmware, NUnit tests and the dashboard simulator.

F1.1 Climate control — FOR-T66 — built

  • S1.1.1 Nest heating hysteresis — FOR-T67 — built As the colony, I want the nest held at 79-83 °F, so that the brood develops year-round. Acceptance: Given the nest-bottom probe below the band, when the loop ticks, then the heater turns on and stays on for at least the minimum dwell. Evidence: Core/Control/HysteresisController.cs, ControlLoop.cs.
  • S1.1.2 Two-zone ventilation — FOR-T68 — built As the colony, I want stale humid air removed without drying the nest, so that mould cannot start. Acceptance: Given nest humidity over the mould-guard setpoint, then the nest exhaust runs; given outworld humidity high, then the lid fan runs. Evidence: HysteresisController.cs, Config/Setpoints.cs.
  • S1.1.3 Float-switch reservoir refill — FOR-T69 — built As the owner, I want hydration to key off the reservoir float switch, so that a dead soil probe never leaves the colony unwatered. Acceptance: Given the float switch low, then the pump refills the 131 mL reservoir and nothing pumps into the nest. Evidence: Core/Control/HydrationController.cs.

F1.2 Safety rules — FOR-T70 — built

  • S1.2.1 Cross-probe over-temperature cutout — FOR-T71 — built As the owner, I want any nest probe over the limit to cut the heater, so that one bad probe cannot cook the colony. Acceptance: Given any nest probe over the cutout, then the heater is off at once, bypassing dwell. Evidence: Core/Control/SafetyWatchdog.cs, FOR-T2.
  • S1.2.2 Safe boot and fail-off — FOR-T72 — built As the owner, I want every output off at boot and on any failure, so that a fault never leaves a heater or pump on. Acceptance: Given a reboot, then nothing energises until a sensor has read. Evidence: ControlLoop.cs, FOR-LAW-2/5.
  • S1.2.3 Invalid readings never stale — FOR-T73 — built As the owner, I want a failed read to be invalid, so that control never acts on old data. Acceptance: Given a sensor read fails, then the Reading is invalid. Evidence: Core/Sensing/Reading.cs, FOR-T3.

F1.3 Feeding and lighting — FOR-T74 — built

  • S1.3.1 Daily sugar-water dose — FOR-T75 — built As the owner, I want sugar water dosed daily, so that the colony is fed without me. Acceptance: Given the clock is set, then one dose runs per day; given a reboot, then no second dose. Evidence: Core/Control/FeedScheduler.cs, FOR-T27.
  • S1.3.2 Traffic-tracking riser lighting — FOR-T76 — built As the owner, I want each riser mouth lit at a brightness tracking its traffic, rotating channels at midnight, so that the experiment separates colour from position. Acceptance: Given ClosedLoop mode, then brightness follows the riser's rolling rate; given 22:00-07:00, then all rings are dark. Evidence: LightingController.cs, RiserTrafficCounter.cs, FOR-T39.

E2. Firmware and local dashboard — FOR-T77 — built

F2.1 ESP32 firmware — FOR-T78 — built

  • S2.1.1 Deployable firmware image — FOR-T79 — built As the owner, I want one script to build the .pe image, so that flashing needs no machine-wide install. Acceptance: firmware/build-firmware.ps1 produces the image. Evidence: that script.
  • S2.1.2 Controller HTTP API — FOR-T80 — built As the dashboard, I want state, feed, lighting and service-mode endpoints, so that I can monitor and command the column. Acceptance: /api/state returns the DeviceState. Evidence: Net/HttpApiServer.cs, Net/FallbackPage.cs.

F2.2 Local dashboard — FOR-T81 — built

  • S2.2.1 Live status and fault labels — FOR-T82 — built — Home shows live readings, outputs and fault bits. Evidence: Pages/Home.razor, Models/DeviceState.cs.
  • S2.2.2 Telemetry history and traffic — FOR-T83 — built — History and Traffic chart telemetry and riser traffic with the channel in force (FOR-LAW-10). Evidence: Pages/History.razor, Pages/Traffic.razor.
  • S2.2.3 Night camera view — FOR-T84 — built — the Camera page shows the 850 nm RTSP feed. Evidence: Pages/Camera.razor.
  • S2.2.4 Offline build manual — FOR-T85 — built — 3D blueprint, drawings, parts and pin tables, 44-step sequence with stored progress, no internet. Evidence: Pages/Build.razor, Shared/Blueprint.razor, BuildChecklist.razor.
  • S2.2.5 Colony simulator — FOR-T86 — built — the real ControlLoop runs against a thermal, hydration and foraging model at 120x. Evidence: Services/ColonySimulator.cs.
  • S2.2.6 Settings in Vault and service mode — FOR-T87 — built — settings in MindAttic Vault; service mode forces outputs off and refuses manual feeds. Evidence: FOR-T23.

E3. Dashboard ready for hardware — FOR-T42 — MS-51

F3.1 Runs from the standard install — FOR-T43 — MS-51

  • FOR-T44 Default DB to local SQL — As the owner, I want the dashboard to open on local SQL Server, so that it runs with Azure gone. Acceptance: a fresh run creates the Formicarium database on localhost.
  • FOR-T40 Formicarium on R: — Acceptance: Debug and Release builds land and start under R:\MindAttic\Apps\Formicarium.

F3.2 Firmware fault contract — FOR-T45 — MS-51

  • FOR-T7 Fault contract parity tests — Acceptance: dashboard Faults equal firmware Faults by name and value, and FaultText describes each bit in priority order.

E4. A working column — FOR-T46 — MS-51

F4.1 Parts sourced — FOR-T47 — MS-51

  • FOR-T48 Refresh BOM prices and links; FOR-T49 Order parts and nest core (owner hands-on).

F4.2 Subsystems proven on the bench — FOR-T50 — MS-51

  • FOR-T51 Flash firmware to ESP32 (owner hands-on); FOR-T52 Bench bring-up of subsystems. Acceptance: every subsystem passes the Build page bring-up order on the bench.

F4.3 Column assembled — FOR-T53 — MS-51

  • FOR-T54 Cut and weld the column; FOR-T55 Install electronics and fluids (owner hands-on).

E5. A proven, documented column — FOR-T56 — MS-51

F5.1 Two-week empty run — FOR-T57 — MS-51

  • FOR-T58 Run empty for two weeks (owner hands-on); FOR-T59 Review burn-in telemetry.

F5.2 As-built documentation — FOR-T60 — MS-51

  • FOR-T61 As-built design record and BOM — Acceptance: docs describe the column as built.

E6. Colony in residence — FOR-T88 — MS-122

F6.1 Colony established — FOR-T89 — MS-122

  • S6.1.1 Order and introduce the colony — FOR-T90 — MS-122 As the owner, I want the colony moved into the burned-in nest, so that the habitat does its job. Acceptance: Given the colony's test tube connected to the outworld, then the queen moves into the nest.
  • S6.1.2 Thirty days without daily care — FOR-T91 — MS-122 As the owner, I want 30 days of automatic heat, humidity, ventilation and sugar feeding, so that the product promise is proven with a living colony. Acceptance: History shows 30 days with no unexplained fault bits; only protein and supply-jar refills were manual.

E7. Colour experiment — FOR-T92 — MS-122

F7.1 Colour preference measured — FOR-T93 — MS-122

  • S7.1.1 Three-phase experiment schedule — FOR-T94 — MS-122 As the owner, I want Off, Fixed and ClosedLoop phases over full three-day rotations, so that the treatment has a baseline and a control. Acceptance: every traffic row of each phase carries its channel and brightness.

F7.2 Result analysed and written up — FOR-T95 — MS-122

  • S7.2.1 Traffic by channel versus position — FOR-T96 — MS-122 As the owner, I want traffic compared per channel against per riser, so that "prefers red" is told apart from "prefers the tube nearest the dish". Acceptance: the Traffic page shows both and exports CSV.
  • S7.2.2 Experiment write-up — FOR-T97 — MS-122 Acceptance: docs/experiment.md states method, data and result with charts.

F7.3 Polish and release 1.1 — FOR-T98 — MS-122

  • S7.3.1 Release 1.1 sign-off — FOR-T99 — MS-122 Acceptance: docs describe the populated column and the experiment as run; the dashboard is redeployed to R: Release; the owner signs off.

E8. Expansion chamber — FOR-T100 — MS-123

F8.1 Expansion design — FOR-T101 — MS-123

  • S8.1.1 Expansion chamber design — FOR-T102 — MS-123 As the owner, I want the chamber designed on paper first, so that the capped port is opened once, correctly. Acceptance: design record, BOM, cut list and Build page include the chamber, its hydration and a probe.

F8.2 Expansion build — FOR-T103 — MS-123

  • S8.2.1 Build and connect the chamber — FOR-T104 — MS-123 — owner hands-on; the nest is never opened and the climate holds.
  • S8.2.2 Chamber monitoring — FOR-T105 — MS-123 — firmware and dashboard read the chamber probe and show it on Home and History.

F8.3 Polish and release 2.0 — FOR-T106 — MS-123

  • S8.3.1 Release 2.0 sign-off — FOR-T107 — MS-123 — every doc describes the two-chamber habitat as built; the owner signs off on the finished product.

5. Non-functional requirements

  • Platforms: ESP32 on .NET nanoFramework; dashboard Blazor Server .NET 10 on Windows, local SQL Server.
  • Every failure worth worrying about is slow; safety rules are proven by NUnit tests on the shared Core.
  • Core/ uses only the nanoFramework base class library (FOR-LAW-7).
  • Offline: the Build page and 3D libraries are served from wwwroot/lib.
  • Secrets: Wi-Fi credentials live in the device config block, never in git (FOR-LAW-9); settings in MindAttic Vault.

6. Interfaces and dependencies

  • Platform by concern (docs/ECOSYSTEM.md §2.1): credentials and settings, MindAttic.Vault (database connection, FOR-T44); shipping, the shared run menu (FOR-T40); the plan, MindAttic.Tickets; documentation hub, MindAttic.Docs. (run.ps1, deploy to R:\MindAttic\Apps\Formicarium).
  • Outside: nanoFramework tooling (nanoff), an ONVIF/RTSP camera, vendors in docs/bom.md.
  • The controller's HTTP API is the contract between firmware and dashboard; fault bits must match by name and value.

7. Release sequence

  1. MS-51 Formicarium 1.0, first column running (active, docs/RELEASE.md): E3, E4, E5.
  2. MS-122 Formicarium 1.1, colony in residence: E6, E7 (ends with F7.3 Polish and release 1.1).
  3. MS-123 Formicarium 2.0, expansion chamber: E8 (ends with F8.3 Polish and release 2.0). The finished product.

8. Change log

Date Change to scope Ticket
2026-11-30 Specification written from the BIBLE, design record, overview, code and ticket history; release sequence MS-51, MS-122, MS-123 MAT-T375
2026-11-30 MAT-T462 single-source pass: 8 renamed, 0 buckets dissolved, 17 requires added (milestone chain MS-51 -> MS-122 -> MS-123 and bench-to-burn-in order), 2 platform re-points (FOR-T40 shared run menu, FOR-T44 connection string from Vault) MAT-T475
2026-11-30 Single-feature epic FOR-T88 kept: one outcome with one capability (colony established) MAT-T475
Part of Formicarium.
From Formicarium/docs/SPEC.md via MindAttic.Docs; synced automatically, so edit the repo, not this page.