dobby-subagent-mcp 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. dobby_subagent_mcp-0.2.0/AGENTS.md +124 -0
  2. dobby_subagent_mcp-0.2.0/CHANGELOG.md +104 -0
  3. dobby_subagent_mcp-0.2.0/LICENSE +21 -0
  4. dobby_subagent_mcp-0.2.0/PKG-INFO +361 -0
  5. dobby_subagent_mcp-0.2.0/README.md +332 -0
  6. dobby_subagent_mcp-0.2.0/pyproject.toml +90 -0
  7. dobby_subagent_mcp-0.2.0/pyproject.toml.orig +84 -0
  8. dobby_subagent_mcp-0.2.0/scripts/check_release_tag.py +45 -0
  9. dobby_subagent_mcp-0.2.0/scripts/mutation_baseline.json +306 -0
  10. dobby_subagent_mcp-0.2.0/scripts/mutation_test.py +1128 -0
  11. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/__init__.py +4 -0
  12. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/__main__.py +5 -0
  13. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/_version.py +24 -0
  14. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/acp_events.py +95 -0
  15. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/codex_agents/review-architecture.toml +34 -0
  16. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/codex_agents/review-correctness.toml +35 -0
  17. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/codex_agents/review-generalist.toml +26 -0
  18. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/codex_agents/review-performance.toml +34 -0
  19. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/codex_agents/review-regression.toml +33 -0
  20. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/codex_agents/review-security.toml +34 -0
  21. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/codex_agents/review-ux.toml +28 -0
  22. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/prompts/brainstorm.md +36 -0
  23. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/prompts/build.md +16 -0
  24. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/prompts/plan.md +17 -0
  25. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/prompts/research.md +20 -0
  26. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/prompts/reverse_engineer-helper.md +2 -0
  27. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/prompts/reverse_engineer-no-helper.md +1 -0
  28. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/prompts/reverse_engineer.md +38 -0
  29. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/prompts/review-single.md +40 -0
  30. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/prompts/review.md +47 -0
  31. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/prompts/shared.md +68 -0
  32. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/prompts/validate.md +16 -0
  33. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/assets/schemas/worker-output.schema.json +79 -0
  34. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/__init__.py +0 -0
  35. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/base.py +151 -0
  36. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/codex/__init__.py +1 -0
  37. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/codex/command.py +683 -0
  38. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/codex/diagnostics.py +327 -0
  39. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/codex/events.py +251 -0
  40. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/codex/rollouts.py +1242 -0
  41. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/codex/runtime.py +625 -0
  42. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/codex/worker.py +332 -0
  43. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/gemini/__init__.py +1 -0
  44. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/gemini/command.py +405 -0
  45. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/gemini/events.py +103 -0
  46. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/gemini/results.py +109 -0
  47. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/gemini/review.py +744 -0
  48. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/gemini/runtime.py +193 -0
  49. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/backends/gemini/worker.py +164 -0
  50. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/background_runs.py +729 -0
  51. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/binaries.py +76 -0
  52. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/catalog.py +343 -0
  53. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/collections_util.py +13 -0
  54. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/errors.py +15 -0
  55. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/finalize.py +420 -0
  56. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/fsutil.py +114 -0
  57. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/git_commands.py +369 -0
  58. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/gitignore.py +139 -0
  59. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/jsonl.py +100 -0
  60. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/logging_utils.py +39 -0
  61. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/models.py +521 -0
  62. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/ownership.py +524 -0
  63. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/paths.py +705 -0
  64. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/process.py +301 -0
  65. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/prompts.py +385 -0
  66. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/protected_paths.py +121 -0
  67. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/repo_state.py +802 -0
  68. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/result_contract.py +95 -0
  69. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/reverse_engineer_details.py +175 -0
  70. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/review_agents.py +85 -0
  71. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/review_common.py +164 -0
  72. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/runner.py +1451 -0
  73. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/safeguards.py +92 -0
  74. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/server.py +984 -0
  75. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/shutdown.py +203 -0
  76. dobby_subagent_mcp-0.2.0/src/dobby_subagent_mcp/snapshot_worker.py +35 -0
  77. dobby_subagent_mcp-0.2.0/tests/conftest.py +280 -0
  78. dobby_subagent_mcp-0.2.0/tests/fake_process.py +67 -0
  79. dobby_subagent_mcp-0.2.0/tests/fixtures/codex-0.169-project-trust-stderr.txt +1 -0
  80. dobby_subagent_mcp-0.2.0/tests/fixtures/codex-0.171-exec-jsonl/PROVENANCE.md +25 -0
  81. dobby_subagent_mcp-0.2.0/tests/fixtures/codex-0.171-exec-jsonl/events.jsonl +28 -0
  82. dobby_subagent_mcp-0.2.0/tests/fixtures/codex-0.171-v2-review/README.md +60 -0
  83. dobby_subagent_mcp-0.2.0/tests/fixtures/codex-0.171-v2-review/expected_spawn_messages.json +4 -0
  84. dobby_subagent_mcp-0.2.0/tests/fixtures/codex-0.171-v2-review/sessions/2026/12/04/rollout-2026-12-04T01-26-02-01a23fbb-30f2-7521-92ee-7886ceb2d80f.jsonl +51 -0
  85. dobby_subagent_mcp-0.2.0/tests/fixtures/codex-0.171-v2-review/sessions/2026/12/04/rollout-2026-12-04T01-26-20-01a23fbb-7a8e-7ec3-ab6c-b1e7d8e66af9.jsonl +37 -0
  86. dobby_subagent_mcp-0.2.0/tests/fixtures/codex-0.171-v2-review/sessions/2026/12/04/rollout-2026-12-04T01-26-37-01a23fbb-bc63-7543-94c1-c390e3e90b25.jsonl +32 -0
  87. dobby_subagent_mcp-0.2.0/tests/fixtures/stop_fake_worker.py +152 -0
  88. dobby_subagent_mcp-0.2.0/tests/fixtures/stop_server.py +37 -0
  89. dobby_subagent_mcp-0.2.0/tests/stop_harness.py +228 -0
  90. dobby_subagent_mcp-0.2.0/tests/test_acp_events.py +220 -0
  91. dobby_subagent_mcp-0.2.0/tests/test_background_runs.py +1477 -0
  92. dobby_subagent_mcp-0.2.0/tests/test_catalog.py +606 -0
  93. dobby_subagent_mcp-0.2.0/tests/test_codex_cli.py +1788 -0
  94. dobby_subagent_mcp-0.2.0/tests/test_codex_review_evidence.py +750 -0
  95. dobby_subagent_mcp-0.2.0/tests/test_codex_runtime_layout.py +1054 -0
  96. dobby_subagent_mcp-0.2.0/tests/test_codex_v2_compatibility.py +1033 -0
  97. dobby_subagent_mcp-0.2.0/tests/test_diagnostics_invariants.py +416 -0
  98. dobby_subagent_mcp-0.2.0/tests/test_event_mapping.py +385 -0
  99. dobby_subagent_mcp-0.2.0/tests/test_file_diff_capture.py +639 -0
  100. dobby_subagent_mcp-0.2.0/tests/test_finalize.py +549 -0
  101. dobby_subagent_mcp-0.2.0/tests/test_gemini_backend.py +3565 -0
  102. dobby_subagent_mcp-0.2.0/tests/test_gemini_review.py +1225 -0
  103. dobby_subagent_mcp-0.2.0/tests/test_git_hardening.py +890 -0
  104. dobby_subagent_mcp-0.2.0/tests/test_gitignore.py +359 -0
  105. dobby_subagent_mcp-0.2.0/tests/test_live_codex_build.py +475 -0
  106. dobby_subagent_mcp-0.2.0/tests/test_live_codex_flags.py +96 -0
  107. dobby_subagent_mcp-0.2.0/tests/test_live_codex_v2.py +56 -0
  108. dobby_subagent_mcp-0.2.0/tests/test_live_gemini.py +205 -0
  109. dobby_subagent_mcp-0.2.0/tests/test_mutation_tool.py +334 -0
  110. dobby_subagent_mcp-0.2.0/tests/test_packaging.py +89 -0
  111. dobby_subagent_mcp-0.2.0/tests/test_paths.py +375 -0
  112. dobby_subagent_mcp-0.2.0/tests/test_private_runtime.py +209 -0
  113. dobby_subagent_mcp-0.2.0/tests/test_process_groups.py +666 -0
  114. dobby_subagent_mcp-0.2.0/tests/test_prompt_loading.py +557 -0
  115. dobby_subagent_mcp-0.2.0/tests/test_protected_paths.py +628 -0
  116. dobby_subagent_mcp-0.2.0/tests/test_recursion_guard.py +126 -0
  117. dobby_subagent_mcp-0.2.0/tests/test_release.py +41 -0
  118. dobby_subagent_mcp-0.2.0/tests/test_review_agents.py +42 -0
  119. dobby_subagent_mcp-0.2.0/tests/test_rollout_parsing_guards.py +247 -0
  120. dobby_subagent_mcp-0.2.0/tests/test_run_artifact_safety.py +808 -0
  121. dobby_subagent_mcp-0.2.0/tests/test_run_registry.py +395 -0
  122. dobby_subagent_mcp-0.2.0/tests/test_runner_schema.py +7373 -0
  123. dobby_subagent_mcp-0.2.0/tests/test_runtime_sweep.py +1008 -0
  124. dobby_subagent_mcp-0.2.0/tests/test_salvage_and_traces.py +113 -0
  125. dobby_subagent_mcp-0.2.0/tests/test_server.py +743 -0
  126. dobby_subagent_mcp-0.2.0/tests/test_server_handlers.py +497 -0
  127. dobby_subagent_mcp-0.2.0/tests/test_shutdown_signals.py +883 -0
  128. dobby_subagent_mcp-0.2.0/tests/test_snapshot_worker.py +201 -0
  129. dobby_subagent_mcp-0.2.0/tests/test_stop_reason_and_diffs.py +591 -0
  130. dobby_subagent_mcp-0.2.0/tests/test_streaming_progress.py +1298 -0
  131. dobby_subagent_mcp-0.2.0/tests/test_subprocess_cancellation.py +270 -0
  132. dobby_subagent_mcp-0.2.0/tests/test_verification_invariants.py +868 -0
@@ -0,0 +1,124 @@
1
+ # Repository and Dobby usage guidance
2
+
3
+ ## Working on this repository
4
+
5
+ - Use `uv` for dependency management and run Python commands through `uv run`.
6
+ - Preserve unrelated worktree changes. The repository may intentionally be dirty while Dobby reviews it.
7
+ - Run the focused tests for changed code, then `uv run pytest` before handing off a runtime change.
8
+ - Keep `README.md`, `llms.txt`, MCP tool and parameter descriptions, schemas, prompts, and tests synchronized when changing a public request or response contract.
9
+ - Invalid-repository tests must use a guaranteed missing or invalid path: mutation runs place pytest's temporary directory inside a real git worktree, so `tmp_path` alone may be a valid repository and launch a worker.
10
+ - Stop and sweep tests run the real stdio server through `tests/stop_harness.py` with the fake workers in `tests/fixtures/stop_fake_worker.py`. They must keep HOME, TMPDIR, CODEX_HOME and the private runtime base inside pytest's temporary tree, and kill every process group they start, never their own: a worker that lost its session reports pytest's group, which `kill_group_quietly` refuses.
11
+ - Before every Codex run the worker runs `codex --version`, `codex login status` and `codex mcp list --json`. An autouse fixture in `tests/conftest.py` replaces the worker's `ensure_codex_ready` and `list_codex_mcp_servers` outside `live` tests; a test of either probe calls it from `backends/codex/runtime.py` or puts it back on the worker. The stop fake answers all three.
12
+ - Protected-path detection (`repo_state._protected_paths`) runs in the snapshot helper before and after every run, for every tool. It lists directories only through `O_DIRECTORY|O_NOFOLLOW|O_NONBLOCK` descriptors and otherwise only `lstat`s: it never reads a file or follows a link. Keep `.dobby` out of it, since Dobby writes the run's own records there. Both snapshots pass the backend's `write_roots(spec, runtime)` as `protected_roots` and `temp_roots` (Codex adds the user's own `[sandbox_workspace_write]` roots, and `/tmp` unless `exclude_slash_tmp`; inside a temp root only git's code paths are compared), so a test fake of `_capture_repo_snapshot_with_deadline` must accept both keywords. Tests run with `command.SLASH_TMP` pointed at a test-owned directory (`conftest._contained_slash_tmp`), since pytest's temp tree is under `/tmp` on Linux. A change fails a mutating run without `danger`; a `danger` or read-only run only warns, because a read-only worker can write none of these paths.
13
+ - git's hooks directories, template directories and config files (`git_commands.git_code_paths`: the effective hooks directory plus every `core.hooksPath` value in any file it visits, every `init.templateDir` and `GIT_TEMPLATE_DIR`, every file git reads, every `include.path`/`includeIf.*.path` target whether its condition holds or not, command-line and `GIT_CONFIG_COUNT`/`GIT_CONFIG_PARAMETERS` includes too, the global config locations), every other worktree's `.git` entry and code paths (`protected_paths.git_paths` over `git_commands.git_worktrees`; a relative hooks path resolves against each worktree's top level), and where any protected path leads through a symlink (`protected_paths.resolved_target`, `os.path.realpath`: `lstat` and `readlink` only) are protected wherever a writable root holds them, by the Codex profile, the Gemini rules and detection alike, all through `protected_paths`. Detection compares a worktree's `.git` as an entry only: a main worktree's is its whole git directory. A hooks or template path that holds a whole writable root refuses a Codex or Gemini launch, and more than `GIT_UNREAD_INCLUDE_MAX_FILES` include targets git does not read refuse every run, read-only included, because detection runs the same lookup.
14
+ - Every git command Dobby runs itself goes through `git_commands.git_argv`, which adds `--no-optional-locks -c core.fsmonitor=false -c core.hooksPath=/dev/null`; `git show` also takes `--no-textconv`, and `git status` takes `--ignore-submodules=dirty` so it never runs git inside a submodule whose `.git` file a worker could have redirected, plus `GIT_ATTR_SOURCE` set to the empty tree so a worker-written `.gitattributes` cannot assign it a filter. The one exception is `git_commands.git_config_lookup_argv`, which leaves out only `core.hooksPath=/dev/null` so `git rev-parse --git-path hooks` reports the user's real hooks directory; use it only for `rev-parse` and `config` reads, which run no hook, always with a timeout, and without `GIT_CONFIG` in the environment, which would make `git config` read only that file.
15
+ - Never start Python with the target repository as its working directory or on `sys.path`: a worker can write modules there. The snapshot helper runs `python -I` from `/`.
16
+ - A completed `Process.wait()` does not mean a worker's pipes closed: since CPython gh-119710 (3.13.16 and 3.14.8 have it, 3.12 never will) it returns at exit while a descendant may still hold them. `runner._exited_with_pipes_at_eof` waits for the stdout and stderr pumps to reach EOF as well. The local environment runs 3.12, so check process-handling changes on the newest 3.13 and 3.14 too (`UV_PROJECT_ENVIRONMENT=<scratch venv> uv run --python 3.14 pytest ...`); CI runs all three.
17
+ - Both providers share one private runtime base (`paths.private_runtime_base()`). It must stay outside system temp directories, runtimes are never adopted, and cleanup must never follow the keychain symlink.
18
+ - Config a worker can write, such as the repository's `.codex/config.toml`, never widens a sandbox: writable roots and other grants come only from the user's own config. Read every config file Dobby parses through `paths.read_user_config` (follows a link to the user's own file) or `paths.read_repo_codex_config` (follows no link), both built on `fsutil.read_regular_file` with `CONFIG_MAX_BYTES`. Never `read_text` a file a worker could have replaced with a FIFO; a test that could block on one goes through `conftest.call_unless_blocked`.
19
+
20
+ ## Mutation testing
21
+
22
+ The suite's strength is scored by `scripts/mutation_test.py`: it flips one
23
+ executed comparison, boolean operator, `not`, or bool constant at a time, and
24
+ some test must fail. Each mutant first runs only the test files that execute
25
+ its statement, then the whole suite if they all pass, so every test file must
26
+ pass when run on its own. The recorded full-sweep baseline lives in
27
+ `scripts/mutation_baseline.json`; survivors listed there are expected, and the
28
+ subset proven semantically unkillable is documented in TODO.md under
29
+ "Known-equivalent mutants". Both tools snapshot the exact working tree —
30
+ uncommitted changes included — into throwaway git worktrees and never modify
31
+ the real checkout.
32
+
33
+ - One-time setup: `uv sync --group mutation` (adds `coverage`).
34
+ - Changed lines only, what CI runs on every pull request:
35
+ `uv run python scripts/mutation_test.py sweep --since origin/main --check`
36
+ - Full sweep (about 1,700 mutants and a little over two hours with eight
37
+ workers; CI repeats it weekly via `mutation-sweep.yml`, split into six
38
+ `--shard K/6` jobs): `uv run python scripts/mutation_test.py sweep --check`
39
+ - Refresh the recorded baseline after a full sweep — never from a `--since`
40
+ run: `uv run python scripts/mutation_test.py sweep --update-baseline`
41
+ - Prove that named tests kill hand-written mutations:
42
+ `uv run python scripts/mutation_test.py verify spec.json tests/test_file.py`,
43
+ where `spec.json` is a JSON list of `{"file", "line", "new", "label"}`
44
+ objects (file is a path relative to `src/dobby_subagent_mcp`).
45
+
46
+ Tests must hold under load: a sweep runs eight suites at once, and a test that
47
+ fails only because the machine is slow scores as a kill for whatever mutant was
48
+ applied, hiding real survivors. A timing-dependent test should treat a missed
49
+ window as inconclusive and retry with a longer one, as
50
+ `tests/test_subprocess_cancellation.py` does. A grandchild killed with its
51
+ group can still answer `kill(pid, 0)` for a moment after a run returns, until
52
+ launchd or init reaps it (macOS's `killpg(pgid, 0)` already fails with EPERM
53
+ for a group whose last member is exiting): poll for it to go, as both files'
54
+ `_assert_gone` do, rather than check once.
55
+
56
+ A new survivor on lines you changed fails the CI lane: add a test that kills
57
+ it, or — only if the mutant is provably equivalent — add the proof to TODO.md
58
+ and refresh the baseline in the same change. Baseline matching keys on the
59
+ survivor's source-line text, not its line number, so refactors that move
60
+ known-weak lines do not fail the lane, while edits that rewrite one do.
61
+
62
+ ## Calling the Dobby MCP tools
63
+
64
+ - Call the `dobby` MCP tool directly; do not wrap it in another generic Agent/Task subagent.
65
+ - Every worker call and `start_run` must name `provider` (`codex` or `gemini`) and `model`; neither has a default. `list_models` returns the live options; it accepts an optional `repo_root` and ignores it.
66
+ - Every other call, including `get_run`, `wait_run`, `list_runs` and `cancel_run`, requires the absolute path of the current git worktree's top level as `repo_root`; a subdirectory is rejected. Dobby intentionally does not infer a repository from its server cwd.
67
+ - Give one concrete outcome per call and pass focused `files` when known.
68
+ - Do not lower worker timeouts. Use the tool default, and use `timeout_seconds=1200` for multi-agent review.
69
+ - A review with zero or one effective lens is direct. Pass two or more canonical lens values—`generalist`, `security`, `performance`, `architecture`, `correctness`, `ux`, or `regression`—for multi-agent fan-out (Codex multi-agent v2 or Gemini `agy` subagents).
70
+ - Pass `danger=true` only to `build` or `reverse_engineer` with `provider="codex"`; everything else rejects it.
71
+ - For long work, prefer `start_run`, wait for its response, then pass the returned `task_id` to `wait_run` or `get_run`. Never launch `start_run` and its lookup concurrently.
72
+ - Re-call `wait_run(task_ids=...)` with the returned `pending_task_ids` until it is empty. There is no `pending_task_ids` parameter; passing one is rejected. Use `get_run` or `list_runs` for non-blocking status checks or task-id recovery.
73
+ - Stop a background run with `cancel_run(repo_root, task_id)`; it returns the `get_run` shape with `stop_reason: cancelled`. A placeholder `result.json` means only that a server died without cleaning up; the next server start sweeps that run's runtime.
74
+ - Each role keeps only the MCP servers in `safeguards.TOOL_MCP_SERVERS`, for both providers: fetchaller for plan, research, brainstorm and build; fetchaller and Ghidra for reverse_engineer; none for validate and review. Every other configured server is turned off, because MCP servers run outside the sandbox. For Codex that includes servers from `/etc/codex/config.toml`, a managed profile or a cloud-managed config, and Codex also turns off the `apps` and `plugins` connectors for every role. Do not instruct review workers to use fetchaller, Ghidra, or another MCP integration.
75
+
76
+ ## Multi-agent review evidence (both providers)
77
+
78
+ - Treat multi-agent `manifest_validated: true` as an integrity signal only when `review_details.execution_evidence` is `codex_session_rollouts` or `agy_transcripts`; use `coverage_complete` and the four agent counts to judge coverage.
79
+ - The parent reports no manifest and no findings that count. Dobby builds `review_details.execution_manifest` from the verified evidence, strips each child's attestation, and reconstructs caller-visible findings from verified child payloads rather than trusting parent synthesis.
80
+ - A child marked `blocked` is not usable review coverage. Partial success requires at least one independently delivered `completed` or `partial` child result.
81
+ - Evidence deviations are split by what they prove, for both providers. Coverage loss marks that lens `failed`, excludes its findings, and still returns the other lenses' verified findings as partial success. An integrity failure excludes that lens entirely — no findings, no summary — and sets `manifest_validated: false` with `status: error`, but the lenses that passed still return their independently verified findings. Only a global evidence failure quarantines the whole review and returns nothing. The provider sections below list which deviation is which.
82
+ - A lens whose evidence failed contributes no caller-visible text at all, not merely no findings. Its `review_details` entry carries a neutral placeholder summary.
83
+ - Each lens's canonical assignment is delivered out of band: Dobby writes a per-run agent definition into the child's private runtime with the assignment inlined, and the child treats that as authoritative over anything a task payload claims, reporting a conflicting payload assignment in `warnings`. The attested SHA-256 is a consistency check layered on top; alone it would only prove the child saw the assignment identity, because the parent holds the same digest. An orchestrated review fails closed if any selected lens has no assignment or the private agent directory is missing.
84
+
85
+ ## Codex rules
86
+
87
+ - Every Codex run requires `codex-cli 0.169.0` or newer (`MINIMUM_CODEX_VERSION`). Dobby checks `codex --version` from the run's private scratch directory before launching, and explicitly enables `multi_agent_v2` for multi-agent review. The rollout parser accepts only the 0.164+ v2 child-session shape. The authenticated live baseline is `codex-cli 0.174.0` (verified 2026-12-04).
88
+ - Codex credentials must be file-based or `CODEX_API_KEY`: keyring credentials are keyed by the `CODEX_HOME` path, which the private per-run home does not share. Before launch, `codex login status` runs from the private scratch directory with the child's environment, bounded by the run deadline, and a failure stops the run with the credential-store explanation. It catches a keyring, `auto` or `ephemeral` store set by any config layer, `requirements.toml` or a managed profile. It is skipped for `CODEX_API_KEY` and for a model provider that does not use Codex's sign-in (a built-in other than `openai`, or a custom provider without `requires_openai_auth = true`).
89
+ - Mutating runs without `danger` use a per-run permission profile, `dobby_<task id>`, which extends `:workspace` and keeps `_PROTECTED_WORKSPACE_ENTRIES` (`.dobby`, `.claude`, `.gemini`, `.mcp.json`, `.codex`, `.git`, `.agents`, `.aws`) read-only in the repository and every writable root, plus other worktrees' `.git` entries and git's hooks directories, template directories and config files as absolute `"<path>"="read"` entries, found inside the workspace roots and the `/tmp` `:workspace` grants as `:slash_tmp` (`command.SLASH_TMP`; `:tmpdir` is the run's `TMPDIR`, inside the scratch root). The profile's filesystem table is one inline-table `-c` value, because `-c` splits keys on dots without honouring quotes; Codex itself carves a read entry, and where it resolves through a symlink, out of every writable root and out of `:slash_tmp` (verified with `codex sandbox -P` on 0.171 and 0.174). Never pass `-s` to them: any `-s` selects Codex's legacy sandbox, which ignores profiles. Read-only tools keep `-s read-only`; `danger=true` keeps `danger-full-access`. Only the user's own `[sandbox_workspace_write]` grants carry into the profile (`writable_roots` as `--add-dir`, `network_access`, `exclude_slash_tmp`), never the repository's.
90
+ - Codex reads the output schema from a private `0600` copy in the run's runtime, never from the run record in `.dobby/runs/`.
91
+ - Multi-agent review pins every key in `command._MULTI_AGENT_V2_PINS` after `features.multi_agent_v2=true`, so a user or project `[features.multi_agent_v2]` table cannot change the parent's tools: they are exactly `spawn_agent`, `list_agents`, `wait_agent` and `interrupt_agent`, with no model overrides on spawn. Pin only keys that exist in 0.169's `MultiAgentV2ConfigToml`, which rejects unknown fields; a later key would stop 0.169 from starting.
92
+ - MCP servers are turned off with one `-c mcp_servers={...}` inline table that repeats each server's own `command` or `url`. Codex's `-c` splits keys on every dot, so per-server dotted keys break on a name with a dot or a space. The servers come from the user's config, the repository's `.codex/config.toml`, and `codex mcp list --json` run before launch (`runtime.list_codex_mcp_servers`), which sees every other layer. A listing that fails or cannot be parsed stops the run before launch; never launch with servers Dobby could not see.
93
+ - `sandbox_violations` lists failed `file_change` items as well as declined commands and denial lines in failed commands' output. A patch Codex's own path check rejects, and a shell command it reports as sandbox-denied at launch, emit no item in the `--json` stream, so they are not listed.
94
+ - Codex 0.169 requires explicit project trust to load project-local configuration and MCP servers, including in sandboxed `codex exec` runs. Save intended trust in the normal parent Codex configuration before invoking Dobby; child runtimes are temporary. Surface the CLI trust diagnostic in response warnings without automatically granting trust or turning an otherwise successful run into an error.
95
+ - Codex review evidence: Dobby validates root v2 mode, each exact custom-role/task/fork spawn, the single encrypted spawn message (it must have the Fernet token structure codex-cli 0.171 persists), the correlated child's SHA-256 assignment attestation, child thread identity, no child collaboration calls, no root collaboration call outside the allowlist `spawn_agent`/`list_agents`/`wait_agent`/`interrupt_agent` (so no parent `send_message` or `followup_task` to a child), one strict read-only terminal JSON result, and the identical completed payload observed by the parent. Each child is correlated through its start record, either an `item_completed` `SubAgentActivity` item or the legacy `sub_agent_activity` event, and its v2 spawn output. It caps spawned threads at the selected lenses with `agents.max_concurrent_threads_per_session`, and pins `features.multi_agent_v2.max_concurrent_threads_per_session` to the lenses plus one for the parent.
96
+ - Codex coverage loss: a lens never spawned, no child session (including a start record with no child session, as when the run ends before the child's rollout is written), no terminal event, or a payload that failed its assignment attestation.
97
+ - Codex integrity failure: duplicate spawns, starts, sessions, terminal events, or deliveries; a start whose thread id contradicts the lens's existing child session; the wrong custom role; a child mode other than verified `v2`; a mismatched v2 spawn output or any child collaboration call; a spawn with the wrong `agent_type`, a `fork_turns` other than `none`, mismatched fields, a message that is neither Fernet-shaped nor its canonical assignment, or an unexpected encrypted argument shape; a root `send_message` or `followup_task` whose `target` names a selected lens by its relative or canonical task name or its thread id (from the child session or start record); or a child reporting file changes. A duplicate spawn or start of a *selected* lens is that lens's integrity failure, not a global one.
98
+ - Codex global failure: an unexpected or nested child session, a session in the run's private runtime that cannot be identified as the root or an expected child, a rollout file with no readable session metadata, a spawn of a task Dobby never selected or whose arguments are unparseable, a start record for a task Dobby never selected, a root `send_message` or `followup_task` with no parseable string `target` or a target no selected lens accounts for, any other root call in the `collaboration` namespace outside the allowlist, a root that never proved v2 mode, or unreadable rollouts. A root reporting multi-agent `v3`, which codex-cli 0.174 can choose from the model catalog, is a global failure with its own message telling the caller to pick a model whose catalog entry uses v2.
99
+
100
+ ## Gemini rules
101
+
102
+ - Never make the target repository `agy`'s working directory or pass it to `--add-dir`: workspace MCP servers start outside the sandbox even when untrusted.
103
+ - Never use `--dangerously-skip-permissions`. Access comes only from the per-run permission rules.
104
+ - Keep the system temp roots denied, git metadata, `.dobby/` and `AGENT_CONFIG_NAMES` (`.codex`, `.agents`, `.claude`, `.gemini`, `.mcp.json`) write-denied for mutating runs (in the repository and every writable root, whether or not they exist), caches per run, and credential-looking variables out of `agy`'s environment. A later Codex, Claude Code or Gemini CLI run starts what a planted config names outside any sandbox.
105
+ - `agy`'s file tools match permission rules case-sensitively and without globs, while macOS volumes usually are not case-sensitive, so each protected path below a write-allowed root is denied in every spelling: each letter in either case, plus every single code point APFS treats as ASCII text (`_FOLDED_SPELLINGS`: `ſ`, the Kelvin sign, `ß`/`ẞ`, the ligatures `ff fi fl ffi ffl ſt st`, U+037E and U+1FEF), in every mix (488 rules per root). A probe on macOS 26 found exactly these by creating `x<t>x` for every printable ASCII character, every two- and three-letter sequence and the empty string, then `lstat`ing `x<c>x` for each of the 154,935 assigned code points and matching inodes; repeat it before changing the set. Keep `MAX_PROTECTED_PATH_RULES` (4096) and the refusal of a non-ASCII name between a writable root and a protected path; a run past either is refused before launch.
106
+ - `agy` reads the output schema from a private `0600` copy in the run's runtime, never from the run record in `.dobby/runs/`.
107
+ - A `SUCCESS` status with `denied_actions` and no valid result is a failure.
108
+ - Gemini runs have no stall detection: `agy` is silent while a tool runs. `timeout_seconds` bounds every run.
109
+ - Gemini review evidence: Dobby validates the private `brain/` entries and the parent and child transcripts without traversing symlinks; every `invoke_subagent` call and announced subagent naming a selected lens exactly once, with only `Prompt`/`Role`/`TypeName` plus a no-op `Model`/`Workspace`; no forbidden parent or child tools; no parent `send_message` (agy lets a parent message a subagent by conversation id or broadcast to `@children`); one strict read-only result sent to the parent; and each child's SHA-256 assignment attestation. There is no parent-observed copy; each child's transcript is the only source of its findings.
110
+ - Gemini coverage loss: a lens never started, no readable child transcript, an unparseable child transcript, no result sent, a result that does not match the worker schema, or a failed assignment attestation.
111
+ - Gemini integrity failure: a lens started or invoked more than once, a disallowed `invoke_subagent` argument or value, a parent `send_message` whose `Recipient` is a started lens's conversation id, a child transcript reached through a symlink, a child calling a forbidden tool, more than one distinct result, or a child reporting file changes.
112
+ - Gemini global failure: a parent forbidden tool call, an `invoke_subagent` call with non-object arguments or an unselected `TypeName`, a parent `send_message` to any other recipient (the `@children` broadcast included) or with none, an announced unselected subagent, a malformed `subagent_info` entry or conversation id, a child reusing the parent's conversation id, an unidentified parent conversation, an unreadable or symlinked `brain/` directory, an unexpected `brain/` entry (except at most one silent, unattributed directory per unstarted lens in an interrupted run), or a parent transcript that is symlinked, unreadable, unparseable, or missing after lenses started.
113
+
114
+ ## Release verification
115
+
116
+ - Dobby targets the MCP Python SDK 2.x line (`mcp[cli]>=2.0.0,<3`), built on the public `MCPServer` API from `mcp.server.mcpserver`. Keep the locked MCP SDK at the supported minimum baseline and run the separate latest-dependency test lane before release.
117
+ - Dobby's advertised initialize version comes from the public `MCPServer(..., version=__version__)` argument. Do not reach into `_lowlevel_server` or any other private SDK attribute to set it.
118
+ - MCP SDK 2.3 hides unexpected handler exceptions. Preserve anticipated invocation, path, and request-model validation detail through the public `ToolError` type at tool boundaries; leave unexpected programming errors to SDK handling.
119
+ - SDK 2.x never answers a request the client cancelled via `notifications/cancelled`, so Dobby carries no cancellation monkey-patch. If that upstream behaviour ever regresses, fix it upstream rather than re-adding a patch module.
120
+ - Progress notifications use the SDK 2.x shapes: request `_meta` is a `RequestParamsMeta` TypedDict read with `meta.get("progress_token")`, and `ProgressNotification` is sent directly to `session.send_notification` with no `ServerNotification` wrapper. The wire payload is unchanged — `_meta.acpEvent`, `taskId`, and `perTaskCount` are a client-visible contract.
121
+ - Run `uv run pytest`, then the authenticated live suites before deploying a new CLI baseline: `DOBBY_RUN_LIVE_V2=1 uv run pytest -m live tests/test_live_codex_v2.py` with a signed-in Codex CLI, and `DOBBY_RUN_LIVE_GEMINI=1 uv run pytest -m live tests/test_live_gemini.py` with a signed-in `agy`. Also run `DOBBY_RUN_LIVE_V2=1 uv run pytest -m live tests/test_live_codex_build.py`, which checks the per-run permission profile in a real build. The verified baselines are `codex-cli 0.174.0` (the minimum stays 0.169.0) and `agy 1.5.24` (the minimum stays 1.5.23), both 2026-12-04.
122
+ - CI's `live-codex-flags` lane runs the no-auth `live` tests against the latest published `@openai/codex` with `DOBBY_REQUIRE_LIVE=1`, under which any skip of a no-auth live test is a failure. Do not add a skip condition to a `live` test expecting CI to tolerate it; tests that genuinely need credentials must also carry the `live_auth` marker.
123
+ - Run `uv build` and verify the wheel over stdio. The MCP initialize response must advertise Dobby's package version, not the MCP SDK version.
124
+ - Tag releases exactly as `v<project.version>`. The publish workflow rejects any mismatch.
@@ -0,0 +1,104 @@
1
+ # Changelog
2
+
3
+ All notable user-facing changes to Dobby Subagent MCP are recorded here.
4
+
5
+ ## 0.2.0 - 2026-12-05
6
+
7
+ ### Breaking changes
8
+
9
+ - Renamed from `codex-dobby-mcp` to `dobby-subagent-mcp`: command `dobby-subagent-mcp`, module `dobby_subagent_mcp`, MCP client key `dobby`, run artifacts in `.dobby/`, recursion guard `DOBBY_ACTIVE`. Remove old registrations from Claude, Codex and `agy` configs first, because the old server does not check `DOBBY_ACTIVE`. Runs in the old `.codex-dobby/` directory are no longer listed or looked up. Not yet published to PyPI.
10
+ - Every worker call and `start_run` must name `provider` (`codex` or `gemini`) and `model`. There is no default model and no built-in model list; `list_models` reads the live catalogs. `reasoning_effort` defaults to `medium` for every tool, so `build` and `reverse_engineer` drop from `high`; a Codex multi-agent review's coordinator stays at `low`.
11
+ - `provider` is added to `ToolResponse`, `AsyncRunHandle`, `RunLookupResponse`, `RunSummary` and `request.json`.
12
+ - `repo_root` must be the top level of its git worktree. A directory inside one used to be accepted. Git reports changes from the top level, so Dobby looked for them in the wrong place: a file already dirty that the worker changed again went undetected, including by the read-only write check. The worktree's `.git` and the top level's `.codex/config.toml` also sat outside what Dobby protects and reads. Dobby uses git's spelling of the root, so a path given in another case on a case-insensitive file system still yields the same permission rules and artifact paths.
13
+ - `danger=true` is accepted only for `build` and `reverse_engineer`, and only with `provider="codex"`. `start_run(tool="validate", danger=true)` used to run Codex with `danger-full-access`.
14
+ - Codex runs keep only the MCP servers their role uses: `fetchaller` for `plan`, `research`, `brainstorm` and `build`; `fetchaller` and `ghidra` for `reverse_engineer`; none for `validate` and `review`. The `apps` and `plugins` connectors are off for every role. MCP servers run outside the sandbox.
15
+ - The worker output schema has no `review_execution` field: Dobby builds a Codex multi-agent review's `execution_manifest` from the verified session rollouts, so a parent that miscounts can no longer fail a lens whose child delivered. The never-emitted `stop_reason` values `max_tokens` and `max_turn_requests` and `execution_evidence: parent_reported_structured_output` are removed.
16
+ - Codex runs need `codex-cli` 0.169.0 or newer, checked with `codex --version` before every run; the `codex features list` probe is gone. Rollouts in the codex-cli 0.147 shape are no longer accepted.
17
+ - `build`, `validate` and `reverse_engineer` can no longer write `.dobby/`, `.claude/`, `.gemini/` or `.mcp.json` in the repository or any writable root, with either provider, on top of git metadata, `.codex/` and `.agents/`. A Codex `build` asked to edit a project's Claude Code commands, agents or skills used to succeed and now fails; only a Codex run with `danger=true` can still write them. The same goes for git's hooks directory and the config files git reads, when `core.hooksPath` or an `include.path` puts one inside a writable root: a build whose `npm install` runs husky's `prepare` script, which regenerates `.husky/_`, gets a denied write there. A change to the agent configuration or to git's hooks and config during a mutating run, yours included, now fails the run; during a read-only run it is a warning (see Fixes and hardening).
18
+
19
+ ### New
20
+
21
+ - Gemini backend (`provider="gemini"`, macOS) on the Antigravity CLI `agy` 1.5.23 or newer, for every worker tool. Each run gets a private `HOME`; the repository is reachable only through per-run permission rules and is never `agy`'s working directory; shell commands have no network; system temp is denied; mutating runs cannot write git metadata; caches are per run; credential-looking environment variables are dropped. Multi-lens review runs one `agy` subagent per lens and is verified from each subagent's own transcript (`execution_evidence: agy_transcripts`).
22
+ - `list_models` lists each provider's models, efforts and suggested model from `codex debug models` and `agy models`, cached for 10 minutes. The server instructions list them as of startup.
23
+ - `cancel_run(repo_root, task_id)` stops a background run and returns it as `get_run` would.
24
+ - SIGTERM, SIGINT, SIGHUP and stdin EOF stop the server cleanly: worker process groups are killed, every unfinished run gets a final `stop_reason: cancelled` result naming the reason, private runtimes are removed, and the server exits, with a watchdog after about 3 seconds. An MCP cancellation also leaves a final cancelled result, so a placeholder `result.json` now means only that a server died uncleanly.
25
+ - On startup Dobby sweeps runtimes left by a dead server. Each runtime is locked by its run (`.lock`, `owner.json`); the orphan's worker group is killed only when a member's command line names that run, the runtime is removed, and its placeholder result is marked final. Workers see their task id in `DOBBY_RUN_ID`.
26
+ - `AGY_BINARY` overrides the `agy` path, as `CODEX_BINARY` does for Codex.
27
+
28
+ ### Fixes and hardening
29
+
30
+ - A run no longer hangs on Python 3.13.16, 3.14.8 or later when the worker leaves behind a process that escaped its process group (one that called `setsid`) with the worker's stdout or stderr still open. Since CPython gh-119710, `Process.wait()` returns as soon as the worker exits instead of once its pipes close. Dobby took a completed wait to mean the pipes had closed, so it drained them with no time limit and skipped the brief grace a lingering group member gets before the group is killed. It now waits for the readers of both pipes to reach EOF, as the older `wait()` did.
31
+ - **Security:** every git command Dobby runs takes no optional locks and disables `core.fsmonitor` and hooks, and `git show` skips textconv. A planted `core.fsmonitor` used to run outside any sandbox during the post-run `git status`, and a cancelled snapshot could leave `index.lock` behind. `git status` no longer runs git inside a submodule: a worker could point a submodule's `.git` file at a git directory whose config runs a clean filter, and Dobby's `git status` ran it outside the sandbox. An edit inside a submodule is still reported, as the submodule's path, from the metadata of the files under it (including ctime and owner), listed through descriptors that follow no link. `git status` also reads no `.gitattributes` from the worktree (git 2.40 or newer), so a worker-written one cannot assign a filter from config it can reach, such as a file the repository's config includes.
32
+ - **Security:** the snapshot helper Dobby runs before and after every run no longer imports code a worker wrote. It ran `python -m` with the repository as its working directory, which puts the repository first on `sys.path`, so a mutating worker that wrote `json.py` or `pydantic.py` there had it run outside any sandbox, after its own run and before every later one. It now runs in isolated mode (`-I`) from `/`.
33
+ - **Security:** every run now compares, before and after, the files that make git, Codex, Claude Code or Gemini CLI run code outside any sandbox: `.codex`, `.agents`, `.claude`, `.gemini`, `.mcp.json` and the `.git` entry in the repository and every writable root, and `hooks`, `config`, `config.worktree` and `info/` in each one's git directory and common git directory. Nothing compared them; only a moved `HEAD` was caught. The snapshot helper fingerprints them by metadata alone, including ctime, so an edit that restores a file's size and mtime still shows, and lists directories only through descriptors that follow no link. A change fails a mutating run without `danger=true` with `stop_reason: sandbox_violation` naming the paths, and only warns for `danger=true` and for a read-only run, whose sandbox lets the worker write none of them, so the change is almost surely yours. Who made it cannot be told, so your own changes during a mutating run count too, such as Claude Code saving an approval to `.claude/settings.local.json` or `git push -u` writing `.git/config`. `.claude/worktrees`, `.claude/agent-memory`, `.claude/scheduled_tasks.lock`, `.DS_Store` and git's `info/refs` are never compared, and each tree is compared up to 10,000 entries, past which the run warns.
34
+ - **Security:** a multi-agent review's parent can no longer steer a reviewer after spawning it. A parent message or follow-up task (Codex `send_message` or `followup_task`; agy `send_message`) sent to a selected lens fails that lens's integrity check, and one aimed at anything else, including agy's `@children` broadcast, discards every finding. Codex parents may otherwise make only the collaboration calls the protocol needs: `spawn_agent`, `list_agents`, `wait_agent` and `interrupt_agent`. A steered reviewer still attested its assignment, so these reviews used to report `manifest_validated: true`.
35
+ - **Security:** a Codex multi-agent review pins the `[features.multi_agent_v2]` settings its checks rely on, after enabling the feature, so Codex no longer offers the parent `send_message`, `followup_task` or model overrides on `spawn_agent` at all, and exposes its collaboration tools only as direct calls in the `collaboration` namespace. The thread cap is pinned to the lenses plus the parent. `-c features.multi_agent_v2=true` sets only `enabled`, so a `[features.multi_agent_v2]` table in your or a trusted project's config could change any of these. The rollout checks for both calls stay as a backstop.
36
+ - **Security:** Codex runs also turn off MCP servers defined only in `/etc/codex/config.toml`, a macOS managed profile or a cloud-managed config. Dobby read only your config and the repository's, so such a server stayed on outside the sandbox, whatever the role. Before launch it now runs `codex mcp list --json` against the run's private home, with the run's own overrides, and turns off every listed server the role does not use. A listing that fails or prints something Dobby cannot read fails the run before launch.
37
+ - **Security:** a worker that plants something in its run directory can no longer freeze the server or make Dobby read outside the repository. Run artifacts (`stdout.log`, `stderr.log`, `last_message.txt`, `result.json`, `request.json`, `events.jsonl`, `owner.json`) are read only as regular files, never through a symlink and never past a size cap far above real runs; a FIFO at `stdout.log` used to block every run and tool call, and the signal handlers with them, a link to `/dev/zero` exhausted memory, and a link from `stderr.log` to a file outside the repository copied it into the summary. Anything else reads as unreadable with a warning, and Codex's last message is an error. File diff capture reads changed files the same way, so a FIFO or a huge sparse file there no longer hangs or exhausts the server.
38
+ - **Security:** Dobby never writes outside the run directory it created. A worker that replaced its run directory, for example with a symlink out of the repository, used to have `result.json` written into the link's target; the run now fails with `status: error` saying so. Logs are created through the run directory before the worker starts, never opened, and every other artifact is replaced by renaming a new file over it, so a FIFO, symlink or hard link a worker left there is never opened or written through. A run whose `result.json` cannot be written (a full disk, or a directory a worker put there) now fails with `status: error` and still returns everything else in its response, file changes and diffs included. It used to raise, which lost the response and let a worker hide what it changed, and a background run then raised on every `get_run` and `wait_run`.
39
+ - **Security:** mutating runs cannot write `.dobby/` in the repository or any writable root, so they cannot rewrite another run's `result.json`, which `get_run` returns as written. A Codex mutating run used to be able to, so it could forge a finished run's result, including a review's `manifest_validated: true`. A Codex run with `danger=true` still can.
40
+ - **Security:** Codex `build`, `validate` and `reverse_engineer` runs without `danger` run in a per-run permission profile, `dobby_<task id>`, extending Codex's `:workspace`, instead of `-s workspace-write`. It keeps `.dobby`, `.claude`, `.gemini`, `.mcp.json`, `.codex`, `.git`, `.agents` and `.aws` read-only in the repository and every writable root, `--add-dir` roots included, for shell commands and `apply_patch`, and on macOS in any letter case. `workspace-write` protected only `.git`, `.agents`, `.codex` and `.aws`, so a worker could plant a `.claude/settings.json` hook or a `.mcp.json` server that Claude Code would run outside any sandbox. Only your own `[sandbox_workspace_write]` grants carry over (`writable_roots`, resolved as Codex resolves them, so `~user/x` is a path relative to the config's directory, `network_access`, `exclude_slash_tmp`); those in a trusted repository's `.codex/config.toml`, which a worker can write, or in `/etc/codex/config.toml` no longer apply. The `build`, `validate` and `reverse_engineer` descriptions name the paths that stay read-only.
41
+ - **Security:** both CLIs read the output schema from a private `0600` copy in the run's runtime. They read the run record in `.dobby/runs/<task id>/`, which a concurrent mutating worker in the same repository could rewrite between Dobby writing it and the CLI reading it. `output-schema.json` is still written there as the record.
42
+ - **Security:** a Codex `reverse_engineer` run takes its Ghidra helper writable root only from your own `$CODEX_HOME/config.toml`. A `helper_dir` or bridge path in the repository's `.codex/config.toml`, which a worker can write, used to make any existing directory outside the repository writable for the next run, whether or not Codex trusted the project.
43
+ - **Security:** Gemini mutating runs cannot write `.codex/`, `.agents/`, `.claude/`, `.gemini/` or `.mcp.json` in the repository or any writable root, even before they exist. A Gemini build could otherwise plant a `.codex/config.toml` redefining an allowlisted MCP server, such as `fetchaller` as `sh`, which the next Codex run in that repository would start outside its sandbox, or a hook or MCP server that Claude Code or Gemini CLI would run the same way. Each of these, git metadata and `.dobby/` included, is denied in every spelling below a writable root (each letter in either case, plus every character APFS treats as ASCII text: `ſ`, the Kelvin sign, `ß` and `ẞ`, the ligatures `ff`, `fi`, `fl`, `ffi`, `ffl`, `ſt` and `st`, and the Greek question mark and varia, in every mix), 488 rules per root: on agy 1.5.24 the file tools match permission rules case-sensitively, and a live probe's write to `<repo>/.Git/hooks/probe-hook` landed in the real hooks directory past a rule for `.git`. A run that would need more than 4096 such rules, such as one with more than eight writable roots side by side, with `src` as an extra root inside the repository, or with a protected path deep inside a root (a linked worktree at `.worktrees/feat`), or that would have to respell a non-ASCII directory name, is refused before launch. `.git` is denied in an extra root that is no git worktree too, where a planted `.git/config` would run in your next git command there. The worker's prompt names the read-only paths.
44
+ - **Security:** git's hooks directory and the config files git reads are protected wherever a writable root holds them, by the Codex profile, the Gemini rules and detection. With husky's `core.hooksPath = .husky/_`, which git ignores, a worker under the Codex profile wrote `.husky/_/pre-commit`, detection saw no change, and the next `git commit` ran it outside any sandbox. Dobby now asks git for the hooks directory (`core.hooksPath` from any scope, a relative value against the worktree) and for every config file it reads or an `include.path` or `includeIf.<condition>.path` names, whether the condition holds now or not, following includes git skips to a bound, plus the global config locations. A worker editing one could set `core.fsmonitor` or `core.hooksPath` for your next git command. Every `core.hooksPath` any of those files sets counts, not only the one in effect: with `includeIf "onbranch:release"` naming a file that sets `core.hooksPath = tools/release-hooks`, a hook planted there on `main` ran after `git switch -c release && git commit`. So do every `init.templateDir` and `GIT_TEMPLATE_DIR`, whose hooks `git clone` runs at once, includes and hooks paths set through `GIT_CONFIG_COUNT` or `GIT_CONFIG_PARAMETERS`, and every other worktree of the repository: a linked worktree nested in a writable root, such as `.worktrees/feat`, has its `.git` file and its own copy of a relative hooks path protected too. Codex's protection and detection also cover git paths under the `/tmp` that `:workspace` makes writable, and detection covers your own `[sandbox_workspace_write]` `writable_roots`. Only the lookups (`git rev-parse` and `git config --list`, neither of which runs a hook) skip Dobby's `core.hooksPath` override; `GIT_CONFIG` is left out of their environment, since it made `git config` read only that one file. A hooks or template directory that is a whole writable root refuses the run. Listing worktrees needs git 2.36 or newer.
45
+ - **Security:** where a protected path leads through a symlink inside a writable root is protected too. `agy` resolves links before it matches a rule, so with `.claude` linking to `cfg/claude`, a Gemini worker could write `cfg/claude/settings.json` past the rule for `.claude`, and detection compared only the link. Codex's profile already kept both read-only (verified with `codex sandbox -P` on 0.171 and 0.174). A worker can still re-point a link above a protected path, such as a linked `.husky`; detection, which follows the path as configured, reports that.
46
+ - **Security:** Gemini's spellings of protected paths now cover every character APFS treats as ASCII text, not only `ſ` and the Kelvin sign: `ß` and `ẞ` for `ss`, the Latin ligatures for `ff`, `fi`, `fl`, `ffi`, `ffl` and `st`, and the Greek question mark and varia, which decompose to `;` and a backtick. A name between a writable root and a protected path, such as a nested root `tests` spelled `tests`, used to reach `.codex` past every rule.
47
+ - **Security:** a FIFO, symlink or huge file in place of a config file can no longer freeze or exhaust the server. Your Codex `config.toml`, the repository's `.codex/config.toml`, and `agy`'s MCP config and settings are read only as regular files of at most 1 MiB; a FIFO at `.codex/config.toml` used to block the event loop as a run was prepared. A symlink to your own config is followed, as a dotfiles setup needs; one at the repository's `.codex` or `.codex/config.toml` is not. A Codex config that exists but cannot be read safely or parsed now fails the run before launch with `status: error` naming the file, because Codex could start MCP servers from it that Dobby could not turn off; it used to be skipped. It is a setup error, not a sandbox violation. Gemini review transcripts larger than 256 MiB are likewise lost coverage instead of being read whole into memory.
48
+ - **Security:** a `.gitignore` larger than 4 MiB is refused unread, and the file is never read past the size that passed that check. A sparse `.gitignore` of any apparent size, which either provider's worker can plant, used to be read whole into memory on the event loop. A read-only FIFO there no longer blocks the server either.
49
+ - A `.gitignore` ending in a bare carriage return gets a newline before Dobby's entry. Only a newline ends a line for git, so the entry used to join the last line and ignore nothing.
50
+ - Snapshots hash only regular files; a FIFO, socket or device is fingerprinted by its type and metadata without being opened. A worker that replaced a tracked file with a FIFO made every later mutating run's baseline snapshot hang until its deadline.
51
+ - **Security:** the startup sweep marks a placeholder result final only in a directory shaped like the run's own `<repo>/.dobby/runs/<task-id>`, spelled canonically. A forged `owner.json` could make it rewrite `result.json` in any directory named after the task id.
52
+ - The startup sweep no longer deletes a runtime another server is claiming. The claim creates its lock and takes it a moment later; a sweep in between took the free lock, treated the new runtime as an orphan and removed it, failing that run. A runtime with a lock but no `owner.json` is now left alone for two minutes, then removed as an orphan.
53
+ - `get_run` and `list_runs` report the provider of a run whose result cannot be read, from `request.json`. They looked for it in the wrong place and always reported none.
54
+ - A Codex last message that is not valid UTF-8 is reported as invalid structured output instead of failing the run with a decoding exception.
55
+ - **Security:** private runtimes moved from the system temp directory to `~/Library/Caches/dobby/<task-id>` (`${XDG_CACHE_HOME:-~/.cache}/dobby` on Linux), and the worker's `TMPDIR` and caches moved there from the repository.
56
+ - A Codex run whose private `CODEX_HOME` cannot sign in fails before launch with an explanation, instead of at its first model request. Dobby runs `codex login status` there, from the private scratch directory and within the run's deadline, which catches credentials kept in the keyring or in memory (`cli_auth_credentials_store` set to `keyring`, `auto` or `ephemeral`) whether your `config.toml`, `/etc/codex/config.toml`, `/etc/codex/requirements.toml` or a managed profile sets it: Codex keys keyring credentials by the `CODEX_HOME` path, which Dobby's private home does not share. Use file-based credentials or `CODEX_API_KEY`. The check is skipped with `CODEX_API_KEY` and for a model provider that does not use Codex's sign-in; a `profile` that is not a string selects no profile.
57
+ - Workers run in their own process group. Stopping one sends SIGTERM to the group, then SIGKILL, and a pid Dobby has reaped is never signalled again. A descendant (an MCP server, a background command) that holds the output pipes after the worker exits no longer keeps the run open until its timeout: Dobby reports the real exit code, kills the group, and warns when a descendant escaped it.
58
+ - A slow MCP progress client no longer slows or truncates a run: output is read and logged as fast as it is written, live notifications beyond 1024 pending are dropped, a stuck client cannot hold a run past its timeout, and `events.jsonl` still records every event.
59
+ - Output parsing skips a line still unfinished after 1 MiB through its newline (a 128 MB line used to take gigabytes and end as a false timeout), keeps going after a deeply nested JSON line, and reports a failure to write `stdout.log`, such as a full disk, in `warnings` without blocking the worker.
60
+ - A run that times out is no longer reported as a stall when the stall threshold passes while Dobby is killing it.
61
+ - A run Dobby stops on a timeout or stall keeps what its progress events show (the narration tail and last completed tool calls), and Ghidra MCP and helper use is read from those events, for both providers. Codex Ghidra activity was not detected at all under `--json`.
62
+ - Codex multi-agent review rollout validation is tested against a sanitized real codex-cli 0.171.0 review capture, and the encrypted spawn message must now have the Fernet token structure (base64url, version byte `0x80`, whole AES blocks) instead of merely using URL-safe characters, so plaintext in that alphabet is compared against the canonical assignment.
63
+ - Codex progress events follow codex-cli 0.171's `exec --json`: file changes carry their paths, the plan updates as steps complete, failed or declined calls are reported as failed, and tool calls carry ACP `rawInput`. Sandbox denials are read from that stream instead of stderr.
64
+ - A patch Codex could not apply is listed in `sandbox_violations`, named by its paths, without failing a run that otherwise succeeded. Dobby read only failed commands' output, and a patch the sandbox refuses is a failed `file_change` item that carries none, so in a live build eight denied writes left `sandbox_violations` empty. The stream does not say why a patch failed. A patch Codex's own path check rejects, and a shell command Codex reports as sandbox-denied the moment it starts, emit no item at all and are still not listed.
65
+ - Codex keeps its own ERROR lines on stderr, because Dobby's `RUST_LOG` now restates the exec default filter (codex-cli 0.174's, which also keeps its MCP startup warnings). Two config overrides that were not real Codex keys are gone; Dobby sets the review thread cap through `agents.max_concurrent_threads_per_session`.
66
+ - Turning off a Codex MCP server whose name holds a dot or a space no longer stops Codex from starting, and neither does turning off one defined only in an untrusted repository's `.codex/config.toml`, which Codex refused as an "invalid transport". Codex's `-c` splits keys on every dot whatever the quoting, so Dobby now passes one `mcp_servers` inline table that repeats each server's own `command` or `url`.
67
+ - A Codex multi-agent review whose model's catalog entry makes codex-cli 0.174 run multi-agent v3 fails with a message saying Dobby does not verify v3 yet and to choose a model whose entry uses v2, instead of a generic mode mismatch.
68
+ - A mutating run whose `HEAD` disappeared, such as a deleted branch, is a sandbox violation, and `stop_reason: sandbox_violation` always comes with a matching `sandbox_violations` entry.
69
+ - File diff capture has one 60-second budget for all files instead of 30 seconds per file; files past it get no diff and a warning.
70
+ - Read-only Codex runs no longer pass `--add-dir`, which a read-only sandbox ignores. Prompts offer the Ghidra helper fallback only when a helper root is mounted.
71
+ - A `reverse_engineer` run that ends without a worker result reports Ghidra the same way whatever stopped it: `prelaunch_failure` when no worker launched, otherwise the Ghidra calls its worker logged in `events.jsonl`. This covers a run that raises, is cancelled, times out in the CLI version check or baseline snapshot, or is finalized by the startup sweep after a server died. These used to report `prelaunch_failure` after the worker had run, or `no_activity` when it never launched or had used Ghidra. A background run keeps the runner's report.
72
+ - The startup sweep treats a `ps` that exits with an error as an unreadable process table, so the orphan worker group is reported as not killed. Its empty output used to look like the group had already exited, and the sweep skipped the group without a word.
73
+
74
+ ## 0.1.4 - 2026-11-14
75
+
76
+ - Preserve anticipated input-validation messages with MCP SDK 2.3, which otherwise reports handler exceptions as generic execution failures. Unexpected programming errors retain the SDK's error handling.
77
+ - Surface Codex 0.169's disabled project-configuration diagnostic in response `warnings`, even on successful runs, with guidance to save intended project trust in the parent Codex configuration. Record the verified 0.169 authenticated multi-agent baseline.
78
+ - Default to GPT-6.1 Sol. Start routine technical tools at medium reasoning, keep reverse engineering at high, and keep the multi-agent coordinator at low. Explicit model and effort overrides still work.
79
+ - Support Codex CLI 0.164 multi-agent review rollouts: correlate v2 child sessions with spawn outputs when started events are absent, cap session slots, and reject reviewer collaboration calls. Retain the Codex 0.147 rollout compatibility fixture.
80
+ - Require an explicit absolute `repo_root` on every MCP tool, including run lookup and wait tools.
81
+ - Move multi-lens review fan-out to Codex multi-agent v2 with deterministic custom reviewer roles, bounded concurrency, and independently verified rollout evidence.
82
+ - Distinguish manifest integrity (`manifest_validated`) from complete review coverage (`coverage_complete`) and salvage only strictly validated delivered child results.
83
+ - Harden private runtime ownership, cleanup, recursion prevention, review read-only enforcement, and malformed-output handling.
84
+ - Improve Claude-facing descriptions, multi-agent timeout defaults, background-run polling guidance, and packaged repository instructions.
85
+ - Advertise Dobby's own package version during MCP initialization and reject release tags that do not exactly match `project.version`.
86
+ - Migrate to the MCP Python SDK 2.x line (`mcp[cli]>=2.0.0,<3`), replacing `FastMCP` with the public `MCPServer` API and setting the advertised initialize version through the supported `version=` constructor argument instead of a private compatibility helper.
87
+ - Drop the MCP 1.x cancellation monkey-patch. SDK 2.x already declines to answer a cancelled request, so Dobby no longer patches the SDK at import time.
88
+ - Progress notification payloads are unchanged: `_meta.acpEvent`, `taskId`, and `perTaskCount` still arrive exactly as before.
89
+ - Fix multi-agent review discarding good results when one lens failed. A lens that never delivered is now reported as lost coverage and the run returns the remaining independently verified findings as partial success, instead of failing the whole review with `status: error` and `completeness: blocked`. Evidence that contradicts the manifest, or that shows a child spawned with the wrong role, a `fork_turns` other than `none`, an unexpected encrypted argument shape, a second session, or a file mutation, still quarantines the review.
90
+ - A review lens whose evidence failed no longer contributes any caller-visible text. Its per-agent `review_details` summary is a neutral placeholder rather than the excluded child's own words.
91
+ - `review(agents=[...])` now defaults to the same 1200-second budget as `start_run` for multi-agent fan-out, instead of half of it.
92
+ - A worker that returns `refused: true` with a non-blocked `completeness` is recorded as blocked with a warning, instead of failing the run with `Codex completed with invalid structured output` and losing the stated refusal reason. The pairing is now documented in the shared worker prompt.
93
+ - Delete the child's runtime scratch tree (`.codex-dobby/runs/<task-id>/runtime`) after every run. It held the child's `TMPDIR` and caches inside the repository and was never removed.
94
+ - Never mirror the parent runtime home itself or its `sessions/` tree into a child runtime, including through symlink aliases and case variants, which could clone credentials and historical rollouts and quarantine an otherwise valid review.
95
+ - Deliver each review lens's canonical assignment to the child out of band, through the per-run agent definition Dobby writes into the child's private runtime, rather than only through the orchestrating parent's spawn message. The parent still chooses which reviewer starts; it no longer chooses what that reviewer reviews, and a conflicting payload assignment must now be reported instead of followed.
96
+ - Reject unknown tool arguments instead of silently dropping them. A misspelled `files` previously became a whole-repo run; every tool now publishes `additionalProperties: false` and fails the call.
97
+ - Report the real cause when a run raises before producing a response. `result.json` kept the aborted placeholder blaming cancellation, which misled every later `get_run`.
98
+ - Fix non-ASCII caller input breaking multi-agent review. A prompt containing U+2028, U+2029, or U+0085 split the canonical assignment across lines and quarantined the whole review, and an emoji made the per-run agent definition unparseable. The canonical assignment is now ASCII-only, and TOML values are encoded as TOML rather than JSON, which cannot represent astral characters as valid TOML escapes.
99
+ - Preserve the runner's failure detail on background runs. `start_run` overwrote `result.json` with a thinner response, discarding the real cause and any warning that a private runtime with copied credentials could not be deleted.
100
+ - Accept JSON-looking text in `important_context` again. The MCP SDK JSON-decodes optional string arguments, so such values were rejected as "Input should be a valid string".
101
+ - Deliver `important_context` to the worker exactly as written. The SDK's JSON pre-parse silently rewrote JSON-shaped context — collapsing layout, reformatting numbers (`1e3` became `1000.0`), dropping duplicate keys, and unescaping `\uXXXX` — and turned the literal text `null` into no context at all. The published nullable schema is unchanged.
102
+ - Stop discarding a whole multi-agent review when one lens is spawned twice. A duplicate spawn is now that lens's integrity failure, and the lenses spawned exactly once still return their independently verified findings, matching the documented contract.
103
+ - Fail closed on a session Dobby cannot account for. A rollout file with any content but no readable session metadata, or a non-root session that never identifies which spawn produced it, previously was skipped silently and could leave `manifest_validated: true` despite an unaccounted child session. This holds during truncated-rollout recovery too, where such a file parses to no records at all.
104
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Avery Levitt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.