Macroscope/STRATA and MNG Convergence Plan
CNL-TN-2026-027: Macroscope/STRATA and MNG Convergence Plan
Author: Dr. Michael P. Hamilton, with Claude Date: April 5, 2026 Status: Draft v2 Scope: Convergence of the Galatea Macroscope/STRATA platform with MNG (macroscope.nexus)
1. Background
Two systems have evolved in parallel to serve the Macroscope vision:
MNG (Macroscope Nexus) at macroscope.nexus — the convergence platform for curated ecological places. Five panels (Identity, Physical Place, Ecological Setting, Living Systems, Field Notebook), a monitoring widget framework (MW.register), media management with photopoints and tags, three-tier authentication, and a complete admin dashboard. Strong on EARTH and LIFE domains via curated places. Database: macroscope_nexus. Deployed on both Data and Galatea via env.php convergence.
Macroscope/STRATA at /Library/WebServer/Documents/Macroscope/ on Galatea — a standalone LAMP application that has evolved into a sophisticated multi-domain environmental intelligence platform. Four-domain architecture (EARTH/LIFE/HOME/SELF), 13 modular micro-agents, a multi-temporal context system with 9 temporal windows, Claude tool-calling integration (24 tools), personality-aware chat, granular privacy controls (per-user, per-domain, per-platform), multi-site support, and a complete sensor registry with 200+ sensors across 13 platform types. Database: macroscope.
A third version exists on Data (Projects/Live/Macroscope/) — a Node.js/Express + Preact application with PHP collectors. This version is now deprecated in favor of the Galatea LAMP codebase, which is more advanced, architecturally consistent, and already in production. The Galatea codebase has been mirrored to Data at Projects/Live/Galatea/Macroscope-Galatea/ for development.
The convergence goal: Merge the intelligence, domain coverage, and privacy architecture of Macroscope/STRATA with the place-based identity, media management, and public-facing design of MNG into a single unified platform.
2. Architecture Comparison
2.1 What MNG Has That STRATA Doesn't
- Curated places model — Rich place identity with geography, stewardship, history, facilities, access descriptions, and curated narratives
- Media management — 10 media types, photopoints for time-series capture, five-category tag system, Archive file browser, EXIF extraction, thumbnail generation, Pannellum 360 viewer
- Monitoring widget framework — MW.register() plugin pattern with independent widget JS/PHP modules (Tempest, Ecowitt, BirdWeather, Strata, Panorama, Video)
- Place-based navigation — Observatory organized by curated places, not by sensor platform
- Field notebook — field_log entries with AI-generated narratives tied to places
- Public-facing design — Three-tier auth (anonymous Observatory, user Laboratory, admin Dashboard) with polished UI suitable for external audiences
- YEA integration — Category model providing EARTH/LIFE structure via macroscope_nexus
- People and organizations — Contributor/researcher registry linked to places
2.2 What STRATA Has That MNG Doesn't
- Four-domain architecture — EARTH and LIFE (public), plus HOME and SELF (private) with granular access control
- 13 micro-agents — Modular temporal state generators for every platform type including 4 health agents (vitals, activity, workouts, clinical)
- Multi-temporal intelligence — 9 temporal windows per sensor (last_hour through rain_year) plus 7 bird-specific windows (including dawn_chorus)
- STRATA context system — 7 modular context builders generating structured system prompts for AI consumption with adaptive query interpretation
- Claude tool-calling — 24 registered tools for real-time sensor queries, document search, observation analysis during conversation
- Personality system — 4 AI personalities (field_naturalist, technical_analyst, conversational_guide, research_assistant) with user preferences
- Chat interface — Full Claude integration with temporal + spatial + document context injection
- SELF domain — Apple Health vitals, Withings body/sleep/activity, clinical records (conditions, medications, immunizations, labs)
- HOME domain — Indoor air quality (Airthings), indoor/transitional space classification with seasonal awareness
- Multi-site support — Sites table with site_id throughout; supports multiple monitoring locations
- Sensor registry — 200+ sensor definitions across 13 platform types with domain classification, aggregation types, and privacy levels
- Additional collectors — AmbientWeather, Withings health metrics, 6 BirdWeather PUCs (vs. MNG's 4)
- Privacy architecture — Per-user domain access (EARTH/LIFE always visible, HOME/SELF controlled), per-platform visibility, admin "god mode"
2.3 What Both Have (Overlap)
- Tempest, Ecowitt, BirdWeather, Strata monitoring widgets (different implementations)
- Connection to
macroscopedatabase for sensor time-series - Authentication systems (different schemas)
- Admin dashboards
- Document/PDF pipeline (collector on Data, no GUI in either system)
3. Galatea Macroscope/STRATA — Full Component Map
3.1 Collectors (11 Active)
All run as launchd agents on Galatea, writing to the macroscope database. Data syncs via com.macroscope.sync every 5 minutes. Collectors are infrastructure, independent of any web application.
| Collector | Table | Interval | Domain |
|---|---|---|---|
| tempest_collector.php | tempest_readings | 5 min | EARTH |
| ecowitt_collector.php | ecowitt_readings | 5 min | EARTH/LIFE |
| airlink_collector.php | airlink_readings | 5 min | EARTH |
| airthings_collector.php | airthings_readings | 15 min | HOME |
| ambientweather_collector.php | ambientweather_readings | 5 min | EARTH |
| birdweather_detections_collector.php | birdweather_detections | 5 min | LIFE |
| birdweather_environmental_collector.php | birdweather_environmental | 5 min | EARTH |
| inaturalist_collector.php | inaturalist_observations | 1 hr | LIFE |
| inaturalist_batch_updater.php | inaturalist_observations | Daily 03:30 | LIFE |
| withings_collector.php | health_vitals, health_sleep | Variable | SELF |
| pdf_document_collector.php | documents | WatchPaths | SELF |
3.2 Agents (3 Orchestrators + 13 Micro-agents)
generate_temporal_state.php — Lean orchestrator that calls platform-specific summary micro-agents and writes context/temporal/site{N}.json. Each micro-agent queries the latest readings for its platform and generates a structured summary with key readings and natural language description.
Platform summary micro-agents (in agents/summaries/):
| Agent | Platform | Domain | Key Readings |
|---|---|---|---|
| tempest.php | WeatherFlow Tempest | EARTH | 8 metrics (temp, feels_like, humidity, wind, pressure, UV, solar) |
| ecowitt.php | Ecowitt GW1200B | EARTH/LIFE | 14 metrics (outdoor, soil x2, leaf wetness, rain) |
| ambientweather.php | WS-2902C | EARTH | 7 metrics (outdoor, indoor, pressure, wind, rain) |
| airthings.php | Airthings Wave | HOME | 9 metrics (CO2, VOC, radon, PM, temp, humidity, pressure) |
| airlink.php | AirLink | EARTH/HOME | 7 metrics (PM2.5, AQI, temp, humidity, dew point) |
| birdweather_detections.php | BirdWeather PUC | LIFE | 6 metrics (detections, species, confidence, top 3) |
| birdweather_environmental.php | PUC environmental | EARTH | 11 metrics (temp, humidity, AQI, sound, GPS) |
| inaturalist.php | iNaturalist | LIFE | 9 metrics (observations, species, research grade, latest) |
| health_vitals.php | Withings + Apple Health | SELF | 8 metrics (weight, body fat, RHR, HRV, VO2, BP, sleep) |
| health_activity.php | Withings Activity | SELF | 4 metrics (steps, distance, calories, active minutes) |
| health_workouts.php | Withings Workouts | SELF | 4 metrics (count, distance, duration, heart rate) |
| health_clinical.php | Clinical Records | SELF | 4 metrics (conditions, medications, labs, immunizations) |
| documents.php | PDF Library | SELF | 4 metrics (total, by type, pages, recent) |
spatial_agent.php — Site-aware spatial context. Queries site info, platform distribution, recent species (7-day window). Writes spatial_state_site{N}.json.
documents_agent.js — Event-driven library awareness. Triggered by PDF collector. Writes documents_state.json.
3.3 STRATA Context System
Seven modular context builders in includes/context/, orchestrated by strata_context.php:
- strata_context_birds.php — 7 temporal windows including dawn_chorus (90 min centered on sunrise), vertical stratification
- strata_context_tempest.php — 7 temporal windows, temperature trends, wind, pressure, rain, solar
- strata_context_ecowitt.php — 8 rain windows (including rain_year), 7 soil windows, leaf wetness, lightning
- strata_context_ambient.php — 7 windows, secondary weather source
- strata_context_airthings.php — Per-room indoor air quality, radon Bq/m3 to pCi/L conversion
- strata_context_airlink.php — Space type classification (outdoor/transitional), seasonal awareness
- strata_context_birdweather_env.php — Per-PUC environmental data, mobile GPS tracking
The orchestrator builds a unified system prompt (~9+ KB) for Claude with adaptive query interpretation (casual, specific source, comparative, temporal, species queries).
3.4 API Layer
Domain-based routing via api/index.php:
api/platforms.php— Platform CRUD, status, domain grouping, temperature comparisonapi/sensors/{platform}.php— 13 platform-specific sensor discovery modulesapi/charts.php— Multi-window temporal chart dataapi/preferences.php— User preferences (personality, units, map settings)api/geography/— Sites, places, observations by locationapi/analysis/— Cross-domain summaries, multi-sensor comparisonapi/strata/tools.php— 24 Claude tool-calling endpoints for real-time queriesapi/admin/— User, site, platform CRUD; sensor curator; tile configuration
3.5 Authentication and Privacy
- users table with roles (admin, user)
- user_preferences — Per-site personality, display preferences
- user_site_access — Multi-site access grants
- user_domain_access — EARTH/LIFE always visible; HOME/SELF per-user
- user_platform_access — Per-platform visibility control
- Admin "god mode" sees everything
- Session-based auth with
requireAuth()andrequireAdmin()helpers
3.6 Database Tables (macroscope, expanded)
Beyond the 14 tables on Data, Galatea has:
| Table | Domain | Purpose |
|---|---|---|
| sites | Config | Multi-site definitions |
| ambientweather_readings | EARTH | Ambient Weather station data |
| applehealth_metrics | SELF | Apple Health vitals (RHR, HRV, VO2 Max) |
| withings_body_measurements | SELF | Weight, body fat, muscle mass |
| withings_sleep_summary | SELF | Sleep duration, efficiency, stages |
| withings_activity_daily | SELF | Steps, distance, calories |
| withings_workouts | SELF | Exercise records |
| clinical_vitals | SELF | Office visit measurements |
| clinical_conditions | SELF | Active/resolved conditions |
| clinical_medications | SELF | Current medications |
| clinical_immunizations | SELF | Immunization records |
| clinical_labs | SELF | Lab results with abnormal flags |
| user_preferences | Config | Per-site user settings |
| user_site_access | Config | Multi-site access |
| user_domain_access | Config | Domain visibility |
| user_platform_access | Config | Platform visibility |
4. Entity Relationship Overview
MACROSCOPE DATABASE (Galatea)
============================
┌────────┐ ┌─────────────────┐ ┌──────────────┐
│ sites │────<│ sensor_platforms │────<│ sensors │
│ │ │ │ │ │
│ id │ │ site_id │ │ platform_id │
│ name │ │ platform_type │ │ sensor_type │
│ slug │ │ domain │ │ field │
│ tz │ │ external_id │ │ domain │
└────────┘ │ specifications │ │ category │
│ └────────┬─────┬──┘ └──────────────┘
│ │ │
│ ┌─────────────────┘ └──────────────────────────┐
│ │ │
│ │ TIME-SERIES READINGS │
│ │ (all: location_id, sensor_id, platform_id, │
│ │ recorded_at, temporal_id) │
│ │ │
│ │ EARTH: │
│ │ tempest_readings (25 fields) │
│ │ ecowitt_readings (52 fields) │
│ │ ambientweather_readings (20+ fields) │
│ │ airlink_readings (33 fields) │
│ │ birdweather_environmental (18 fields) │
│ │ LIFE: │
│ │ birdweather_detections (32 fields) ──> species │
│ │ inaturalist_observations (60+ fields) > species│
│ │ HOME: │
│ │ airthings_readings (14 fields) │
│ │ SELF: │
│ │ applehealth_metrics │
│ │ withings_body_measurements │
│ │ withings_sleep_summary │
│ │ withings_activity_daily │
│ │ withings_workouts │
│ │ clinical_vitals / conditions / meds / labs │
│ │ documents (278 PDFs) │
│ └───────────────────────────────────────────────────┘
│
│ ┌───────────────────────────────────────────────────┐
│ │ ACCESS CONTROL │
│ │ │
└──│──> user_site_access (user_id, site_id) │
│ user_domain_access (user_id, domain) │
│ user_platform_access (user_id, platform_id) │
│ user_preferences (personality, units, map) │
└───────────────────────────────────────────────────┘
MACROSCOPE_NEXUS DATABASE
=========================
┌──────────┐ ┌───────────────────┐
│ places │────<│ monitoring_sources │
│ │ │ │
│ │ │ macroscope_ │──── BRIDGE to
│ │ │ platform_id │ sensor_platforms
│ │ │ viewer_config │
│ │ └───────────────────┘
│ │
│ │────<┌──────────────┐
│ │ │ photopoints │────<┌────────┐
│ │ └──────────────┘ │ media │
│ │ │ │
│ │────<─────────────────────│ tags │
└──────────┘ └────────┘
│
┌────┴─────┐ ┌─────────────┐
│ people │────<│ field_log │
└──────────┘ └─────────────┘
Bridge pattern: monitoring_sources.macroscope_platform_id links MNG places to STRATA sensor platforms. This seam is preserved in convergence — MNG manages identity and presentation, STRATA manages intelligence and data.
5. Convergence Strategy
5.1 Principle: Merge Capabilities, Not Codebases
Rather than moving files from one project to another, convergence means the unified platform gains the capabilities of both systems. MNG's codebase is the deployment target (it's the public-facing site). STRATA's codebase is the development reference for intelligence, privacy, and domain expansion.
5.2 What Moves Into MNG
From STRATA's intelligence layer:
- The temporal agent pattern (orchestrator + 13 micro-agents) for generating sensor state JSON
- The STRATA context system (7 modular builders + orchestrator) for AI prompt construction
- The Claude tool-calling framework (24 tools for real-time sensor queries)
- Chat interface with personality system and adaptive query interpretation
From STRATA's domain architecture:
- HOME domain panels and widgets (Airthings indoor air quality, transitional space classification)
- SELF domain panels and widgets (health vitals, activity, workouts, clinical records, document library)
- The four-domain classification scheme (extend MNG's existing EARTH/LIFE with HOME/SELF)
From STRATA's privacy architecture:
- Per-user domain access (EARTH/LIFE public, HOME/SELF controlled)
- Per-platform visibility
- User preferences (personality, display settings)
From STRATA's sensor infrastructure:
- Sensor registry pattern (modular platform definition files with domain, category, aggregation type metadata)
- Additional collectors (AmbientWeather, Withings) and their reading tables
- Multi-site support (sites table, site_id references)
5.3 What Stays In MNG As-Is
- Places model and curated place identity
- Media management (photopoints, tags, Archive file browser, thumbnail system)
- MW.register() monitoring widget framework
- Observatory, Laboratory, Admin three-tier auth pattern
- YEA integration and category model
- People and organizations registry
- Field notebook / field_log system
- env.php convergence pattern for Data/Galatea deployment
5.4 What Gets Deprecated
- Data's Node.js Macroscope (
Projects/Live/Macroscope/) — Replaced by Galatea LAMP codebase - Data's Preact frontend — MNG Observatory is the canonical UI
- Data's temporal.js / spatial.js / documents_agent.js — Replaced by Galatea's PHP agents
- Data's Express backend routes — Replaced by STRATA's PHP API layer
5.5 Collectors Remain Independent
All 11 collectors continue running as launchd services on Galatea, writing to the macroscope database. Data syncs via com.macroscope.sync. The collectors are infrastructure — they don't need to change regardless of which web application consumes their data.
6. Transition Sequence
Phase 1: Document Management GUI
Priority: Immediate — the most concrete gap with working data.
Build a Document panel in MNG admin for the 278 documents in macroscope.documents. The PDF collection pipeline is operational (iCloud watch folder, Python extractor, automatic metadata extraction). What's missing is any way to browse, search, read, tag, or manage the processed documents.
Components: api/documents.php (REST API), admin/documents.php (three-column manager UI), js/document-manager.js (client-side logic). Pattern follows MNG's existing media manager.
Phase 2: HOME Domain — AirLink and Airthings Widgets
Priority: Near-term — completes indoor/air quality coverage.
Build mw-airlink.php/js and mw-airthings.php/js monitoring widgets using the MW.register() pattern. STRATA's existing implementations in api/sensors/airlink.php and api/sensors/airthings.php provide the query patterns and data mapping. Introduce HOME domain classification in MNG's monitoring_sources.
Phase 3: STRATA Intelligence Integration
Priority: Medium-term — the signature capability.
Port the temporal agent orchestrator and 13 micro-agents into MNG as a scheduled PHP process. The agents generate site{N}.json state files consumed by the context builders. Then port the 7 STRATA context builders and chat endpoint. This gives MNG a Claude-powered chat interface with full multi-temporal environmental intelligence.
The tool-calling framework (24 tools) follows — each tool is a standalone PHP file that can be ported independently.
Key decision: Whether the chat interface lives in MNG admin (authenticated, full four-domain access) or gets a public-facing version (EARTH/LIFE only, no SELF/HOME data).
Phase 4: SELF Domain Expansion
Priority: Medium-term — depends on privacy architecture.
Port the health agents (vitals, activity, workouts, clinical) and their Withings/Apple Health data integrations. This requires the privacy architecture from Phase 3 (per-user domain access) to be in place. The SELF domain is personal and must never leak to unauthenticated users.
Tables to integrate: applehealth_metrics, withings_body_measurements, withings_sleep_summary, withings_activity_daily, withings_workouts, clinical_vitals, clinical_conditions, clinical_medications, clinical_immunizations, clinical_labs.
Phase 5: Multi-Site and Sensor Registry
Priority: Lower — enhances scalability but not functionally critical.
Port the sites architecture and sensor registry pattern. This enables MNG to manage multiple monitoring locations (Canemah, JSMR, Blue Oak, Owl Farm) with per-site sensor definitions and access control. Currently MNG handles this through the places model; the sites/sensor_registry pattern adds a data-collection-layer awareness.
Phase 6: SOMA Production Deployment
Priority: Parallel track — independent of MNG convergence.
Deploy SOMA (Stochastic Observatory for Mesh Awareness) to Galatea for 24/7 anomaly detection. Currently prototyped on Data. SOMA's free energy / tension signals integrate with the STRATA context system as an additional intelligence layer — anomalies surface in the chat narrative.
7. Risk Assessment
Low risk: Collectors are completely independent. Nothing in convergence affects data collection.
Low risk: MNG already reads from macroscope database. New widgets and document GUI use the same connection pattern.
Medium risk: The SELF domain health data requires bulletproof privacy controls before any code goes to production. A leak of clinical or health data through the public Observatory would be a serious failure. The privacy architecture must be tested thoroughly.
Medium risk: The STRATA context system generates 9+ KB system prompts. In MNG's place-based model, context needs to be place-aware (which sensors are at which place), not just site-aware. The bridging logic (monitoring_sources.macroscope_platform_id) handles this but needs to be extended for the new platform types.
Medium risk: Chat integration uses the Anthropic API, which has per-call costs. Rate limiting and caching strategies are needed, especially if the chat becomes public-facing.
Low risk: Galatea Macroscope continues running independently during transition. MNG gains capabilities incrementally. Nothing is removed from either system until the converged version is confirmed working.
8. Files Reference
Development Core (Galatea Macroscope, mirrored to Data)
Location on Data: Projects/Live/Galatea/Macroscope-Galatea/
Location on Galatea: /Library/WebServer/Documents/Macroscope/
| Directory | Contents | Convergence Role |
|---|---|---|
| agents/ | Temporal orchestrator + 13 micro-agents + spatial agent | Port to MNG as scheduled intelligence layer |
| agents/summaries/ | Platform-specific summary generators (13 files) | Reference for MNG temporal state generation |
| api/ | Domain-based REST API (platforms, sensors, charts, strata tools) | Reference for MNG API expansion |
| api/strata/tools/ | 24 Claude tool-calling endpoints | Port to MNG for chat integration |
| collectors/ | 11 data ingestion scripts + collector_manager | Keep as-is (infrastructure) |
| context/ | Generated JSON state files (temporal, registry) | Output directory for ported agents |
| includes/ | Shared libs: auth, database, sensor_registry, strata_context | Port auth and intelligence patterns to MNG |
| includes/context/ | 7 STRATA context builders | Port to MNG for chat system prompt construction |
| includes/registry/ | 13 platform sensor definition files | Reference for MNG sensor metadata |
| domains/ | EARTH/LIFE/HOME/SELF detail pages | Pattern reference for MNG domain panels |
| admin/ | User/site/platform management, dashboard curator | Reference for MNG admin expansion |
| public/ | Frontend PWA assets | Not ported (MNG has its own frontend) |
| scripts/ | Setup utilities, launchd installers, migrations | Reference for deployment automation |
Convergence Target (MNG)
Location on Data: Projects/Live/Galatea/MNG/
Location on Galatea: /Library/WebServer/Documents/Canemah/projects/MNG/
New files to create during convergence are listed in each Phase description above.
9. Deprecated
The following is deprecated as of this plan:
Projects/Live/Macroscope/on Data (Node.js/Express + Preact version)Projects/Live/Macroscope/backend/(Express routes — replaced by STRATA PHP API)Projects/Live/Macroscope/frontend/(Preact UI — replaced by MNG Observatory)Projects/Live/Macroscope/agents/temporal.js(replaced by generate_temporal_state.php)Projects/Live/Macroscope/agents/spatial.js(replaced by spatial_agent.php)
NOT deprecated: Projects/Live/Macroscope/collectors/ — these remain the active data collection infrastructure on Data. The macroscope_sync.php service continues syncing from Galatea.
10. Recommended Session Sequence
Session 1: Document Management GUI in MNG (Phase 1). Build api/documents.php, admin/documents.php, js/document-manager.js. Test against 278 existing documents.
Session 2: AirLink and Airthings monitoring widgets (Phase 2). Complete HOME domain sensor coverage. Introduce HOME domain classification.
Session 3: STRATA intelligence integration (Phase 3). Port temporal agents, context builders, and chat endpoint into MNG. This is the largest session — may span multiple sittings.
Session 4: SELF domain expansion (Phase 4). Health data integration with privacy controls. Requires Phase 3 privacy architecture.
Session 5: SOMA production deployment (Phase 6). Deploy anomaly detection to Galatea. Wire tension signals into STRATA context.
Session 6: Multi-site and sensor registry (Phase 5). Scale MNG to handle multiple monitoring locations.
Sessions are self-contained and produce working, deployable code. The sequence can be reordered based on priority. Phases 3 and 6 can run in parallel since SOMA is architecturally independent.
Cite This Document
BibTeX
Permanent URL: https://canemah.org/archive/document.php?id=CNL-TN-2026-042