ARCH-01 Foundation Slice A — first implementation leaf of the #820/#821
program. Adds a new, disabled-by-default SQLite kernel:
- Connection-bound trusted-service actor context (cp_actor_principal/kind,
cp_operation_mode, cp_service_session, cp_context_epoch) that SQL may read
but never set; every mutating trigger runs the actor protocol and fails
closed on a missing, stale, or epoch-shifted context.
- Immutable authority-dominance lattice with the exact seeded tuple set,
validated individually by the install-state trigger.
- Principal-equivalence root: a class exists before its first principal and
current_class_id is NOT NULL.
- Single atomic BEGIN IMMEDIATE install seeding the installer principal, the
distinguished operator-key issuer, dominance, the initial NULL-grantor
bootstrap grant, the active invariant, and the immutable installed marker
last; second install returns ALREADY_INSTALLED with no mutation.
- Immutability triggers on marker/seed/dominance/issuer/installer
registration/initial-grant identity; append-only audit_records; last-active
grant floored by CHECK so concurrent revokes cannot drop it to zero.
Files: arch01_platform.py (new), tests/test_arch01_platform.py (new).
Tests: 25 tests + 21 subtests cover ACs 1-14 including negative, rollback,
raw-write-bypass, and concurrency. Focused suite green; full suite 4422
passed / 11 pre-existing baseline failures at 53c2c92, zero new.
Subsystem disabled by default until readiness checks pass. SQLite-first;
PostgreSQL parity is #827.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>