Skip to content

fix(pipelines): add preflight tool validation and TodoWrite avoidance#202

Merged
nextlevelshit merged 11 commits intomainfrom
fix/preflight-and-todowrite
Mar 1, 2026
Merged

fix(pipelines): add preflight tool validation and TodoWrite avoidance#202
nextlevelshit merged 11 commits intomainfrom
fix/preflight-and-todowrite

Conversation

@nextlevelshit
Copy link
Collaborator

Summary

  • Preflight tool validation: Added requires.tools to all 22 platform pipelines so preflight catches missing CLIs (gh, glab, tea, bb) before execution starts — prevents personas from wasting tool calls searching for binaries
  • TodoWrite avoidance: Added soft instruction to base-protocol.md to avoid TodoWrite for progress tracking (hard denial via settings.json is ineffective under --dangerously-skip-permissions)

Follows up on PR #200 which only included the wave-land branch workflow fix.

Test plan

  • go test -race ./... passes
  • Preflight validation proven: wave run gh-implement without gh on PATH fails with clear error and recovery instructions
  • Run a pipeline and verify TodoWrite usage is reduced after base-protocol instruction

…lidation

Preflight now checks that gh is on PATH before running GitHub pipelines,
preventing personas from wasting tool calls searching for the binary.
…lidation

Preflight now checks that glab is on PATH before running GitLab pipelines.
…lidation

Preflight now checks that tea is on PATH before running Gitea pipelines.
…lidation

Preflight now checks that bb is on PATH before running Bitbucket pipelines.
Soft instruction to avoid TodoWrite for internal progress tracking,
which wastes ~500 tokens per step with no benefit to pipeline output.
Hard denial via settings.json is not possible while using
--dangerously-skip-permissions.
Replace all Bash(bb ...) tool permissions with Bash(curl ...) and
Bash(jq *) for Bitbucket Cloud REST API access. Analyst is read-only
(only curl -s* allowed), enhancer can PUT, scoper can POST+PUT,
commenter has full curl access for comments and PR creation.
Replace all bb CLI command examples with curl+jq calls against the
Bitbucket Cloud REST API v2.0. Document $BB_TOKEN requirement,
correct field mappings (content.raw not body, kind not labels),
and temp file pattern for JSON payloads.
Replace all bb CLI calls in inline pipeline prompts with curl+jq
against Bitbucket Cloud REST API v2.0. Update requires.tools from
bb to curl+jq. Fix bb-scope verify-report step to respect
bitbucket-analyst read-only permissions.
Replace bb issue view with curl GET + jq in fetch-assess.md.
Replace bb pr create/edit with curl POST/PUT in create-pr.md.
Add $BB_TOKEN auth header and temp file payload pattern.
The bb CLI no longer exists — Bitbucket personas now use curl+jq.
Remove the dead Bash(bb *) deny entries from all GitHub, GitLab,
and Gitea persona configs.
Document that perl -pi -e 'next if /pattern/' does NOT delete lines
(next skips but -p still prints). Use perl -ni -e 'print unless
/pattern/' to actually remove lines.
@nextlevelshit nextlevelshit merged commit 1b1da6f into main Mar 1, 2026
3 checks passed
@nextlevelshit nextlevelshit deleted the fix/preflight-and-todowrite branch March 1, 2026 19:19
nextlevelshit added a commit that referenced this pull request Mar 2, 2026
…e JSON validation

Fixes three systematic issues observed in headless Claude Code runs:

1. Write/Edit tools don't exist in headless Claude Code CLI (-p mode).
   Personas tried Write, got rejected, wasted a turn falling back to
   Bash. Now normalizeAllowedTools strips Write/Edit entries entirely
   from both --allowedTools args and settings.json.

2. validateAndCorrectOutput ran on the persona's text response (markdown)
   instead of the actual JSON artifact file, producing false "[DEBUG]
   Output validation/correction failed" warnings every step. Removed —
   the contract validator already validates the artifact file on disk.

3. TodoWrite wasted turns despite base protocol saying "Do not use
   TodoWrite". Now passed via --disallowedTools to block it at CLI level.

Continuation of fix/preflight-and-todowrite (PR #202) which addressed
the preflight side of these issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant