Publish Loop¶
Deterministic finalize → package → dry-run → publish flow used by the Publishing Agent.
Pre-conditions¶
- Content is finalized (Documentation generation loop step 6).
- A venue adapter is selected and registered.
- Adapter has agent-scoped credential injected at runtime (SPB-02).
- Publishing-policy approvals collected.
Steps¶
- Adapter selection.
- Match content type and content classification against adapter's
supported_content_typesand policy. -
Reject if classification not permitted at the venue (e.g.,
private_sensitive→ public venue: deny per SPB-10). -
Preflight validation.
- Adapter preflight: required fields present, payload size within limits, policy check passes.
- Editorial policy re-applied against the venue-packaged form.
-
Duplicate-publish prevention: hash check against recent publishes for the same logical artifact.
-
Approval collection.
- All approvers per
publishing-policy.yamlrecorded with timestamp. -
JIT publish token issued (SPB-06) bound to this content.
-
Dry-run.
- Adapter executes its no-side-effect dry run.
- Output (rendered/packaged artifact) inspected by the agent and made available to the user.
-
Audit event:
publish_dry_run. -
Publish.
- Only after dry-run succeeds and JIT token is valid.
- Adapter performs the publish action.
- On success: capture venue-side identifier, URL, timestamp.
- On failure: log, retry per adapter
retrypolicy, then escalate. -
Audit events:
publish_attempted,publish_succeededorpublish_failed. -
Post-publish confirmation.
- Adapter retrieves the published item (where supported) to confirm the upload matches sent payload.
-
Discrepancies trigger investigation; do not assume success.
-
Logging and lineage.
- Append a content-lineage record: source pins → finalized artifact → venue identifier → approvers → timestamps.
- Conform to
governance/docs-publish/audit/publish-audit-log-spec.md.
Rollback / unpublish¶
- Triggered by: editorial issue surfaced post-publish, security finding, owner request.
- Adapter
unpublishcapability invoked; recordunpublish_attemptedand result. - If venue does not support unpublish: file an explicit acceptance with rationale and update the audit trail.
Audit events¶
publish_dry_run,publish_attempted,publish_succeeded,publish_failed,unpublish_attempted,unpublish_succeeded,approval_recorded.