Add read-only release readiness validation

This commit is contained in:
2026-12-05 22:03:34 +00:00
parent 92b820b234
commit 000e9ef9b9
19 changed files with 1286 additions and 8 deletions

View File

@@ -242,6 +242,17 @@ tree and does not perform candidate validation or remote publication. `check`
and `publish` run the same configured build after their one candidate
validation, using temporary output outside the worktree.
Inspect working release configuration without creating a release:
```sh
releasekit validate [--repo DIR] [--config FILE] [--context local|ci] [--operation NAME ...] [--offline] [--assets DIR] [--json]
```
Validation defaults to local credentials and read-only remote access. Operation
flags narrow the selected capabilities; `--offline` omits remote observations.
See the [readiness guide](consumers/readiness.md) for scope, evidence, and exit
statuses.
Deliver a tagged source release:
```sh

View File

@@ -177,6 +177,11 @@ local files to exist, or inspect Git history. Existing clean-index/worktree
requirements still apply to candidate operations. An ignore rule alone does
not remove a previously committed file from the candidate.
`readiness.required_files` optionally lists literal repository-root-relative or
absolute files whose readability `validate` checks. These are explicit local
inputs, not inferred SSH authentication requirements; see the
[readiness guide](consumers/readiness.md).
The `delivery` object contains `forge`, `base_url`, `owner`, `repository`, and
context-specific `credentials`. A delivery request must set `forge` to
`"gitea"`; a missing or unsupported selection is an error for delivery. These

View File

@@ -0,0 +1,45 @@
# Readiness validation
`releasekit validate` inspects the working profile and source inputs before a
release candidate is ready. It does not run product checks, build, download
dependencies, change the checkout, or write to a remote. It does not require a
version or release note. Its results are optional setup evidence, not a release
gate or proof of later write permission.
```sh
releasekit validate
releasekit validate --context ci --operation delivery --json
releasekit validate --offline --operation publication
```
By default, the command selects publication, configured Go and build work, and
delivery when declared. Repeated `--operation` flags select only the named
operations: `publication`, `go`, `build`, `delivery`, and `rehearsal`.
Rehearsal is explicit. The selected `local` or `ci` context controls credential
loading independently of network scope. Online validation reads authoritative
Git `main` from the effective push endpoint and performs hosted delivery
preflight. Offline mode omits those remote reads and identifies the omitted
checks. Local publication readiness also checks Git's configured tagger
identity. Native Git and SSH authentication remain in use; no conventional
private-key filename is required.
To require a specific local input, list it in `readiness.required_files` in the
profile. Paths are literal repository-root-relative or absolute filenames. This
checks readability, not Git authentication. `--assets DIR` selects an existing
build receipt and artifacts for identity and digest checks; delivery must be
selected. Build outputs are otherwise not required to exist. Dependency-cache
completeness and actual build execution remain unchecked.
JSON output is one document with `schema_version: 1`, `command: "validate"`,
the working-input scope, selected operations, context, safe credential sources,
destinations, and ordered check results. Check statuses are `passed`, `failed`,
`skipped`, and `unchecked`; reasons distinguish configuration, input, remote,
dependency, offline, and unexecuted evidence. A selected failed or incomplete
check makes the command unsuccessful; an offline omission alone does not. Status
2 reports usage, configuration, or required-input errors; status 1 reports
other failures, cancellation, or output failure. Actual CI secret injection
requires a job or rehearsal result and is not established by local readiness.
The Go facade's `Validate` accepts explicit selections and tokens and returns a
`ValidationReport` with a `ReadinessError` when selected checks fail. The CLI
loads its own credentials; the library does not load ambient tokens.

View File

@@ -3,14 +3,15 @@
Public Go contracts are defined in declarations and GoDoc. ReleaseKit supports
two Go facades and a command-line interface:
- The root `releasekit` package is the orchestration facade. `Check` validates
- The root `releasekit` package is the orchestration facade. `Validate` inspects
working setup and read-only access, `Check` validates
one local candidate, `Publish` validates and publishes its exact annotated
source tag, `Build` compiles selected application targets, and `Deliver`
delivers a tagged note page and any declared assets. `PrepareTaggedCheckout`
and `PrepareBuildDependencies` provide explicit local CI preparation.
- `buildinfo` is the small runtime facade. `Version` reports the injected
application version, the main-module version when available, or `dev`.
- `cmd/releasekit` is the executable interface. Its `version`, `check`,
- `cmd/releasekit` is the executable interface. Its `version`, `validate`, `check`,
`publish`, `reconcile`, `publication-attempts`, `build`, `deliver`, and
`ci-deliver` commands adapt profiles and command output to the supported
library operations.
@@ -20,7 +21,8 @@ See the [CLI contract](../cli.md), [configuration reference](../config.md),
[source publication guide](../consumers/publish.md),
[publication record format](../integrations/publication-records.md),
[build guide](../consumers/build.md),
[delivery guide](../consumers/delivery.md), and
[delivery guide](../consumers/delivery.md),
[readiness guide](../consumers/readiness.md), and
[runtime version guide](../consumers/runtime-version.md) for task-oriented use.
Go declarations and GoDoc remain the owners of exact exported contracts.
@@ -49,6 +51,7 @@ reports these implemented packages:
| `internal/tempdir` | Disposable system temporary storage outside source worktrees. |
| `internal/process` | Cancellable child-process execution, including owned stdin/stdout pipes for serialized exchanges, with per-command environment overlays and removals. |
| `internal/preparation` | Coordination for expected-commit tag checkout and Go module dependency preparation. |
| `internal/readiness` | Working-input inspection and read-only setup observations for explicitly selected capabilities. |
| `internal/releaseidentity` | Committed-object and working-tree module selection, declaration reading, and semantic-version-to-tag derivation. |
| `internal/validation` | Shared Go validation with optional race, full-vet, and static package-compilation target selections, formatting, workspace-file and filesystem-replacement checks, per-blob size limits, and selected Markdown destination and fragment checking; `internal/candidate` retains capture, callback sequencing, and local-state rechecks. |
| `internal/publish` | Publication guards, one validation run, annotated tag creation, push, pre-push evidence recording, saved-attempt discovery, later observation, and recovery state. |

View File

@@ -305,6 +305,13 @@ legacy migration errors, retained CI variable names, and secret-safe diagnostics
## Stage 7: Implement readiness validation and its CLI
**Completed:** The facade and `validate` command inspect working selections,
optional inputs, Go/build setup, credential contexts, retained artifacts, and
read-only publication/delivery access. Reports aggregate failures and identify
offline or unexecuted evidence. Focused CLI and facade tests, the offline
`go test ./...` suite, and `go run ./internal/apicheck` pass. Rehearsal profile
loading and Woodpecker observation are connected in the following stages.
**Work:** add internal readiness orchestration, a root `Validate` operation,
facade-owned request/report types, and `releasekit validate`.