Files
releasekit/docs/integrations/rehearsal-records.md

4.7 KiB

Rehearsal identity and records

A diagnostic annotated tag carries the exact source and profile identity for a single rehearsal. Its message begins with ReleaseKit rehearsal v1, followed by a newline and one compact JSON object. schema_version: 1 identifies the manifest. Its fields include the attempt ID, selector, captured commit, profile path and SHA-256, source directory, Go capability and optional module path, publication and version selection, diagnostic version, and full tag. A 16-byte random attempt ID is represented by 32 lowercase hexadecimal digits; the tag and injected version include the same ID.

The manifest fields are schema_version, attempt_id, selector, commit, profile_path, profile_sha256, source_dir, go_enabled, optional module_path, publication_mode, version_format, version_prefix, diagnostic_version, and tag. The diagnostic ref has the form releasekit-test/<selector>/<attempt-id>; the injected version is releasekit-test-<attempt-id>.

The manifest is verified against the actual annotated tag target, the event commit, the selected dispatch row, the exact committed profile bytes, and the normalized selection decoded from those bytes. The tag namespace alone is not proof of ownership or permission to delete anything. A profile is read from the captured commit rather than the current working tree.

Private attempt records use format_version: 1 and retain the manifest, Git endpoint and remote, forge and Woodpecker destinations, planned page and asset identities, tag object, observed resource IDs, timestamps, and outcomes. They do not store resolved forge or Woodpecker tokens. Endpoints and paths may themselves contain sensitive information, so treat records as private. By default they are stored under the Git common directory in releasekit/rehearsals/<attempt-id>.json. An explicit record-directory override follows the same worktree ignore rules as publication records. The initial record is created exclusively; updates use a private temporary file and rename. Records remain available for explicit recovery and operator retention.

Manifest and record strings that contain non-UTF-8 bytes are omitted in their lossy JSON form and represented by standard base64 values in identity_bytes. A recognized override supplies the exact bytes on decoding; unknown override names are ignored. Supported versions tolerate additive unknown fields.

CI result

After verifying a diagnostic tag, the delivery job emits one line beginning RELEASEKIT_REHEARSAL_RESULT_V1 and a JSON object. It includes the manifest identity and exact-byte overrides, delivery scope and outcomes, the observed page ID, and each verified artifact's filename, size, and SHA-256. A failed job emits the evidence it has reached; an earlier bootstrap failure can leave no result. The observer reads complete log lines, accepts identical retransmissions, and rejects malformed, conflicting, or mismatched evidence without echoing the raw log. The page and declared assets are read back before managed build output is removed.

The result uses the manifest fields plus scope (page or page-and-assets), build, delivery, verification, page_id, artifacts entries with name, size, and sha256, and optional safe diagnostics. A successful result requires complete delivery and verification and a positive page ID. For asset scope it also requires the planned artifacts, including the checksum manifest.

The start coordinator records tag creation and push intent before dispatch. It keeps matching pipeline numbers, workflow and step observations, the job result, and partial outcomes in the selected attempt record. A timeout or cancellation leaves those observations available for explicit recovery; it does not cancel the independent CI job or establish that cleanup is safe.

Cleanup and recovery

Recovery selects one explicit record and uses its captured destinations with current explicitly supplied credentials. A started or uncertain dispatch is eligible for cleanup only after every matching observed pipeline and relevant job is terminal and the CI search is checked again. Missing, active, or unavailable CI evidence leaves cleanup pending. Cleanup verifies the recorded tag object and page identity, then removes the page and its assets, the remote tag, and the matching local tag. It records intent before each deletion and reobserves ambiguous outcomes. A canceled observation does not cancel CI; cleanup uses an independent bounded context.

A completed result describes the recorded resources and the CI runs observed at cleanup time. Later operator-initiated reruns, CI history, notifications, and webhook effects are outside that result. Records remain available for operator retention.