From 4352c845a6ce77480ce655166e6f9c7c2ac5da33 Mon Sep 17 00:00:00 2001 From: Sebastien Tardif Date: Wed, 16 Sep 2026 11:52:37 -0700 Subject: [PATCH 1/2] chore(deps-dev): bump fast-check from 4.9.0 to 4.10.1 Maintainer pass after the js-yaml pin. Property-based unit tests pass. Signed-off-by: Sebastien Tardif --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7414f90..4955168 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@types/vscode": "~1.90.0", "@vscode/test-electron": "^3.1.0", "@vscode/vsce": "^3.0.0", - "fast-check": "^4.9.0", + "fast-check": "^4.10.1", "ovsx": "^1.2.0", "typescript": "^7.0.2", "vscode-extension-tester": "^8.26.1" @@ -3775,9 +3775,9 @@ } }, "node_modules/fast-check": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.9.0.tgz", - "integrity": "sha512-7ms6T7SybUev/PQITciI0yLM2pOSFy5zpG8Ty7tQofcVaQUvrMXp6CBwqF6fThLCLOrfBtuHAtwq6Yu4XPCllg==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.10.1.tgz", + "integrity": "sha512-sB5Vghiu8MyCyToHoBVGsT0baZg3sZWNIY+a6Ct2EDrQJlT4YdH6MC1BSLNe3kX1k5i5g0q1O52XFgcKK/rGHg==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index 47f5003..22a01c4 100644 --- a/package.json +++ b/package.json @@ -275,7 +275,7 @@ "@types/vscode": "~1.90.0", "@vscode/test-electron": "^3.1.0", "@vscode/vsce": "^3.0.0", - "fast-check": "^4.9.0", + "fast-check": "^4.10.1", "ovsx": "^1.2.0", "typescript": "^7.0.2", "vscode-extension-tester": "^8.26.1" From db59a774c4f3e18daa750bcc67695a644f87f503 Mon Sep 17 00:00:00 2001 From: Sebastien Tardif Date: Wed, 16 Sep 2026 11:55:48 -0700 Subject: [PATCH 2/2] feat: align extension with patchloom CLI 0.34.0 Recommend 0.34.0. Document empty-payload invalid_input, dest/--glob invalid_input, and parse_timeout (exit 4). formatCliOutput already prefixes error_kind; add a unit test for parse_timeout. Signed-off-by: Sebastien Tardif --- AGENTS.md | 2 +- README.md | 15 ++++++++++++--- src/commands/configureMcp.ts | 2 +- test/unit/initializeProject.test.ts | 13 +++++++++++++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 4ee73c5..0c59b34 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -53,7 +53,7 @@ test/ batchApply.test.ts Batch template and operation count parsing (20 tests) binary.test.ts Binary discovery, managed install, compatibility, workspace env (76 tests) binaryDiscovery.test.ts Real executable discovery on PATH (13 tests) - initializeProject.test.ts Status display, agents file classification, formatError (69 tests) + initializeProject.test.ts Status display, agents file classification, formatError (70 tests) managedLifecycle.test.ts Managed install with real file I/O (26 tests) mcpConfig.test.ts MCP config with real temp directories (16 tests) managedInstall.test.ts Managed Update compares latest vs managed binary (10 tests) diff --git a/README.md b/README.md index f9470af..045f22e 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Run `Patchloom: Setup Workspace` to walk through everything your project needs: When configuring, pick **Full tool inventory** (default) or **Core pack**. Core sets `PATCHLOOM_MCP_SURFACE=core` on the server entry. Existing servers in JSON or JSONC (`//` comments, trailing commas) stay in the file. A config that is not an object is left unchanged and the command reports an error. -CLI **0.33.0** (and 0.24+) exposes **58** MCP tools by default (including `list_files` and `apply_fragment`). The core pack is 11 tools: `read_file`, `search_files`, `list_files`, `replace_text`, `batch_replace`, `doc_get`, `doc_set`, `doc_query`, `md_replace_section`, `execute_plan`, `server_info`. `search_files` accepts `files_without_match` (CLI 0.29+). `apply_patch` accepts unified diffs, Codex `*** Begin Patch`, and Aider SEARCH/REPLACE (CLI 0.30+). `doc_query` can list object keys and count array or object length (CLI 0.32+). Search, replace, and tidy dests accept cwd-only globs such as `*.txt` (CLI 0.33+; use `**/*.txt` or `--glob` for nested files). Absolute paths that resolve inside the MCP workspace root are allowed; empty paths, `../`, and outside paths still reject with stable `error_kind` peels. +CLI **0.34.0** (and 0.24+) exposes **58** MCP tools by default (including `list_files` and `apply_fragment`). The core pack is 11 tools: `read_file`, `search_files`, `list_files`, `replace_text`, `batch_replace`, `doc_get`, `doc_set`, `doc_query`, `md_replace_section`, `execute_plan`, `server_info`. `search_files` accepts `files_without_match` (CLI 0.29+). `apply_patch` accepts unified diffs, Codex `*** Begin Patch`, and Aider SEARCH/REPLACE (CLI 0.30+). `doc_query` can list object keys and count array or object length (CLI 0.32+). Search, replace, and tidy dests accept cwd-only globs such as `*.txt` (CLI 0.33+; use `**/*.txt` or `--glob` for nested files). Absolute paths that resolve inside the MCP workspace root are allowed; empty paths, `../`, and outside paths still reject with stable `error_kind` peels. ### Status bar @@ -181,7 +181,7 @@ 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.33.0** is recommended. Which fix to use depends on how the CLI was resolved (status shows Source): +The extension requires Patchloom **0.3.0** or newer; **0.34.0** is recommended. Which fix to use depends on how the CLI was resolved (status shows Source): 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. @@ -211,6 +211,15 @@ On CLI 0.32+, **List structured keys** and **Count structured length** run `doc On CLI 0.33+, a search, replace, or tidy dest of `*.txt` matches files in the current directory only. `sub/*.txt` stays in that directory. Use `**/*.txt` or `--glob '*.txt'` when you want nested files. That dest glob is not the same as the Search Quick Action `--glob` field, which still walks nested files. +**Empty or whitespace-only edit payload** +On CLI 0.34+, empty or whitespace-only create, replace, markdown, rename, and AST mutate payloads report `error_kind: invalid_input` instead of writing junk. `"\n"` still writes a blank-line file. Empty `""` create still writes a 0-byte file. + +**Invalid dest or `--glob`** +On CLI 0.34+, a bad dest glob or `--glob` is `error_kind: invalid_input` (not a parse error), so `--json` callers can switch on `error_kind`. + +**AST parse timed out** +On CLI 0.34+, an AST parse that runs longer than five seconds reports `error_kind: parse_timeout` and exit 4. Narrow the file or pick an explicit language. Unknown explicit language is `invalid_input`. + **Patch apply formats** On CLI 0.30+, `patch apply` (and MCP `apply_patch`) accepts unified diffs, Codex `*** Begin Patch`, and Aider SEARCH/REPLACE. Update and SEARCH matches must be unique unless you pass `--replace-all` (SEARCH/REPLACE only). The Quick Action **Apply patch (unified / Begin Patch / SEARCH-REPLACE)** builds `patch apply`. **Merge patch (three-way)** is still `patch merge` for stale unified diffs. @@ -268,7 +277,7 @@ File bugs and feature requests at [patchloom/patchloom-vscode/issues](https://gi ## Requirements - VS Code 1.90 or newer (or compatible editors: Cursor, Windsurf, VSCodium) -- [Patchloom CLI](https://github.com/patchloom/patchloom) 0.3.0 or newer (**0.33.0+ recommended** for dest globs on search/replace/tidy (`*.txt` is cwd-only), `doc keys` / `doc len`, YAML merge-key edits that keep `<<:` and comments, Windows dest/`--cwd` rules, charset / EditorConfig `charset`, YAML alias-to-merge on `doc set`, create/rename `parent path is not a directory`, numeric selector compares (`servers[port>8000]`), `search -L` / `files_without_match`, Codex Begin Patch and Aider SEARCH/REPLACE on `patch apply`, `agent-rules --surface core` honoring `--mode`, empty-path fail-closed (`path must not be empty`), `suggested_op` on fail-closed doc navigation, `not_regular_file` soft peels, ambiguous markdown headings, `list_files` MCP inventory, `apply-fragment`, full `error_kind` peels (`binary` / `invalid_encoding` / `fuzzy_span_suspicious` / `already_exists` / `guard_rejected` / `ambiguous`), optional `PATCHLOOM_MCP_SURFACE=core` 11-tool pack, multi-doc `doc merge --selector`, line-oriented inserts, batch `replace PATH OLD NEW` hints, 58 MCP tools, and agent-facing JSON envelopes) +- [Patchloom CLI](https://github.com/patchloom/patchloom) 0.3.0 or newer (**0.34.0+ recommended** for empty or whitespace-only edit payloads as `invalid_input`, AST `parse_timeout` (exit 4), dest/`--glob` mistakes as `invalid_input` (not parse errors), dest globs on search/replace/tidy (`*.txt` is cwd-only), `doc keys` / `doc len`, YAML merge-key edits that keep `<<:` and comments, Windows dest/`--cwd` rules, charset / EditorConfig `charset`, YAML alias-to-merge on `doc set`, create/rename `parent path is not a directory`, numeric selector compares (`servers[port>8000]`), `search -L` / `files_without_match`, Codex Begin Patch and Aider SEARCH/REPLACE on `patch apply`, `agent-rules --surface core` honoring `--mode`, empty-path fail-closed (`path must not be empty`), `suggested_op` on fail-closed doc navigation, `not_regular_file` soft peels, ambiguous markdown headings, `list_files` MCP inventory, `apply-fragment`, full `error_kind` peels (`binary` / `invalid_encoding` / `fuzzy_span_suspicious` / `already_exists` / `guard_rejected` / `ambiguous` / `parse_timeout`), optional `PATCHLOOM_MCP_SURFACE=core` 11-tool pack, multi-doc `doc merge --selector`, line-oriented inserts, batch `replace PATH OLD NEW` hints, 58 MCP tools, and agent-facing JSON envelopes) ## Contributing diff --git a/src/commands/configureMcp.ts b/src/commands/configureMcp.ts index e4b1116..043a0d1 100644 --- a/src/commands/configureMcp.ts +++ b/src/commands/configureMcp.ts @@ -48,7 +48,7 @@ export async function configureMcp(): Promise { [ { label: "Full tool inventory", - description: "Default (58 tools on CLI 0.24+; verified on 0.33)", + description: "Default (58 tools on CLI 0.24+; verified on 0.34)", surface: "full" as const }, { diff --git a/test/unit/initializeProject.test.ts b/test/unit/initializeProject.test.ts index 6e6f8aa..d8a29e9 100644 --- a/test/unit/initializeProject.test.ts +++ b/test/unit/initializeProject.test.ts @@ -194,6 +194,19 @@ test("formatCliOutput surfaces binary kind (CLI 0.20+)", () => { ); }); +test("formatCliOutput surfaces parse_timeout kind (CLI 0.34+)", () => { + const stdout = JSON.stringify({ + ok: false, + error: "AST parse exceeded 5s", + error_kind: "parse_timeout", + applied: false + }); + assert.equal( + formatCliOutput({ exitCode: 4, stdout, stderr: "" }), + "parse_timeout: AST parse exceeded 5s" + ); +}); + test("formatCliOutput surfaces invalid_encoding kind (CLI 0.20+)", () => { const stdout = JSON.stringify({ ok: false,