Illegal States, Mostly Unrepresentable
Daniel Ari Friedman (2026) · Entomology
Context
This work addresses topics in Entomology: strongly typed programming, session types, algebraic data types, category theory.
Methods
Primary methods and techniques applied in this work:
- Simulated ant-robot colony: agents with own SQLite DB and protocol endpoint — Each simulated colony member owns one on-disk SQLite database and one fault-injectable protocol endpoint, with no shared storage or network state.
- mypy --strict as oracle on six known-bad and three known-good fixtures — Runs mypy --strict as a subprocess on negative-control fixtures (expect errors), positive-control fixtures, and the src tree (expect zero exit).
- Seeded fault injection (drop/reorder/duplicate/corrupt) over an in-process bus — Drives real handshakes through an in-process bus with each fault mode enabled, checking typed error results and seed determinism.
- Pre-registered seeded experiments with Wilson CIs, Fisher and Cochran–Armitage tests — Tests colony convergence over independently seeded trials at a calibrated baseline (8 agents, 2 locations, 30 ticks) using Wilson intervals, Fisher and trend tests.
- Design lenses: schema as functor; decision as expected-free-energy minimizer — Frames per-agent storage as a functor Schema→Set and decisions via expected free energy, explicitly as design lenses rather than proofs.
Key Findings
Core contributions and results:
- In the tested calibrated configuration, the stigmergic mechanism beat a random-choice null model: its Wilson lower bound (0.8816) clears the null model's upper bound (0.0368).
- Disabling only pheromone deposit collapsed convergence to chance level, attributing the mechanism's advantage to the stigmergic channel in this configuration.
- Convergence versus decay showed a threshold rather than a monotonic slope, with 0/60 trials converging at decay 0.10 and 0.30.
- Convergence decreased strictly as preference heterogeneity widened (1.0000 > 0.9333 > 0.2500 > 0.0333).
- An audit found a defect the src-only mypy gate missed (a Protocol a frozen dataclass could not satisfy), fixed with read-only properties and a good-fixture regression guard.
Methods and findings are summarized from the full text; each item is backed by a verbatim quote recorded in metadata.json (evidence, key_findings_evidence).
Related Works
See BIBLIOGRAPHY.md for related publications.
Validation
Verification points for this work:
- Canonical DOI: 10.5281/zenodo.21298885
- PDF SHA-256: See zenodo_record
- Pairing confidence: unknown
- Last checked: 2026-07-10T19:31:26Z
Prerequisites
- Familiarity with strongly typed programming, session types, algebraic data types
- Background in Entomology fundamentals
- Access to source repository: N/A
Instructions
When working with this paper:
- Reference the DOI for citation:
10.5281/zenodo.21298885
- Apply methods listed in the Methods section for related analysis.
- Validate findings against the original PDF and metadata.
1---2# docxology:generated-document SKILL.md; ownership=explicit-manifest3name: illegal-states-mostly-unrepresentable4description: "This paper presents a strongly-typed, decentralized multiagent simulation — an ant-robot colony — as the computational exemplar of the Research Project Template (https://github.com/docxology/template). Each colony member is an Agent that owns exactly..."5tags: ["strongly-typed-programming", "session-types", "algebraic-data-types", "category-theory", "active-inference", "multiagent-systems", "affine-types", "illegal-state-unrepresentable"]6domain: "Entomology"7citation: "Daniel Ari Friedman (2026). *Illegal States, Mostly Unrepresentable*. Zenodo."8doi: "10.5281/zenodo.21298885"9metadata:10 source: https://skillmd.com/skills/docxology/illegal-states-mostly-unrepresentable11---1213# Illegal States, Mostly Unrepresentable1415**Daniel Ari Friedman** (2026) · Entomology1617## Context1819This work addresses topics in **Entomology**: strongly typed programming, session types, algebraic data types, category theory.2021## Methods2223Primary methods and techniques applied in this work:2425- **Simulated ant-robot colony: agents with own SQLite DB and protocol endpoint** — Each simulated colony member owns one on-disk SQLite database and one fault-injectable protocol endpoint, with no shared storage or network state.26- **mypy --strict as oracle on six known-bad and three known-good fixtures** — Runs mypy --strict as a subprocess on negative-control fixtures (expect errors), positive-control fixtures, and the src tree (expect zero exit).27- **Seeded fault injection (drop/reorder/duplicate/corrupt) over an in-process bus** — Drives real handshakes through an in-process bus with each fault mode enabled, checking typed error results and seed determinism.28- **Pre-registered seeded experiments with Wilson CIs, Fisher and Cochran–Armitage tests** — Tests colony convergence over independently seeded trials at a calibrated baseline (8 agents, 2 locations, 30 ticks) using Wilson intervals, Fisher and trend tests.29- **Design lenses: schema as functor; decision as expected-free-energy minimizer** — Frames per-agent storage as a functor Schema→Set and decisions via expected free energy, explicitly as design lenses rather than proofs.3031## Key Findings3233Core contributions and results:3435- In the tested calibrated configuration, the stigmergic mechanism beat a random-choice null model: its Wilson lower bound (0.8816) clears the null model's upper bound (0.0368).36- Disabling only pheromone deposit collapsed convergence to chance level, attributing the mechanism's advantage to the stigmergic channel in this configuration.37- Convergence versus decay showed a threshold rather than a monotonic slope, with 0/60 trials converging at decay 0.10 and 0.30.38- Convergence decreased strictly as preference heterogeneity widened (1.0000 > 0.9333 > 0.2500 > 0.0333).39- An audit found a defect the src-only mypy gate missed (a Protocol a frozen dataclass could not satisfy), fixed with read-only properties and a good-fixture regression guard.4041Methods and findings are summarized from the full text; each item is backed by a verbatim quote recorded in `metadata.json` (`evidence`, `key_findings_evidence`).4243## Related Works4445See [BIBLIOGRAPHY.md](../../pages/BIBLIOGRAPHY.md) for related publications.4647## Validation4849Verification points for this work:5051- Canonical DOI: 10.5281/zenodo.2129888552- PDF SHA-256: See zenodo_record53- Pairing confidence: unknown54- Last checked: 2026-07-10T19:31:26Z5556## Prerequisites5758- Familiarity with strongly typed programming, session types, algebraic data types59- Background in Entomology fundamentals60- Access to source repository: N/A6162## Instructions6364When working with this paper:65661. Reference the DOI for citation: `10.5281/zenodo.21298885`672. Apply methods listed in the Methods section for related analysis.683. Validate findings against the original PDF and metadata.