From f53354be5fefbd6e59421c6777fe1eb4b7135392 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Wed, 7 Oct 2026 18:41:29 +0000 Subject: [PATCH] Complete shared validation foundation --- check.go | 20 ++++++++++++-------- docs/roadmap/implementation.md | 8 +++++++- docs/roadmap/model.md | 20 +++++++++++++------- publish.go | 14 +++++++------- 4 files changed, 39 insertions(+), 23 deletions(-) diff --git a/check.go b/check.go index dfa3b86..0518b73 100644 --- a/check.go +++ b/check.go @@ -42,14 +42,7 @@ type ReleaseRequest struct { // branch, HEAD, worktree, index, and local tag state. Success establishes local // candidate evidence only; it does not establish remote availability. func Check(ctx context.Context, request ReleaseRequest) (Candidate, error) { - checked, err := candidate.Check(ctx, candidate.Request{ - RepositoryDir: request.RepositoryDir, - Product: request.Product, - Version: request.Version, - AdditionalChecks: candidateChecks(request.AdditionalChecks), - AfterValidate: internalbuild.CandidateCallback(internalBuildSpec(request.Build), request.Output), - Output: request.Output, - }) + checked, err := candidate.Check(ctx, candidateRequest(request)) if err != nil { return Candidate{}, convertValidationError(err) } @@ -60,6 +53,17 @@ func Check(ctx context.Context, request ReleaseRequest) (Candidate, error) { }, nil } +func candidateRequest(request ReleaseRequest) candidate.Request { + return candidate.Request{ + RepositoryDir: request.RepositoryDir, + Product: request.Product, + Version: request.Version, + AdditionalChecks: candidateChecks(request.AdditionalChecks), + AfterValidate: internalbuild.CandidateCallback(internalBuildSpec(request.Build), request.Output), + Output: request.Output, + } +} + func candidateChecks(checks func(context.Context, Candidate) error) func(context.Context, candidate.Candidate) error { if checks == nil { return nil diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index 20ecf5c..0b5828c 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -1,6 +1,7 @@ # Validation model implementation plan -Status: In progress; shared execution, candidate inspection, facade diagnostics, and CLI mapping are complete. +Status: Foundation complete; individual v0.2.0 validation capabilities and +their settings remain future work. This plan implements the enabling work in [model.md](model.md), guided by [ADR 0003](../adr/0003-declarative-validation.md). It is written for a Luna @@ -545,6 +546,11 @@ outside this implementation plan. ## Stage 8: Verify and document the completed foundation +**Completion:** Complete. `Check` and `Publish` now use one shared conversion +from the facade request into candidate validation. The full Go suite and public +API/dependency check pass, and the roadmap distinguishes the completed +foundation from the optional capabilities still to come. + **Outcome:** The enabling refactor is complete, its current boundary is clear, and later feature implementation can proceed through the shared model. diff --git a/docs/roadmap/model.md b/docs/roadmap/model.md index 28c4efb..645af51 100644 --- a/docs/roadmap/model.md +++ b/docs/roadmap/model.md @@ -1,7 +1,7 @@ # Validation API and profile model -Status: Agreed direction for v0.2.0; the staged plan records the API design -and agreed incremental rollout. +Status: Shared validation foundation implemented; optional v0.2.0 capabilities +and their public/profile settings remain future work. This roadmap describes the shared model that enables the optional validation capabilities in the [v0.2.0 roadmap](v0.2.0.md). It owns their common API, @@ -124,11 +124,17 @@ failure-stopping behavior of the candidate workflow. ## Implementation -The [implementation plan](implementation.md) defines the enabling sequence, -proposed declarations and diagnostics, inspection primitives, verification, -and documentation work. Individual capabilities supply their behavioral -coverage as they are implemented. The target state above describes the complete -model across those capabilities. +The [implementation plan](implementation.md) records the completed foundation: +shared execution, internal diagnostics, captured candidate-tree inspection and +destination resolution, facade diagnostics, and consistent CLI presentation. +The public `ReleaseRequest.Validation` field and profile `validation` object are +not yet available; each setting will be introduced with its first working +capability. Individual checkers, module-selected CI tooling, and the publication +endpoint expectation remain future work in the [v0.2.0 roadmap](v0.2.0.md). + +The target state above describes the complete model across those capabilities. +Foundation completion establishes their shared owners and conversion boundaries, +but does not mean the optional checks are implemented or that v0.2.0 is complete. ## Adoption evidence diff --git a/publish.go b/publish.go index 7976ba8..a7c9bfa 100644 --- a/publish.go +++ b/publish.go @@ -3,7 +3,6 @@ package releasekit import ( "context" - internalbuild "gitea.maximumdirect.net/eric/ReleaseKit/internal/build" "gitea.maximumdirect.net/eric/ReleaseKit/internal/publish" ) @@ -60,14 +59,15 @@ type PublicationResult struct { // an unreadable result is unknown. A nil error means publication is confirmed // by the successful push or exact remote object match. func Publish(ctx context.Context, request ReleaseRequest) (PublicationResult, error) { + candidateInput := candidateRequest(request) result, err := publish.Publish(ctx, publish.Request{ - RepositoryDir: request.RepositoryDir, - Product: request.Product, - Version: request.Version, + RepositoryDir: candidateInput.RepositoryDir, + Product: candidateInput.Product, + Version: candidateInput.Version, Remote: request.Remote, - AdditionalChecks: candidateChecks(request.AdditionalChecks), - AfterValidate: internalbuild.CandidateCallback(internalBuildSpec(request.Build), request.Output), - Output: request.Output, + AdditionalChecks: candidateInput.AdditionalChecks, + AfterValidate: candidateInput.AfterValidate, + Output: candidateInput.Output, }) return PublicationResult{ Version: result.Version,