Repository navigation
Dispatch Scripts
All execution scripts live in dispatch/. Together they form the backbone of Hydra's routing, editing, reviewing, and cost-tracking.
Single entry point for developer commands.
./dispatch/hydra.sh status
./dispatch/hydra.sh list
./dispatch/hydra.sh do SIMPLE "write a User DTO"
./dispatch/hydra.sh duck "$(cat src/auth.ts)"
./dispatch/hydra.sh set-pct 52Resolves enum keys to model tiers, handles fallbacks, skips exhausted pools. Writes cost records to logs/cost.jsonl. See Routing Protocol.
Wraps agy --print to target a specific model by swapping the model in ~/.gemini/antigravity-cli/settings.json, restoring it on exit. Parses stderr for browser auth URLs.
Executes prompts against local Ollama (Qwen2.5-Coder by default). Checks daemon health, starts it if needed. Extracts token counts from the JSON response.
Guards workspace directory permissions before any write. Checks allowed_globs/denied_globs from registry/workspace.yaml.
dispatch/scope.sh /absolute/path/to/file.ts
# exits 0 if allowed, exits 1 if deniedReads registry/policy.yaml and evaluates rules against a task spec to output execution flags for edit.sh:
{ "edit_mode": "sr-blocks", "retry_limit": 3 }Files over 400 lines get sr-blocks (search-replace diffs) instead of full rewrite.
Applies model-generated edits atomically with backup and rollback.
- Creates
.hydra-baksnapshot - Applies edit (full rewrite or search-replace blocks)
- Runs file validator (
node --check,bash -n, etc.) - If validation fails → rolls back from
.hydra-bak
dispatch/review.sh summary # JSON list of modified files
dispatch/review.sh diff # unified diff
dispatch/review.sh approve # stage changes, remove backups
dispatch/review.sh reject # rollback all changes
dispatch/review.sh qa # dispatch diff to a QA tierFans out multiple independent tasks as background jobs, aggregates results into a unified JSON array. Saves to logs/last_parallel.json.
dispatch/parallel.sh '[
{"enum": "SIMPLE", "prompt": "write UserDTO", "file": "src/user.dto.ts"},
{"enum": "SIMPLE", "prompt": "write PostDTO", "file": "src/post.dto.ts"}
]'Executes multi-stage playbooks from registry/playbooks.yaml.
dispatch/company.sh start refactor-sweep
dispatch/company.sh next
dispatch/company.sh statusScans workspace directories and builds compressed code signature maps for injection into model prompts. Supports TS, JS, Rust, Go, Python, Shell.
dispatch/repo-map.sh src/dispatch/cost.sh by-tier
dispatch/cost.sh by-day
dispatch/cost.sh by-run