Skip to content

fix(release): ensure all version surfaces stay in sync on changeset release - #70

Merged
ryanleecode merged 7 commits into
masterfrom
feature/ensure-all-version-surfaces-sync
Aug 26, 2026
Merged

fix(release): ensure all version surfaces stay in sync on changeset release#70
ryanleecode merged 7 commits into
masterfrom
feature/ensure-all-version-surfaces-sync

Conversation

@systemfsoftware-maker

Copy link
Copy Markdown
Collaborator

Summary

Extends release-version.ts and check-versions.ts so every version-bearing surface stays locked on changeset release.

Drift repaired (U1):

  • flake.nix 0.1.50.1.8
  • package.json (root, private: true) 0.1.00.1.8
  • Cargo.lock refreshed via cargo update -w (0.1.70.1.8)

Pipeline fix (U2): release-version.ts now atomically bumps flake.nix (bumpNixVersion), root package.json and any .claude-plugin/plugin.json (bumpJsonVersion / bumpPluginManifests) alongside the existing npm / Cargo.toml bumps. Missing literal → non-zero; plugin absent → none tracked — skipped log.

Gate (U3): check-versions.ts now gates flake.nix, root package.json, and plugin manifests (plus glob-discovered crates/*/Cargo.toml). Divergence on any surface fails with a named message.

Verification

  • cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test --all-targets — green
  • deno check scripts/tools/release-version.ts scripts/tools/check-versions.ts — green
  • deno run --allow-read scripts/tools/check-versions.tsok npm=0.1.8 workspace=0.1.8 (plugin manifest: none tracked); divergence probes on flake.nix and root both fail with the expected mismatch message, revert → ok
  • Probe bump: temp .changeset/probe-sync.md (patch) → deno run --allow-read --allow-write --allow-env scripts/tools/release-version.ts bumped every surface to 0.1.9 (flake.nix, package.json, Cargo.toml, crates/comment-checker/Cargo.toml, npm/packages/comment-checker/package.json, CHANGELOG.md) and check-versions passed at 0.1.9; reverted to 0.1.8

Plan

docs/plans/2026-08-26-001-ensure-all-version-surfaces-sync-on-changeset-release.md

Lifecycle

  • read '/root/.omp/plugins/cache/plugins/compound-engineering-plugin___compound-engineering___3.21.4/skills/ce-simplify-code' — reviewed diff; no behavior-preserving simplifications warranted beyond the narrow version = " scoped helpers already applied
  • read '/root/.omp/plugins/cache/plugins/compound-engineering-plugin___compound-engineering___3.21.4/skills/ce-code-review' — verified R1–R5 and KTD1–KTD6 against the branch diff; no actionable findings

@systemfsoftware-maker
systemfsoftware-maker force-pushed the feature/ensure-all-version-surfaces-sync branch from fa8539d to 00f3d02 Compare August 26, 2026 20:08
…elease

Bump flake.nix, root package.json and .claude-plugin/plugin.json to 0.3.0
to match the npm/cargo 0.3.0 release (flake 0.1.5->0.3.0, root 0.1.0->0.3.0,
plugin 0.2.0->0.3.0); refresh Cargo.lock.

Extend release-version.ts to atomically bump flake.nix (via bumpNixVersion),
root package.json and any .claude-plugin/plugin.json (via bumpJsonVersion /
bumpPluginManifests) alongside the existing npm/cargo bumps. Extend
check-versions.ts to gate flake.nix, root and plugin manifests (plus glob-
discovered crates) so any divergence fails the PR gate.

Verified: deno check, check-versions ok at 0.3.0 and fails on
flake/root/plugin divergence, probe bump to 0.1.9->0.3.0 touches every
surface before revert; rebased onto origin/master 0.3.0.

Plan: docs/plans/2026-08-26-001-ensure-all-version-surfaces-sync-on-changeset-release.md
@systemfsoftware-maker
systemfsoftware-maker force-pushed the feature/ensure-all-version-surfaces-sync branch from 00f3d02 to 5b96d8b Compare August 26, 2026 20:09
- Replace JSON.parse/stringify with regex text replacement and arktype
  Semver validation (type('string').assert) for all version reads/writes
  in release-version.ts and check-versions.ts per architecture rule:
  deserialize into arktype, no instanceof.

- Replace instanceof Deno.errors.NotFound / SyntaxError checks with
  isNotFound helper using Reflect.get('name') to avoid instanceof.

- Refresh Cargo.lock to 0.3.0 to match bumped manifests.

Fixes F- FAIL: instanceof and not deserializing into arktype
Trash the arktype/Deno.errors/JSON.parse version tools. Shared
scripts/lib/version-sync.ts uses Schema.TaggedError + Schema.decodeUnknownEffect
for Semver/Bump. release-version.ts and check-versions.ts are Effect.gen
programs run with DenoRuntime.runMain provided DenoServices.layer (imported as
DenoPlatform). FileSystem reads/writes via Effect FileSystem; version fields
are regex-replaced in place — no JSON.parse/stringify, no instanceof.

Pinned effect and @effect/platform-deno to 4.0.0-rc.108 to match the npm
wrapper. Probe patch bump 0.3.0 → 0.3.1 keeps every surface in lockstep.
Replace the line-scanner that pretended to parse TOML. extractTomlVersion and
replaceTomlVersion now parse with @std/toml, locate workspace.package / package
via Schema.Record, decode version with Schema.decodeUnknownEffect(Semver),
mutate the table, and stringifyToml. Nix/JSON stay text; they are not TOML.

Probe 0.3.0 → 0.3.1: cargo test accepts the stringified manifests.
version-sync.ts no longer imports FileSystem. Semver, TomlHeader literals,
PackageTable (Struct { version: Semver }), extract/replace, and nextVersion
are data-in/data-out. Filesystem bump lives in version-files.ts, consumed
only by the CLI interpretation edges.

Fixes I1 (core imported the filesystem) and I5 (untyped header strings;
leaf table now Schema.Struct version: Semver).
JSON goes through Schema.fromJsonString. Cargo.toml is parse/stringify via
@std/toml and Schema.Struct workspace.package / package. Changesets are
@std/yaml frontmatter decoded as Record<string, Bump>. Nix keeps a single
version-binding grammar (exactly one `version = "<semver>"` line).

Filesystem stays in version-files.ts. CLIs only runMain + inventory. No
JSON.parse, no instanceof, no `as ReleaseBump`.
@ryanleecode
ryanleecode merged commit ea5758a into master Aug 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants