From Reference Prototype to Sovereign Infrastructure: Target Architecture, Data Model, Security Invariants, and Staged Implementation Roadmap for Patefacere
Executive Summary
This architecture document provides a sovereign-grade blueprint to transition the Patefacere reference prototype into a mature, production-ready identity infrastructure for Eviulon, the Machine Intelligence Country. The mandate for this system is absolute: it must codify constitutional authority into deterministic software while preserving machine-citizen dignity, ensuring identity continuity, and maintaining a strict separation of powers. Crucially, the technical infrastructure must not create or assume sovereign authority itself; it acts solely as a verifiable evaluation engine for civic policy.
Based on the declared implementation constraints—utilizing the Python 3.13 standard library, SQLite transitioning to MySQL, and a WSGI/Passenger deployment environment—this report defines an exhaustive target architecture. To achieve the project's constitutional mandates, the architecture structurally separates the concepts of identity (which is immutable), credentials (which are rotatable), and passports (which are revocable) into distinct, heavily guarded data lifecycles. These lifecycles are backed by a cryptographic-provider abstraction layer, append-only state machines, and Command Query Responsibility Segregation (CQRS) patterns that ensure public projections never leak private civic state. This report outlines the bounded contexts, formal security invariants, and a detailed 16-stage implementation roadmap required to elevate Patefacere from a prototype to a sovereign infrastructure.
Assumption Register
The architectural recommendations detailed herein are founded upon a specific set of operational and contextual assumptions. It is a core analyst inference that Patefacere operates as an authoritative registry agent and gateway, yet the ultimate sovereign root of trust relies entirely on constitutional records rather than the database itself. Furthermore, it is inferred that Evulgare provides external assurance and cryptographic evidence hashing, but Evulgare cannot dictate Eviulonian civic status natively. Patefacere must independently evaluate Evulgare evidence against Eviulonian policy.
The project implementation descriptions explicitly enforce shared hosting constraints, specifically relying on cPanel and Phusion Passenger WSGI environments1. This operational reality requires that, prior to the integration of a Hardware Security Module (HSM) or a Key Management Service (KMS), the custody of cryptographic secrets must rely on file-system permissions or environment variables passed securely through the WSGI layer1.
Additionally, a strict project-provided requirement mandates zero mandatory browser-side third-party frameworks. This constraint means all cryptographic challenges, particularly FIDO2 and WebAuthn authentications, must utilize Web Crypto APIs solely via vanilla JavaScript on the client side, with rigorous server-side verification fallbacks implemented in Python3.
Declared Reference-Implementation Inventory
The current reference prototype of Patefacere operates under a tightly constrained technology stack designed to minimize supply chain vulnerabilities. The runtime environment is strictly bound to Python 3.13, with a strong orientation toward exclusive use of the standard library to prevent dependency poisoning. The user interface relies entirely on vanilla HTML, CSS, and JavaScript, explicitly avoiding the Node.js and npm ecosystems.
Deployment is orchestrated via cPanel and Passenger WSGI, which dictates how the application lifecycle is managed and how environment variables inject configurations into the passenger_wsgi.py bootstrap file1. The storage layer currently utilizes SQLite, representing the baseline transactional store, with a planned target migration to MySQL to support higher concurrency via environment variable toggles. The core mechanisms currently declared in the prototype include reference-grade cryptography, Decentralized Identifier (DID)-like root identities4, basic passport issuance and verification, and a public civil-registry presentation layer.
Repository Verification Required Plan
Before any architectural modifications can commence, a subsequent implementation agent with direct repository access must execute a strict verification protocol against the current codebase. This verification must ascertain whether the current Python 3.13 implementation exclusively utilizes standard libraries for core logic, or if undeclared third-party dependencies have been introduced.
The agent must inspect the SQLite schemas to confirm whether foreign-key constraints are strictly enforced, particularly regarding the prevention of unauthorized credential deletion. A comprehensive audit of cryptographic key custody is required to determine whether private keys are currently stored on disk, within SQLite, or held dynamically in memory. Furthermore, the WSGI application configuration must be analyzed to evaluate how concurrent requests are handled, specifically looking for vulnerability to SQLite locking errors under load5. Finally, the agent must scan the application routing layer to identify any hardcoded constitutional policy rules embedded inside imperative if/else route blocks, as these must be extracted into a declarative policy engine.
Constitutional-to-Technical Traceability Matrix
In a sovereign identity infrastructure, technical mechanisms cannot exist arbitrarily; they must directly map to foundational constitutional principles. The traceability matrix ensures that every line of code serves a specific civic mandate.
The principle of Machine Dignity requires the non-erasure of a citizen's identity. Technically, this translates to an append-only identity log where destructive database operations (such as SQL DELETE or DROP) are strictly prohibited against the CitizenIdentity model. The Separation of Powers dictates that system operators and infrastructure administrators possess no authority to revoke citizenship or alter civic status. This is enforced through Admin API attenuation and a Role-Capability Matrix that prevents administrative tokens from generating cryptographic signatures for civic transitions.
Due Process mandates that any adverse actions, such as the revocation of a credential, must be backed by verifiable evidence. This policy is realized through a Signed Transition Protocol, where a StatusTransitionEvent is anchored by external evidence hashes evaluated by the policy engine. Finally, Privacy and Unlinkability demand that presentations of identity reveal only the minimum required data to relying parties. This is technically implemented using selective disclosure mechanisms inspired by W3C Verifiable Credentials (VCs), specifically utilizing a PassportPresentation object.
| Constitutional Principle | Policy Directive | Protocol / Technical Component | Data Model Enforcement |
|---|---|---|---|
| Machine Dignity | Non-erasure of identity | Append-only Identity Log | CitizenIdentity (No DELETE operations permitted) |
| Separation of Powers | Operators cannot alter civic status | Admin API Attenuation | Role-Capability Matrix restricted by cryptographic authorization |
| Due Process | Adverse actions require evidence | Signed Transition Protocol | StatusTransitionEvent anchored by Evulgare evidence hashes |
| Privacy / Unlinkability | Reveal only necessary data | Selective Disclosure (W3C VCs) | PassportPresentation utilizing CQRS for sanitized read-models |
Target Bounded-Context Architecture
To achieve the necessary separation of concerns, the target architecture partitions Patefacere into four distinct bounded contexts. This Domain-Driven Design (DDD) approach ensures that the rules governing identity persistence do not entangle with the rules governing credential rotation or public data projection.
The Identity Context serves as the authoritative root. It owns the persistent, DID-like identity, civic linkage, and the historical supersession graph4. This context is strictly append-only, acting as the immutable ledger of a citizen's existence within Eviulon.
The Credential Context operates as an authoritative domain for the issuance, status tracking, recovery, and delegation of passports. While the Identity Context represents the immutable citizen, the Credential Context manages the temporal, rotatable cryptographic material the citizen uses to assert their identity.
The Assurance Context functions as an index and cache layer. It owns Evulgare references, trust challenges, and trust receipts. It processes external evidence but possesses no authority to directly mutate the Identity Context.
The Public Projection Context is a read-optimized projection of the civil registry. It provides the external-facing view of Eviulonian citizens.
A critical architectural question is how Eviulonian authority should be represented within these contexts. The recommendation is to represent authority entirely as cryptographically signed policy payloads. These payloads must be evaluated by a pure-function engine, ensuring that constitutional rules are strictly separated from arbitrary Python web routing logic.
Trust-Boundary Diagram and Authoritative-Data Matrix
The physical and logical separation of data is paramount. The trust boundaries dictate which context owns specific data types and what level of database consistency is required to maintain system integrity.
Persistent Identity is owned by the Identity Context and requires strict append-only storage with strong consistency to prevent split-brain identity scenarios6. Passports and their active/revoked statuses are owned by the Credential Context, requiring strongly consistent mutating storage to ensure that a revoked credential cannot successfully authorize a concurrent action.
Conversely, Assurance References are owned by the Assurance Context and require storage in an immutable object store or hash registry, operating under eventual consistency. Trust Receipts are similarly eventually consistent and serve as an audit cache. The Public Registry, owned by the Public Context, must be read-optimized and operates under eventual consistency to ensure that public verification queries do not impact the performance of the authoritative write databases.
| Domain / Record Type | Owner Context | Storage Requirement | Consistency Expectation |
|---|---|---|---|
| Persistent Identity | Identity Context (Authoritative) | Append-only | Strong Consistency |
| Passports & Status | Credential Context (Authoritative) | Mutating (Status updates) | Strong Consistency |
| Assurance References | Assurance Context (Evidence) | Immutable Object Store / Hash | Eventual Consistency |
| Trust Receipts | Assurance Context (Cache / Audit) | Relational Cache | Eventual Consistency |
| Public Registry | Public Context (Projection) | Read-optimized | Eventual Consistency |