PHIDS Documentation Information Architecture
This document defines the canonical scientific documentation structure for PHIDS in its current state. It serves both as a migration plan from the legacy markdown corpus and as an editorial blueprint for future documentation work.
1. Documentation Objectives
PHIDS documentation is now organized around three primary goals:
- Scientific exposition first — describe the simulator as a deterministic ecological model with explicit assumptions, state transitions, and invariants.
- Codebase traceability — connect every major concept to concrete implementation
artifacts under
src/phids/. - Archival continuity — preserve the historical design documents that motivated the current architecture.
2. Intended Audiences
2.1 Research and modeling audience
This audience needs:
- the simulator's ecological abstraction,
- mathematical and algorithmic assumptions,
- state variables and invariants,
- reproducibility and determinism guarantees,
- interpretation of outputs and scenario semantics.
2.2 System and engine contributors
This audience needs:
- module responsibilities,
- lifecycle ordering,
- data-oriented constraints,
- performance invariants,
- API/UI state ownership.
2.3 Operators and evaluators
This audience needs:
- how to inspect, run, configure, and export a simulation,
- how the UI draft state differs from live runtime state,
- what each route and stream provides,
- where curated scenarios fit into analysis workflows.
3. Canonical Top-Level Structure
The documentation site should present the following top-level sections in this order:
- Home — scientific overview and navigation entry point.
- Documentation Architecture — this page; defines structure and migration logic.
- Foundations — conceptual model, terminology, assumptions, ecological scope.
- Architecture — system decomposition and runtime data flow.
- Engine — simulation execution internals and subsystem behavior.
- Interfaces — REST, WebSocket, UI draft/live semantics.
- Scenarios — configuration model, curated examples, import/export semantics.
- Telemetry — metrics, replay, export, termination interpretation.
- Development — quality gates, style, docs process, contribution constraints.
- Reference — API reference, README mirror, and symbol index.
- Legacy Archive — immutable pre-restructure source documents.
4. Detailed Page Outline
4.1 Home
Purpose: Provide a concise research-style description of PHIDS as a deterministic computational ecology instrument.
Must include:
- simulator scope,
- key architectural claims,
- core invariants,
- where to start for theory / architecture / API / UI / reference,
- current implementation anchors such as
SimulationLoop,GridEnvironment,ECSWorld, andDraftState.
4.2 Foundations
foundations/index.md
Purpose: Establish the scientific framing and glossary.
Subtopics to include over time:
- plant–herbivore competition framing,
- deterministic time-stepped interpretation,
- discrete grid assumptions,
- ecological simplifications and non-goals,
- glossary of domain and implementation terms.
foundations/research-scope.md
Purpose: Define model scope and normative invariants.
Detailed outline:
- Biological abstractions represented in PHIDS.
- Variables represented explicitly vs omitted.
- Determinism and replayability.
- Data-oriented constraints as methodological commitments.
- Current known approximations and implementation caveats.
4.3 Architecture
architecture/index.md
Purpose: Explain the macro-architecture of the simulator.
Detailed outline:
- Runtime package boundaries.
- SimulationLoop as the orchestration center.
- Environment, ECS, and systems split.
- Dual interface surface: API and server-rendered UI.
- Traceability to telemetry and replay.
- Mermaid diagrams to be migrated from legacy architecture docs.
Legacy sources:
legacy/2026-03-11/architecture.mdlegacy/2026-03-11/comprehensive_description.md
4.4 Engine
engine/index.md
Purpose: Provide a formal overview of the runtime execution model.
Detailed outline:
- Tick ordering in
SimulationLoop.step. - Flow field phase.
- Lifecycle phase.
- Interaction phase.
- Signaling phase.
- Telemetry and termination phase.
- Deterministic ordering and side-effect boundaries.
Future child pages recommended:
engine/ecs-and-spatial-hash.mdengine/biotope-and-double-buffering.mdengine/flow-field.mdengine/lifecycle.mdengine/interaction.mdengine/signaling.md
Each should document:
- owned state,
- read/write invariants,
- asymptotic expectations,
- relevant tests,
- performance constraints,
- failure modes and edge cases.
4.5 Interfaces
interfaces/index.md
Purpose: Describe PHIDS as an executable interface surface.
Detailed outline:
- FastAPI application role.
- Schema validation boundary.
- Simulation lifecycle endpoints.
- Binary simulation stream.
- Lightweight UI stream.
- Error handling and state transitions.
ui/index.md
Purpose: Explain the server-driven HTMX/Jinja control center.
Detailed outline:
DraftStateas the UI source of truth.- Difference between draft configuration and live
SimulationLoop. - Partial-template rendering model.
- Scenario import/export and load-draft workflow.
- Why the UI is intentionally not a SPA.
Legacy sources:
legacy/2026-03-11/PHIDS_htmx_ui_design_specification.md
4.6 Scenarios
scenarios/index.md
Purpose: Document the scenario language and curated example pack.
Detailed outline:
SimulationConfigas canonical scenario schema.- Rule-of-16 matrix bounds.
- Trigger rule semantics.
- Import/export/replay relationship.
- Curated example scenarios and what each demonstrates.
- Scenario design conventions, including the plants-plus-swarms competition rule.
4.7 Telemetry
telemetry/index.md
Purpose: Explain how simulation outputs are recorded, exported, and interpreted.
Detailed outline:
- Tick-level telemetry collection.
- Replay frames and deterministic reinspection.
- CSV/JSON export pathways.
- Termination conditions and scientific interpretation.
- Suggested future figures and example plots.
4.8 Development
development/index.md
Purpose: Document engineering governance for future contributors.
Detailed outline:
- Toolchain and quality gates.
- Documentation contribution workflow.
- Google-style docstrings and mkdocstrings integration.
- Testing strategy, including benchmark-sensitive modules.
- Architectural non-negotiables from
AGENTS.mdand Copilot instructions.
4.9 Reference
reference/index.md
Purpose: Tell readers how to use the API reference and where human-oriented prose ends.
reference/api.md
Purpose: Expose mkdocstrings-backed Python reference material.
appendices/readme.md
Purpose: Mirror the root README.md within the docs site for continuity between GitHub
and MkDocs audiences.
5. Migration Matrix from Legacy Documents
| Legacy source | Canonical destination | Migration strategy |
|---|---|---|
index.md |
index.md |
Replace with scientific landing page; preserve original in archive. |
architecture.md |
architecture/index.md |
Expand diagrams into explanatory prose and updated diagrams. |
comprehensive_description.md |
foundations/ + engine/ + telemetry/ |
Split into conceptually coherent scientific chapters. |
technical_requirements.md |
development/ + future normative constraints page |
Preserve as normative source; later convert into a specification chapter. |
requirements_coverage.md |
future traceability appendix | Maintain a live code-to-requirements mapping. |
PHIDS_htmx_ui_design_specification.md |
ui/index.md |
Convert from prescriptive design memo into current-state UI architecture. |
reference.md |
reference/api.md |
Preserve as generated-reference entry point. |
docstring_guidelines.md |
development/index.md + future docs standards page |
Keep as style source for contributor guidance. |
6. Editorial Standards
All new canonical pages should follow these conventions:
- Tone: formal, precise, and research-oriented.
- Provenance: cite the legacy source document when material is migrated.
- Traceability: name the concrete source modules and symbols being described.
- Separation of concerns: distinguish current implementation from aspirations.
- Figures and diagrams: prefer Mermaid for architecture and state sequencing.
- Mathematical notation: use it where clarifying, not decoratively.
- Testing links: important claims about behavior should cite tests or verified runtime modules.
7. Immediate Implementation Status
The current overhaul establishes:
- a scientific landing page,
- section landing pages for the future documentation tree,
- a README mirror inside the docs site,
- an archive of the previous documentation corpus,
- an updated MkDocs navigation structure.
Subsequent work should expand each section into full subsystem documentation without losing traceability to the preserved legacy material.