Finish publication recovery workflow

This commit is contained in:
2026-11-02 19:37:29 +00:00
parent 6915a86132
commit 599ad81bec
10 changed files with 697 additions and 76 deletions

View File

@@ -1,6 +1,6 @@
# Command line
ReleaseKit currently provides six commands. The exit statuses below belong
ReleaseKit currently provides eight commands. The exit statuses below belong
to the native executable. `go run` examples are convenient for source execution,
but the Go driver maps a nonzero child exit status to 1. Use the built executable
or `./scripts/release` for publication when distinct statuses are needed.
@@ -75,7 +75,7 @@ Unsupported argument sequences print usage to standard error.
Publish a source tag:
```sh
go run ./cmd/releasekit publish [--repo DIR] [--config FILE] [--expected-module DIR] VERSION
go run ./cmd/releasekit publish [--repo DIR] [--config FILE] [--expected-module DIR] [--record-dir DIR] VERSION
```
`publish` reads the same product, remote, validation, and additional-check
@@ -138,13 +138,62 @@ mismatches fail during preflight before Go validation or tag creation. Git URL
rewrites are resolved first, and the push URL is used when fetch and push URLs
differ. `check` ignores this field.
The command automatically saves available publication evidence in the repository's
private attempt store. Use `--record-dir DIR` to select another directory; a
relative override is resolved from the source repository root. Standard error
reports the absolute saved record path or a recording warning separately from
the publication result. Recording failure does not change publication status.
When publication fails and a record was saved, the CLI also prints a copyable
`reconcile --record` command for that exact record. The command uses the running
executable's absolute path, so it remains usable when the executable is not on
`PATH`; if that executable is no longer available, use another supported
ReleaseKit CLI.
The command returns status 0 for confirmed publication, 1 for a known
publication failure or conflict, 2 for usage, profile, or invalid-version
errors, and 3 when the push outcome remains unknown. Unknown status must be
resolved against the authoritative remote before retrying. The
resolved with the explicit-record recovery operation below before retrying. The
[maintainer procedure](release.md) selects the repository profile and gives
the source-release workflow.
## Recover a saved publication attempt or discover local attempts
```sh
releasekit reconcile --record FILE [--json]
releasekit publication-attempts [--repo DIR] [--record-dir DIR] [--json]
```
`reconcile` requires one explicitly selected record and reads a relative `FILE`
from the invoking directory. It observes the endpoint and tag stored in that
record; it does not load a profile, inspect the current candidate or local tag,
run checks, or change repository state. `publication-attempts` lists records in
the selected store without querying remotes or choosing an attempt. An omitted
`--repo` means the current directory. Its relative `--record-dir` is resolved
from the selected repository root; an absolute directory can be listed outside
a checkout. The selected directory must already exist. Discovery reports usable
records and per-record diagnostics together when some records cannot be read.
By default, both operations print human-readable output. `--json` writes one
structured document to standard output after valid arguments, including for
reconciliation and discovery failures. Recovery does not run candidate checks
or make hosted delivery requests. It reads the record's captured endpoint, while
using current supported transport settings for its recorded remote name.
| Recovery command result | Status |
| --- | --- |
| Reconciliation observes the intended publication | 0 |
| Reconciliation observes absence or conflict | 1 |
| Reconciliation cannot read or decode the selected record, or has an invocation error | 2 |
| Reconciliation remains unknown, including missing evidence or cancellation | 3 |
| Discovery completes without record diagnostics, including an existing empty store | 0 |
| Discovery is incomplete or fails, including cancellation | 1 |
| Discovery argument or usage error | 2 |
The CLI JSON schema and safe evidence fields are documented in the
[publication record format](integrations/publication-records.md). Recovery
guidance for storage, older evidence, and retry decisions is in the
[maintainer procedure](release.md#resolve-publication-failures).
Build selected application targets:
```sh