Skip to content

fix: mark generated MCP swarms as read-only analysis#12

Closed
kbentonferguson wants to merge 1 commit into
professorpalmer:mainfrom
kbentonferguson:bferguson/read-only-generated-swarms
Closed

fix: mark generated MCP swarms as read-only analysis#12
kbentonferguson wants to merge 1 commit into
professorpalmer:mainfrom
kbentonferguson:bferguson/read-only-generated-swarms

Conversation

@kbentonferguson

Copy link
Copy Markdown
Contributor

Summary

  • mark generated MCP swarm workers as read-only analysis tasks
  • carry existing no-edit fields through generated swarm config: read_only, sandbox: "read-only", and dangerously_bypass_approvals_and_sandbox: false
  • add regression coverage proving generated analysis swarms remain read-only even if routed to Codex
  • preserve dirty-tree blocking for edit/implement paths

Why

Generated MCP swarms are analysis workers: they are prompted to emit structured artifacts and not modify files. When auto-routing selects an edit-capable adapter like Codex, that analysis intent needs to survive in the task payload so the adapter uses its existing read-only path.

Without this, a review/audit swarm over an intentionally dirty diff can be treated like a full-edit run and blocked by the clean-tree guard, even though the dirty diff is the input being reviewed rather than an output Puppetmaster needs to attribute.

This keeps the boundary explicit: analysis swarms can review dirty diffs read-only, while implement/edit workers still require a clean tree unless explicitly allowed.

Tests

  • python3 -m pytest tests/test_puppetmaster.py -q -k 'generated_swarm_codex_read_only or mcp_swarm_config_writer or codex_read_only or dirty_worktree or swarm_mode'
  • env -u CODEX_COMMAND -u CODEX_CI -u CODEX_HOME -u CODEX_PATH -u CODEX_THREAD_ID python3 -m pytest tests/test_puppetmaster.py -q
  • git diff --check

…ing handles dirty diff reviews safely. Comprehensive tests for read-only routing and swarm config.
@kbentonferguson kbentonferguson force-pushed the bferguson/read-only-generated-swarms branch from df4ac14 to 2aa2836 Compare June 16, 2026 16:43
@professorpalmer

Copy link
Copy Markdown
Owner

Integrated into main via cherry-pick 9eb22ee (authorship preserved). Validated end-to-end: full suite green, swarm_mode classification confirmed to keep edit/implement paths gated. Thanks @kbentonferguson.

professorpalmer added a commit that referenced this pull request Jun 17, 2026
…rms, heartbeat throttle, compact status, cross-project dashboard)

Five external contributions reviewed end-to-end, integrated with authorship
preserved, and hardened with follow-up fixes/tests:

- #10 (@kbentonferguson): explicit, secret-safe Codex MCP credential
  inheritance (--env/--inherit-env/--env-file/--map-env/--force-env), managed
  0600 wrapper for secrets, $CODEX_HOME/auth.json billing, doctor --json.
  Follow-up: decoupled Codex availability from billing health so an
  OPENAI_API_KEY-only setup is never demoted (non-regressive + regression test).
- #11/#12 (@kbentonferguson): generated MCP swarms carry read_only/sandbox so
  Codex-routed analysis reviews dirty diffs without tripping the clean-tree
  guard; edit/implement paths still require a clean tree.
- #11 (@kbentonferguson): worker heartbeat throttled off the 0.1s poll loop
  (cap lease/3 keeps >=3 renewals/lease); inline workers scope
  PUPPETMASTER_STATE_DIR to the store root.
- #13 (@kbentonferguson): status --compact + MCP compact arg replace prompt
  bodies with chars+sha256 refs (97.4% reduction measured); default unchanged.
- #14 (@jwellman80): dashboard --all-projects aggregates every project state
  dir with traversal guard intact. Follow-ups: added the missing aggregation
  test and wired --all-projects through the MCP puppetmaster_dashboard tool.

Full suite 702 green (+19 tests).
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.

2 participants