Skip to content

feat(a-sounder-constitution): typed civic contagion simulator — rights as transition constraints#29

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/dreamy-feynman-7dk6tj
Jun 19, 2026
Merged

feat(a-sounder-constitution): typed civic contagion simulator — rights as transition constraints#29
hyperpolymath merged 1 commit into
mainfrom
claude/dreamy-feynman-7dk6tj

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

A Sounder Constitution

A new research proof-of-concept in a-sounder-constitution/: a Plague Inc.-style civic simulator where the "pathogen" is a constitutional doctrine, norm, fear, right, or type error.

The one idea: rights are not resources (sliders, budgets). They are type constraints on legal state transitions. An unsound constitution can produce fast, stable order by permitting domination. A sound constitution makes some coercive moves literally unrepresentable — slower, but far more resilient.

This sits squarely in the incubator's remit: the load-bearing claim is type-theoretic, it ships an Idris2 formalization alongside an executable model, and it has a graduation path toward typell.

What's here

Path Role
src/constitution.js the type checker — under a sound constitution Person -> Property, Emergency -> PermanentPower, etc. are UNREPRESENTABLE; liberty restrictions need a discharged proof obligation. Unsound permits every coercive move and books hidden legitimacy debt.
src/engine.js a deterministic typed cellular automaton — regions, mobile doctrine "gliders", neighbour diffusion, exogenous shocks, outcome classification. Coercive effects are routed through the type checker, so the same strategy diverges purely by constitution.
web/ zero-dependency canvas simulator; the live type-checker log makes the thesis visible (✗ unrepresentable vs ✓ permitted (domination)).
sim/compare.mjs headless, quantitative sound-vs-unsound demonstration.
tests/ node --test suite (12 tests) pinning mechanics and thesis-level behaviour.
formal/Constitution.idr the static certificate: the sound Person type has no Property inhabitant (soundNeverProperty), sound standing transitions are rank-monotone (soundMonotone), and lawful coercion demands proofs.
docs/, README.adoc, MOTIVATION.adoc, 0.1-AI-MANIFEST.a2ml design, type-theory, glider catalogue, near-miss/novelty survey, graduation path.

The result (hold strategy fixed, vary only the constitution — npm run sim)

STRATEGY A · reach for coercion (emergency, surveillance, caste)
mode     t→order  safety  legit  domin  resil  blocked   outcome
unsound      32     67%     0%    93%     0%        0   Caste stability (order by domination)
sound     never     45%    52%     0%    32%    23778   Contested / transitional

STRATEGY B · build legitimacy (rights, virtue, due process)
sound        40     71%    90%     0%    86%     1674   Rights-preserving resilience

Unsound buys order by domination (legitimacy/trust → 0, huge hidden debt); sound refuses the coercive moves at the type level (tens of thousands "blocked") so domination never happens. In Reconstruction, the rights patch only "takes" under a sound constitution — under unsound the pre-existing caste can't be undone.

How to run

cd a-sounder-constitution
npm run sim      # headless thesis demonstration
npm test         # 12/12 tests
npm run serve    # python3 -m http.server 8080  →  open /web/

Verification done in this environment

  • node --test — 12/12 pass
  • node sim/compare.mjs — produces the contrast above
  • ✅ all web module URLs resolve over HTTP; ui.js passes node --check
  • ⚠️ formal/Constitution.idr is written to compile clean (%default total, no believe_me) but is not yet run through idris2 here (none on PATH) — flagged as pending in formal/README.adoc, per the repo's blocker convention.
  • ⚠️ The web UI was not opened in a live browser in this environment (no headless browser available).

🤖 Generated with Claude Code

https://claude.ai/code/session_015w8C1xaGwiDcHHjfuxHBd6


Generated by Claude Code

… as transition constraints)

A Plague Inc.-style civic simulator where the "pathogen" is a constitutional
doctrine and the central thesis is that RIGHTS ARE TYPE CONSTRAINTS ON LEGAL
STATE TRANSITIONS, not resources.

- src/constitution.js: the type checker. Under a SOUND constitution, coercive
  downgrades (Person -> Property, Emergency -> PermanentPower, ...) are
  UNREPRESENTABLE; liberty restrictions require a discharged proof obligation.
  Under an UNSOUND one every coercive move is a permitted total function that
  books hidden legitimacy debt.
- src/engine.js: a deterministic typed cellular automaton — regions, mobile
  doctrine "gliders", neighbour diffusion, exogenous shocks, and outcome
  classification (caste / authoritarian / collapse / sclerosis / free /
  rights-preserving resilience). Coercive effects are routed through the type
  checker, so the same strategy diverges purely by constitution.
- web/: zero-dependency canvas simulator. The type-checker log makes the thesis
  visible (✗ unrepresentable vs ✓ permitted/domination).
- sim/compare.mjs: headless, quantitative sound-vs-unsound demonstration.
- tests/: node --test suite (12 tests) pinning mechanics and thesis-level
  behaviour.
- formal/Constitution.idr: the static certificate — the sound Person type has no
  Property inhabitant (soundNeverProperty), sound standing transitions are
  rank-monotone (soundMonotone), and lawful coercion demands proofs.
- docs/, README.adoc, MOTIVATION.adoc, 0.1-AI-MANIFEST.a2ml: design, type-theory,
  glider catalogue, near-miss/novelty survey, and graduation path.

Verified: `node --test` (12/12) and `node sim/compare.mjs` pass. The Idris2
module is written to compile clean but is not yet CI-checked (no idris2 here).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015w8C1xaGwiDcHHjfuxHBd6
@hyperpolymath hyperpolymath marked this pull request as ready for review June 19, 2026 15:43
@hyperpolymath hyperpolymath merged commit 04fc6ae into main Jun 19, 2026
17 of 18 checks passed
@hyperpolymath hyperpolymath deleted the claude/dreamy-feynman-7dk6tj branch June 19, 2026 15:43
hyperpolymath added a commit that referenced this pull request Jun 19, 2026
…mpliance (#30)

## Unblock `openssf-compliance` (pre-existing template debt)

The `openssf-compliance` CI check fails **repo-wide** (on `main` too,
and it surfaced on #29) because two RSR-template files still carry
unfilled `{{PLACEHOLDER}}` tokens. This is pre-existing scaffolding
debt, unrelated to any feature work — split out from #29 into its own
reviewable PR as requested.

### Changes
- **`.github/SECURITY.md`** — fill `PROJECT_NAME` / `OWNER` / `REPO` /
`SECURITY_EMAIL` / `CURRENT_YEAR` with the repo's own established values
(security contact `j.d.a.jewell@open.ac.uk`, matching the canonical root
`SECURITY.md`); remove the "delete before publishing"
template-instruction block; drop the unused **PGP** sections (this
project uses email-only disclosure — the root `SECURITY.md` has no PGP);
add the SPDX header for consistency with the rest of the tree.
- **`.machine_readable/ECOSYSTEM.a2ml`** — fill `REPO_DESCRIPTION`, and
correct the stale `name "katagoria"` → `"ideas-to-alphas"` (matching
`STATE.a2ml` after the repo rename).

### Verification
Replicated the CI placeholder scan locally over every required file:

```
0 required files contain placeholder tokens
.github/SECURITY.md: 375 lines (> 10 required)
no stray {{ tokens remain in the edited files
```

No code, dependencies, or feature behaviour touched —
governance/template files only.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_015w8C1xaGwiDcHHjfuxHBd6

---
_Generated by [Claude
Code](https://claude.ai/code/session_015w8C1xaGwiDcHHjfuxHBd6)_

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants