manifest-version check, and a Nix flake this repository validates under it #46

Merged
mikluko merged 3 commits from manifest-version into main 2026-11-22 11:26:08 +00:00
Owner

Summary

A manifest-version check, default error, from beads changelog-e17. First consumer: https://sarak.sh/mikluko/baox, whose nix eval shell step it replaces.

inspect
  Lint                      document and tag checks; fragments-release forecasts with this
  lintManifest              outside Lint: a forecast release has no bump yet
    off / no versioned entry / no flake.nix beside the changelog  -> silent, nix not run
    readFlake               nix eval --raw --no-write-lock-file .#<flake-attr>.version, in the changelog's dir
    Changelog.LintManifest  compares with the version the `version` output reports

New flake-attr input / -flake-attr flag, default unless set. The action does not install nix.

This repository then consumes the check itself:

+flake.nix        # packages.{changelog,default}, overlays.default, formatter
+package.nix      # buildGoModule; version = actions/VERSION, so a release needs no extra bump
+flake.lock
 .forgejo/workflows/ci.yaml       lint: + install nix, nix build, then validate
 .forgejo/workflows/release.yaml  + install nix before the first validate
 .github/workflows/mirror-release.yaml  + install nix before the smoke test, where the tag has a flake.nix

Evidence

Real nix 2.36 in a nixos/nix container, against the linux binary:

match           exit 0
-flake-attr baox exit 0
-flake-attr nope CHANGELOG.md:0: error: flake.nix states no version at nope.version that can be read, so it cannot be compared with 1.2.0, the newest entry: nix eval .#nope.version: exit status 1: error: flake 'git+file:///w' does not provide attribute 'packages.aarch64-linux.nope.version', 'legacyPackages.aarch64-linux.nope.version' or 'nope.version' (manifest-version)
entry at 1.3.0  CHANGELOG.md:5: error: version 1.3.0 is the newest entry and flake.nix states "1.2.0" at default.version; the commit cutting the release sets the two alike (manifest-version)
flake.lock      not written

This repository's flake, in the same container: nix build .#changelog builds, nix fmt -- --check is clean, and ./result/bin/changelog -fragments .changelog passes. After echo 9.9.9 > actions/VERSION:

CHANGELOG.md:10: error: version 2.2.0 is the newest entry and flake.nix states "9.9.9" at default.version; the commit cutting the release sets the two alike (manifest-version)

cmd/changelog/manifest_test.go pins the exact nix argv and working directory with a fake nix on PATH, plus the no-nix, missing-package and nothing-to-compare cases. TestLintRaisesNoManifestFinding holds it out of Lint.

Merge Danger

Door: two-way

Blast Radius: consumers

A repository on @v2 with a flake.nix beside its changelog and no nix on the runner turns red at the release carrying this, until it installs nix or switches the check off.

The Forgejo runner builds unsandboxed as root, where the go command's telemetry created /homeless-shelter and nix refused the next derivation; package.nix points HOME at $TMPDIR for both derivations. The release workflow's and the mirror's nix steps run only at a release. Running go run ./cmd/changelog locally now needs nix, or -off manifest-version.

Checklist

  • .changelog/ gained a fragment carrying this change's notes, or this change needs none.
  • AI assistance is declared below.

AI assistance

Claude Code (Assisted-By trailer on the commit).

## Summary A `manifest-version` check, default `error`, from beads `changelog-e17`. First consumer: https://sarak.sh/mikluko/baox, whose `nix eval` shell step it replaces. ```text inspect Lint document and tag checks; fragments-release forecasts with this lintManifest outside Lint: a forecast release has no bump yet off / no versioned entry / no flake.nix beside the changelog -> silent, nix not run readFlake nix eval --raw --no-write-lock-file .#<flake-attr>.version, in the changelog's dir Changelog.LintManifest compares with the version the `version` output reports ``` New `flake-attr` input / `-flake-attr` flag, `default` unless set. The action does not install nix. This repository then consumes the check itself: ```diff +flake.nix # packages.{changelog,default}, overlays.default, formatter +package.nix # buildGoModule; version = actions/VERSION, so a release needs no extra bump +flake.lock .forgejo/workflows/ci.yaml lint: + install nix, nix build, then validate .forgejo/workflows/release.yaml + install nix before the first validate .github/workflows/mirror-release.yaml + install nix before the smoke test, where the tag has a flake.nix ``` ## Evidence Real nix 2.36 in a `nixos/nix` container, against the linux binary: ```text match exit 0 -flake-attr baox exit 0 -flake-attr nope CHANGELOG.md:0: error: flake.nix states no version at nope.version that can be read, so it cannot be compared with 1.2.0, the newest entry: nix eval .#nope.version: exit status 1: error: flake 'git+file:///w' does not provide attribute 'packages.aarch64-linux.nope.version', 'legacyPackages.aarch64-linux.nope.version' or 'nope.version' (manifest-version) entry at 1.3.0 CHANGELOG.md:5: error: version 1.3.0 is the newest entry and flake.nix states "1.2.0" at default.version; the commit cutting the release sets the two alike (manifest-version) flake.lock not written ``` This repository's flake, in the same container: `nix build .#changelog` builds, `nix fmt -- --check` is clean, and `./result/bin/changelog -fragments .changelog` passes. After `echo 9.9.9 > actions/VERSION`: ```text CHANGELOG.md:10: error: version 2.2.0 is the newest entry and flake.nix states "9.9.9" at default.version; the commit cutting the release sets the two alike (manifest-version) ``` `cmd/changelog/manifest_test.go` pins the exact nix argv and working directory with a fake `nix` on PATH, plus the no-nix, missing-package and nothing-to-compare cases. `TestLintRaisesNoManifestFinding` holds it out of `Lint`. ## Merge Danger **Door:** two-way **Blast Radius:** consumers A repository on `@v2` with a `flake.nix` beside its changelog and no nix on the runner turns red at the release carrying this, until it installs nix or switches the check off. The Forgejo runner builds unsandboxed as root, where the go command's telemetry created `/homeless-shelter` and nix refused the next derivation; `package.nix` points `HOME` at `$TMPDIR` for both derivations. The release workflow's and the mirror's nix steps run only at a release. Running `go run ./cmd/changelog` locally now needs nix, or `-off manifest-version`. ## Checklist - [x] `.changelog/` gained a fragment carrying this change's notes, or this change needs none. - [x] AI assistance is declared below. ## AI assistance Claude Code (`Assisted-By` trailer on the commit).
The version is read with nix eval rather than from the file, since a flake
may compute it. A flake.nix whose version cannot be read, nix missing
included, is a finding: a silent skip passes the release commit that forgot
the bump. LintManifest stays out of Lint so the fragments-release forecast
does not demand a bump only the release commit makes.

Assisted-By: Claude <noreply@anthropic.com>
Nix flake, so this repository validates under its own manifest-version
Some checks failed
CI / test (pull_request) Successful in 18s
CI / lint (pull_request) Failing after 34s
8a72890d53
The package reads its version from actions/VERSION, which the release
workflow already writes and TestVersionMatchesTheChangelog holds to the
changelog, so a release needs no bump step of its own. The checks stay off
in the build: the suite reads the whole tree and its git history.

Every workflow that runs the validator installs nix first: CI's lint job,
the release workflow and its smoke test, and the mirror's smoke test.

Assisted-By: Claude <noreply@anthropic.com>
package.nix: keep the go command's telemetry out of $HOME
All checks were successful
CI / test (pull_request) Successful in 17s
CI / lint (pull_request) Successful in 39s
f36c209719
An unsandboxed build running as root, as on the Forgejo runner, creates
/homeless-shelter through it, and nix then refuses the next derivation.

Assisted-By: Claude <noreply@anthropic.com>
mikluko deleted branch manifest-version 2026-11-22 11:26:09 +00:00
Sign in to join this conversation.
No description provided.