21 KiB
ReleaseKit Adoption Implementation Plan
Implement the agreed adoption roadmap in the stages below, in order. Each stage is scoped for one Luna coding-agent prompt. This document owns the implementation steps; the roadmap owns purpose and selected policy.
Baseline And Working Rules
- Planning baseline: PromptKit commit
41b2021d8cd90b8dc15483f63fb1979642acad3a. ReleaseKit is not yet a dependency; publication and validation live inscripts/release.shandscripts/release-check.sh. - Select released ReleaseKit
v0.2.0, whose commit ise030794969fb7787e647a90bbc4eb81bd0610f07. Use its profile, CLI, and candidate validation contracts. No upstream changes or sibling-checkout dependency are needed. - Start with development, then read the agent policy and applicable architecture, testing, documentation, release, and OSS policies. Reuse already-read, unchanged policies and preserve unrelated work.
- Inspect current files before each stage. Validate and commit each completed unit under the agent policy. Follow later explicit user instructions about commits if they differ.
- All Git publication during implementation verification targets disposable local remotes. Implementing this plan does not authorize publishing to PromptKit's actual origin, creating a real release tag, or modifying ReleaseKit.
- Keep PromptKit's runtime API and business logic unchanged. The approved Go requirement update and tool dependency are module changes, not runtime ReleaseKit integration.
- Retain source-only publication, the main-before-tag workflow, and completion at confirmed tag publication. Hosted pages and CI deployment are outside this adoption. Retire the credential regex without adding a replacement gate.
- Use the latest Go installation available in the development environment.
Activate it as
go, setGOTOOLCHAIN=local, and use it for tool builds, candidate tests, and examples. At planning time the active local version isgo1.26.8; derive the version during implementation instead of freezing it in scripts. Do not querygo@latestor download another toolchain to find it. - Keep dependency preparation separate from offline validation. Reuse successful checks for unchanged content; do not add parallel validators, a persistent validation cache, or additional human release sign-offs.
Stage 1 — Declare The Released Tool And Advance The Go Requirement
Outcome: Module metadata selects ReleaseKit as a maintainer tool and records the development environment's current Go requirement.
Read: go.mod, go.sum, the runbook's
preparation step, and the OSS policy.
Changes:
- From the repository root, use the active latest local Go installation:
export GOTOOLCHAIN=local; capturego env GOVERSION. - Advance the requirement with
go get "go@${release_go_version#go}", whererelease_go_versioncontains that captured value. This is preparation before the resulting candidate commit, not an operation performed inside publication. - Add the tool with
go get -tool gitea.maximumdirect.net/eric/ReleaseKit/cmd/releasekit@v0.2.0. Use a Gotooldeclaration, not an artificial runtime import or atools.goworkaround. - Prepare dependencies with
GOTOOLCHAIN=local go mod download. Review the module and checksum changes; retain necessary tool/transitive dependencies without opportunistic unrelated upgrades. - Apply the OSS policy according to actual use. This is tool-only use, with no copied ReleaseKit implementation or documentation; that alone requires no new attribution entry. If a necessary existing dependency selection changes, maintain its applicable existing notices in this unit.
- Preserve repository independence: no committed workspace or local filesystem replacement. Do not select a PromptKit release version or write a prospective versioned release note in this stage.
Verification:
GOTOOLCHAIN=local go list -m gitea.maximumdirect.net/eric/ReleaseKitidentifiesv0.2.0; module metadata declares the intended tool.- Run
GOTOOLCHAIN=local go test -mod=readonly ./...for the Go/module change. - Inspect
go list -deps .to confirm the runtime facade has no ReleaseKit import dependency. Review the diff and commit the unit.
Stage 2 — Extract The Consumer Check And Declare Shared Validation
Outcome: One focused example checker and one profile express the selected validation without changing the publication entry point yet.
Read: The example-assertion block in scripts/release-check.sh, the three
maintained examples, the testing policy, and ReleaseKit's profile reference.
Changes:
-
Create
scripts/check-examples.py, runnable aspython3 scripts/check-examples.py. Use Python's standard library, derive the repository root from the script location, and run from that root. -
Move the existing semantic assertions into that checker. Preserve all current expectations: preparation ID/profile/model/message count; execution output, validity, validation status, model and token count; observation attempt/retry counts, usage completeness, and accepted assessment outcome.
-
Execute each example once, parse its JSON, propagate compilation/process and assertion failures as nonzero results, and provide useful failure context. Keep the checker narrow; it does not run tests, vet, formatting, links, module inspection, or publication.
-
Use the selected local Go installation for example execution. Set native host
GOOS/GOARCHfrom that installation'sgo env GOHOSTOS GOHOSTARCHfor the example children so ambient cross-build settings do not select an unexecutable target. Keep normal native cgo/cache settings. -
Create root
releasekit.jsonwith these exact selections:Profile field Value product"Promptkit"remote"origin"validation.go.racetruevalidation.go.full_vettruevalidation.go_formattruevalidation.markdown{}validation.module_distribution.workspace_filestruevalidation.module_distribution.local_replacementstrueSet
checksto one command whose argument vector is["python3", "./scripts/check-examples.py"]. Its environment map selectsGOTOOLCHAIN=local,GOWORK=off,GOFLAGS=-mod=readonly,GOPROXY=off,GONOPROXY=none, andGOSUMDB=off. These settings apply to the additional check; ReleaseKit owns its own shared Go environment. -
Omit
build,delivery,expected_push_url, package-compilation targets, file-size selection, and Markdown boundary enforcement. Accept the upstream default out-of-scope handling for outside-checkout Markdown destinations. -
Add a concise standalone example-check command to the development guide. Keep the existing publication/checker documentation until the cutover.
Verification:
- Run the new example checker using the offline environment above.
- Check profile JSON syntax and the selected fields against the released reference. Detailed API/profile equivalence tests belong upstream.
- Review the extracted assertions against the old block, then commit.
Stage 3 — Add The Native Tool Bootstrap
Outcome: A small shared invocation script builds and runs the module-selected native executable. Legacy source publication remains active until Stage 6.
Read: .gitignore, the new module declaration and profile, and the
upstream CLI contract.
Changes:
- Create executable POSIX-shell
scripts/releasekit.sh. Its role is: enter its repository root, build the declared tool, and invoke the native executable with the supplied CLI arguments. - Use
set -eu,GOTOOLCHAIN=local,GOWORK=off, andGOFLAGS=-mod=readonly. Buildgitea.maximumdirect.net/eric/ReleaseKit/cmd/releasekitwithgo build -mod=readonlyinto.releasekit/bin/releasekit. Select the native hostGOOS/GOARCHfor that build using the active Go installation's host values. - Rebuild through Go's normal build cache on each invocation. This ensures the executable uses the active Go compiler and module selection, without a custom cache/version-validation protocol.
- Use
execto invoke the built executable and forward"$@"unchanged. Delegate command/version parsing, candidate guards, and exit classifications to ReleaseKit. Do not usego runfor publication. - Ignore the root
.releasekit/directory. Do not commit the built tool or describe it as a PromptKit binary deliverable. - Bootstrap may use ordinary module access if preparation has not populated caches, while readonly mode preserves module files. Candidate validation and examples remain offline. Bootstrap does not edit the Go requirement, fetch Git refs itself, create tags, or add publication guards.
- Add an optional diagnostic
./scripts/releasekit.sh check VERSIONinvocation to the current runbook, linked to upstream requirements for a committed candidate. Make clear it is not required before publication.
Verification:
- Run
sh -n scripts/releasekit.sh. - Run
./scripts/releasekit.sh version; inspect the executable withgo version -mto confirm its recorded Go build version matches the selected installation and its module selection is the released ReleaseKit. - Check that bootstrap leaves
go.mod/go.sumunchanged and the tool output ignored. No real publication is performed. Commit.
Stage 4 — Add A Small Successful Publication Fixture
Outcome: A standalone offline integration check protects local bootstrap, profile wiring, and successful source publication.
Read: The production profile/bootstrap, the testing policy, and the upstream source-publication contract.
Changes:
- Create
scripts/test-release.py, invoked explicitly with Python 3 during tooling development. Keep it outside the default Go suite and outside the profile's release checks. It is not a new per-release gate. - Use standard-library temporary directories and subprocesses with real Git
and the released tool. Use a synthetic working repository on
mainand a local bareorigin; all identities and release versions are fixture data. - Copy the production bootstrap, profile, and relevant ignore rule into the
fixture. Copy the selected
go.mod/go.sumso tool selection follows production metadata without a local replacement. - Add a tiny formatted Go package and test. The test writes an invocation
marker outside the checkout and records
runtime.Version(). Use small race/non-race build-tag files so the test can prove the selected suite was race-enabled. This fixture never imports or retests PromptKit's full library. - At the configured example-check path, install a fixture-only Python stand-in that writes an external invocation marker. Keep the real profile command and validation selections unchanged. Stage 2 verifies the real examples; this fixture verifies additional-check wiring.
- Add a simple version-matched release note, commit the fixture, and push its
mainto the local bare remote. Run the copied bootstrap'spublishcommand from outside the fixture's repository root to exercise path handling. - Keep the test invocation offline with prepared module caches,
GOTOOLCHAIN=local,GOPROXY=off,GONOPROXY=none, andGOSUMDB=off. Format generated Go files before committing them. - Assert native status 0, exactly one suite marker and one additional-check marker, and equal selected/tool-build/test Go versions. Verify that the local and remote tag are annotated and identify the fixture candidate, with the committed note as annotation. Confirm module bytes are unchanged and the fixture remains clean apart from ignored tool output.
Verification:
- Run
python3 scripts/test-release.pyafter dependency preparation. - Inspect that fixtures and markers use only temporary paths/local remotes.
- Do not add upstream's full tag/recovery/checker matrix or test framework. Commit the focused success-path test.
Stage 5 — Cover Local Failure Propagation
Outcome: The same fixture demonstrates that failed product validation cannot publish a tag and that native argument failures remain classified.
Read: Stage 4's fixture and ReleaseKit's CLI exit classifications.
Changes:
- Extend the fixture stand-in to select failure through a test-owned environment value. In a fresh candidate/version, let shared validation pass and then fail that additional check.
- Assert nonzero native publication status 1, one suite and one additional-check invocation, useful failure context, and no selected tag locally or remotely. Keep the fixture clean and module metadata unchanged.
- Add one malformed/unsupported invocation case that exercises native status 2. Check the classification and a useful diagnostic fragment, not a complete output snapshot.
- Reuse the small fixture setup and production profile. Do not simulate CI, live push errors, uncertain-write reconciliation, hosted delivery, or malicious concurrent mutation; those are upstream responsibilities.
- Preserve cleanup of the temporary repositories and external markers. Failures must not modify the actual PromptKit checkout or its remote.
Verification:
- Run the completed standalone integration check.
- Review coverage for the three risks: successful wiring, failed additional validation, and native usage classification. Commit.
Stage 6 — Cut Over Publication And Its Canonical Documentation
Outcome: One publication command uses ReleaseKit; obsolete local validators and their documented gates are retired in the same unit.
Read: scripts/release.sh, scripts/release-check.sh, the released CLI
and recovery guidance, and the affected canonical documentation.
Changes:
- Replace
scripts/release.shwith a thin executable wrapper that delegates toscripts/releasekit.sh publish, forwarding supplied arguments throughexec. Keep the familiar./scripts/release.sh VERSIONentry point. Add no duplicate argument, branch, remote, note, tag, or status machinery. - Delete
scripts/release-check.sh. The shared suite, vet, formatting, Markdown parser, and module checks now belong to ReleaseKit. The example assertions already have their focused owner. - Remove the credential-pattern gate, clean-candidate diff-whitespace gates,
ambient-workspace rejection, blanket vendor-path check, blanket replacement
prohibition, mandatory four-heading note validator, and extra annotation
commit line. Retain ordinary credential-aware change review and useful
development
git diff --checkcommands. - Update
scripts/test-release.pyto copy and invoke the actualscripts/release.shentry point for publication cases. The generic native invocation can continue to own the CLI classification case. - Update
docs/policy/release.mdlocally where needed: shared selections, source-only deliverables, main-before-tag publication, the simpler note convention, native recovery states, and retired gates. Preserve SemVer/compatibility rules, immutable records, catalog exceptions, the Go-update/same-toolchain requirement, and successful-tag-push completion. Preserve upstream provenance/base-policy metadata; update the local date. - Update
docs/policy/testing.mdto describe selected race/full vet and consumer workflows, with shared machinery upstream. Document the standalone wiring check as focused development validation, not a recurring release requirement or part of default Go tests. - Rewrite the relevant
docs/release.mdsections around: activate the latest available local Go; update its requirement before the candidate commit; prepare module caches; author the note/footer; retire completed roadmaps; ordinary review/commit; pushmain; run the single publication command. Preparation commands may update module metadata before commit; bootstrap/validation preserve the final candidate. - Document native statuses 0/1/2/3 and the upstream captured-endpoint recovery model. Link to upstream detail and include a concise usable recovery command. Never resolve uncertainty by deleting a tag before confirming authoritative absence. No CI wait, successful-push read-back, or installation check is added.
- Update
docs/development.md: remove the old checker command/inventory and scanner reference; retain proportionate tests, formatting, examples and ordinary review for dirty development work. Identify the optional committed candidate diagnostic and the separate tooling integration command. - Repair links to the removed checker. Keep existing historical release notes, licenses, runtime inventory, and public API documentation unchanged unless a concrete affected reference requires correction. No prospective release note, hosted workflow, or new consumer restriction is part of this unit.
Verification:
- Run
sh -non the two wrappers and the completed integration check using the final publication entry point. - Review the diff for policy/procedure agreement and removal of the listed duplicate gates. Check links and whitespace without running a second complete package suite solely for these documentation edits. Commit the cutover.
Stage 7 — Verify The Actual Profile Against The Complete Source Snapshot
Outcome: The assembled adoption is verified without publishing a real PromptKit release.
Read: The final roadmap, profile, wrappers, runbook, and this plan's completion criteria.
Work:
- Confirm prior stages are committed and the working checkout is clean. Use the same active local Go installation and prepared module cache.
- Make a disposable local clone of the final committed PromptKit source,
checkout
main, and add/commit only a synthetic unused version's release note there. The note follows the adopted product/version convention and footer paths. Do not add that note to the actual checkout. - Run the clone's
scripts/releasekit.sh check VERSIONwith the real profile and actual example checker. This is the one complete final smoke check: the real race-enabled suite, full vet, formatting, Markdown, committed distribution checks, and three examples. Do not also run the old full checker or another full test/vet/example sequence for that same snapshot. - Confirm module files remain unchanged, actual example checks succeed,
shared Markdown/format checks inspect the final source, and the clone remains
clean. This local
checkcreates no tag and needs no remote publication. - If supported upstream checks expose affected formatting or documentation defects, correct those specific issues and commit the changed candidate before repeating the snapshot check. Do not disable the selected validation to make the smoke check pass.
- Audit completion against the roadmap: module tool selection, native/same-Go bootstrap, all six optional validation selections, one local example check, retired validators/gates, accurate runbooks/policies, and successful fixture publication/failure protection. Reuse Stage 6's unchanged integration results.
- Report the implementation commits, checks, and any remaining issues. Update temporary roadmap/plan status to reflect implemented work awaiting review; keep the documents available for the user's review. Release preparation and completed-roadmap retirement remain later maintainer work.
Completion criteria:
- The final source-only publication command delegates to released ReleaseKit; the committed profile is the single local declaration of selected checks.
- Go metadata records the preparation-time requirement; tool build, native validation and examples use the same selected local Go installation.
- Profile-selected shared validation and the real consumer examples pass on the complete source snapshot, while fixture failures prevent publication.
- No runtime ReleaseKit import, local module replacement, extra release gate, hosted workflow, provider call, real origin push, or real release tag has been introduced.
- Canonical docs agree with implemented tooling and preserve the accepted compatibility, catalog, licensing-footer and release-completion policies.
No significant product decisions remain open. Implementation choices above settle the filenames, bootstrap, profile, validation boundaries, and test strategy needed to carry out the agreed scope.