Skip to content

fix(orchestrate): shell-quote drill queries + sanitize the idea's inline-code span#13

Merged
maxgfr merged 1 commit into
mainfrom
fix/orchestrate-review
Jul 9, 2026
Merged

fix(orchestrate): shell-quote drill queries + sanitize the idea's inline-code span#13
maxgfr merged 1 commit into
mainfrom
fix/orchestrate-review

Conversation

@maxgfr

@maxgfr maxgfr commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Review findings fixed (family orchestrate round)

P2 — drill commands embedded brief free-text with only "' sanitization (src/analyze.ts drill()). Backticks and $() in a brief field survived into the emitted --q "<query>" shell line — which analyze prints for copy-paste and orchestrate amplifies into research.workflow.mjs subagent prompts. Queries are now single-quoted (the only shell-inert quoting — backticks and $() never expand inside single quotes), an embedded ' is escaped as '"'"', and newlines flatten to a space. Output is otherwise unchanged.

P2 — a brief idea with backticks broke the researcher contract's inline-code span (src/orchestrate-templates.ts). An interior backtick closed the span early (and read as executable in copy-paste contexts). The interpolated idea now has backticks stripped to apostrophes and newlines flattened before the span is built.

Family stale-id rule added to the worklist-driven fan-out contracts:

  • claim-reviewer: If a PAIRS key is no longer in the worklist, skip it and say so in your note.
  • builder: If your TASK id is no longer in the worklist, skip it and say so in your summary.

Tests (TDD — all 4 new/updated tests failed RED before the fix)

  • tests/analyze.test.ts: a hostile competitor name (pwn `whoami` $(id) and it's\nmultiline) must emit an inert, single-quoted drill command byte-for-byte; the existing gap test's expectation deliberately updated to --q 'Zzyzx'.
  • tests/orchestrate.test.ts: a brief idea carrying backticks + a newline must render as ONE intact inline-code span in researcher.md; both worklist-driven contracts must carry the stale-id sentence.
  • Golden snapshot updated only for the deliberate changes (single-quoted drill commands in the research workflow BATCHES, stale-id sentence in claim-reviewer.md).

Suite: 465 tests green · typecheck · lint · check:build (bundle reproducibility) all pass.

🤖 Generated with Claude Code

…ine-code span

Review findings from the family round (both P2):

- analyze's drill() embedded brief free-text into a copy-paste / subagent-
  executed shell line with only "->' sanitization — backticks and $() in a
  brief field survived into `--q "<query>"` (and orchestrate amplifies these
  lines into research.workflow.mjs prompts). Queries are now single-quoted
  (the only shell-inert quoting), an embedded ' is escaped as '"'"' and
  newlines flatten to a space.
- the researcher contract interpolated the brief idea into a Markdown
  inline-code span verbatim — an interior backtick closed the span early.
  Backticks are stripped to apostrophes and newlines flattened before the
  span is built.
- Family stale-id rule added to the worklist-driven fan-out contracts:
  claim-reviewer (if a PAIRS key is no longer in the worklist, skip it and
  say so in your note) and builder (same for a TASK id, in the summary).

Golden snapshot updated only for the deliberate changes: single-quoted drill
commands in the research workflow BATCHES and the stale-id sentence in
claim-reviewer.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@maxgfr
maxgfr merged commit 087805a into main Jul 9, 2026
4 checks passed
@maxgfr
maxgfr deleted the fix/orchestrate-review branch July 9, 2026 18:58
github-actions Bot pushed a commit that referenced this pull request Jul 9, 2026
## [1.11.1](v1.11.0...v1.11.1) (2026-07-09)

### Bug Fixes

* **orchestrate:** shell-quote drill queries + sanitize the idea's inline-code span ([#13](#13)) ([087805a](087805a))
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.11.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant