Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ src/
test/
unit/ Unit tests (node:test, dependency-injected, no VS Code API)
batchApply.test.ts Batch template and operation count parsing (16 tests)
binary.test.ts Binary discovery, managed install, compatibility, workspace env (64 tests)
binary.test.ts Binary discovery, managed install, compatibility, workspace env (66 tests)
binaryDiscovery.test.ts Real executable discovery on PATH (13 tests)
initializeProject.test.ts Status display, agents file classification, formatError (39 tests)
managedLifecycle.test.ts Managed install with real file I/O (22 tests)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ The extension detects outdated CLI builds and warns with upgrade guidance. It re
Set `patchloom.path` in settings, or add the CLI to your `PATH`.

**CLI compatibility warning / upgrade path**
The extension requires Patchloom **0.3.0** or newer; **0.28.0** is recommended. Prefer channels that track GitHub Releases the same day:
The extension requires Patchloom **0.3.0** or newer; **0.28.0** is recommended. Which fix to use depends on how the CLI was resolved (status shows Source):

1. **Patchloom: Update Patchloom** (or **Install Patchloom**) for the extension managed install (checksum-verified download from GitHub Releases)
2. **Scoop** on Windows: `scoop update patchloom` after `scoop install patchloom`
3. Homebrew / npm / cargo / the official installer script on macOS and Linux
1. **Source: managed install** **Patchloom: Update Patchloom** (checksum-verified GitHub release into extension storage)
2. **Source: PATH** → upgrade that install in place (**Scoop** `scoop update patchloom` on Windows; Homebrew / npm / cargo / the official installer elsewhere). Managed Install will not override a PATH binary.
3. **Source: patchloom.path** → **Open Settings** and point at a current binary, or clear the setting so PATH/managed resolution can take over

Do **not** rely on winget or Chocolatey to stay current. Those community packages lag moderation and Microsoft publish, so upgrades often stay stuck on older CLI versions.

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
"@vscode/test-electron": "^3.1.0",
"@vscode/vsce": "^3.0.0",
"fast-check": "^4.9.0",
"ovsx": "^1.1.0",
"ovsx": "^1.1.1",
"typescript": "^7.0.2",
"vscode-extension-tester": "^8.24.0"
}
Expand Down
11 changes: 7 additions & 4 deletions src/binary/patchloom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,19 @@ export function preferredBinaryRemediationAction(
}

if (patchloomNeedsUpgrade(status)) {
if (status.source === "managed" || status.managedInstall?.exists) {
// Managed Update only refreshes the extension storage binary. PATH and
// patchloom.path still win resolution order, so Install/Update managed
// would not replace an active outdated PATH/setting binary.
if (status.source === "managed") {
return {
title: "Update Patchloom",
command: "patchloom.updateBinary"
};
}
if (status.managedInstall) {
if (status.source === "setting") {
return {
title: "Install Patchloom",
command: "patchloom.installBinary"
title: "Open Settings",
command: "patchloom.openPatchloomSettings"
};
}
return {
Expand Down
47 changes: 47 additions & 0 deletions test/unit/binary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,53 @@ test("preferredBinaryRemediationAction updates outdated managed install", () =>
});
});

test("preferredBinaryRemediationAction opens releases for outdated PATH even when managed exists", () => {
// PATH wins resolution over managed; updating managed would not change the active binary.
const action = preferredBinaryRemediationAction({
ready: true,
source: "path",
message: "Using Patchloom from PATH.",
binaryPath: "/usr/local/bin/patchloom",
version: "patchloom 0.0.9",
detectedVersion: "0.0.9",
compatibility: "unsupported",
minimumSupportedVersion: MINIMUM_SUPPORTED_PATCHLOOM_VERSION,
compatibilityMessage: `Patchloom 0.0.9 is older than the minimum supported version ${MINIMUM_SUPPORTED_PATCHLOOM_VERSION}.`,
managedInstall: {
exists: true,
binaryPath: "/managed/managed-bin/patchloom",
target: {
platform: "darwin",
arch: "arm64",
targetTriple: "aarch64-apple-darwin",
archiveFormat: ".tar.xz"
}
}
});
assert.deepEqual(action, {
title: "Open Releases",
command: "patchloom.openPatchloomReleases"
});
});

test("preferredBinaryRemediationAction opens settings for outdated patchloom.path", () => {
const action = preferredBinaryRemediationAction({
ready: true,
source: "setting",
message: "Using Patchloom from patchloom.path.",
binaryPath: "/custom/old/patchloom",
version: "patchloom 0.0.9",
detectedVersion: "0.0.9",
compatibility: "unsupported",
minimumSupportedVersion: MINIMUM_SUPPORTED_PATCHLOOM_VERSION,
compatibilityMessage: `Patchloom 0.0.9 is older than the minimum supported version ${MINIMUM_SUPPORTED_PATCHLOOM_VERSION}.`
});
assert.deepEqual(action, {
title: "Open Settings",
command: "patchloom.openPatchloomSettings"
});
});

test("preferredBinaryRemediationAction opens settings when no managed path exists", () => {
const action = preferredBinaryRemediationAction({
ready: false,
Expand Down
7 changes: 4 additions & 3 deletions test/unit/initializeProject.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ test("buildStatusDetails surfaces managed install failure diagnostics", () => {
assert.match(details, /Managed install diagnostic: Checksum mismatch/);
});

test("preferredStatusAction points outdated PATH CLI users to managed install", () => {
test("preferredStatusAction points outdated PATH CLI users to releases", () => {
// PATH wins over managed install; Install managed would not replace the active binary.
const action = preferredStatusAction({
ready: true,
source: "path",
Expand All @@ -368,8 +369,8 @@ test("preferredStatusAction points outdated PATH CLI users to managed install",
});

assert.deepEqual(action, {
title: "Install Patchloom",
command: "patchloom.installBinary"
title: "Open Releases",
command: "patchloom.openPatchloomReleases"
});
});

Expand Down
Loading