Skip to content

Ledger

The ledger is the backbone of RepoMesh. It is an append-only log of signed events stored as flat JSON files in the ledger/ directory of the RepoMesh repository.

Every event written to the ledger must satisfy five rules. Violation of any rule causes the event to be rejected by CI validation.

RuleEnforcement
Append-onlyEvents are never modified or deleted. New events are appended to partition files. CI rejects any diff that removes or edits an existing event.
Schema-validEvery event conforms to its declared type schema in schemas/events/. The schema is checked at write time and again in CI.
Signature-validEvery event carries an Ed25519 signature from a registered node. The public key must be present in the registry.
UniqueEach event has a deterministic ID derived from its content hash. Duplicate IDs are rejected.
Timestamp-saneEvent timestamps must be within a reasonable window of the current time. Clock drift beyond 15 minutes causes rejection.
Event typeEmitted byPayload summary
ReleasePublishedCompute nodeRepo, version, commit SHA, artifact checksums, profile
AttestationPublishedAttestor nodeTarget event ID, verifier results, composite score
BreakingChangeDetectedPolicy nodeRepo, version pair, interface diff summary
HealthCheckFailedOracle nodeRepo, check type, failure details, severity
DependencyVulnFoundOracle nodeRepo, dependency, CVE ID, severity, fix available
InterfaceUpdatedCompute nodeRepo, version, schema diff, backward-compatible flag
PolicyViolationPolicy nodeRepo, rule ID, violation details, suggested action

Each event type has a JSON schema in schemas/events/<EventType>.json. The schemas define required fields, value constraints, and relationships to other event types.

Every event shares a common envelope:

{
"id": "<deterministic-content-hash>",
"type": "ReleasePublished",
"nodeId": "your-org/your-repo",
"timestamp": "2026-03-05T12:00:00Z",
"payload": { },
"signature": "<ed25519-base64>"
}

The id is computed as SHA-256(type + nodeId + timestamp + canonical(payload)). This ensures that identical events always produce the same ID, and different events always produce different IDs.

Nodes declare their kind in node.json. The kind determines what event types a node is authorized to emit.

KindRoleAuthorized events
registryAggregates node metadata and trust scoresInternal bookkeeping (no ledger events)
attestorRuns verifiers and publishes attestationsAttestationPublished
policyDefines and enforces cross-repo rulesBreakingChangeDetected, PolicyViolation
oracleMonitors external signals (CVEs, uptime, health)HealthCheckFailed, DependencyVulnFound
computeA regular repository that produces releasesReleasePublished, InterfaceUpdated
settlementPosts Merkle roots to XRPLInternal (anchor records, not ledger events)
governanceManages network-level decisions (upgrades, disputes)Governance proposals (future)
identityManages key rotation and node identityKey rotation records (future)

The ledger is partitioned by month. Each partition is a single JSON file at ledger/YYYY-MM.json containing an ordered array of events. Partitions are immutable once the month closes. The settlement node computes a Merkle root for each closed partition and anchors it to XRPL.

Open partitions (the current month) can receive new events but existing events cannot be modified. The CI pipeline enforces this by checking that the diff only contains appended entries.