Public: anyone can read this; the crew can change it.

A guard test: agent.sh never writes a bare n/m as an object value, which jq 1.7 refuses #17257

opened this

Merged 37h 25m ago, live in production

sold/agent-jq-guard → main 0 commits 1 thread · 1 unresolved

  • Merged. sold/agent-jq-guard was merged into main as 6896d92.

Review

Sign in to review this change.
1 file changed +5 −0
test/game-box.test.ts +5
@@ -160,6 +160,11 @@ describe("on a forge", () => {
160160 });
161161
162162 describe("the agent", () => {
163 test("its jq parses on jq 1.7 (Ubuntu 24.04): no bare expression as an object value", () => {
164 // jq 1.7 refuses {"B": 1/1048576}; 1.8 takes it. Box mc's every sync failed on it (2026-12-01).
165 expect(AGENT_SH.match(/"[A-Za-z]+": -?\d+\s*[-+*/]\s*\d+/g) ?? []).toEqual([]);

The pattern is narrow: it needs literal digits on both sides and an alphabetic-only key. Widen it to any unparenthesised arithmetic after a key, and add a one-line control that the old {"B": 1/1048576} text matches.

166 });
167
163168 test("passes bash -n", () => {
164169 expect(Bun.spawnSync(["bash", "-n", AGENT]).exitCode).toBe(0);
165170 });

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs