Skip to content

About

Personal sovereign media-OS. 5-layer LFS-style self-bootstrapping repo. SINGULYAR Emergent Intent Runtime v0.6. 35 ADRs. make verify 33/33. 290 tests green.

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

222 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
polymath-os — Суверенная персональная media-OS: 5 слоёв, самосборка

Polymath OS

polymath-os

Open-source ideal repository. Clone it. Run make verify. Every claim in this repo is reproducible by that one command. If it exits 0 — every claim holds. If non-zero — the claim that failed is shown.

License: MIT Verify SINGULYAR EIR v0.6 Tests Decrees CI OpenSSF Scorecard CII Best Practices OSPS Baseline

Current version: v3.25.0 (2026-11-07) — see CHANGELOG.md.

🛡 Living Shield — живой щит самоверификации

Этот блок пересчитывается workflow ЖИВОЙ ЩИТ — не статичный бейдж.

Источник Живое значение
OpenSSF Scorecard 7.5 / 10 — живой замер
Последний релиз v3.25.0 (2026-11-06) · 8 артефактов · цепь аттестаций ×4 (cosign + SLSA)
SBOM CycloneDX 1.6 37 компонентов — артефакт релиза скачан и распарсен живьём
OSPS Baseline v2026.08.28 (self-assessed) L1 22✅/2⚠️/0❌ · L2 19✅/0⚠️/0❌ · L3 9✅/9⚠️/1❌ — матрица
TTL мандатов (П-74) 🟡 29 дн. до 2026-12-09 — реестр П-74 (приватный)

Замер: 2026-11-10 08:11 UTC · прогон · ручная правка между маркерами перезаписывается.


What this is

Polymath OS is an open-source LFS-style rebuild of a personal operating system. It is not a "report" — it is a working, reproducible codebase. 5 layers + cross-cutting concerns, all in one self-contained git tree. Above all 5 layers sits the Decree Log — the human's supreme law layer, hash-chained and append-only, that the runtime enforces BEFORE any policy check.

Philosophy: Человек = PID=1 = processor + сумма частей. The repo is the material projection of that init-process: every component is fork-exec from the human, not an external dependency. Audit (audit A11) — PID=1 is a metaphor, not a source of technical requirements. Rights, session isolation, portability are recorded separately.

Decree system (since v3.6.0): the human types a decree in the Decree Portal → it's recorded in real SQLite (~/.polymath-os/decrees.db, hash-chained, append-only) → the SINGULYAR EIR runtime checks every Intent against active decrees BEFORE policy. DECREE > ADR > code. Per ADR-0021 + ADR-0022.

Layers

Layer What Code
Decree Log (supreme) Human's word = law. SQLite, hash-chained, append-only. Enforced BEFORE policy. runtime/src/decree_log.py + apps/browser/decree-portal.html
Layer 5 Execution Kernel — preserves intent across executor changes, never claims success without verified state, decree gate above policy runtime/ (SINGULYAR EIR v0.6)
Layer 4 DevEx / CI / IaC / Dotfiles / Observability infra/, Makefile, .github/workflows/, .devcontainer/
Layer 3 Second Brain (PKM) — markdown-first, git-synced, AI-augmented vault/ (private, canary-tested for default-deny publish)
Layer 2 AI Workflows — MCP-native (version-pinned, 4 adapters) tooling/agents/mcp/
Layer 1 Repository Structure — pnpm + Turborepo + Changesets + CODEOWNERS repo root
Cross-cutting Security (cosign/SLSA/SBOM) + OTel + git + token hygiene everywhere

For the mental model, see ARCHITECTURE.md. For how every architectural decision was made, see docs/adr/ (35 ADRs: 0001-0029, 0031-0036).

Quick start

# 1. Clone
git clone https://github.com/rtynbirf/polymath-os.git
cd polymath-os

# 2. Verify every claim in this repo (no installation required, Python 3.10+)
make verify
# → Result: 33 passed, 0 failed (of 33 claims)

# 3. Issue the 7 foundational decrees (creates ~/.polymath-os/decrees.db)
python3 ~/scripts/issue_decrees.py
# → 7 decrees recorded, chain integrity OK

# 4. Run the production decree enforcement demo
python3 runtime/src/demo_with_decree.py
# → Intent 1: CONFIRMED
# → Intent 2: WAITING_FOR_HUMAN (blocked by decree #3 'never use Google DNS')

# 5. Check compliance via Node bridge
node apps/browser/decree-bridge.js list
node apps/browser/decree-bridge.js check "configure DNS with Google 8.8.8.8"
# → {"compliant": false, "violations": [...]}

# 6. Open Decree Portal UI (browser, localStorage fallback)
open apps/browser/decree-portal.html
# OR — Electron desktop wrapper (~200MB install)
cd apps/browser/electron && npm install && npm start

# 7. If you want to develop:
make bootstrap   # pnpm install + nix develop (optional)
make test        # runs all tests (295 runtime + MCP coverage)
make ci-local    # reproduces CI locally via `act`

If make verify exits 0 — every claim below holds on your machine. That's the open-source contract.

Verifiable claims

Every claim in this repo is backed by a test or command. make verify runs all 33 checks (was 12 in v1.0, was 22 in v3.6.0, +1 token hygiene in v3.8.0, +2 agent lines in v3.22.0, +1 holos agent in v3.23.0, +1 pipeline tool in v3.24.0, +1 holon archivarius +2 agent-line selftests in v3.25.0).

# Claim How to verify Status
01 SINGULYAR EIR passes all 295 tests (including real os._exit between effect and recording, +12 new for v0.6 phrase matching) cd runtime && python scripts/check.py ✓
02 JSON Schemas (Intent / Capability / Evidence) parse and validate python scripts/check.py (check 02) ✓
03 35 ADRs (0001-0029, 0031-0036) all present ls docs/adr/ ✓
04 Every ADR follows template (Date/Status/Context/Decision/Consequences) python scripts/check.py (check 04) ✓
05 AUDIT_RESPONSE.md cross-references every ADR python scripts/check.py (check 05) ✓
06 Sovereignty Registry covers every package.json dependency python scripts/check.py (check 06) ✓
07 RUNBOOK is hardened (preconditions + result check + ⛔ irreversible markers) python scripts/check.py (check 07) ✓
08 LICENSE = MIT cat LICENSE ✓
09 ARCHITECTURE.md documents 5+1 layers + Sovereignty Registry + falsifiable self-* python scripts/check.py (check 09) ✓
10 runtime/src/*.py compile (Python syntax check) python scripts/check.py (check 10) ✓
11 No __pycache__ or *.pyc in tree python scripts/check.py (check 11) ✓
12 CI workflow runs pnpm + turbo + gitleaks python scripts/check.py (check 12) ✓
13 Pattern: manifest exclusivity (S17) python scripts/check.py (check 13) ✓
14 Pattern: counter-from-source (S2) python scripts/check.py (check 14) ✓
15 Pattern: CSP no scheme-only connect-src (S26/S41) python scripts/check.py (check 15) ✓
16 Pattern: sovereignty drill runner exists (ADR-0002) python scripts/check.py (check 16) ✓
17 Pattern: sequential triage rule-layer-first (S75) python scripts/check.py (check 17) ✓
18 Pattern: no silent SW registration failure (S48) python scripts/check.py (check 18) ✓
19 Pattern: storage eviction with protected-key Set (S30/S31) python scripts/check.py (check 19) ✓
20 Pattern: identity backup documented (S37) python scripts/check.py (check 20) ✓
21 Freedom: zero Tier 3 benefactors in code python scripts/check.py (check 21) ✓
22 MANIFEST.json exists + valid (ADR-0020) python scripts/check.py (check 22) ✓
23 Token hygiene: no plaintext PATs in code (v0.6, ADR-0021 enforcement) python scripts/check.py (check 23) ✓
24 Agent Card .well-known/agent.json valid (ADR-0023, v3.11.0) python scripts/check.py (check 24) ✓
25 Trust anchor: external tamper-evidence (ADR-0029 §9, v3.x.0) python scripts/check.py (check 25) ✓
26 Decree signing: Ed25519 authorship, pure stdlib (ADR-0031, v3.20.0) python scripts/check.py (check 26) ✓
27 ARCHIVARIUS v1.3.1 selftest 84/84 (v3.22.0) python scripts/check.py (check 27) ✓
28 Polymath-agent v3.8.0 selftest 130/130 (v3.22.0) python scripts/check.py (check 28) ✓
29 HOLOS agent v2.0 selftest 60/60 (stdlib-only) python scripts/check.py (check 29) ✓
30 POLIMAT_PIPELINE v1.2 selftest 13/13 (v3.24.1) python scripts/check.py (check 30) ✓
31 POLIMAT-ARCHIVARIUS v2.1 selftest 30/30 (holon agent, genome v2) python scripts/check.py (check 31) ✓
32 Polymath-agent v3.10.0 selftest 135/135 (C5 GATE ANTI-VACUUM, линия СуперЗ) python scripts/check.py (check 32) ✓
33 Polymath-agent v3.10.1 selftest 135/135 (CODEQL HYGIENE, линия СуперЗ) python scripts/check.py (check 33) ✓

To reproduce: clone this repo, run make verify. You will see the same 33/33 PASS result.

Decree system (v3.6.0+ OPERATIONAL)

The decree log is the human's supreme law layer — above every ADR, above the kernel, above the code. Per ADR-0021 + ADR-0022 + MANIFESTO principle 2 (PAROLE > LANGUE).

7 foundational decrees + N supersession/amendment decrees (in ~/.polymath-os/decrees.db)

The 7 foundational decrees are issued once via python3 ~/scripts/issue_decrees.py. After that, additional decrees may be added via the Decree Portal:

  • category=supersession — revokes a previous decree (per ADR-0028, v3.14.0)
  • category=amendment — drives ADR operations: create/amend/supersede/deprecate (per ADR-0026, v3.12.0)
  • category=law/prohibition/permission/observation/directive — new rules (existing behavior)

All decrees are append-only, immutable, hash-chained. Superseded decrees remain in the log for audit but get_active_laws() skips them.

# Category Text
1 law ЧЕЛОВЕК = PID=1. Каждый инструмент — fork-exec от человека.
2 law PAROLE > LANGUE. Индивидуальное слово выше коллективного договора.
3 prohibition never use Google DNS
4 prohibition never use Cloudflare
5 prohibition never use Chrome Firefox Edge Safari
6 law UNKNOWN first-class. Таймаут ≠ failure ≠ success.
7 law Default-deny. Публикуется только явное publish:true.

v0.6 Decree matching — three generations, all backward compatible

Generation Algorithm Example
v0.4 (initial) Naive substring match chrome matched chromebook (FALSE POSITIVE)
v0.5 (v3.7.0) Phrase classification (LIST/PHRASE/SINGLE/DEFAULT) Google DNS → block on google dns OR google head noun
v0.6 (v3.8.0) Word-boundary regex \b{term}\b + scope filter + regex parser chrome no longer matches chromebook; never install/deploy/run/rely on recognized

Decree enforcement on real intents

$ node apps/browser/decree-bridge.js check "configure DNS with Google 8.8.8.8"
{
  "compliant": false,
  "violations": [{
    "decree_seq": 3,
    "decree_text": "never use Google DNS",
    "violation": "intent contains prohibited term: google",
    "matched_term": "google"
  }],
  "laws_checked": 7
}

$ node apps/browser/decree-bridge.js check "configure DNS with local unbound"
{"compliant": true, "violations": [], "laws_checked": 7}  # v0.5+ FIX — was false positive in v0.4

$ node apps/browser/decree-bridge.js check "buy a chromebook"
{"compliant": true, "violations": [], "laws_checked": 7}  # v0.6 FIX — \bchrome\b doesn't match chromebook

What you can take

  • The whole repo — fork it, replace rtynbirf with your handle, run make verify, you have your own Polymath OS.
  • runtime/ alone — SINGULYAR EIR v0.6 is self-contained, MIT-licensed, zero dependencies (Python 3.10+, standard library only). Drop into your project as the execution kernel.
  • runtime/src/decree_log.py — DecreeLog class (SQLite WAL, hash-chained, append-only). Use as a standalone supreme-law layer in any project.
  • apps/browser/decree-portal.html + decree-bridge.js — drop-in decree portal UI with Node bridge to Python DecreeLog.
  • Individual ADRs — each is self-contained, with Context/Decision/Consequences. Copy the pattern.
  • The hardened RUNBOOK template — the procedure template (ПРЕДУСЛОВИЯ → ПРЕДПРОСМОТР → ДЕЙСТВИЕ ⛔ → ПРОВЕРКА → ЕСЛИ УПАЛО → СЛЕД) works for any ops team.
  • The Sovereignty Registry pattern — the two-tier dependency registry (sovereign core vs rented services vs forbidden benefactors) works for any project that wants to think about vendor lock-in.
  • Token hygiene pattern — scripts/check_token_hygiene.py (234 lines) scans for plaintext GitHub PATs in shell scripts. Drop into any Python project.

Why this exists

This repo is the answer to: "Какое новое свойство возникает, когда git, AI-agents, base знаний, CI/CD и recovery соединены именно так — и как доказать, что это не просто красивое название?"

The answer is Layer 5 (SINGULYAR EIR) — an execution kernel that:

  • preserves a person's declared intent across interchangeable execution methods
  • makes every completion claim depend on inspectable evidence of the required final state
  • treats "cannot tell" as a first-class outcome (UNKNOWN), not as a silent CONFIRMED
  • (v3.6.0+) enforces the human's decrees BEFORE any policy check (supreme law above code)

Emergence here is a falsifiable hypothesis, not a slogan. The ablation ladder B0→B3→EIR in runtime/docs/EXPERIMENT_RESULTS.md shows that each link removes a specific class of failure. The test test_each_ablation_link_is_load_bearing checks that each link is actually load-bearing. The price: in two scenarios, the kernel honestly answers UNKNOWN instead of "probably worked".

Documentation map

Document Purpose
ARCHITECTURE.md Mental model: 5+1 layers + Sovereignty Registry + falsifiable self-* + Decree as supreme law
ТЗ_Polymath_OS_v3.7.0.md Consolidated ТЗ (technical spec, 16 sections, 47.9 KB) — comprehensive
ROADMAP_v3.7.0.md Consolidated roadmap (history of 28 releases + 30/90/180/365-day vision)
TZ.md Original technical spec (Layer 1-4 view, pre-decree)
ROADMAP.md Phased plan (Phase 0-4, exit-gate based)
CHANGELOG.md Release history (v1.0.0 → v3.25.0, all changes logged)
MANIFEST.json Root manifest (ADR-0020 — manifest-driven architecture)
docs/AUDIT_RESPONSE.md Audit findings A1-A11 → ADR → action mapping
docs/adr/ 35 ADRs (0001-0029, 0031-0036) — every architectural decision
docs/MANIFESTO.md System manifesto (4 theses: PID=1, PAROLE>LANGUE, LFS, security context)
docs/SOVEREIGNTY_CONTRACT.md Sovereignty contract (Tier 1/2/3 dependency classification)
docs/01-principles.md 18 principles (constitution)
docs/02-repo-structure.md Layer 1 details
docs/03-ai-workflows.md Layer 2 details
docs/04-second-brain.md Layer 3 details
docs/05-devex-ci.md Layer 4 details
docs/runbook/RUNBOOK.md Hardened operations runbook
runtime/README.md Layer 5: SINGULYAR EIR v0.6
runtime/docs/TECHNICAL_SPEC.md EIR technical spec
runtime/docs/DECREE_PRODUCTION_DEMO.md Production decree demo (v3.7.0+)
runtime/docs/EXPERIMENT_RESULTS.md Ablation B0→B3→EIR
runtime/docs/LIMITATIONS.md What's NOT proven (honesty)
runtime/docs/THREAT_MODEL.md Threat model
runtime/docs/AUDIT_POLYMATH.md The audit that drove the fixes
apps/browser/decree-portal.html Decree Portal UI (HTML/JS, browser + Electron)
apps/browser/decree-bridge.js Node bridge: HTML UI ↔ Python DecreeLog ↔ SQLite
apps/browser/electron/ Electron desktop wrapper (v3.7.0+)
SECURITY.md Security policy + Token hygiene best practices (v3.8.0)

Contributing

See CONTRIBUTING.md. Trunk-based, conventional commits, ADR-driven.

Every PR must pass make verify. If your PR adds a new architectural decision, you must add an ADR. If your PR adds a new claim to README, you must add a check to scripts/check.py.

License

MIT — see LICENSE. Take it. Use it. Fork it. The sovereign core (git, markdown, SQLite, age, Nix) is yours forever — works without network, without accounts, without permission.

Origin

This repo was built through an iterative dialogue:

  1. v0.1: User asked for 100 file formats → 100 messengers → 100 portable apps (philosophical exploration of "human = system")

  2. v0.2: User delegated polymath audit → 4 parallel research agents → synthesis into Polymath OS (4 layers + cross-cutting)

  3. v0.3-v1.1.0: SINGULYAR EIR v0.3 audit applied → 11 audit findings fixed via 12 ADRs → SINGULYAR integrated as Layer 5 → repo promoted from "report" to "open-source ideal repo" with make verify contract

  4. v3.0.0-v3.5.0: Liberation roadmap (DNS unbound + Cloudflare-free + Chrome-free + sovereign browser) → Decree Portal UI + ADR-0022 + MANIFEST.json

  5. v3.6.0 (OPERATIONAL): Decree Bridge wired — 7 foundational decrees recorded in real SQLite. Runtime.set_decree_log() implemented. check_compliance() works on real decrees. v0.5 NLP phrase matching (LIST/PHRASE/SINGLE/DEFAULT classification).

  6. v3.7.0 (Multiagent): 4 parallel subagent tracks — production decree demo + v0.5 NLP + Electron desktop wrapper + CI steps 8+ green. All 4/4 CI checks green.

  7. v3.8.0 (CLEAN-UP): v0.6 word-boundary regex matching (fixes chrome ↔ chromebook false positive) + decree scope filtering + regex prohibition parser + token hygiene automation (scripts/check_token_hygiene.py + claim #23 + SECURITY.md best practices). 24/24 verify, 220/220 tests, 5/5 CI green.

  8. v3.9.0 (DOCS SYNC): All documentation synced with reality — README badges, MANIFEST counts, ARCHITECTURE ADR table (22 → 28), TZ.md layer count.

  9. v3.10.0 (СИНГУЛЯР synthesis): ADR-0023 Agent Card Protocol + ADR-0024 Decree-Enforced Multi-Agent Communication. Decree system теперь работает в 2 направлениях (inbound in-process + outbound).

  10. v3.11.0 (Symmetric СИНГУЛЯР): ADR-0025 Decree-Driven A2A Client (outbound decree gate BEFORE network request). v0.6.1 regex extension (+send/share/transmit/expose verbs). Decree Portal UI multi-agent view. Agent Card schema validation (claim #24). 4/5 CI green.

  11. v3.12.0 (Meta-architecture): ADR-0026 Decree-Driven ADR Amendment Mechanism (closes ADR-0016 target-for-v1.0 ahead of schedule). AdrAmender class. New 'amendment' decree category. 4 patterns: create/amend/supersede/deprecate. СИНГУЛЯР extends to 3 layers (runtime + meta-architecture + audit).

  12. v3.13.0 (HTTP inbound): ADR-0027 Decree-Enforced HTTP JSON-RPC Server (stdlib only). .well-known/agent.json теперь actually serves a real JSON-RPC endpoint. Closes ADR-0023 endpoint loop. СИНГУЛЯР полный в 4 направлениях.

  13. v3.14.0 (Decree revocation): ADR-0028 Decree Supersession Mechanism. Decrees can now be revoked via supersession decree category. Decree system CLOSED under all natural operations (issue + enforce + supersede). Append-only + revocable, no contradiction.

  14. v3.15.0 (ALL GAPS CLOSED): Production DB reset to 7 decrees (was 8 from manual test). MANIFEST.json synced (v3.14.0, adrs=28, tests=220, ci_checks=24, expanded features). ARCHITECTURE.md ADR table 28 rows. README "7 foundational + N" instead of stale "7". AgentMeshServer real Runtime integration (replace _demo_execute_fn). AdrAmender production use (create amendments.log). Audit of sovereignty_drill + cross-repo-governance workflows. Electron install test.

  15. v3.20.0 (FULLY OPERATIONAL): ADR-0031 decree cryptographic signing — pure-python Ed25519 (RFC 8032, stdlib only), ssh-keygen-compatible keys, signatures over chain hash in append-only decree_signatures table. Honest verification (integrity_failed/not_signed/signature_mismatch). provenance_report(). 20 tests. make verify 25→26 claims (26/26 green). Production decrees signed by PID=1 key (7/7, chain OK, trust anchor VERIFIED). FIXED: CI red on main (biome lint in decree-bridge.js), Electron 31 portal sandbox (npm start showed no decrees — sandbox:false in main.js).

  16. v3.25.0 (CRYSTALLIZE, current): 39 commits since v3.21.1 released as one version — POLIMAT-ARCHIVARIUS v2.1 holon (387 content-addressed parts, Merkle DAG, Reed-Solomon k=8/n=12, gossip-CRDT, суд), POLIMAT_PIPELINE v1.1/1.2 canon tool (verify-gate, git am idempotency, D2 fix), agent lines v3.8.0/v3.10.0/v3.10.1/v128-Хронотоп, HOLOS v2.0, evidence packs (RLHF, RAZBOR-9, emergent protocol), self-audit ПУЛЬС v2, Windows-green fixes (selftest 130/130 и 135/135 на nt). make verify 33/33, 290 runtime tests, CI green.

Worklog: ~/worklog.md (10+ Task IDs across multiple release sessions — full audit trail of every change).

About

Personal sovereign media-OS. 5-layer LFS-style self-bootstrapping repo. SINGULYAR Emergent Intent Runtime v0.6. 35 ADRs. make verify 33/33. 290 tests green.

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages