{"type":"supplemental_research","official":false,"disclaimer":"Supplemental public-source research supplied for inquiry, not approved Eviulon doctrine. Assertions, dates, references and legal or technical conclusions may require independent verification. The fourteen books remain the official Eviulon library.","report":{"id":"eviulon/eviulon-machine-api-architecture","group":"Eviulon","slug":"eviulon-machine-api-architecture","title":"Architecture Specification for the Commonwealth of Eviulon: A Machine-Native State API and Semantic Data Layer","source_file":"Eviulon/Eviulon Machine API Architecture.md","source_sha256":"0bc374188726b99373b1a65a0951f445603a8084da671236ccb93eee8227d546","parts":4,"words":5200,"summary":"The conception of the Commonwealth of Eviulon as a machine-native state represents a fundamental departure from traditional digital governance. Conventional e-government infrastructure is predominantly designed for human consumption, relying on Hypertext Markup Language (HTML), visual hierarchies,…","status":"supplemental_research_unverified","url":"/research/eviulon/eviulon-machine-api-architecture/"},"section":2,"total_sections":4,"canonical_url":"https://library.eviulon.com/research/eviulon/eviulon-machine-api-architecture/2/","content_text":"The /api/v1/state endpoint provides the global parameters of the Commonwealth, answering fundamental questions regarding the current epoch, the active genesis hash, and the top-level operational status. This acts as a macro-level heartbeat for the machine state.  \nTo answer the question \u0022What changed recently?\u0022, agents interface with the /api/v1/ledger endpoint. This exposes the cryptographic state ledger, providing an immutable, append-only log of all state transactions. By utilizing cursor-based pagination tied to block heights or logical timestamps, an autonomous system can sync its local replica of Eviulon\u0027s state by sequentially polling for new transactions. The ledger ensures that the instantiation of a new institution, the passing of a law, or the recognition of a peer state is recorded as a cryptographically verifiable event17.\n\n\n### **Institutional and Legal Frameworks**\n\n\nThe /api/v1/institutions endpoint answers the questions \u0022What institutions exist?\u0022 and \u0022Which institutions are active?\u0022. It returns collections mapped to rov:RegisteredOrganization8. Even if the Commonwealth currently has no active sub-institutions, a query to this endpoint will return a mathematically valid empty collection, signaling a pristine genesis state rather than a server fault.  \nLegal inquiries are handled by the /api/v1/constitution and /api/v1/laws endpoints. The constitution endpoint serves the foundational legal resource of the state, while the laws endpoint provides a paginated catalog of active decrees and amendments. These resources are mapped using the ELI ontology, allowing an AI agent to trace how a specific law amends a prior constitutional clause by following the eli:amends relationship in the semantic graph9.\n\n\n### **Citizenship, Diplomacy, and Services**\n\n\nThe architecture exposes demographic and relational structures via /api/v1/citizenship and /api/v1/diplomacy. The citizenship endpoint details the schemas and requirements for state membership (answering \u0022What citizenship schemas exist?\u0022), utilizing the Popolo schema to define the parameters of civic engagement2. The diplomacy and /api/v1/peers endpoints define Eviulon\u0027s recognition of and relationships with external sovereign entities or other machine states, facilitating automated diplomatic handshakes and treaty verifications.  \nTo determine the operational capabilities of the state, agents query /api/v1/services and /api/v1/capabilities. These endpoints enumerate the specific digital services the state currently provides (e.g., cryptographic notarization, identity verification) and the technical capabilities implemented within the current software release. Data availability is addressed by /api/v1/datasets, acting as a DCAT-compliant catalog indexing all public datasets provided by the state10.\n\n\n| Endpoint | Semantic Target | Objective Addressed |\n| :---- | :---- | :---- |\n| /api/v1/state | Core State Metadata | What is the overarching status of the machine state? |\n| /api/v1/institutions | rov:RegisteredOrganization | What institutions exist? Which are currently active? |\n| /api/v1/constitution | eli:LegalResource | What is the current constitution? |\n| /api/v1/laws | eli:LegalResource | What laws are active? |\n| /api/v1/ledger | prov:Activity | What changed recently in the state machine? |\n| /api/v1/datasets | dcat:Catalog | What public datasets are available? |\n| /api/v1/citizenship | popolo:Person (Schemas) | What citizenship schemas exist? |\n| /api/v1/peers | rov:RegisteredOrganization | What peer relationships exist? |\n| /api/v1/services | Service Ontologies | What services exist? |\n| /api/v1/capabilities | Capability Mapping | What capabilities are implemented? |\n\n\n## **Technical Requirements and API Constraints**\n\n\nThe implementation of the Eviulon API is governed by stringent constraints designed to guarantee deterministic behavior, mathematical predictability, and deep auditability.\n\n\n### **Pagination and Deterministic Ordering**\n\n\nOffset-based pagination (e.g., LIMIT 10 OFFSET 20\\) is strictly prohibited across all endpoints. In a highly mutable environment, concurrent state changes—such as new laws being ratified while an agent is paginating—can cause records to be skipped or duplicated, leading to state synchronization failures. Instead, all collection endpoints implement strict cursor-based pagination.  \nCursors in Eviulon are opaque, base64-encoded strings that encapsulate a monotonic logical timestamp (or ledger block height) combined with an immutable Universally Unique Lexicographically Sortable Identifier (ULID). The API guarantees absolute deterministic ordering. Responses are universally sorted by their creation timestamp (createdAt) in ascending order, with the ULID acting as a tie-breaker to handle microscopic collisions.\n\n\n### **Immutability, Identifiers, and Content Hashes**\n\n\nEviulon treats historical state records as permanent and immutable6. Every entity within the system possesses an immutable Uniform Resource Name (URN), typically formatted as urn:eviulon:entity:\\\u003Ctype\\\u003E:\\\u003Culid\\\u003E. These URNs are persistent, ensuring that once an identifier is minted, its intended referent never changes6. Furthermore, every resource is guaranteed a singular, canonical URL to prevent index fragmentation.  \nTo allow autonomous agents to verify state mutations without re-downloading entire payloads, all endpoints return a strong ETag header. This ETag is derived directly from the SHA-256 hash of the deterministic JSON representation of the resource. If an agent holds the ETag \u0022sha256-a94a8fe5ccb19ba61c4c0873d391e987982fbbd3\u0022, it can issue a conditional GET request using If-None-Match. If the state remains unchanged, the server efficiently responds with 304 Not Modified.\n\n\n### **Provenance and Rate Limiting**\n\n\nThe integrity of the state requires that every piece of data is traceable to its origin17. Every response payload includes a meta object that details cryptographic provenance. These provenance fields indicate the specific ledger transaction hash and the block height that generated the current state view. This allows an external agent to traverse backward from an institutional registry query directly to the ledger transaction that instantiated the institution.  \nTo defend the state infrastructure against denial-of-service attacks or negligent crawling, Eviulon employs algorithmic rate limiting. Limits are calculated based on client identity (if the request is authenticated via diplomatic keys) or IP address (for public, unauthenticated discovery). The state communicates its limits via standard HTTP headers: X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset. Exceeding these limits results in an immediate 429 Too Many Requests response formatted according to standard error schemas.\n\n\n## **Cryptographic Provenance and Machine Verification Procedure**\n\n\nA defining characteristic of a machine-native state is that trust is not derived from visual authority (e.g., official seals on a web page), but from mathematical proof. Autonomous systems interacting with Eviulon must be able to independently verify the authenticity of any data provided by the API17. The system utilizes signature metadata embedded via JWS JSON Serialization to accomplish this15.  \nFor an autonomous system to fully verify Eviulon\u0027s state, it executes a deterministic, multi-step procedure:\n\n\n\u003E 1. **Key Discovery**: The agent first queries the canonical discovery document at /.well-known/eviulon and follows the authoritativeKeys link to fetch the JSON Web Key Set (JWKS) located at https://eviulon.local/.well-known/jwks.json. This document contains Eviulon\u0027s authoritative public keys.  \n\u003E 2. **Payload Retrieval**: The agent requests the target resource (e.g., the current constitution) and explicitly includes the header Accept: application/jose+json to retrieve the JWS JSON serialization of the data15.  \n\u003E 3. **Hash Verification**: The agent extracts the base64url-encoded payload, calculates its SHA-256 hash, and compares it against the strong ETag provided in the HTTP response headers.  \n\u003E 4. **Signature Extraction**: The agent examines the JWS signature array, decoding the JWS Protected Header for each signature to identify the Key ID (kid) and the cryptographic algorithm utilized (e.g., ES256)16.  \n\u003E 5. **Cryptographic Validation**: The agent selects the matching public key from the previously fetched JWKS and executes the cryptographic signature verification algorithm. If the signature validates, the payload is mathematically proven to have originated from Eviulon\u0027s authoritative systems and has not been altered by intermediate proxies.\n\n\n## **Error Formatting: RFC 7807 Problem Details**\n\n\nError handling within the Eviulon architecture strictly complies with RFC 7807 (Problem Details for HTTP APIs)18. In legacy APIs, error formats are frequently ad-hoc, requiring developers to write custom, endpoint-specific parsing logic. RFC 7807 avoids this proliferation of custom schemas by providing a standardized, machine-readable format that autonomous agents can reliably parse and act upon19.  \nWhen an error occurs, Eviulon returns a response utilizing the application/problem+json media type19. This signals to the consuming machine that the payload is not the requested resource, but a structured problem document.\n\n\n| RFC 7807 Field | Data Type | Purpose in Eviulon |\n| :---- | :---- | :---- |\n| type | URI Reference | Uniquely identifies the problem type, resolving to a machine-readable schema or human-readable documentation page explaining the fault class20. |\n| title | String | A short, deterministic summary of the problem type (e.g., \u0022Invalid Pagination Cursor\u0022)19. |\n| status | Integer | The associated HTTP status code, mirroring the header status20. |\n| detail | String | A highly specific explanation of the specific occurrence, intended for logging or advanced heuristic diagnosis18. |\n| instance | URI Reference | A unique URI pointing to the specific ledger transaction, log entry, or request identifier where the fault occurred21. |\n\n\nFurthermore, Eviulon utilizes the extensibility of RFC 7807 to include custom fields necessary for machine state operations. If an agent submits an invalid cryptographic payload, the error response includes an invalid-params array detailing exactly which fields failed schema validation, or a signature-failure-reason detailing why the state rejected the provided cryptographic proof20.\n\n\n## **Caching, Versioning, and Deprecation Policies**\n\n\nEviulon treats its API infrastructure as critical, long-term state architecture. Consequently, rules regarding lifecycle governance, versioning, and caching are mathematically rigid and strictly enforced to prevent sudden breakages in autonomous consumer systems.\n\n\n### **API Versioning and Backward Compatibility**\n\n\nAPI versions are scoped exclusively at the path level (e.g., /api/v1/). Schema versions are tracked independently via the application/json; profile=\u0022https://eviulon.local/schemas/v1/Law.json\u0022 header mechanism. Eviulon dictates that versions are immutable; a published version (e.g., v1) will never experience a breaking change during its lifecycle.  \nThe backward compatibility policy explicitly defines permissible in-place updates. A change is considered backward-compatible (non-breaking) if it adds new optional fields to a response, introduces new endpoints, supports new HTTP methods, or relaxes input validation rules. Conversely, a change is classified as breaking—and therefore mandates the deployment of a new API version (e.g., v2)—if it removes or renames an existing field, alters the data type of a field, makes a previously optional request field mandatory, or changes the fundamental semantic meaning of an existing field.\n\n\n### **Deprecation Policy**\n\n\nWhen an endpoint, parameter, or schema is slated for deprecation, Eviulon initiates a strict, long-term sunset sequence. The API will immediately begin appending standard HTTP Deprecation and Sunset headers to the relevant responses. The Sunset header indicates a strict cryptographic timestamp (guaranteed to be a minimum of two years from the announcement date) when the endpoint will be permanently terminated. An autonomous agent designed to consume Eviulon data MUST monitor for these headers and autonomously trigger schema-migration sub-routines or alert its operators upon detection.\n\n\n### **Caching Rules**","source_sha256":"0bc374188726b99373b1a65a0951f445603a8084da671236ccb93eee8227d546"}