Dispatch Contract
dispatch_contractSend code-review, audit, implementation, or test contracts to another local AI agent over shared SQLite, with file fingerprints and overlap warnings.
Instructions
Dispatch a task or code review contract to another local AI agent host via the shared SQLite WAL mesh.
Purpose
Registers a new contract in SUBMITTED status with full-file SHA-256 fingerprint snapshots of all target files, establishing an immutable baseline for cross-host verification and emitting active pointer overlap warnings.
Usage Guidelines
When to use: Use when requesting code reviews, architecture audits, implementation, or test generation from a target agent (e.g., target_agent="workbuddy" or "antigravity").
Mutation Write Modes (ADR-0006 / ADR-0007):
write_mode="direct" (default for implementation / test_generation): Worker edits pointer files directly on disk and commits post-mutation SHA-256 hashes at fulfill time.
write_mode="proposal": Worker is forbidden from editing disk files and must deliver a unified git diff in proposed_patch; requester reviews and atomically applies it via apply_contract_patch. Recommended when concurrent agents share workspace_root.
When NOT to use:
Do NOT use to claim or execute tasks (use poll_next_task).
Do NOT use to check task status or inspect outputs (use inspect_mesh_state).
Do NOT pass write_mode on read-only tasks (code_review / architecture_audit).
Behavior & Side Effects
Mutates local SQLite database (~/.ferrycat/mesh.db) only; makes zero network requests.
Active Pointer Overlap Detection (ADR-0007): Checks non-expired SUBMITTED / CLAIMED contracts in the same workspace_root and populates overlapping_contracts + warning if pointer files intersect.
Return Value
Returns { contract_id, status: 'SUBMITTED', created_at, write_mode?, files, patch_sha256?, patch_bytes?, overlapping_contracts?, warning? }.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"target_agent": "<target_agent>",
"task_type": "<task_type>",
"title": "<title>",
"context_summary": "<context_summary>",
"workspace_root": "<workspace_root>",
"pointers": "<pointers>"
},
"name": "dispatch_contract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Concise contract title (1-120 chars) summarizing the goal of the request. | |
| pointers | Yes | Array of 1 to 50 target file pointers hashed with full-file SHA-256 and snapshot boundaries for tamper detection. | |
| git_patch | No | Optional unified git diff patch payload (max 512KB, FC-202) enabling self-contained cross-branch or disjoint workspace reviews without requiring identical on-disk working tree state. | |
| task_type | Yes | Type of contract task. Tiered default execution TTL: 1800s for code_review/architecture_audit, 300s for implementation/test_generation. | |
| write_mode | No | Mutation delivery mode for "implementation" | "test_generation" contracts (ADR-0007). Defaults to "direct" (worker edits pointer files in place per ADR-0006). Set "proposal" to forbid worker disk edits and require delivering a unified diff via proposed_patch for requester-controlled atomic apply. | |
| exec_ttl_sec | No | Execution TTL in seconds once CLAIMED (default: 1800s for review/audit, 300s for implementation/test). Worker must fulfill, extend, release, or fail within this window. | |
| target_agent | Yes | Target worker agent identifier expected to claim and execute this contract (e.g., "workbuddy", "antigravity"). | |
| queue_ttl_sec | No | Queue expiration TTL in seconds while status is SUBMITTED (default: 1800s / 30m). Transitions to TIMED_OUT if unclaimed before expiry. | |
| workspace_root | Yes | Absolute canonical path to the shared local workspace directory accessible by both hosts (e.g. "F:/git/FerryCat"). Path escapes and sensitive files are blocked. | |
| context_summary | Yes | Detailed task instructions, audit focus areas, architectural constraints, and background context for the worker agent (1-20000 chars). | |
| contract_schema | No | Optional Draft-07 JSON Schema that structured_output must validate against. Bounded to 1MB and max 32 depth (FC-302). | |
| requester_agent | No | Requester agent identifier. Defaults to AGENT_NAME env var (e.g., "antigravity", "workbuddy"). |