From 7e6cbd9d7a4c5e08eee348f261b5016e52facd44 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Mon, 23 Nov 2026 18:11:36 +0000 Subject: [PATCH] Plan the native ReleaseKit implementation --- docs/roadmap/implementation.md | 315 +++++++++++++++++++++++++++++++++ 1 file changed, 315 insertions(+) create mode 100644 docs/roadmap/implementation.md diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md new file mode 100644 index 00000000..805bfa51 --- /dev/null +++ b/docs/roadmap/implementation.md @@ -0,0 +1,315 @@ +# ReleaseKit Implementation Plan + +## Objective And Execution Rules + +Implement [Native ReleaseKit Adoption](releasekit.md). That roadmap owns the +approved scope: ReleaseKit v0.10.0, annotated source tags, hosted release notes, +and native Linux/amd64 binary/checksum delivery. This document owns the ordered +implementation steps. Each numbered stage is one Luna coding-agent prompt. + +Execute all seven stages in order as one sprint. Intermediate stages may leave +temporarily broken references or commands; do not add compatibility wrappers or +duplicate machinery merely to make every intermediate commit independently +usable. The final state must satisfy the whole roadmap. + +Start with `docs/development.md` and `docs/policy/agents.md`. Apply the architecture, +testing, documentation, OSS, and release policies to their respective changes. +The existing release policy's lightweight-tag/source-only clauses are deliberately +replaced in Stage 5; preserve unrelated compatibility and versioning choices. +Follow the agent policy for committing completed units, without empty commits. + +Throughout the sprint: + +- Use `go.maximumdirect.net/releasekit` v0.10.0, reviewed commit + `82bac1a3ab935beddd4b8789d1e07f52135d4243`. Inspect that selected source rather + than silently adopting later `main` changes. Use the version-pinned upstream + links in the feature roadmap for canonical behavior. +- Keep the Go consumer minimum and selected release toolchain at Go 1.27.0. + ReleaseKit's own Go 1.27.4 maintainer choice does not change this decision. +- Do not read, print, copy, validate remotely, or commit the real + `.releasekit/gitea-token`. Its directory and ignore rule are already prepared. + Preserve the file and its permissions. Use synthetic credentials only if a + local integration test needs them. +- Do not publish to `origin`, push branches/tags, create hosted releases, upload + assets, or run production inference. Actual release publication is a later, + separately authorized task. +- Do not change pipelines, artifact contracts, model settings, cache behavior, + or runtime application configuration. Do not add extra release gates, targets, + signing, custom packaging, or application-owned release orchestration. + +## Stage 1: Register ReleaseKit And Adopt Native Runtime Identity + +**Goal:** Select the upstream tool and replace Notarius's runtime version logic. + +Inspect `go.mod`, `go.sum`, `internal/buildinfo/`, `internal/cli/run.go`, +`internal/cli/command_contract_test.go`, and the selected upstream adoption and +runtime-version guides. Use graph discovery to locate other buildinfo callers. + +1. Register the tool with + `go get -tool go.maximumdirect.net/releasekit/cmd/releasekit@v0.10.0` using + the selected Go toolchain and the repository's ordinary private-module access. +2. Import `go.maximumdirect.net/releasekit/buildinfo` in CLI composition and pass + `buildinfo.Version()` directly to `NewApplication`. Remove the obsolete error + path for Notarius's stable-version parser. Preserve other composition failures. +3. Remove `internal/buildinfo` and its tests after replacing all imports. Do not + retain the old linker variable, stable-version restriction, or a wrapper + translating native `dev` back to `development`. +4. Rewrite the affected CLI version test without mutable buildinfo globals. + Exercise normal CLI wiring against the native accessor; use the existing + `NewApplication` version argument to test an explicitly supplied release + identity through CommandKit. Delete the old invalid-linker-identity case, + which tests behavior intentionally removed by this migration. +5. Run `go mod tidy` with `GOWORK=off`. Review shared module selection and sums. + Keep the tool directive and do not add local replacements or import the + release facade into runtime orchestration. + +**Acceptance:** The runtime uses the native accessor, no private buildinfo +package/import remains, and the registered tool is pinned to v0.10.0. No +application-owned release service was added. + +**Validation:** With `GOTOOLCHAIN=go1.27.0` and `GOWORK=off`, run focused CLI version +tests and `go run ./cmd/notarius version`. Run the tool's `version` command by +full package path with `GOOS`/`GOARCH` selected from `go env GOHOSTOS/GOHOSTARCH`. +Use offline/readonly module settings after dependency preparation. Full-suite +verification belongs to Stage 7. + +## Stage 2: Add The Native Profile And Thin Launcher + +**Goal:** Provide the complete native configuration and one small tool entry point. + +Inspect the selected upstream `docs/config.md`, adoption guide, build guide, +and delivery guide before writing the profile. Create root `releasekit.json` +with these exact selections: + +```json +{ + "product": "Notarius", + "remote": "origin", + "build": { + "main_package": "./cmd/notarius", + "binary_name": "notarius", + "targets": ["linux/amd64"] + }, + "delivery": { + "forge": "gitea", + "base_url": "https://forge.maximumdirect.net", + "owner": "eric", + "repository": "notarius", + "token_env": "RELEASEKIT_GITEA_TOKEN", + "token_file": ".releasekit/gitea-token" + } +} +``` + +Omit `module_dir`, extra `checks`, optional `validation` gates, and +`expected_push_url`. Native defaults and the chosen remote suffice; no exact-URL +restriction was selected. One profile supplies both candidate validation builds +and tagged-source delivery. It contains a token path, never a token value. + +Create executable `scripts/releasekit` as a small POSIX launcher: change to the +repository root relative to the launcher, select host OS/architecture using the +upstream adoption example, and `exec go tool +go.maximumdirect.net/releasekit/cmd/releasekit "$@"`. Preserve ordinary workspace, +toolchain, credential, and cache settings; native operations own their Go child +environments. Do not validate versions, parse profiles, push `main`, create tags, +aggregate exit statuses, or retry operations in this launcher. + +**Acceptance:** All eight native commands are available through direct forwarding; +the sole application build target is Linux/amd64. The existing ignored credential +file remains untouched. No custom release configuration loader exists. + +**Validation:** Run `sh -n scripts/releasekit`, launcher `version`, and a benign +invalid invocation to verify the native usage failure is forwarded. Confirm +`git check-ignore .releasekit/gitea-token` without displaying the file. Actual +native profile/build verification is consolidated in Stage 7. + +## Stage 3: Retire Duplicate Machinery And Maintain Notices + +**Goal:** Remove the replaced release implementation and account for adopted material. + +Delete `scripts/release.sh`, `scripts/check-release-source.sh`, and +`scripts/release_test.go`. Do not port their Git publication fixtures or guard +assertions into a new local suite; ReleaseKit owns those behaviors. Retain +consumer-specific version tests from Stage 1. + +Inspect ReleaseKit's selected `COPYRIGHT`, `LICENSE`, and attribution notices. +Update `docs/oss/attribution.md` for the runtime dependency and any copied launcher +material under the local OSS policy, using the reviewed commit. Add any missing +standard license text only when applicable; reuse existing texts. Distinguish +runtime-incorporated material from tool-only transitive dependencies rather than +automatically attributing the entire Go tool module graph. Include copied CI +material in that factual identification when Stage 4 lands. + +**Acceptance:** The old publication/check implementation and its duplicate suite +are gone; notices match the actual runtime and copied material. The only retained +release script is the thin native launcher. + +**Validation:** Search current code for the removed buildinfo import and linker +override. Review notice links against the selected source. Current-document and +CI references may remain temporarily until their owning stages below. + +## Stage 4: Replace Advisory Tag CI With Native Delivery + +**Goal:** Deliver the committed release note and Linux/amd64 assets through +ReleaseKit's maintained consumer bootstrap. + +Inspect `.woodpecker/release.yml` and the selected upstream +`examples/woodpecker/tag-delivery.yml` plus its delivery guide. Replace the +existing job in `.woodpecker/release.yml` using that consumer template, not +ReleaseKit's self-building source-only workflow. + +- Retain the upstream event-tag/peeled-commit verification, clean detached source + selection, temporary module-file bootstrap, host target selection, full tool + package invocation, and native `ci-deliver --prepared` handoff. +- Set the image selection to `golang:1.27.0`, matching Notarius's selected + toolchain. Keep the template's Woodpecker escaping and temporary-directory + lifecycle. Do not simplify away tagged-source tool-version selection. +- Map Woodpecker secret `releasekit_gitea_token` to `RELEASEKIT_GITEA_TOKEN` in + the delivery step. Preserve ordinary private-module access requirements; + deployment secret provisioning is a maintainer action, not a tracked token. +- Let the committed root profile select the sole build target and destination. + Do not add `check`, `publish`, `go test`, asset naming, hashing, or upload logic + to the delivery job. Source publication has already validated the candidate. +- Preserve native delivery status and failure handling. CI delivery failure does + not undo the source release, trigger a new source version by itself, or require + source publication to poll the job. + +**Acceptance:** Tag CI performs native binary/page delivery, not repeated candidate +validation. Bootstrap code differs from the selected upstream template only for +Notarius's selected toolchain and necessary consumer wiring. Update the copied +material's attribution from Stage 3 if needed. + +**Validation:** Parse YAML with an available local validator and compare the +bootstrap to the pinned template. Inspect secret mapping and native arguments. +Do not execute the job against the real remote or use the local API token. +Generic bootstrap/publication behavior remains upstream-owned; do not introduce +a large local shell-fixture suite to retest it. Report external CI secret/access +setup as pending operator setup when it cannot be verified locally. + +## Stage 5: Align Release Policy And Rewrite The Maintainer Runbook + +**Goal:** Make the canonical release contract and practical workflow agree. + +Read the release and documentation policies, then update `docs/policy/release.md` +and rewrite `docs/release.md`. Preserve the policy's upstream baseline metadata; +use the actual edit date for local maintenance and identify the relevant local +adaptation without claiming a new upstream policy adoption. + +Policy changes must cover annotated tags; `main` already published at the +candidate before native publication; a single native offline suite plus selected +Linux/amd64 build/native version verification; hosted page/binary/checksum +delivery; and separately reported source-publication and delivery outcomes. +Remove contradictory source-only, lightweight-tag, temporary-products-only, +no-hosted-page, and no-asynchronous-delivery claims throughout the policy, +including its footer, guard, recovery, and runbook requirements. + +Preserve stable-version selection, compatibility, immutability, proportionate +gates, no routine CI polling, and historical notes/tags. Extra native validation +features stay disabled. Vet or link checking used during this migration must +not become a new permanent publication gate. + +The runbook should be short and executable, containing: + +- Notarius's selected toolchain, Git/module access prerequisites, `main`/`origin`, + and separate dependency preparation before offline validation. +- Version/note preparation, actual immutable-tag license-footer URLs, committing + the candidate, and explicit `git push origin main` before native publication. +- `./scripts/releasekit publish VERSION` as the publication command. `check` + is optional diagnosis, not a required repeated validation step. +- Native tag CI delivery and the required Woodpecker secret name; local + `./scripts/releasekit deliver VERSION` as the alternative from matching clean + tagged source. Do not imply every release runs both delivery routes. +- The local token path, environment override, and upstream credential guidance; + never display a token. Explain that Git publication does not use this token. +- Separate publication and delivery results, native saved-record recovery links, + and native retained-output/receipt retry guidance when original asset bytes + must be retained. No blind overwrite, republishing source, or invented local + reconciliation machinery. + +Link the selected upstream CLI, configuration, publication/recovery, and delivery +guides for detailed behavior. Do not reproduce their manuals, record formats, +credential internals, or full exit-status tables. No new ADR or actual release +note/tag is needed for this sprint. + +**Acceptance:** A maintainer has one unambiguous native workflow and recovery +entry point, with separate source/delivery outcomes. Every release-policy clause +agrees with that workflow and the actual selected profile. + +**Validation:** Read policy and runbook together; check commands against the +selected native CLI contract and local launcher. Verify local links and intended +footer file paths without requiring future tag URLs to resolve remotely. + +## Stage 6: Refresh Installation And Contributor Guidance + +**Goal:** Document the delivered product without duplicating upstream features. + +Update README installation guidance for the Linux/amd64 binary and native +checksum assets while retaining source installation. Derive the filename from +ReleaseKit's selected build contract (`notarius--linux-amd64`); link the +actual Notarius hosted release location. Do not claim the new binaries already +exist for historical releases. A generic pinned-version example is sufficient; +do not invent a published version or add packaging support. + +Update `docs/cli.md` for the native `dev` fallback; keep CommandKit version/report +semantics unchanged. Update `docs/internal/overview.md` to remove the deleted +buildinfo package entry, and adjust `docs/internal/cli.md` and +`docs/development.md` where needed for version wiring and release navigation. +Only add a separate ReleaseKit integration document if there is substantive +Notarius-specific content that the runbook does not already own; normally the +runbook's pinned upstream links are sufficient. + +Reconcile the packaged-release backlog bullet in `docs/roadmap/future.md`: remove +the now-implemented Linux/amd64 native-distribution scope, preserving broader +packaging or target ideas only as deferred ideas, not promised deliverables. +Do not retire this active feature roadmap/plan or rewrite historical release +notes during the sprint. + +**Acceptance:** Current documentation describes the implemented native workflow +and chosen binary scope. There are no active links to deleted scripts/packages, +no contradictory source-only claim, and no copied upstream feature reference. + +**Validation:** Check local links and search active documentation for +`release.sh`, `check-release-source.sh`, `internal/buildinfo`, `development`, +`lightweight`, and `source-only`. Review matches in context; historical records +and baseline descriptions in roadmaps are not current-contract errors. + +## Stage 7: Verify The Assembled Migration + +**Goal:** Prove the final integration locally without publishing anything. + +1. Prepare dependencies if necessary, then use `GOWORK=off`, + `GOTOOLCHAIN=go1.27.0`, and offline module access (`GOPROXY=off`) for checks. + Run `go test -mod=readonly ./...` and `go vet -mod=readonly ./...`. + Existing default tests cover maintained application examples. +2. Run launcher `version` and ordinary `go run -mod=readonly ./cmd/notarius + version`. Confirm ReleaseKit v0.10.0 and native application version fallback + for an unversioned checkout. Confirm no configuration/credential requirement + was added to the application version command. +3. Create an external temporary output directory with `mktemp -d`. Run native + `./scripts/releasekit build --output ABSOLUTE_TEMP_DIR v0.0.0` as a synthetic + local build, not a publication attempt. It needs no new release note/tag or + unused version on the remote. Check the selected Linux/amd64 artifact and + native receipt; on Linux/amd64 run its `version` command and confirm + `notarius v0.0.0`. On another host rely on ReleaseKit's built-in temporary + native version check; do not attempt to execute the foreign artifact. +4. Review CI/profile mapping against the selected upstream template and confirm + exactly one build target. A live hosted-delivery test is not necessary. + If supplementary consumer tests are justified, use local disposable inputs + and fake external transport, never the real token or Notarius remote. +5. Check relevant links, attribution, obsolete imports/paths, and + `git diff --check`. Verify that no generated build files, credential contents, + temporary profiles, Go workspace files, or local replacements entered the + tracked change set. Confirm the credential path is ignored without reading it. +6. Review the feature roadmap requirement by requirement against actual code, + profile, CI, and documentation. Fix any gaps. Record checks run and any + externally unverified CI setup; do not claim a live delivery occurred. + +**Acceptance:** The complete roadmap is implemented, the native tool and real +version-injected CLI work, default tests and migration checks pass, current docs +agree, and no custom release machinery remains beyond the thin launcher and +consumer configuration. Only Linux/amd64 is selected for distribution. Report +any external CI secret/access setup required before the first actual delivery. + +Commit the final nonempty unit under the agent policy and report the completed +sprint. Do not push, publish, upload, or delete these planning documents without +separate user direction.