ARSGATE Canonical Library Sync — Technical EN v1.0
Purpose
Canonical Library Sync projects ARSGATE canonical Markdown from governed Forgejo repositories into the persistent ChatGPT Library. Forgejo remains the publication source of truth; Library is a mandatory verified projection and Administrative Closure is fail-closed when the projection is missing, stale, ambiguous, or unverifiable.
Canonical inventory
The producer resolves documents from the Resource Registry, mandatory Technical EN/IT and Non-technical EN/IT slots, component manifests and their repository_files, explicit canonical documentation paths, and workstream Documentation Registry evidence. Local README/test/fixture/generated Markdown is excluded unless explicitly promoted by those authorities.
Every document has a stable document_id, component, canonical repository path, implementation revision, source revision and SHA-256. Duplicate physical copies representing the same logical identity are collapsed before Library synchronization.
Durable lifecycle
Guardian creates a deterministic request in the Library outbox. Requests survive process, worker, assignment and browser loss. A newer request for the same workstream supersedes stale PENDING or FAILED_RETRYABLE requests; an active SYNCING generation is never superseded mid-transaction. Receipt states are SYNCED, FAILED_RETRYABLE, FAILED_TERMINAL or SUPERSEDED. Missing or retryable receipts leave Administrative Closure open.
Receipt verification
A SYNCED receipt is accepted only when every Documentation Registry entry has a Library path, stable library_file_id, positive version, matching source SHA-256, documented revision and source revision. The four mandatory slots must always be present. Additional registered manuals, ADRs, roadmaps, runbooks and governance documents are validated with the same rules.
Idempotence
Unchanged content reuses the existing Library identity and version. Repeated sync must create no duplicate files and no new version when bytes are unchanged. Changed content updates the same Library identity. Same filename with different document_id is never deduplicated solely by name.
Immutable sync snapshot
Each Library request is revision-pinned and carries an immutable embedded snapshot. The request records source_revision, manifest_sha256, file_count and, for every document, canonical_path, SHA-256, size_bytes and the exact UTF-8 content to synchronize. The consumer must use the embedded snapshot content, never reread mutable source_path bytes during the transaction.
Once a request is SYNCING, Guardian does not supersede it even if canonical HEAD advances. The in-flight snapshot completes and produces a receipt bound to the same manifest. A newer canonical revision becomes the next generation after the current request reaches a terminal state. Partial writes never constitute a valid receipt; retries reconcile the same immutable snapshot idempotently.
Same-revision reopen recovery
When a workstream is reopened without changing its immutable implementation revision, Guardian may restore previously accepted integration, deployment and acceptance receipts instead of replaying already completed work. Restoration is fail-closed: the prior implementation revision, integration source revision, integration job ID and canonical commit chain must match the current authoritative worker job. Any revision, job or canonical mismatch disables restoration and leaves the normal governed recovery path in control.
Async projection closure policy — 6 October 2026
Administrative closure is gated synchronously by the canonical Git revision, documentation registry, immutable projection manifest and durable Library request. A valid PROJECTION_QUEUED request with blocking=false does not block COMPLETE. Library writes run asynchronously and idempotently, writing only changed documents; unchanged identities are reused. Manifest/revision mismatch remains fail-closed. Set blocking=true only when immediate Library availability is explicitly required.