From ee72566263350e17e7468608ce2881f6923ffed7 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Tue, 3 Nov 2026 00:23:06 +0000 Subject: [PATCH] Verify vendored recovery after launcher cleanup --- cmd/releasekit/publication_handoff_test.go | 23 +++++++--- docs/roadmap/implementation.md | 9 ++++ docs/roadmap/remediation.md | 51 ++++++++++++---------- 3 files changed, 54 insertions(+), 29 deletions(-) diff --git a/cmd/releasekit/publication_handoff_test.go b/cmd/releasekit/publication_handoff_test.go index 3cfeaba..67e5161 100644 --- a/cmd/releasekit/publication_handoff_test.go +++ b/cmd/releasekit/publication_handoff_test.go @@ -52,18 +52,29 @@ func TestVendoredAPIOnlyPublicationRecovery(t *testing.T) { if err := os.WriteFile(filepath.Join(remote, "hooks", "pre-receive"), []byte("#!/bin/sh\nexit 1\n"), 0700); err != nil { t.Fatal(err) } - var out, diagnostics bytes.Buffer - if status := run(t.Context(), []string{"publish", "--repo", repo, "v1.2.3"}, &out, &diagnostics); status != 1 { - t.Fatalf("publication status=%d: %s", status, &diagnostics) + launcherStore := t.TempDir() + launcherArgs, err := gotool.RecoveryTool(t.Context(), repo, launcherStore) + if err != nil { + t.Fatal(err) } - command := outputLineValue(diagnostics.String(), "recovery command: ") + launcher := exec.Command(goBinary, append(launcherArgs, "publish", "--repo", repo, "v1.2.3")...) + launcher.Dir = t.TempDir() + publicationOutput, err := launcher.CombinedOutput() + var exitError *exec.ExitError + if !errors.As(err, &exitError) || exitError.ExitCode() != 1 { + t.Fatalf("vendored publication: %v: %s", err, publicationOutput) + } + // The later handoff owns different launch metadata from the original driver. + if err := os.RemoveAll(launcherStore); err != nil { + t.Fatal(err) + } + command := outputLineValue(string(publicationOutput), "recovery command: ") if command == "" { - t.Fatalf("no handoff: %s", &diagnostics) + t.Fatalf("no handoff: %s", publicationOutput) } recovery := exec.Command("sh", "-c", command) recovery.Dir = t.TempDir() recovered, err := recovery.CombinedOutput() - var exitError *exec.ExitError if !errors.As(err, &exitError) || exitError.ExitCode() != 1 || !strings.Contains(string(recovered), "module=example.com/cli-candidate tag=v1.2.3 state=not_published") { t.Fatalf("vendored recovery: %v: %s", err, recovered) } diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index 2e88938..59c603d 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -583,3 +583,12 @@ recovery workflow satisfy this plan and the feature roadmap. The final report should identify implemented interfaces, validation results, and any remaining limitations. Subsequent architecture review and release/testing decisions take place after this complete initial implementation. + +**Follow-up verification completed:** R14–R17 corrections and their assigned +regression coverage are complete. The vendored API-only workflow runs through +a private Go-tool launcher, removes the original launcher metadata, and then +executes its printed recovery command. Native and cold Go-tool cancellation, +fallback, setup-error classifications, and byte-field format validation are +covered. The full offline suite and compiled facade/dependency checks passed +with Go 1.26.8; prose whitespace, local links, and fragment destinations were +checked. See [remediation completion records](remediation.md). diff --git a/docs/roadmap/remediation.md b/docs/roadmap/remediation.md index 128df82..888327b 100644 --- a/docs/roadmap/remediation.md +++ b/docs/roadmap/remediation.md @@ -1,8 +1,9 @@ # Publication reconciliation remediation -Status: all corrections are implemented and individually verified; final -assembled verification is pending. R01–R13 retain their completion evidence. -R14–R17 describe the subsequent stage-by-stage review of `363f7cd` and its fixes. +Status: complete. R01–R17 are implemented and verified. The full offline suite +and compiled facade/dependency checks passed with Go 1.26.8 after the follow-up +corrections. R01–R13 retain their original completion evidence; R14–R17 describe +the subsequent stage-by-stage review of `363f7cd` and its fixes. R01–R13 describe commits `4dff808` through `599ad81`, against planning baseline `447b42a`. Their audit evidence and defect descriptions refer to that reviewed @@ -16,7 +17,8 @@ implementation. The broad package structure is in place: the root facade owns public evidence and recovery types, `internal/publish` owns observation, recording, and discovery, `internal/git` owns scoped endpoints and ref queries, and the CLI owns command parsing, presentation, and exit classification. -The findings below identify remaining correctness, boundary, and contract gaps. +Each finding records its reviewed defect, implemented correction, and +verification. ## Review evidence @@ -607,7 +609,10 @@ correctness for these additional combinations. **Completed:** API-only recovery uses a private module root with preserved module settings and relocated local replacements. Vendored API-only, relative/versioned replacement, cold Go-tool, native handoff, and source-module entry-point tests -passed. Stage 7/8 instructions and consumer/internal guidance are updated. +passed. The assembled vendored case also runs publication through a private +Go-tool launcher, removes its metadata, and executes the later handoff from +another directory. Stage 7/8 instructions and consumer/internal guidance are +updated. **Relevant code:** `internal/gotool/recovery.go:95–107`; the command assembly in `cmd/releasekit/main.go:126–145`. Affects Stage 7 and its Stage 8 coverage. @@ -773,25 +778,25 @@ tests rather than duplicating their fixtures. ## Implementation plan and verification follow-through -When implementing R14–R17, update [implementation.md](implementation.md) alongside -the corresponding changes: +**Completed:** [implementation.md](implementation.md) records the R14–R17 +corrections alongside their implementation: -- Stage 1: record the cause-based endpoint setup classification from R16. -- Stage 2: describe ordinary version-1 records and version-2 byte-preserving +- Stage 1 records the cause-based endpoint setup classification from R16. +- Stage 2 describes ordinary version-1 records and version-2 byte-preserving records, including the structural validation from R17. -- Stage 6: align typed failures, human guidance, and structured diagnostics with - R16; retain the implemented JSON output-failure handling from R06. -- Stage 7: replace the original executable-only handoff instructions with R07's +- Stage 6 aligns typed failures, human guidance, and structured diagnostics with + R16 and retains the implemented JSON output-failure handling from R06. +- Stage 7 replaces the original executable-only handoff instructions with R07's module-selected/durable API-only approach, extended for vendoring and - cancellation by R14 and R15. Retain a usable native fallback and explicit - record selection. -- Stage 8: add the regression coverage assigned above, update affected canonical - documentation as behavior lands, and run the offline suite and compiled - facade/dependency checks after assembly. Review local links and prose changes. + cancellation by R14 and R15, including native fallback and explicit record + selection. +- Stage 8 includes the regression coverage assigned above and updated canonical + documentation. Final assembly passed `go test ./...`, + `go run ./internal/apicheck`, and `git diff --check`; local links and fragment + destinations were checked. Validation used Go 1.26.8 with offline dependencies. -Preserve earlier completion evidence and distinguish these follow-up corrections -from the original completed implementation. Add completion markers as the new -issues are addressed. The corrections retain the existing public facade, -publication completion point, separate recording failures, and operator-owned -recovery choices; they introduce no consumer pilot, intermediate release, or -external review gate. +Earlier completion evidence and the distinction between original and follow-up +corrections are retained. Each issue has a completion marker. The corrections +retain the existing public facade, publication completion point, separate +recording failures, and operator-owned recovery choices; they introduce no +consumer pilot, intermediate release, or external review gate.