@agentplat/collective-sync-postgres
v1.2.0
Published
Transactional PostgreSQL persistence for Agentplat collective causal synchronization.
Readme
@agentplat/collective-sync-postgres
Transactional PostgreSQL persistence for @agentplat/collective-sync.
Installation (developer preview)
Install the coordinated preview explicitly:
npm install @agentplat/collective-sync-postgres@nextKeep all @agentplat/* packages on the same release version. npm's default
latest tag can point to an older preview. See the
release channels
for distribution status and version selection.
The repository stores append-only causal records, exact point reads, compare-and-set stream heads, resumable session cursors, receipts, and catch-up certificates for one exact peer instance. Records and head advancement commit in the same transaction, so a restart cannot expose a partially imported frontier.
import {
PostgresCollectiveSyncRepositoryV1,
runMigrations,
} from "@agentplat/collective-sync-postgres";
await runMigrations(pool, { schema: "agentplat", createSchema: true });
const repository = new PostgresCollectiveSyncRepositoryV1(pool, {
schema: "agentplat",
tenantId: "tenant.1",
meshId: "mesh.1",
peerId: "peer.1",
instanceId: "instance.peer.1",
policyDomainId: "policy.1",
});The @agentplat/collective-sync-postgres/checkpoints subpath provides
PostgresExecutionCheckpointRepositoryV1. It stores immutable portable
checkpoint artifacts, signed replica receipts, replication certificates and
certificate-custody acknowledgements in the same peer-instance scope while
remaining independent from causal catch-up sessions.
import { PostgresExecutionCheckpointRepositoryV1 } from "@agentplat/collective-sync-postgres/checkpoints";
const checkpoints = new PostgresExecutionCheckpointRepositoryV1(pool, {
schema: "agentplat",
tenantId: "tenant.1",
meshId: "mesh.1",
peerId: "peer.1",
instanceId: "instance.peer.1",
policyDomainId: "policy.1",
});Importing the package performs no connection, migration, or filesystem write. Rollback is destructive and requires the exact confirmation string, an explicit data-loss acknowledgement, and a verified external backup.
