From 7a64e4d6362540eca13887280ed057a87a50f621 Mon Sep 17 00:00:00 2001 From: "Z. D. Smith" Date: Tue, 19 May 2026 13:41:37 -0400 Subject: [PATCH] patches: retire awk-comma-continuation and jq-permissive-control-chars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both upstreamed: - awk-comma-continuation: vercel-labs#206 (merged 2026-04-29, brought in via the just-bash@2.14.4 sync). The lexer now swallows newlines after continuation-allowing tokens (`,`, `{`, `&&`, `||`, `?`, `:`, `do`, `else`, `if`, `while`) per POSIX. Our 3-line patch from 58a69ce is now fully absorbed — `git diff upstream/main..flowglad-main -- commands/awk/` is empty. - jq-permissive-control-chars: vercel-labs#214 (merged 2026-05-05, also upstream-authored by zd@zdsmith.com after carrying it here first). Upstream's jq scanner now tolerates literal newlines/tabs in JSON strings the same way the carry did. `git diff upstream/main..flowglad-main -- commands/jq/` is empty. Drop both describe blocks from flowglad-patches.integration.test.ts and both rows from README.md's patch table. Update the intro from "three patches" to "one patch". Add a note pointing readers to the upstreaming PRs so the history is discoverable. The remaining carry is sqlite3-dot-commands. That's also pending upstream in vercel-labs#249; once it lands the README patch table goes to zero and this section can be retired along with the integration test fixture. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) --- README.md | 10 ++--- .../src/flowglad-patches.integration.test.ts | 43 ------------------- 2 files changed, 5 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index e7fa4683..ff8038fc 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ > ## Flowglad fork notes > > This is [Flowglad](https://github.com/flowglad)'s fork of [`vercel-labs/just-bash`](https://github.com/vercel-labs/just-bash). -> We carry three patches that fix issues encountered while embedding just-bash -> in our reasoning agent. Each patch lives at TypeScript-source level on the +> We carry one patch that fixes an issue encountered while embedding just-bash +> in our reasoning agent. The patch lives at TypeScript-source level on the > `flowglad-main` branch (this repo's default) and is reflected in the > committed `dist/`. Consumers must pin a package-root tag named > `v-fgp.` (for example, `v2.14.3-fgp.1`), not the branch and not a @@ -12,9 +12,9 @@ > > | Patch | What it fixes | Upstream PR | > | --- | --- | --- | -> | `sqlite3-dot-commands` | sql.js doesn't implement sqlite3's CLI dot-commands (`.tables`, `.schema`, `.mode`, `.read`, `.separator`, `.quit`, etc.), so agent scripts pasted from real `sqlite3` sessions hit syntax errors. We carry a preprocessor (`commands/sqlite3/dot-commands.ts`) that translates each dot-command to equivalent SQL, formatter-state mutations, recursive `.read` inlining, or actionable in-band error messages before handing the script to the worker. (The original `sqlite3-worker` bundling bug was upstreamed in [vercel-labs#190](https://github.com/vercel-labs/just-bash/pull/190).) | _filed in Patch 2_ | -> | `awk-comma-continuation` | The bundled awk lexer emits a `NEWLINE` token after a trailing comma, breaking POSIX comma-continuation in scripts our agent runs. | _filed in Patch 2_ | -> | `jq-permissive-control-chars` | The bundled jq input scanner calls `JSON.parse` on raw bytes that may contain literal control characters (which Shopify's Admin API responses do), failing parse. We sanitize the slice before parsing. | _filed in Patch 2_ | +> | `sqlite3-dot-commands` | sql.js doesn't implement sqlite3's CLI dot-commands (`.tables`, `.schema`, `.mode`, `.read`, `.separator`, `.quit`, etc.), so agent scripts pasted from real `sqlite3` sessions hit syntax errors. We carry a preprocessor (`commands/sqlite3/dot-commands.ts`) that translates each dot-command to equivalent SQL, formatter-state mutations, recursive `.read` inlining, or actionable in-band error messages before handing the script to the worker. (The original `sqlite3-worker` bundling bug was upstreamed in [vercel-labs#190](https://github.com/vercel-labs/just-bash/pull/190).) | [vercel-labs#249](https://github.com/vercel-labs/just-bash/pull/249) | +> +> The `awk-comma-continuation` patch (upstreamed in [vercel-labs#206](https://github.com/vercel-labs/just-bash/pull/206)) and the `jq-permissive-control-chars` patch (upstreamed in [vercel-labs#214](https://github.com/vercel-labs/just-bash/pull/214)) have been retired — those issues are fixed in upstream and our source matches it byte-for-byte. > > ### Releasing > diff --git a/packages/just-bash/src/flowglad-patches.integration.test.ts b/packages/just-bash/src/flowglad-patches.integration.test.ts index 46b95adf..f6835261 100644 --- a/packages/just-bash/src/flowglad-patches.integration.test.ts +++ b/packages/just-bash/src/flowglad-patches.integration.test.ts @@ -59,47 +59,4 @@ describe("Flowglad carried patches", () => { expect(result.exitCode).toBe(0); }); }); - - describe("awk-comma-continuation", () => { - it("continues awk expressions across a newline after comma", async () => { - const env = new Bash(); - - const result = await env.exec(`awk 'BEGIN { printf "%s-%s\\n", - "left", "right" }'`); - - expect(result.stderr).toBe(""); - expect(result.stdout).toBe("left-right\n"); - expect(result.exitCode).toBe(0); - }); - }); - - describe("jq-permissive-control-chars", () => { - it("accepts a literal newline inside a JSON string", async () => { - const env = new Bash({ - files: { - "/shopify.json": '{"body":"first\nsecond"}\n', - }, - }); - - const result = await env.exec("jq -r '.body' /shopify.json"); - - expect(result.stderr).toBe(""); - expect(result.stdout).toBe("first\nsecond\n"); - expect(result.exitCode).toBe(0); - }); - - it("accepts a literal tab inside a JSON string", async () => { - const env = new Bash({ - files: { - "/payload.json": '{"body":"col1\tcol2"}\n', - }, - }); - - const result = await env.exec("jq -r '.body' /payload.json"); - - expect(result.stderr).toBe(""); - expect(result.stdout).toBe("col1\tcol2\n"); - expect(result.exitCode).toBe(0); - }); - }); });