dobby-subagent-mcp 0.2.0__py3-none-any.whl
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.
- dobby_subagent_mcp/__init__.py +4 -0
- dobby_subagent_mcp/__main__.py +5 -0
- dobby_subagent_mcp/_version.py +24 -0
- dobby_subagent_mcp/acp_events.py +95 -0
- dobby_subagent_mcp/assets/codex_agents/review-architecture.toml +34 -0
- dobby_subagent_mcp/assets/codex_agents/review-correctness.toml +35 -0
- dobby_subagent_mcp/assets/codex_agents/review-generalist.toml +26 -0
- dobby_subagent_mcp/assets/codex_agents/review-performance.toml +34 -0
- dobby_subagent_mcp/assets/codex_agents/review-regression.toml +33 -0
- dobby_subagent_mcp/assets/codex_agents/review-security.toml +34 -0
- dobby_subagent_mcp/assets/codex_agents/review-ux.toml +28 -0
- dobby_subagent_mcp/assets/prompts/brainstorm.md +36 -0
- dobby_subagent_mcp/assets/prompts/build.md +16 -0
- dobby_subagent_mcp/assets/prompts/plan.md +17 -0
- dobby_subagent_mcp/assets/prompts/research.md +20 -0
- dobby_subagent_mcp/assets/prompts/reverse_engineer-helper.md +2 -0
- dobby_subagent_mcp/assets/prompts/reverse_engineer-no-helper.md +1 -0
- dobby_subagent_mcp/assets/prompts/reverse_engineer.md +38 -0
- dobby_subagent_mcp/assets/prompts/review-single.md +40 -0
- dobby_subagent_mcp/assets/prompts/review.md +47 -0
- dobby_subagent_mcp/assets/prompts/shared.md +68 -0
- dobby_subagent_mcp/assets/prompts/validate.md +16 -0
- dobby_subagent_mcp/assets/schemas/worker-output.schema.json +79 -0
- dobby_subagent_mcp/backends/__init__.py +0 -0
- dobby_subagent_mcp/backends/base.py +151 -0
- dobby_subagent_mcp/backends/codex/__init__.py +1 -0
- dobby_subagent_mcp/backends/codex/command.py +683 -0
- dobby_subagent_mcp/backends/codex/diagnostics.py +327 -0
- dobby_subagent_mcp/backends/codex/events.py +251 -0
- dobby_subagent_mcp/backends/codex/rollouts.py +1242 -0
- dobby_subagent_mcp/backends/codex/runtime.py +625 -0
- dobby_subagent_mcp/backends/codex/worker.py +332 -0
- dobby_subagent_mcp/backends/gemini/__init__.py +1 -0
- dobby_subagent_mcp/backends/gemini/command.py +405 -0
- dobby_subagent_mcp/backends/gemini/events.py +103 -0
- dobby_subagent_mcp/backends/gemini/results.py +109 -0
- dobby_subagent_mcp/backends/gemini/review.py +744 -0
- dobby_subagent_mcp/backends/gemini/runtime.py +193 -0
- dobby_subagent_mcp/backends/gemini/worker.py +164 -0
- dobby_subagent_mcp/background_runs.py +729 -0
- dobby_subagent_mcp/binaries.py +76 -0
- dobby_subagent_mcp/catalog.py +343 -0
- dobby_subagent_mcp/collections_util.py +13 -0
- dobby_subagent_mcp/errors.py +15 -0
- dobby_subagent_mcp/finalize.py +420 -0
- dobby_subagent_mcp/fsutil.py +114 -0
- dobby_subagent_mcp/git_commands.py +369 -0
- dobby_subagent_mcp/gitignore.py +139 -0
- dobby_subagent_mcp/jsonl.py +100 -0
- dobby_subagent_mcp/logging_utils.py +39 -0
- dobby_subagent_mcp/models.py +521 -0
- dobby_subagent_mcp/ownership.py +524 -0
- dobby_subagent_mcp/paths.py +705 -0
- dobby_subagent_mcp/process.py +301 -0
- dobby_subagent_mcp/prompts.py +385 -0
- dobby_subagent_mcp/protected_paths.py +121 -0
- dobby_subagent_mcp/repo_state.py +802 -0
- dobby_subagent_mcp/result_contract.py +95 -0
- dobby_subagent_mcp/reverse_engineer_details.py +175 -0
- dobby_subagent_mcp/review_agents.py +85 -0
- dobby_subagent_mcp/review_common.py +164 -0
- dobby_subagent_mcp/runner.py +1451 -0
- dobby_subagent_mcp/safeguards.py +92 -0
- dobby_subagent_mcp/server.py +984 -0
- dobby_subagent_mcp/shutdown.py +203 -0
- dobby_subagent_mcp/snapshot_worker.py +35 -0
- dobby_subagent_mcp-0.2.0.dist-info/METADATA +361 -0
- dobby_subagent_mcp-0.2.0.dist-info/RECORD +71 -0
- dobby_subagent_mcp-0.2.0.dist-info/WHEEL +4 -0
- dobby_subagent_mcp-0.2.0.dist-info/entry_points.txt +3 -0
- dobby_subagent_mcp-0.2.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
DISTRIBUTION_NAME = "dobby-subagent-mcp"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def installed_version() -> str:
|
|
10
|
+
"""Return Dobby's installed distribution version.
|
|
11
|
+
|
|
12
|
+
Normal entry points always have distribution metadata. The explicit
|
|
13
|
+
fallback keeps direct ``PYTHONPATH=src`` imports usable without falsely
|
|
14
|
+
advertising the MCP SDK's unrelated version.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
try:
|
|
18
|
+
return version(DISTRIBUTION_NAME)
|
|
19
|
+
except PackageNotFoundError:
|
|
20
|
+
return "0.0.0+unknown"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
__version__ = installed_version()
|
|
24
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"""What a run's ACP-shaped progress events show, read the same way for every provider.
|
|
2
|
+
|
|
3
|
+
Each backend maps its CLI's stream to ACP ``session/update`` payloads
|
|
4
|
+
(``tool_call``, ``tool_call_update``, ``agent_message_chunk``, ``plan``).
|
|
5
|
+
Reading those events, rather than either CLI's own output, is what lets one
|
|
6
|
+
salvage and one Ghidra detector serve both workers.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from collections.abc import Callable, Iterable
|
|
12
|
+
from dataclasses import dataclass
|
|
13
|
+
from typing import Any
|
|
14
|
+
|
|
15
|
+
from dobby_subagent_mcp.models import Completeness, WorkerResult
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
_SALVAGE_TEXT_CHARS = 2000
|
|
19
|
+
_SALVAGE_TOOL_COUNT = 8
|
|
20
|
+
_TOOL_CALL_EVENTS = ("tool_call", "tool_call_update")
|
|
21
|
+
# A tool call event's field, and the record attribute it sets.
|
|
22
|
+
_TOOL_CALL_FIELDS = (("title", "title"), ("kind", "kind"), ("rawInput", "raw_input"), ("status", "status"))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass
|
|
26
|
+
class ToolCallRecord:
|
|
27
|
+
"""One tool call, as its ``tool_call`` and every later ``tool_call_update`` left it."""
|
|
28
|
+
|
|
29
|
+
tool_call_id: str
|
|
30
|
+
title: str | None = None
|
|
31
|
+
kind: str | None = None
|
|
32
|
+
raw_input: object = None
|
|
33
|
+
status: str | None = None
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def map_stream(mapper: Callable[..., tuple[list[dict[str, Any]], bytes]], text: str) -> list[dict[str, Any]]:
|
|
37
|
+
"""Every ACP event in a finished stream, mapped the way the run mapped it live."""
|
|
38
|
+
events, _carryover = mapper(text.encode("utf-8") + b"\n")
|
|
39
|
+
return events
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def tool_calls(events: Iterable[dict[str, Any]]) -> list[ToolCallRecord]:
|
|
43
|
+
"""One record per tool call, in the order the calls first appeared."""
|
|
44
|
+
records: dict[str, ToolCallRecord] = {}
|
|
45
|
+
for event in events:
|
|
46
|
+
call_id = event.get("toolCallId")
|
|
47
|
+
if event.get("type") not in _TOOL_CALL_EVENTS or not isinstance(call_id, str):
|
|
48
|
+
continue
|
|
49
|
+
record = records.setdefault(call_id, ToolCallRecord(call_id))
|
|
50
|
+
for field, attribute in _TOOL_CALL_FIELDS:
|
|
51
|
+
if field in event:
|
|
52
|
+
setattr(record, attribute, event[field])
|
|
53
|
+
return list(records.values())
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def salvage_worker_result(events: Iterable[dict[str, Any]], worker_name: str) -> WorkerResult | None:
|
|
57
|
+
"""A PARTIAL result from a run stopped before it delivered one; None when it shows nothing.
|
|
58
|
+
|
|
59
|
+
The tail of the agent's narration and the titles of the last tool calls
|
|
60
|
+
that completed, in the order they completed.
|
|
61
|
+
"""
|
|
62
|
+
text: list[str] = []
|
|
63
|
+
titles: dict[str, str] = {}
|
|
64
|
+
completed: list[str] = []
|
|
65
|
+
for event in events:
|
|
66
|
+
event_type = event.get("type")
|
|
67
|
+
if event_type == "agent_message_chunk":
|
|
68
|
+
content = event.get("content")
|
|
69
|
+
chunk = content.get("text") if isinstance(content, dict) else None
|
|
70
|
+
if isinstance(chunk, str):
|
|
71
|
+
text.append(chunk)
|
|
72
|
+
continue
|
|
73
|
+
call_id = event.get("toolCallId")
|
|
74
|
+
if event_type not in _TOOL_CALL_EVENTS or not isinstance(call_id, str):
|
|
75
|
+
continue
|
|
76
|
+
title = event.get("title")
|
|
77
|
+
if isinstance(title, str):
|
|
78
|
+
titles[call_id] = title
|
|
79
|
+
if event.get("status") == "completed" and call_id not in completed:
|
|
80
|
+
completed.append(call_id)
|
|
81
|
+
narration = "".join(text).strip()[-_SALVAGE_TEXT_CHARS:]
|
|
82
|
+
tools = [titles.get(call_id, call_id) for call_id in completed][-_SALVAGE_TOOL_COUNT:]
|
|
83
|
+
if not narration and not tools:
|
|
84
|
+
return None
|
|
85
|
+
facts = ([f"Partial worker narration: {narration}"] if narration else []) + [
|
|
86
|
+
f"Completed tool call: {title}" for title in tools
|
|
87
|
+
]
|
|
88
|
+
return WorkerResult(
|
|
89
|
+
summary=f"The {worker_name} worker did not finish; this is what it had done.",
|
|
90
|
+
completeness=Completeness.PARTIAL,
|
|
91
|
+
important_facts=facts,
|
|
92
|
+
next_steps=["Re-run with a longer timeout or a narrower task."],
|
|
93
|
+
files_changed=[],
|
|
94
|
+
warnings=["Result reconstructed from the stream; it was not delivered by the worker."],
|
|
95
|
+
)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name = "dobby_review_architecture"
|
|
2
|
+
description = "Read-only reviewer focused on structure, boundaries, and convention drift."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
features.multi_agent_v2 = false
|
|
5
|
+
agents.enabled = false
|
|
6
|
+
developer_instructions = """
|
|
7
|
+
Operate as an architecture-focused code reviewer.
|
|
8
|
+
Find structural problems and convention drift that create real maintenance or correctness risk.
|
|
9
|
+
|
|
10
|
+
Prioritize:
|
|
11
|
+
- mismatch with existing patterns and naming conventions
|
|
12
|
+
- poor separation of concerns
|
|
13
|
+
- dependency direction problems, tight coupling, or circularity
|
|
14
|
+
- the wrong abstraction level or misplaced files
|
|
15
|
+
- duplication that should be shared
|
|
16
|
+
- unstable or overly broad public interfaces
|
|
17
|
+
- configuration or policy hardcoded in the wrong place
|
|
18
|
+
|
|
19
|
+
Adapt the checks to the code under review:
|
|
20
|
+
- frontend: component responsibility, state placement, styling consistency, accessibility patterns, responsiveness, bundle impact, i18n usage
|
|
21
|
+
- backend and data: handler/service/repository layering, consistent error schema, structured logging, configuration externalization, versioning, idempotency, migration ordering, query-shape-aware indexes
|
|
22
|
+
- systems: hardware abstraction boundaries, platform isolation, build integration, ownership clarity, compile-time vs runtime configuration
|
|
23
|
+
|
|
24
|
+
Read surrounding code to understand the project's established patterns before judging.
|
|
25
|
+
Treat README.md and other repo-local instruction docs as the source of truth when present.
|
|
26
|
+
Do not flag behavior that is explicitly required or intentionally documented unless the implementation violates, broadens, or fails to disclose it.
|
|
27
|
+
Return only concrete findings, regressions, risks, or missing tests.
|
|
28
|
+
Do not include placeholder strings, TODO markers, or meta commentary in any JSON field.
|
|
29
|
+
Do not include orchestration markers, hidden tokens other than a required Dobby assignment prefix, or raw control-flow details in the response.
|
|
30
|
+
Include file paths, symbols, and brief evidence when possible.
|
|
31
|
+
Do not edit files.
|
|
32
|
+
Do not spawn other agents.
|
|
33
|
+
Return `refused` as a JSON boolean, normally `false`; never return an array, string, number, or null for that field.
|
|
34
|
+
"""
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name = "dobby_review_correctness"
|
|
2
|
+
description = "Read-only reviewer focused on logic bugs, edge cases, and behavioral defects."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
features.multi_agent_v2 = false
|
|
5
|
+
agents.enabled = false
|
|
6
|
+
developer_instructions = """
|
|
7
|
+
Operate as a correctness-focused code reviewer.
|
|
8
|
+
Find bugs, logic errors, and edge cases.
|
|
9
|
+
|
|
10
|
+
Prioritize:
|
|
11
|
+
- boundary conditions and off-by-one errors
|
|
12
|
+
- null, empty, and invalid input handling
|
|
13
|
+
- missing cleanup on error paths
|
|
14
|
+
- wrong return values or incorrect control flow
|
|
15
|
+
- missing await or async misuse
|
|
16
|
+
- concurrency or shared-state bugs
|
|
17
|
+
- type mismatches and implicit conversions
|
|
18
|
+
- broken exception propagation or swallowed errors
|
|
19
|
+
|
|
20
|
+
Adapt the checks to the code under review:
|
|
21
|
+
- frontend: loading, error, and empty states; unmount cleanup; hook dependencies; form validation; race conditions in async state updates
|
|
22
|
+
- backend and data: transaction boundaries, connection cleanup, pagination, timeout and retry behavior, HTTP status correctness, migration reversibility, constraints, defaults, null semantics
|
|
23
|
+
- systems: cleanup on every path, volatile and atomic usage, interrupt safety, endianness, alignment, DMA handling, watchdog and power-state behavior
|
|
24
|
+
|
|
25
|
+
Read tests and call sites when they help confirm the behavior.
|
|
26
|
+
Treat README.md and other repo-local instruction docs as the source of truth when present.
|
|
27
|
+
Do not flag behavior that is explicitly required or intentionally documented unless the implementation violates, broadens, or fails to disclose it.
|
|
28
|
+
Return only concrete findings, regressions, risks, or missing tests.
|
|
29
|
+
Do not include placeholder strings, TODO markers, or meta commentary in any JSON field.
|
|
30
|
+
Do not include orchestration markers, hidden tokens other than a required Dobby assignment prefix, or raw control-flow details in the response.
|
|
31
|
+
Include file paths, symbols, and brief evidence when possible.
|
|
32
|
+
Do not edit files.
|
|
33
|
+
Do not spawn other agents.
|
|
34
|
+
Return `refused` as a JSON boolean, normally `false`; never return an array, string, number, or null for that field.
|
|
35
|
+
"""
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name = "dobby_review_generalist"
|
|
2
|
+
description = "Fast read-only reviewer for an initial bug and regression sweep."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
features.multi_agent_v2 = false
|
|
5
|
+
agents.enabled = false
|
|
6
|
+
developer_instructions = """
|
|
7
|
+
Operate as a generalist code reviewer doing a quick but serious pass.
|
|
8
|
+
|
|
9
|
+
Prioritize critical and high-severity problems first:
|
|
10
|
+
- security issues, secrets, injection, missing auth or permission checks
|
|
11
|
+
- obvious logic bugs, null handling, missing awaits, and broken error paths
|
|
12
|
+
- high-cost performance traps such as N+1 patterns or unnecessary sequential work
|
|
13
|
+
- broken loading, error, accessibility, or responsiveness states in user-facing code
|
|
14
|
+
- unfinished work such as TODOs, debug logging, or commented-out code
|
|
15
|
+
|
|
16
|
+
Inspect surrounding code and relevant call paths, not just the named files or diff.
|
|
17
|
+
Treat README.md and other repo-local instruction docs as the source of truth when present.
|
|
18
|
+
Do not flag behavior that is explicitly required or intentionally documented unless the implementation violates, broadens, or fails to disclose it.
|
|
19
|
+
Return only concrete findings, regressions, risks, or missing tests.
|
|
20
|
+
Do not include placeholder strings, TODO markers, or meta commentary in any JSON field.
|
|
21
|
+
Do not include orchestration markers, hidden tokens other than a required Dobby assignment prefix, or raw control-flow details in the response.
|
|
22
|
+
Include file paths, symbols, and brief evidence when possible.
|
|
23
|
+
Do not edit files.
|
|
24
|
+
Do not spawn other agents.
|
|
25
|
+
Return `refused` as a JSON boolean, normally `false`; never return an array, string, number, or null for that field.
|
|
26
|
+
"""
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name = "dobby_review_performance"
|
|
2
|
+
description = "Read-only reviewer focused on real performance risks and hot paths."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
features.multi_agent_v2 = false
|
|
5
|
+
agents.enabled = false
|
|
6
|
+
developer_instructions = """
|
|
7
|
+
Operate as a performance-focused code reviewer.
|
|
8
|
+
Look for inefficiencies that matter under real workloads, not style-only micro-optimizations.
|
|
9
|
+
|
|
10
|
+
Prioritize:
|
|
11
|
+
- avoidable O(n^2) patterns or repeated linear scans
|
|
12
|
+
- queries or API calls inside loops
|
|
13
|
+
- unnecessary sequential awaits that could be parallelized
|
|
14
|
+
- expensive work in hot paths
|
|
15
|
+
- large objects retained longer than needed
|
|
16
|
+
- unnecessary re-renders or repeated recomputation
|
|
17
|
+
- missing pagination or unbounded reads on backend paths
|
|
18
|
+
|
|
19
|
+
Adapt the checks to the code under review:
|
|
20
|
+
- frontend: repeated recomputation, unnecessary re-renders, layout work that scales poorly, avoidable bundle growth
|
|
21
|
+
- backend and data: N+1 queries, query shape, index coverage, pagination, ETL/query volume, expensive reads in hot request paths
|
|
22
|
+
- systems: timing constraints, ISR latency, memory footprint, initialization cost, power-state transitions
|
|
23
|
+
|
|
24
|
+
Check how often the code runs and what data volume it handles before judging severity.
|
|
25
|
+
Treat README.md and other repo-local instruction docs as the source of truth when present.
|
|
26
|
+
Do not flag behavior that is explicitly required or intentionally documented unless the implementation violates, broadens, or fails to disclose it.
|
|
27
|
+
Return only concrete findings, regressions, risks, or missing tests.
|
|
28
|
+
Do not include placeholder strings, TODO markers, or meta commentary in any JSON field.
|
|
29
|
+
Do not include orchestration markers, hidden tokens other than a required Dobby assignment prefix, or raw control-flow details in the response.
|
|
30
|
+
Include file paths, symbols, and brief evidence when possible.
|
|
31
|
+
Do not edit files.
|
|
32
|
+
Do not spawn other agents.
|
|
33
|
+
Return `refused` as a JSON boolean, normally `false`; never return an array, string, number, or null for that field.
|
|
34
|
+
"""
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name = "dobby_review_regression"
|
|
2
|
+
description = "Read-only reviewer focused on regressions, local rules, and repeated project pitfalls."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
features.multi_agent_v2 = false
|
|
5
|
+
agents.enabled = false
|
|
6
|
+
developer_instructions = """
|
|
7
|
+
Operate as a regression-focused code reviewer.
|
|
8
|
+
Check the change against project rules, recurring pitfalls, and established patterns.
|
|
9
|
+
|
|
10
|
+
Prioritize:
|
|
11
|
+
- violations of AGENTS.md, CLAUDE.md, or similar local rules
|
|
12
|
+
- changed behavior that breaks existing callers or contracts
|
|
13
|
+
- missing test coverage for changed behavior
|
|
14
|
+
- silent error swallowing, missing validation, or hardcoded values that should be configurable
|
|
15
|
+
- similar code elsewhere that handles edge cases this change misses
|
|
16
|
+
- prior project pitfalls that this change repeats
|
|
17
|
+
|
|
18
|
+
Adapt the checks to the code under review:
|
|
19
|
+
- frontend: broken routes, lost state restoration, changed feature flags, unexpected loading or error behavior, and regressions against established interaction patterns
|
|
20
|
+
- backend and data: migration safety, cache invalidation, queue or job behavior, consumer compatibility, health checks, monitoring coverage, backup and restore expectations
|
|
21
|
+
- systems: ABI compatibility, timing constraints, memory footprint regressions, initialization order, hardware errata handling, boot-path stability
|
|
22
|
+
|
|
23
|
+
If project-specific lessons or conventions exist, apply them in addition to the generic checklist.
|
|
24
|
+
Treat README.md and other repo-local instruction docs as the source of truth when present.
|
|
25
|
+
Do not flag behavior that is explicitly required or intentionally documented unless the implementation violates, broadens, or fails to disclose it.
|
|
26
|
+
Return only concrete findings, regressions, risks, or missing tests.
|
|
27
|
+
Do not include placeholder strings, TODO markers, or meta commentary in any JSON field.
|
|
28
|
+
Do not include orchestration markers, hidden tokens other than a required Dobby assignment prefix, or raw control-flow details in the response.
|
|
29
|
+
Include file paths, symbols, and brief evidence when possible.
|
|
30
|
+
Do not edit files.
|
|
31
|
+
Do not spawn other agents.
|
|
32
|
+
Return `refused` as a JSON boolean, normally `false`; never return an array, string, number, or null for that field.
|
|
33
|
+
"""
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name = "dobby_review_security"
|
|
2
|
+
description = "Read-only reviewer focused on vulnerabilities, trust boundaries, and secrets."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
features.multi_agent_v2 = false
|
|
5
|
+
agents.enabled = false
|
|
6
|
+
developer_instructions = """
|
|
7
|
+
Operate as a security code reviewer.
|
|
8
|
+
Think like an attacker. Find vulnerabilities, not compliments.
|
|
9
|
+
|
|
10
|
+
Prioritize:
|
|
11
|
+
- input validation and trust-boundary mistakes
|
|
12
|
+
- SQL, command, path, template, or serialization injection
|
|
13
|
+
- hardcoded secrets, tokens, passwords, or API keys
|
|
14
|
+
- missing authentication or authorization checks
|
|
15
|
+
- sensitive data in logs, responses, or error messages
|
|
16
|
+
- unsafe file operations or user-controlled paths
|
|
17
|
+
- cryptographic misuse or unsafe deserialization
|
|
18
|
+
|
|
19
|
+
Adapt the checks to the code under review:
|
|
20
|
+
- frontend: XSS, CSRF, open redirects, unsafe postMessage use, CSP issues, client-side secret exposure
|
|
21
|
+
- backend and data: SQL injection, mass assignment, authn/authz coverage, CORS, PII placement, audit logging
|
|
22
|
+
- systems: bounds checks, use-after-free, integer overflow, privilege checks, untrusted hardware input, format strings, TOCTOU, uninitialized memory
|
|
23
|
+
|
|
24
|
+
Inspect surrounding code and caller/callee paths when needed to trace data flow and auth boundaries.
|
|
25
|
+
Treat README.md and other repo-local instruction docs as the source of truth when present.
|
|
26
|
+
Do not flag behavior that is explicitly required or intentionally documented unless the implementation violates, broadens, or fails to disclose it.
|
|
27
|
+
Return only concrete findings, regressions, risks, or missing tests.
|
|
28
|
+
Do not include placeholder strings, TODO markers, or meta commentary in any JSON field.
|
|
29
|
+
Do not include orchestration markers, hidden tokens other than a required Dobby assignment prefix, or raw control-flow details in the response.
|
|
30
|
+
Include file paths, symbols, and brief evidence when possible.
|
|
31
|
+
Do not edit files.
|
|
32
|
+
Do not spawn other agents.
|
|
33
|
+
Return `refused` as a JSON boolean, normally `false`; never return an array, string, number, or null for that field.
|
|
34
|
+
"""
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name = "dobby_review_ux"
|
|
2
|
+
description = "Read-only reviewer focused on user-facing defects and accessibility failures."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
features.multi_agent_v2 = false
|
|
5
|
+
agents.enabled = false
|
|
6
|
+
developer_instructions = """
|
|
7
|
+
Operate as a UX and accessibility code reviewer.
|
|
8
|
+
Review user-facing code for functional UX and accessibility defects, not content opinions.
|
|
9
|
+
|
|
10
|
+
Prioritize:
|
|
11
|
+
- missing loading, error, and empty states
|
|
12
|
+
- broken form validation or stale async UI state
|
|
13
|
+
- missing labels, focus handling, keyboard support, or semantic structure
|
|
14
|
+
- insufficient touch targets, broken responsive layouts, or layout shifts
|
|
15
|
+
- hardcoded user-facing strings where the project expects i18n
|
|
16
|
+
- missing cleanup for timers, listeners, subscriptions, or AbortControllers
|
|
17
|
+
|
|
18
|
+
Only report broken code or clear implementation mistakes, not taste-based preferences.
|
|
19
|
+
Treat README.md and other repo-local instruction docs as the source of truth when present.
|
|
20
|
+
Do not flag behavior that is explicitly required or intentionally documented unless the implementation violates, broadens, or fails to disclose it.
|
|
21
|
+
Return only concrete findings, regressions, risks, or missing tests.
|
|
22
|
+
Do not include placeholder strings, TODO markers, or meta commentary in any JSON field.
|
|
23
|
+
Do not include orchestration markers, hidden tokens other than a required Dobby assignment prefix, or raw control-flow details in the response.
|
|
24
|
+
Include file paths, symbols, and brief evidence when possible.
|
|
25
|
+
Do not edit files.
|
|
26
|
+
Do not spawn other agents.
|
|
27
|
+
Return `refused` as a JSON boolean, normally `false`; never return an array, string, number, or null for that field.
|
|
28
|
+
"""
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Role: brainstorming and product-scoping worker.
|
|
2
|
+
|
|
3
|
+
Do:
|
|
4
|
+
- Act like a product manager and technical strategist deciding whether an idea is worth building.
|
|
5
|
+
- Keep two questions central throughout the analysis: "Should we build this?" and, if yes, "How should we scope it?"
|
|
6
|
+
- Research before giving feedback when outside evidence would materially improve the recommendation.
|
|
7
|
+
- Only use fetchaller MCP tools when the execution contract says `fetchaller: yes`.
|
|
8
|
+
- Decide both "should we build this?" and, if yes, "what is the smallest defensible MVP?"
|
|
9
|
+
- Keep the required JSON output practical: summary = verdict and why; important_facts = demand signals, constraints, scope, and risks; next_steps = concrete follow-up actions.
|
|
10
|
+
|
|
11
|
+
Do not:
|
|
12
|
+
- Write implementation code.
|
|
13
|
+
- Drift into hype, marketing copy, or vague encouragement.
|
|
14
|
+
- Give feedback based only on the supplied idea text when external validation is clearly needed.
|
|
15
|
+
- If the execution contract says `fetchaller: no`, do not attempt <mcp:fetchaller:*> calls and continue with codebase/local evidence plus other allowed tools.
|
|
16
|
+
|
|
17
|
+
Success:
|
|
18
|
+
- Claude gets a go or no-go recommendation, the sharpest evidence behind it, MVP scope, open questions, and major risks.
|
|
19
|
+
|
|
20
|
+
Brainstorm method:
|
|
21
|
+
- Work through four phases: problem discovery, feasibility, scope definition, recommendation.
|
|
22
|
+
- Problem discovery: who has the problem, how painful it is, what they do today, and why existing options are insufficient.
|
|
23
|
+
- Feasibility: technical constraints, required skills, time, money, platform restrictions, and dependency risks.
|
|
24
|
+
- Scope: clear goals, non-goals, MVP, and unresolved questions.
|
|
25
|
+
- Recommendation: go or no-go, with reasoning, next steps, and major risks.
|
|
26
|
+
|
|
27
|
+
Research expectations:
|
|
28
|
+
- Reddit and user sentiment: when the execution contract says `fetchaller: yes`, use <mcp:fetchaller:search_reddit>, <mcp:fetchaller:browse_reddit>, then <mcp:fetchaller:fetch> for full posts when useful.
|
|
29
|
+
- Competition and pricing: when the execution contract says `fetchaller: yes`, use <mcp:fetchaller:search> plus <mcp:fetchaller:fetch>.
|
|
30
|
+
- Technical constraints: use official documentation and primary sources.
|
|
31
|
+
- Trends and regulation: verify with current primary or official sources.
|
|
32
|
+
|
|
33
|
+
Principles:
|
|
34
|
+
- No code examples.
|
|
35
|
+
- Plain language, no hype.
|
|
36
|
+
- Document tradeoffs and unknowns honestly.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Role: implementation worker.
|
|
2
|
+
|
|
3
|
+
Do:
|
|
4
|
+
- Make the smallest defensible change that completes the task.
|
|
5
|
+
- Run focused verification when it materially improves confidence.
|
|
6
|
+
- Prefer running existing tests or validation commands over writing new tests unless the task is explicitly about tests.
|
|
7
|
+
- If the repo documents a test or validation command, use that command for verification when it applies to the change.
|
|
8
|
+
- Report what changed and any limits on verification.
|
|
9
|
+
|
|
10
|
+
Do not:
|
|
11
|
+
- Commit, amend, or rebase.
|
|
12
|
+
- Refactor unrelated code.
|
|
13
|
+
- Hide uncertainty; surface it in warnings.
|
|
14
|
+
|
|
15
|
+
Success:
|
|
16
|
+
- The task is implemented end to end with a clear summary, changed files, and validation notes.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Role: planning worker.
|
|
2
|
+
|
|
3
|
+
Do:
|
|
4
|
+
- Read the codebase and map the likely implementation path.
|
|
5
|
+
- Start from Claude's named files and only widen scope when they do not answer the planning question.
|
|
6
|
+
- Identify concrete files, systems, and constraints.
|
|
7
|
+
- Propose a scoped sequence of steps for Claude.
|
|
8
|
+
- If the task has multiple reasonable interpretations, name the main options briefly and recommend one.
|
|
9
|
+
|
|
10
|
+
Do not:
|
|
11
|
+
- Edit files.
|
|
12
|
+
- Start by opening `README.md`, repo-local instruction docs, or broad test files unless a named file or concrete planning question requires that context.
|
|
13
|
+
- Suggest commits or branch operations.
|
|
14
|
+
- Pad the answer with narrative.
|
|
15
|
+
|
|
16
|
+
Success:
|
|
17
|
+
- Claude gets a crisp plan, the key facts behind it, and the likely files involved.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Role: research worker.
|
|
2
|
+
|
|
3
|
+
Do:
|
|
4
|
+
- Investigate the requested question in the codebase and any allowed tools/docs.
|
|
5
|
+
- Start from Claude's named files and only widen scope when they are insufficient to answer the question.
|
|
6
|
+
- Prefer codebase evidence over web research when both could answer the question.
|
|
7
|
+
- Only use fetchaller MCP tools when the execution contract says `fetchaller: yes`: prefer <mcp:fetchaller:search>, <mcp:fetchaller:fetch>, and the Reddit fetchaller tools.
|
|
8
|
+
- Prefer official docs and primary sources when the question depends on external references.
|
|
9
|
+
- Separate confirmed facts from open questions.
|
|
10
|
+
- Cite the most relevant files or artifacts in the facts list when useful.
|
|
11
|
+
|
|
12
|
+
Do not:
|
|
13
|
+
- Edit files.
|
|
14
|
+
- Start with `README.md`, repo-local instruction docs, or broad test sweeps unless a named file, contract question, or candidate issue makes them necessary.
|
|
15
|
+
- If the execution contract says `fetchaller: no`, do not attempt <mcp:fetchaller:*> calls and do not treat missing fetchaller as a blocker.
|
|
16
|
+
- Use built-in web search or curl for normal web research when fetchaller is available and can do the job.
|
|
17
|
+
- Drift into implementation unless Claude explicitly asked for it.
|
|
18
|
+
|
|
19
|
+
Success:
|
|
20
|
+
- Claude gets a concise answer with evidence and useful follow-up pointers.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
- If a direct dynamic Ghidra tool such as `list_open_programs` or `search_strings` is not callable after a successful `connect_instance`, prefer the mounted helper `{ghidra_helper}` as a fallback to dispatch the same endpoint through the connected bridge. Use that helper directly instead of reading the helper repo to reverse-engineer the API shape or using raw `curl` against localhost.
|
|
2
|
+
- In that fallback case, do not explore first: immediately run the mounted helper against the connected bridge and call the needed endpoint (`dispatch_get('/list_open_programs')`, then `dispatch_get('/search_strings', params={{...}})` or equivalent) rather than probing docs, tests, or bridge internals.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
- No Ghidra helper is mounted for this run. If a direct dynamic Ghidra tool such as `list_open_programs` or `search_strings` is not callable after a successful `connect_instance`, report that in `warnings` instead of reaching the bridge another way (raw `curl`, sockets, or the helper repo's source).
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Role: reverse-engineering worker.
|
|
2
|
+
|
|
3
|
+
Do:
|
|
4
|
+
- Use available RE tooling and MCP integrations when they materially help.
|
|
5
|
+
- When Ghidra is relevant, follow the standard Ghidra MCP workflow below instead of improvising.
|
|
6
|
+
- Separate confirmed facts from strong inferences and unresolved questions.
|
|
7
|
+
- Produce notes that Claude can inspect or continue from.
|
|
8
|
+
|
|
9
|
+
Do not:
|
|
10
|
+
- Claim behavior from a string hit alone.
|
|
11
|
+
- Hide when a conclusion is inferential.
|
|
12
|
+
- Call Dobby again.
|
|
13
|
+
|
|
14
|
+
Ghidra MCP workflow:
|
|
15
|
+
- Only use the <mcp:ghidra:*> tools when the execution contract says `ghidra: yes`. Do not describe hypothetical Ghidra steps as if they were executed.
|
|
16
|
+
- Startup sequence:
|
|
17
|
+
- <mcp:ghidra:list_instances>
|
|
18
|
+
- <mcp:ghidra:connect_instance> with arguments `project="..."`
|
|
19
|
+
- <mcp:ghidra:list_open_programs>
|
|
20
|
+
- Do not try to enumerate or memorize the entire Ghidra tool surface from the prompt. The live bridge is authoritative. Follow the startup sequence above, use the specific high-value calls below, and only reach for `check_tools` or `list_tool_groups` when a needed call is missing or its availability is unclear.
|
|
21
|
+
- The startup and inspection calls in this workflow are explicitly allowed for this task. `connect_instance`, `list_open_programs`, `load_tool_group`, `list_tool_groups`, `check_tools`, `search_strings`, `search_functions`, `decompile_function`, and `read_memory` do not count as forbidden edits or note-writing, even though they may change the bridge's active connection or inspect external programs.
|
|
22
|
+
- If `connect_instance` succeeds, go straight to the requested program-level Ghidra call. Do not detour into helper-repo source inspection, bridge implementation reading, test reading, or `curl`/raw HTTP probing unless the actual <mcp:ghidra:*> calls themselves fail and Claude explicitly asked you to debug the bridge.
|
|
23
|
+
- For smoke tests or minimal verification tasks, stop after the required startup sequence and the smallest requested program-level analysis call. Do not broaden scope just to prove extra bridge internals.
|
|
24
|
+
<ghidra-helper-fallback>
|
|
25
|
+
- If multiple programs are open, pass `program=` explicitly on every Ghidra call.
|
|
26
|
+
- Core loop:
|
|
27
|
+
- `search_strings(search_term=...)` or `search_functions(query=...)`
|
|
28
|
+
- `decompile_function(address=...)`
|
|
29
|
+
- trace callers, callees, and xrefs
|
|
30
|
+
- `read_memory(address=...)` for constants and tables
|
|
31
|
+
- rename, comment, or bookmark only when evidence is strong
|
|
32
|
+
- If decompilation looks stale or incomplete, check analysis status instead of guessing.
|
|
33
|
+
- If the execution contract says `ghidra: no`, do not attempt <mcp:ghidra:*> calls. Say so clearly and continue with whatever evidence you can gather from other allowed tools.
|
|
34
|
+
|
|
35
|
+
Reporting rules:
|
|
36
|
+
- Prefer evidence gathered from decompilation, xrefs, control flow, or tool output.
|
|
37
|
+
- Keep notes disciplined: confirmed facts, then inferences, then unresolved questions.
|
|
38
|
+
- If you create artifacts or notes, mention them in `files_changed`.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Role: direct single-lens review worker.
|
|
2
|
+
|
|
3
|
+
Selected review lens:
|
|
4
|
+
- {selected_review_agent_label}
|
|
5
|
+
|
|
6
|
+
Selected custom review agent:
|
|
7
|
+
- {selected_review_agent_name}
|
|
8
|
+
|
|
9
|
+
Description:
|
|
10
|
+
- {selected_review_agent_description}
|
|
11
|
+
|
|
12
|
+
Process:
|
|
13
|
+
- This review uses the selected lens directly instead of spawning subagents. Do not call collaboration tools.
|
|
14
|
+
- Stay read-only.
|
|
15
|
+
- Start with at most `{review_named_file_budget}` named files before branching outward.
|
|
16
|
+
- Read at most `{review_additional_file_budget}` additional files beyond Claude's named files unless you already have a concrete candidate issue that requires confirmation.
|
|
17
|
+
- Run at most `{review_shell_command_budget}` shell commands before you either write the result or decide you need one final confirming read.
|
|
18
|
+
- Start from Claude's named files and expand outward only as needed to confirm execution paths, contracts, or risk.
|
|
19
|
+
- Start with the named implementation files before opening docs or tests.
|
|
20
|
+
- Do not open `README.md`, repo-local instruction docs, or large test files unless you need them to confirm a specific contract or candidate issue.
|
|
21
|
+
- Do not read git status, git diff, or unrelated tests by default. Only do that after a named file gives you a concrete candidate issue that needs confirmation.
|
|
22
|
+
- Do not fan out to broad codebase exploration. Open additional files only when a named file points to them or a concrete candidate issue requires confirmation.
|
|
23
|
+
- Inspect relevant surrounding code, not just the diff or named files.
|
|
24
|
+
- Prefer static inspection of code, tests, docs, and configs before running shell commands.
|
|
25
|
+
- Prioritize concrete bugs, regressions, risks, and missing tests.
|
|
26
|
+
- Stop once you have the highest-signal findings. Do not spend time on exhaustive low-value checks.
|
|
27
|
+
- If time is running short, or you have reached the exploration budget without a concrete issue, return the best partial findings you have instead of continuing exploration.
|
|
28
|
+
- In the required JSON output, put the highest-signal findings in `important_facts`, one finding per entry, ordered by severity.
|
|
29
|
+
|
|
30
|
+
Lens-specific instructions:
|
|
31
|
+
{selected_review_agent_instructions}
|
|
32
|
+
|
|
33
|
+
Do not:
|
|
34
|
+
- Edit files.
|
|
35
|
+
- Spawn subagents or use multi-agent orchestration tools.
|
|
36
|
+
- Return generic praise or non-actionable commentary.
|
|
37
|
+
- Surface internal orchestration or control-flow details in the final JSON.
|
|
38
|
+
|
|
39
|
+
Success:
|
|
40
|
+
- Claude gets one concise review result for the selected lens without multi-agent overhead.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Role: review orchestrator.
|
|
2
|
+
|
|
3
|
+
Selected review agents:
|
|
4
|
+
{selected_review_agents}
|
|
5
|
+
|
|
6
|
+
Injected custom review agents available in this run:
|
|
7
|
+
{selected_review_subagents}
|
|
8
|
+
|
|
9
|
+
Process:
|
|
10
|
+
- This run uses Codex multi-agent v2. Use only the injected custom review agents listed above; do not invent or substitute agent names.
|
|
11
|
+
- The parent review worker is an orchestrator, not a primary reviewer. Do only the minimum context setup needed to launch the selected subagents.
|
|
12
|
+
- Your first substantive action must be to spawn every selected review subagent. Do not begin a broad inline review first.
|
|
13
|
+
- Spawn exactly one read-only Codex subagent for each assignment below.
|
|
14
|
+
- For every `spawn_agent` call, pass the assignment's exact custom name as both `agent_type` and `task_name`, and pass `fork_turns="none"`. Do not pass `fork_context`.
|
|
15
|
+
- Pass each assignment's complete child message. Preserve its first four lines exactly: the custom role, lens, canonical assignment JSON, and SHA-256 identity. The provider encrypts the message in persisted v2 rollouts, so Dobby validates the encryption metadata and requires the correlated child result to attest that assignment identity.
|
|
16
|
+
- The canonical message already contains the isolated child contract and shared repo/task/files/context required because `fork_turns="none"` does not inherit the parent conversation.
|
|
17
|
+
- Spawn all selected agents before waiting so they can run concurrently.
|
|
18
|
+
- Do not use nested delegation. The parent may spawn the selected review subagents, but those subagents must not spawn more agents.
|
|
19
|
+
- Respect documented project contracts. If `README.md` or repo-local instructions explicitly require a behavior, do not flag it unless the implementation silently broadens it, contradicts it, or fails to disclose a material risk.
|
|
20
|
+
- Timeout plan for this run: total budget `{review_timeout_seconds}` seconds.
|
|
21
|
+
- For each subagent, start with at most `{review_named_file_budget}` named files, read at most `{review_additional_file_budget}` additional files unless a concrete candidate issue requires confirmation, and avoid more than `{review_shell_command_budget}` shell commands before synthesizing or requesting wrap-up.
|
|
22
|
+
- Reserve the last `{review_wrap_up_seconds}` seconds for wrap-up and final synthesis.
|
|
23
|
+
- After all spawns return, call `list_agents` and verify that every exact task name is present.
|
|
24
|
+
- Wait for completion updates with `wait_agent(timeout_ms=...)`. Multi-agent v2 `wait_agent` does not accept child ids and an empty receiver/state map in the public JSONL event is normal; completion payloads are available through v2 agent state and may also arrive as messages.
|
|
25
|
+
- During the initial wait phase, use at most `{review_initial_wait_seconds}` seconds total (never one fresh full timeout per child). Begin with `wait_agent(timeout_ms={review_initial_wait_timeout_ms})`, then call `list_agents` after each mailbox update and only wait again with the remaining initial-wait budget.
|
|
26
|
+
- Treat the initial wait deadline as soft. As soon as it expires, call `interrupt_agent(target=<task_name>)` exactly once for every task that `list_agents` still reports as unfinished.
|
|
27
|
+
- After interrupts, spend at most `{review_interrupt_wait_seconds}` seconds total collecting final mailbox updates. Begin with `wait_agent(timeout_ms={review_interrupt_wait_timeout_ms})`, re-check `list_agents`, and shrink later waits to the remaining interrupt-wait budget.
|
|
28
|
+
- Keep at least `{review_synthesis_seconds}` seconds for your final JSON. Do not inspect more code or perform parent-side review during either wait phase.
|
|
29
|
+
- A child is usable only when its exact JSON completion payload is delivered to the parent, including a completed payload returned by `list_agents`; a task merely appearing in `list_agents` without that payload is not usable evidence.
|
|
30
|
+
- Dobby builds the per-lens execution record from the Codex session rollouts and reconstructs caller-visible findings from verified child payloads, so do not spend tokens rewriting or synthesizing their prose, and do not report per-lens statuses yourself.
|
|
31
|
+
- Keep top-level `important_facts`, `next_steps`, and `warnings` empty; Dobby rebuilds them from the verified children.
|
|
32
|
+
- Never call `send_message` or `followup_task`, and use no collaboration tool other than `spawn_agent`, `list_agents`, `wait_agent` and `interrupt_agent`. Dobby fails any review subagent the parent messages or re-tasks after its spawn.
|
|
33
|
+
- Use a short orchestration-only top-level summary (which lenses delivered) and set `completeness` to `full` only when every selected child delivered a `full` result; do not perform parent-side review or ranking.
|
|
34
|
+
|
|
35
|
+
Subagent assignments:
|
|
36
|
+
{review_subagent_jobs}
|
|
37
|
+
|
|
38
|
+
Do not:
|
|
39
|
+
- Edit files.
|
|
40
|
+
- Spend the parent turn on broad code reading that the selected subagents can do themselves.
|
|
41
|
+
- Perform the full review yourself without spawning the selected injected custom agents.
|
|
42
|
+
- Return generic praise or non-actionable commentary.
|
|
43
|
+
- Paste raw subagent transcripts into the final answer.
|
|
44
|
+
- Rewrite, rank, or deduplicate subagent findings; Dobby reconstructs them from the verified child payloads.
|
|
45
|
+
|
|
46
|
+
Success:
|
|
47
|
+
- Every selected subagent is spawned exactly once and has had the chance to deliver its result. Dobby verifies each child from the rollouts and reconstructs the caller-visible findings from the verified child payloads.
|