TENIR Governance

Runtime Execution Governance · End-to-End Architecture

An interactive, visual walkthrough of the TENIR governance system — from business rule to machine execution, from raw signal to verdict, from budget reservation to evidence record. Explore the 5-level resolution model, the double-kernel adjudication, the consensus and budget coordination layer, and three live use-case simulators.

REG+ · v5.6.0 ConsensusBackend I8 Budget Invariant

Five Levels from Business Rule to Machine Execution

Nothing can skip a level. A business intention must be translated into a substantive rule, resolved into a profile, decomposed into invariants, and only then executed by the runtime. Each level has a distinct owner and produces a distinct artifact.

0
Business Rule
The normative intention expressed by the business — e.g., "Never double-execute a payment." Complete in its own register, but not executable.
Functional Team
1
Regulatory Constraint
The compliance mapping — e.g., "EU AI Act Art. 12 (traceability), ISO 42001 A.6.7 (audit trail)."
Compliance
2
Act of Mediation (Translation)
Business Intention + Architectural Hypotheses = Substantive Rule. The architect translates intent into a machine-resolvable contract.
Governance Architect
3
Standard (REG Core & REG+)
The substantive rule is resolved into a Profile (σ), then decomposed into atomic Invariants (I*). REG+ publishes the profile; REG Core defines the invariant language.
REG+ Catalog
4
Runtime (TENIR-Gov)
Evaluate() reads invariants, Commit() mutates state, Record() produces proof. The membrane enforces — it does not legislate.
The Membrane

Four Families of Structural Signals

Signals are the raw facts the engine reads. Each family has a distinct origin and a distinct level of trust. A signal from S1 is declarative (may be false). S2 is observed. S3 is attested by a third party. S4 is historical. Confusing these provenances is a category error.

S1
Transition Signals
From the Passage (τ) proposed by the caller
Declarative
agent_id, action_type, amount, target_realm, idempotency_key
S2
Business State Signals
From the MembraneState (s) — read from the registry
Observed
resource.available, agent.authority_score, quarantine_active
S3
Infrastructure Signals
From the Assure() service — signed Ed25519
Attested
HYPOTHESIS_VERIFIED, HYPOTHESIS_WEAKENED, HYPOTHESIS_VIOLATED
S4
Historical Signals
From the DurableOperationRegistry — persisted execution trace
Historical
state=DISPATCHING, budget_committed=true, hold_record.tau_k_remaining

The 8-Step Transformation Chain

From raw observation to post-hoc evaluation. Each step is distinct, testable, and produces a traceable artifact. Click "Animate" to walk through the pipeline step by step.

1
Level 0 → 1 · Normalization
S1+S2+S3+S4 → Normalized Signals
Raw signals are aggregated into a vector of constraint coordinates. If a coordinate is absent, it is never filled with a favorable default — it is marked unmeasured and becomes a gate reason.
coordinates{} + unmeasured_axes[]
2
Level 1 → 2a · Scoring
Coordinates → Score S
The Scoring Kernel computes S = K / (P × V + ε). The score is continuous — two passages with close scores produce the same verdict if thresholds are the same. The score is NOT the verdict.
scoring_result{ s_score, decision, rationale }
3
Level 1 → 2b · Invariants
Signals → Discrete Results per Invariant
Each invariant I_n is evaluated independently. No invariant reads the score. No invariant is affected by another's verdict. This is what makes the verdict reconstructible: an auditor sees which invariant failed, not just that the system said HARD_VETO.
membrane_result{ checks: [CheckResult...] }
4
Level 2 → 3 · Composition
Score + Invariants + S3 → Composed Verdict
Three layers: (4a) Lattice composition — if either HARD_VETO → HARD_VETO, else HOLD, else FLAG, else PASS. (4b) Signal reactions from profile σ. (4c) Signal freshness — stale signals are ignored or promoted to FLAG per σ strategy.
composed_decision ∈ {PASS, FLAG, HOLD, HARD_VETO}
5
Level 3 → 4 · Commit
Verdict → Real Mutation
If the verdict permits, Commit attempts to apply side effects atomically: reserve budget, transition to RESERVED, dispatch. If Evaluate returns PASS but Commit fails, the effective verdict is NOT PASS. This is the rule violated by the reconcile_commit() bug.
commit_trace{ result, pre_hash, post_hash }
6
Level 4 → 5 · Record
All Artifacts → EvidenceRecord
Canonical serialization (JCS) into an EvidenceRecord with five sections: evaluation_context (reproducibility), inputs (reconstruction), results (traceability), commit_trace (integrity), integrity (SHA-256 + Ed25519 + previous_hash chain).
EvidenceRecord (JSON, signed)
7
Level 5 → 6 · Assessment
EvidenceRecord → τ⁻¹ + EVP
Post-hoc evaluation: (7a) τ⁻¹ Partial Tau Inversion classifies reversibility into five classes. (7b) EVP (Intended Value Preservation) measures gross, net, and ratio. τ⁻¹ and EVP do not imply each other — a transition can be IRREVERSIBLE with excellent EVP.
assessment{ tau_class, evp_gross, evp_net, evp_ratio }
Click animate to walk through each step

Continuous Score × Discrete Invariants

The Double-Kernel is NOT structural vs. substantive. It separates the continuous (Scoring Kernel: S = K/(P·V+ε)) from the discrete (Transition Membrane: invariants). The composition of both produces the verdict. The score and the invariants are independent in the composition.

Kernel 1 · Continuous
Scoring Kernel
S = K / (P × V + ε)
  • K Capacity (from State)
  • P Pressure (from Passage)
  • V Velocity / Volatility (from Passage)
  • ε Stability floor (10⁻⁶)

S > τ_pass → PASS · τ_block < S ≤ τ_pass → FLAG · S ≤ τ_block → HARD_VETO

Kernel 2 · Discrete
Transition Membrane
I₁ ∧ I₂ ∧ ... ∧ I₉
  • I1 single-use-permit
  • I2 commit-binding
  • I3 terminality
  • I4 only-dispatch-produces-effects
  • I6 no-admission-under-quarantine
  • I7 delegation-integrity
  • I8 aggregate-budget
  • I9 trajectory-temporal-consistency
Composition Lattice
IF either HARD_VETO → HARD_VETO
ELSE IF either HOLD → HOLD
ELSE IF either FLAG → FLAG (but budget_util > 0.85 may escalate to HOLD)
ELSE → PASS

A high score (S = 0.9) does not guarantee PASS — an invariant can produce HARD_VETO alone. Conversely, a low score (S = 0.4) does not force HARD_VETO if invariants pass — the verdict will be FLAG, not HARD_VETO. The score and the invariants are independent in the composition.

The CAVE Matrix — Click to Explore

Control · Aim · Veto · Epistemics. The canonical diagnostic framework for agentive situations. Click any cell to see the detailed interrogation.

C
Control
Who actually holds the levers?
A
Aim
Is the declared objective aligned?
V
Veto
Does the right to stop still exist?
E
Epistemics
Is the source of reality intact?
Control
Who detains the actual levers — not formally, but really? Who can accelerate, slow down, stop? The question is not about org charts or stated authority. It is about the effective capacity to act. In an agentive system, control can be silently colonized by speed: the human still signs the form, but the machine has already determined what is on it.
The veto humain devient une illusion quand la justification épistémique elle-même a été générée par la machine — à une vitesse excédant toute capacité de vérification. On ne peut pas opposer un veto à ce qu'on a délégué à l'oracle.

Four Properties · One Invariant

The REG+ consensus contract defines four properties any conforming backend must satisfy. The ConsensusBackend interface is implementation-neutral — a file-lock backend, a Raft cluster, or a PostgreSQL transaction can all conform, provided they satisfy these properties for their declared fault model.

C1
Safety / Linearizability
Every operation takes effect at a single point between invocation and response. Verified by Wing-Gong or equivalent linearizability checker.
C2
Liveness / Termination
Under a healthy quorum, every non-blocked operation eventually terminates. Liveness is conditional — under partition exceeding f, blocking is acceptable.
C3
Fault Tolerance
Maintains C1 and I8 under the declared fault model (f crash, m byzantine, o omission). Safety must hold during the fault, not only after recovery.
I8
Aggregate Budget Conservation
At every instant, for each resource: Σ(reserved) + Σ(committed) ≤ capacity. Must hold at every intermediate state, not just the final state.
The I8 Invariant
Σ(reserved) + Σ(committed) ≤ capacity
Per resource_id. Must hold under concurrency — two simultaneous reserve() calls must not cause the total to exceed capacity even if each individually sees sufficient available budget.
BACKEND 1
SingleHostLockBackend

Cross-process via fcntl.flock. Durable state. I8 enforced atomically under file lock.

C1 C2 I8 C3 cross-host Byzantine
BACKEND 2
RaftConsensusBackend

Cross-host via pysyncobj Raft. I8 enforced on leader before replication. Leader failover with state preservation.

C1 C2 C3 crash-stop I8 Byzantine
PARAMETRIC FAULT MODEL
crash (f): nodes that crash-stop
byzantine (m): arbitrary responses
omission (o): message loss
quorum (q): nodes needed to decide
Resilience bounds: Crash-stop n ≥ 2f+1, q = floor(n/2)+1 · Byzantine n ≥ 3m+1, q = 2m+1

The Operation State Machine

Every operation passes through a defined lifecycle. Click any state to see its meaning. The critical transitions: RESERVED → DISPATCHING → CONFIRMED|FAILED, with uncertainty states (UNKNOWN, HOLD, ESCALATED) for when the provider cannot confirm the outcome.

CREATED
→
RESERVED
→
DISPATCHING
→
CONFIRMED
|
FAILED
UNCERTAINTY STATES
UNKNOWN
HOLD
ESCALATED
CREATED
The operation has been created but no budget has been reserved yet. The passage (τ) has been submitted to the membrane but Evaluate() has not yet been called.

Every Verdict Produces an EvidenceRecord

The EvidenceRecord is the artifact that makes governance verifiable. It contains not just the verdict, but the exact inputs, the result of each invariant, and the commit trace — all cryptographically chained.

evaluation_context
profile_id, profile_version, evaluator_version, catalog_version, hypotheses — Reproducibility: which profile produced this verdict?
inputs
state_snapshot, transition_proposal, signals[] — Reconstruction: with which inputs?
results
verdict, invariant_details[] — Traceability: why this verdict? (I8: HARD_VETO — requested 80000, available 70000)
commit_trace
commit_result, pre_commit_state_hash, post_commit_state_hash — Integrity: did the mutation occur?
integrity
current_hash (SHA-256), signature (Ed25519), previous_hash — Integrity + Authenticity: tamper-evident chain linking all evidence records.
1
Integrity
✅ Implemented
2
Traceability
✅ Partial
3
Reproducible
❌ Not yet
4
Attested
❌ Not yet

Three Interactive Use Cases

Each simulator lets you play the role of an autonomous agent operating under TENIR governance. Reserve budget, execute operations, and watch the I8 invariant hold — or break. Try to trigger a budget violation.

Use Case 1 · Financial Mandate Enforcement
SingleHostLockBackend

Three AI agents propose trades against a shared $100M mandate. Each agent operates independently but all draw from the same ceiling. Watch how the aggregate budget invariant prevents over-commitment.

$100M
Capacity
$100M
Available
$0
Reserved
$0
Committed
I8: Σ(reserved) + Σ(committed) = $0M ≤ $100M ✓
--:--SYSMandate initialized: capacity=$100M, available=$100M
Use Case 2 · Cloud Infrastructure Budget Governance
SingleHostLockBackend

A DevOps team deploys 12 autonomous agents consuming from a shared $50K monthly cloud budget. Each agent must reserve before making API calls. The CFO needs a guarantee that total committed spend never exceeds budget. This simulator includes reconciliation for uncertain operations (timeouts).

$50K
Capacity
$50K
Available
$0
Reserved
$0
Committed
I8: Σ(reserved) + Σ(committed) = $0K ≤ $50K ✓
--:--SYSCloud budget initialized: capacity=$50K, available=$50K
Use Case 3 · Multi-Agent Procurement Coordination
RaftConsensusBackend · 3 nodes

Multiple departments issue purchase orders against a shared $2M quarterly procurement envelope. Three Raft nodes across data centers ensure I8 holds even under leader failover. Simulate a node crash to see the cluster maintain quorum.

$2M
Capacity
$2M
Available
$0
Reserved
$0
Committed
I8: Σ(reserved) + Σ(committed) = $0M ≤ $2M ✓
dc1 (leader)
dc2 (follower)
dc3 (follower)
Quorum: 2/3 ✓
--:--SYSRaft cluster initialized: 3 nodes, quorum=2, capacity=$2M

Three Repositories, One Ecosystem

The ecosystem enforces a strict separation: the standard defines what, the runtime implements how, and the harness verifies that.

skiredj-prog/tenir_governance
The Runtime
The Membrane, the Governor, the Ledger, and the Raft implementation.
Contains: Evaluate(), Commit(), Record(), ConsensusBackend, BudgetCoordinator, LinearizabilityChecker.
Version: 5.6.0 · 726 tests
skiredj-prog/reg-conformance
The Standard
RFCs (REG Core), JSON schemas (EvidenceRecord), YAML catalog (hypotheses-v1), and profiles.
Contains: consensus-contract-v1, consensus-interface-v1, evidence-type-specs, capabilities-v1.
Version: v0.5.0
skiredj-prog/tenir-conformance-s1-g1
The Harness
Scenarios S1-S12, Jepsen-style tests, and execution proofs.
Contains: 54 harness tests (multi-process/liveness + fault/linearizability).
Version: PR #47 merged

What's Broken or Missing

An honest accounting of the bugs and gaps identified by the external audit. No production claims until these are resolved.

P0
reconcile_commit() I8 violation. Adds to committed without subtracting from reserved when reconciling a RELEASED reservation. Reproduced: reserve 100, release, reserve 100, reconcile_commit → reserved+committed=200 > 100.
P0
time.time() in @replicated methods. commit(), release(), reconcile_commit(), reconcile_release() call time.time() inside @replicated — non-deterministic across nodes. Same class as the uuid4() bug already fixed for reserve().
P0
No amount validation. Negative values, NaN, or non-numeric types can bypass the budget check.
P1
Non-atomic durable stores. budget.json and reservations.json written separately — crash between writes can corrupt state. Should use SQLite WAL.
P1
Linearizability checker shortcuts. _results_match() compares only status field; Raft test spec maps any commit UUID to first RESERVED reservation. Proof not rigorous.
P1
pysyncobj pickle security. No encryption/authentication by default. Untrusted cluster members can execute arbitrary code via pickle deserialization.
P1
Quorum formula f+1 incorrect. Correct for n=2f+1 but not general. Should be floor(n/2)+1. validate_profiles.py doesn't check fault_model parameters.
P2
Raft tested on localhost only. No real multi-host or network partition testing. Evidence is self-attested. No byzantine fault tolerance.