# Native ReleaseKit Adoption ## Purpose Adopt ReleaseKit's native release workflow and runtime version accessor, replacing Notarius-owned release machinery with a versioned tool, a small declarative profile, and concise project-specific documentation. ReleaseKit owns common validation, publication, build, and recovery mechanics. Notarius supplies product facts, compatibility decisions, and any justified product-specific checks. This is a feature roadmap, not an implementation sequence. It authorizes no release publication. The approved distribution scope is source tags, hosted release notes, and Linux/amd64 binaries, using native ReleaseKit delivery. ## Reviewed Baseline The reviewed upstream release is **ReleaseKit v0.10.0**, module `go.maximumdirect.net/releasekit`, at commit `82bac1a3ab935beddd4b8789d1e07f52135d4243`. The local checkout at `../ReleaseKit` matches that tag and upstream `main` at review time. Canonical references for this selected version: - [Adoption](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/adoption.md). - [Profile configuration](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/config.md). - [Candidate checking](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/check.md). - [Source publication and recovery](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/publish.md). - [Runtime version](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/runtime-version.md). - [Builds](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/build.md) and [delivery](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/delivery.md). Notarius currently has: - `scripts/release.sh`, which guards a committed candidate, invokes validation, pushes `main`, creates a lightweight tag, pushes that tag, and handles ambiguous publication results. - `scripts/check-release-source.sh`, which checks the release note, runs the default Go suite, builds `cmd/notarius` with a private linker override, and checks the executable's version output. - `scripts/release_test.go`, with custom Git fixtures and publication tests. These three files total 323 lines. - `internal/buildinfo`, with custom stable-version parsing, linker override, module-version fallback, and tests. `internal/cli.RunWithOptions` obtains this version before constructing the CommandKit application. - `.woodpecker/release.yml`, which repeats advisory validation on tag events. - [Release Policy](../policy/release.md) and [Source Releases](../release.md), defining source-only delivery, lightweight tags, and the custom commands. Both modules declare Go 1.27.0. Adoption does not require a Go-series increase. Notarius's selected release toolchain is currently Go 1.27.0; ReleaseKit's own maintainer toolchain is not automatically a Notarius requirement. ## Target End State ### Native tool and small profile Register `go.maximumdirect.net/releasekit/cmd/releasekit` at v0.10.0 as a Go tool dependency. Also import `go.maximumdirect.net/releasekit/buildinfo` for runtime identity. Both uses share the module-selected version. Use a root `releasekit.json` with product `Notarius`, the root Go module, and authoritative remote `origin`. Use native defaults where they express the selected behavior; omit unnecessary settings. Declare the selected build and delivery settings below. Do not add a separate Notarius configuration schema for releases. Invoke the tool by its full package path. If a convenience launcher is useful, keep it to the upstream host-target selection and direct argument forwarding, with repository-directory selection if needed. It must not reimplement release guards, validation orchestration, Git publication, or recovery. Do not add an application release subcommand or a custom Go release executable. Review `go.mod` and `go.sum` changes, including shared dependency version selection: Go tool dependencies participate in the application's module graph. Update applicable attribution for the runtime import and any copied material under the [OSS policy](../policy/oss.md), using the selected upstream source revision. ### Release deliverables and credential supply Publish an annotated source tag with its committed release note, then deliver a hosted Gitea release page and the native Linux/amd64 binary assets. Use the complete committed release note as the hosted body, including its license and attribution footer. ReleaseKit owns binary naming, version injection, hashing, its native checksum manifest, upload, and delivery reconciliation. Do not add custom packaging or upload scripts. The single native profile selects: - Build main package `./cmd/notarius`, binary name `notarius`, and exactly one target: `linux/amd64`. - Delivery forge `gitea`, base URL `https://forge.maximumdirect.net`, owner `eric`, and repository `notarius`. - Credential environment variable `RELEASEKIT_GITEA_TOKEN` and fallback token file `.releasekit/gitea-token`, relative to the repository root. Native precedence applies: a nonblank environment value takes precedence over the file. These credentials are for hosted delivery, not source-tag publication. The local `.releasekit/` directory is git-ignored. Put only the plain personal access token in `gitea-token`, without a variable assignment or JSON wrapper. Use owner-only access for this credential, following upstream token-file guidance. The token needs access to the Notarius repository and permission to create releases and upload release assets. Do not copy it into the profile, documentation, or tracked files. CI supplies its own secret through the native environment variable rather than depending on the maintainer's local file. This replaces the current source-only distribution decision. Retain source-build installation guidance and add the selected binary installation path. macOS, Linux/arm64, and Windows binaries, OS packages, containers, custom archives, and signing are not selected in this work set. Future targets may be considered when there is a concrete need; this selection is not a permanent prohibition. ### Native publication and recovery Adopt these intentional changes rather than preserving the old workflow through compatibility wrappers: - Prepare and commit the version-matched release note, then push the candidate to `origin/main` before invoking native `publish`. - Let ReleaseKit check the clean candidate and authoritative branch, validate it, create an **annotated** tag, and publish that exact tag object. - Use native publication evidence, attempt discovery, and explicit-record reconciliation for failed or ambiguous publication. Link upstream for record storage, diagnostic sensitivity, exit statuses, and recovery semantics. - Use native `check` only as an optional candidate diagnostic, not as a mandatory preliminary invocation that duplicates `publish` validation. Historical lightweight tags and published notes remain unchanged. Source publication completes at confirmed tag publication, independently of CI or hosted delivery. Delivering the release page and binary assets is required work with a separate reported outcome; a delivery failure leaves the source release intact and is recovered against the same immutable tag. Recovery must not become a routine successful-push read-back gate. No new manual approval, signing, consumer-installation, or provider-availability gate is part of this work. ### Proportionate native validation ReleaseKit owns the single offline default test suite and its native candidate checks. Remove the duplicated suite command from Notarius-owned release code. Prepare dependencies and the selected toolchain separately from offline validation, following upstream conventions. Retain the executable/version gate through the same native Linux/amd64 build selection used for delivery. Candidate validation uses temporary build output; delivery builds from the published tagged source. On a different host, ReleaseKit additionally builds a temporary native executable for its version check. This is a deliberate move from a strictly host-only build to the selected distribution target plus the native check, not a broader platform matrix. Do not retain custom linker flags or a shell build/version checker. Other native checks, including full vet, race testing, formatting, Markdown, module-distribution checks, forbidden paths, and file-size limits, are optional capabilities, not automatically new Notarius release requirements. Enable one only for a selected, concrete need; otherwise keep it disabled. Full native adoption means delegating mechanics, not enabling every available restriction. ### Native runtime identity Read `buildinfo.Version()` from ReleaseKit and pass its result to the existing CommandKit application. Remove Notarius's private override, version resolver, associated package, and tests of those replaced internals. Do not wrap the native accessor merely to retain stable-tag parsing or the old fallback spelling. Accept ReleaseKit's native fallback `dev` instead of `development`. Keep CommandKit's version command and report formats; this is an identity-source change, not a new application presentation layer. Update relevant CLI tests to exercise supported application behavior without mutable version globals. ### Minimal release automation Remove `.woodpecker/release.yml`'s redundant post-publication check. Native `check` requires a clean candidate on `main` with no existing release tag, so it is not a drop-in command for that detached/tagged job. Use the maintained ReleaseKit consumer tag-delivery workflow and native `ci-deliver`, adapted only for Notarius's actual profile and CI environment. Keep source publication and delivery outcomes separate. Document native local delivery as the alternative when CI delivery is unavailable; both routes use the same committed profile and tagged source. Use native retained build output and receipts when retrying delivery requires preserving previously produced bytes, rather than adding local artifact tracking. ## Required Repository Changes - Add the module-selected tool and runtime dependency in `go.mod`/`go.sum`, plus the small native `releasekit.json` profile. - Remove both custom release scripts and their publication-test fixture suite. Keep only any genuinely useful, thin native launcher. - Replace runtime version wiring and remove `internal/buildinfo`; adjust the affected CommandKit CLI tests. - Replace the redundant advisory release CI job with native hosted-page and Linux/amd64 asset delivery, including its separately supplied CI secret. - Rewrite `docs/release.md` around Notarius's selected native workflow. Include product-specific preparation, actual entry commands, selected toolchain, release-note location/footer, delivery choice, and upstream recovery links. - Update `docs/policy/release.md` for annotated tags, pre-pushed `main`, native validation ownership, the selected build gate, and hosted/binary delivery instead of source-only distribution. Preserve versioning, immutability, and compatibility decisions not changed by this roadmap. Avoid restating upstream implementation mechanics as additional local guarantees. - Update `docs/cli.md` for native runtime identity, and relevant links or local integration statements in README, `docs/development.md`, and internal docs. Document upstream features through canonical upstream links, not a duplicated ReleaseKit manual or a separate local field-by-field profile reference. - Maintain `docs/oss/attribution.md` and license texts as applicable. Do not rewrite published release notes or tags to retrofit adoption. - Reconcile the packaged-artifact backlog item in `future.md` with the approved distribution decision, retaining any portion that remains deferred. No changes to pipeline behavior, extraction contracts, artifact schemas, cache identity, or runtime configuration are part of this scope. A new ADR is not required solely to record this tooling adoption; the release policy and runbook own the selected release contract and procedure. ## Verification And Acceptance The adoption is complete when: - The selected registered tool runs with the intended version, including through any retained launcher; no old release entry point remains in current guidance. - Candidate validation and publication are native ReleaseKit operations, with no duplicate application implementation or repeated mandatory suite invocation. - The executable receives its identity through the native accessor. An ordinary development build and a native version-injected build report the appropriate identity through CommandKit. - Product facts and any selected targets/delivery destination are accurate and release policy, runbook, profile, and automation agree. - The profile selects only Linux/amd64, the hosted body comes from the committed note, and delivery uses native binary/checksum assets and native retry paths. Local credential loading and CI secret mapping use the same native contract; no secret is committed or required by the offline test suite. - Maintained examples and the normal offline Go suite pass after dependency and version-wiring changes; run vet/build checks appropriate to those changes. - Focused consumer verification covers actual wiring, not a copied ReleaseKit publication test suite. If an end-to-end publication check is warranted, use a disposable checkout and local bare Git remote, never the live Notarius remote. - Documentation links and relevant attribution have been checked. Existing historical release records remain intact. Do not publish a real release, create hosted pages, or upload assets merely to verify adoption. Native integration must be verifiable without production API keys or a new release tag on `origin`.