Skip to content

Keep toolchain bumps compatible with audited presets and installer behavior - #127

Merged
unbraind merged 1 commit into
mainfrom
fix/self-syncing-toolchain-pin
Oct 11, 2026
Merged

unbraind merged 1 commit into
mainfrom
fix/self-syncing-toolchain-pin

Conversation

@unbraind

@unbraind unbraind commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Weekly grouped toolchain bumps failed when the installed prepare template changed and when the newer audited settings SDK retained an unrecognized stored field. Existing-template previews also proposed an overwrite without --force.

Pin checks now derive expected versions from package.json and compare the lock root, locked package entries, and installed metadata for the CLI, pm-ops, and pm-changelog. Exact development pins remain required; peer and extension floors remain compatible minima. Negative fixtures reject ranged pins and each independently drifted version source without an approved-version constant.

Before, preparation required byte equality with the installed template and preview ignored the existing-template skip. After, the launcher delegates to the installed export under a durable behavior contract, preserves the original resolution diagnostic for inconclusive presence probes, and preview follows the same force rule as application. Replacement assertions check recognized overrides and effective named-policy defaults through the real SDK. Audited mutation and history safety remain covered for all seven presets. Numeric README toolchain statements are replaced by manifest references.

Validation:

Manifest scenario Command Result
Original manifests; empty HOME and global/system Git configuration disabled npm run release:check 162/162 passed, 0 failed/skipped
Original manifests bun run release:check 162/162 passed, 0 failed/skipped
Actual grouped bump manifests from the existing dependency branch npm run release:check 162/162 passed, 0 failed/skipped
Same unmodified bump manifests bun run release:check 162/162 passed, 0 failed/skipped

Every full run met the unchanged 100% line/branch/function thresholds across the configured 16 files, documented 95 declarations in 38 TypeScript files, found zero production audit vulnerabilities, packed 62 files, and passed changelog, publish-attestation, and version-derived date checks. The original manifest pair was restored byte for byte and reinstalled before committing. Changelog generation and its check ran after tracker writes.

The focused and tracker-linked suite passed 29/29. Independent direct and tracker-linked verification passed 4/4. Reverting only the changed production files while retaining the regressions caused 2/2 expected assertion failures (force-aware preview and retained installer diagnostic); restoring the source passed. These tests import TypeScript source directly. Installer safety tests retain real fresh Git checkouts, the installed installer, omission, stale/broken package, nonzero exit, and signal cases. SDK tests use real temporary trackers.

Strict tracker health with required merge drivers passed under an empty HOME and disabled global/system Git configuration; tracker history hashes match. Ambient health correctly refuses a globally installed pm-github host-version mismatch (repo CLI 2026.10.3 versus extension metadata 2026.10.11); no global configuration was changed.

CI passed on exact head 43e8e7b1658be32394ecced227c14e31388e9814: Node 22 and Node 26 each passed 162/162 tests, and Windows prepare passed 1/1; CodeQL passed. Both Node jobs also passed strict tracker health, committed-build drift, audit, package, changelog, attestation/date, and Bun dependency installation checks. Substantive review remains pending where review services skipped. Coverage describes the configured 16-file scope. Unknown stored fields remain under host serializer authority.

PM: pm-0czt, claim released and item retained for orchestrator verification.

@sourcery-ai

sourcery-ai Bot commented Oct 11, 2026

Copy link
Copy Markdown

Sorry @unbraind, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 2 days and 7 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4459afe7-c521-4514-b0a1-7cdb1eb6afd0

📥 Commits

Reviewing files that changed from the base of the PR and between 6b53609 and 43e8e7b.


⛔ Files ignored due to path filters (4)
  • dist/presets/shared.d.ts is excluded by !**/dist/**
  • dist/presets/shared.d.ts.map is excluded by !**/dist/**, !**/*.map
  • dist/presets/shared.js is excluded by !**/dist/**
  • dist/presets/shared.js.map is excluded by !**/dist/**, !**/*.map

📒 Files selected for processing (8)
  • .agents/pm/history/pm-0czt.jsonl
  • .agents/pm/issues/pm-0czt.toon
  • README.md
  • scripts/prepare-merge-driver.ts
  • src/presets/shared.ts
  • tests/compatibility-floor.test.ts
  • tests/prepare-merge-driver.test.ts
  • tests/shared.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



Summary by CodeRabbit

  • Bug Fixes
    • Existing templates are now skipped during dry runs unless --force is specified, matching normal application behavior.
    • Preset replacement resets preset-owned settings to the preset and host defaults while retaining unrecognized stored fields.
    • The prepare hook can use the installed package export without a template file and preserves installation errors when package detection is inconclusive.
  • Documentation
    • Updated guidance on preset replacement, merge safety, and the minimum CLI version.

Walkthrough

The changes update preset replacement and dry-run handling, prepare-launcher error behavior, and development toolchain pin checks. The README and PM records describe the updated behavior and verification.

Changes

Preset application

Layer / File(s) Summary
Preset replacement and dry-run behavior
src/presets/shared.ts, tests/shared.test.ts, README.md
Dry-run now skips existing templates unless --force is set. Tests check the resulting governance settings and confirm that dry-run leaves template and settings files unchanged. The documentation describes replace-mode settings behavior and the declared CLI minimum.

Prepare launcher

Layer / File(s) Summary
Prepare launcher behavior
scripts/prepare-merge-driver.ts, tests/prepare-merge-driver.test.ts, README.md
An inconclusive package-presence check now treats pm-ops as present, preserving the original resolution error. Tests cover delegation without a template file and the MODULE_NOT_FOUND failure case. The README describes the launcher and its installer behavior contract.

Toolchain pin checks and tracking

Layer / File(s) Summary
Toolchain pin checks and regression records
tests/compatibility-floor.test.ts, README.md, .agents/pm/issues/pm-0czt.toon, .agents/pm/history/pm-0czt.jsonl
Tests require exact pins for three tools to match the manifest, lockfile, and installed package metadata. The README removes the reconcile CLI minimum. The PM records list the tracked changes and verification commands.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 43e8e

No concrete issue requiring a fix before merge was identified in the supplied evidence.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check Passed The description directly explains the toolchain-pin validation, installer behavior, preset replacement, preview behavior, tests, and validation results covered by the changeset.
Title check Passed The title clearly summarizes the main changes: keeping toolchain bumps compatible with audited presets and installer behavior.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 5 files. (3 skipped: 3 …
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
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@sourcery-ai

sourcery-ai Bot commented Oct 11, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR hardens weekly toolchain bumps by deriving and validating exact versions from manifest, lockfile, and installation metadata; updates preset replacement and preview behavior to honor the audited SDK and --force contract; and makes the prepare hook resilient to pm-ops template revisions while preserving installer diagnostics and safety coverage.

Sequence diagram for audited preset application and template safety

sequenceDiagram
    participant User
    participant Preset as applyPreset
    participant SDK as AuditedSettingsSDK
    participant FS as TemplateFilesystem

    User->>Preset: applyPreset
    Preset->>SDK: audit and commit settings
    SDK-->>Preset: audited result
    alt existing template and no --force
        Preset->>FS: existsSync
        FS-->>Preset: template exists
        Preset-->>User: skip template
    else --force or template absent
        Preset->>FS: write template
        FS-->>Preset: template written
    end
Loading

Sequence diagram for resilient pm-ops installer preparation

sequenceDiagram
    participant Install as npm install
    participant Launcher as prepare-merge-driver
    participant Resolver as Node resolver
    participant Ops as pm-ops installer
    participant PM as pm merge install

    Install->>Launcher: run prepare hook
    Launcher->>Resolver: resolve pm-ops
    alt pm-ops absent
        Resolver-->>Launcher: MODULE_NOT_FOUND
        Launcher-->>Install: skip with notice
    else pm-ops present or probe inconclusive
        Resolver-->>Launcher: installed export or retained error
        Launcher->>Ops: run installer
        alt pm on PATH
            Ops->>PM: pm merge install
            PM-->>Ops: result
        else pm unavailable
            Ops-->>Launcher: skip with notice
        end
        Ops-->>Launcher: exit status
        Launcher-->>Install: success or installer failure
    end
Loading

Flow diagram for manifest-derived toolchain compatibility checks

flowchart TD
    A[Read package.json] --> B[Read lock root and locked packages]
    B --> C[Read installed CLI pm-ops and pm-changelog metadata]
    C --> D{Exact development pins match?}
    D -- No --> E[Reject drift or ranged pin]
    D -- Yes --> F{Peer and extension floors satisfied?}
    F -- No --> E
    F -- Yes --> G[Accept toolchain compatibility]
Loading

File-Level Changes

Change Details Files
Align toolchain compatibility checks with all declared and installed version sources.
  • Require exact development pins for the CLI, pm-ops, and pm-changelog.
  • Cross-check package.json, lockfile root declarations, lock entries, and installed package metadata.
  • Add negative coverage for ranged pins and each independently drifted source while retaining compatible minimum checks.
tests/compatibility-floor.test.ts
Make preset replacement and template preview behavior follow host SDK and force semantics.
  • Skip existing templates during dry-run unless --force is supplied, matching apply behavior.
  • Validate replacement through the real SDK's effective named-policy defaults.
  • Document preservation of unknown stored settings fields under host serializer ownership.
src/presets/shared.ts
dist/presets/shared.js
dist/presets/shared.d.ts
dist/presets/shared.js.map
dist/presets/shared.d.ts.map
tests/shared.test.ts
README.md
Decouple the prepare hook from a byte-matched pm-ops template while preserving installer safety behavior.
  • Delegate from the local launcher to the installed pm-ops export.
  • Retain the original module-resolution diagnostic when package presence probing is inconclusive.
  • Replace byte-equality coverage with export-contract, fresh-checkout, and failure-mode tests.
scripts/prepare-merge-driver.ts
tests/prepare-merge-driver.test.ts
README.md
Record the associated project-management item and history artifacts.
  • Add the PM issue and committed history record for the released change.
.agents/pm/issues/pm-0czt.toon
.agents/pm/history/pm-0czt.jsonl

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

Please review head 43e8e7b, including outside-diff findings.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@unbraind
unbraind merged commit 36ede3b into main Oct 11, 2026
10 checks passed
@unbraind
unbraind deleted the fix/self-syncing-toolchain-pin branch October 11, 2026 11:11
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