Skip to content

fix(installer): derive every gentle-ai version literal from one authoritative pin - #262

Merged
Alan-TheGentleman merged 1 commit into
mainfrom
fix/single-gentle-ai-pin
Aug 1, 2026
Merged

fix(installer): derive every gentle-ai version literal from one authoritative pin#262
Alan-TheGentleman merged 1 commit into
mainfrom
fix/single-gentle-ai-pin

Conversation

@Alan-TheGentleman

@Alan-TheGentleman Alan-TheGentleman commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Quick win. Independent of the release-artifact initiative and of any tracker.

Problem

The pinned gentle-ai version was hand-duplicated across six literals plus a textual grep. This already caused a production incident, documented verbatim in the header of scripts/install-gentle-ai.mjs: the installer reported installing v2.1.11 while writing v2.2.0 to disk, because two hardcoded copies survived a pin bump.

The check meant to catch that was installer.includes(...) on a literal string — it verifies a string appears in a file, not that the values agree. That is exactly why it did not catch the incident.

Change

INSTALLER_VERSION becomes the sole authoritative literal. RELEASE_BASE_URL, GENTLE_AI_WINDOWS_SOURCE_TAG, lib/gentle-ai-binary.ts's GENTLE_AI_VERSION, and the previously undocumented sixth copy (the hardcoded version regex in assertExactGentleAiVersion) all derive from it.

scripts/verify-package-files.mjs now imports the live constants and compares actual values through a new pure gentleAiVersionPinMismatches(...), replacing the textual grep.

The pinned version value is unchanged (2.2.3). This is a refactor of how the value is expressed, not a bump.

Out of scope, deliberately

Per-platform sha256 digests stay as data — they are inherently plural and cannot be single-sourced. Symlink rejection, path confinement and the TOCTOU re-check in runtime/gentle-ai-binary.mjs are untouched.

Tests

RED first: importing RELEASE_BASE_URL failed before the export existed. Three new tests in tests/verify-package-files.test.ts cover a single-field mismatch, a multi-field mismatch, and agreement across the real values — the first is the regression test for the documented incident and could not have failed under the old grep.

pnpm run check:transaction-runner passes (runtime/ regenerated, never hand-edited). node scripts/verify-package-files.mjs passes.

Three tests in native-review-parity-runtime.test.ts fail on this branch and fail identically on clean main — they require receipt-driven development to be enabled, which is globally off in this environment. Verified independently against the base commit.

Rollback

Single commit. Reverting restores the prior six-literal-plus-grep state with no other side effects.

Summary by CodeRabbit

  • Bug Fixes

    • Ensured the Gentle AI version remains consistent across the installer, library, release URL, and Windows source.
    • Improved package verification to detect version mismatches clearly.
  • Tests

    • Added coverage for mismatched version pins and confirmed successful validation when all versions agree.
    • Updated package checks to verify version references dynamically.

The pinned Gentle AI version was hand-duplicated across five literals plus a
textual grep in verify-package-files.mjs, which is exactly why a prior pin
bump shipped installing v2.1.11 while writing v2.2.0 to disk (see
scripts/install-gentle-ai.mjs header comment). scripts/gentle-ai-installer.mjs
INSTALLER_VERSION is now the single source: RELEASE_BASE_URL,
GENTLE_AI_WINDOWS_SOURCE_TAG, and the installed-binary version check all
derive from it, and lib/gentle-ai-binary.ts imports it instead of repeating
the literal (runtime/gentle-ai-binary.mjs regenerated to match).
verify-package-files.mjs now imports and compares the live constants via
gentleAiVersionPinMismatches instead of grepping file text for a version
substring, so a drifted derived location fails with a specific message
instead of silently passing the old textual check.
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a74fd225-d6d1-4e75-8341-80037baadcc8

📥 Commits

Reviewing files that changed from the base of the PR and between 5fe1bea and 0d5e9ce.

📒 Files selected for processing (6)
  • lib/gentle-ai-binary.ts
  • runtime/gentle-ai-binary.mjs
  • scripts/gentle-ai-installer.mjs
  • scripts/verify-package-files.mjs
  • tests/package-manifest.test.ts
  • tests/verify-package-files.test.ts

📝 Walkthrough

Walkthrough

The installer version is now the authoritative Gentle AI version source. Binary metadata, release URLs, Windows source tags, regex validation, and package verification use derived values. Tests cover mismatched and consistent version pins.

Changes

Gentle AI version pinning

Layer / File(s) Summary
Version derivation and binary metadata
scripts/gentle-ai-installer.mjs, lib/gentle-ai-binary.ts, runtime/gentle-ai-binary.mjs, tests/package-manifest.test.ts
Release metadata and binary version values derive from INSTALLER_VERSION. The package manifest test checks this reference.
Package version consistency validation
scripts/verify-package-files.mjs, tests/verify-package-files.test.ts
The verifier checks the library version, release URL, and Windows source tag. Tests cover each mismatch and the matching case.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: type:bug

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes centralizing all Gentle AI version literals on one authoritative installer pin.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/single-gentle-ai-pin

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant