agent-orchestration-skill 0.0.0-stage → 1.0.0
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.
- package/CATALOG.md +161 -0
- package/LICENSE +21 -0
- package/README.md +66 -2
- package/SKILL.md +119 -0
- package/assets/models.json +105 -0
- package/assets/result.schema.json +77 -0
- package/bin/cli.mjs +249 -0
- package/install/CAI-DAT.md +51 -0
- package/install/install.ps1 +63 -0
- package/install/install.sh +35 -0
- package/package.json +44 -4
- package/references/adapters/antigravity-cli.md +32 -0
- package/references/adapters/claude-code.md +60 -0
- package/references/adapters/codex-cli.md +53 -0
- package/references/adapters/other-agents.md +95 -0
- package/references/brief-and-budget.md +132 -0
- package/references/gates-and-routing.md +72 -0
- package/references/huddle.md +95 -0
- package/references/management-models.md +19 -0
- package/references/multi-perspective-and-single-host.md +140 -0
- package/references/roles.md +46 -0
- package/references/self-update.md +39 -0
- package/references/team-shapes.md +77 -0
- package/references/two-way.md +29 -0
- package/references/verification.md +49 -0
- package/scripts/agent_run.py +871 -0
- package/scripts/anatomy.py +454 -0
- package/scripts/ao_common.py +1518 -0
- package/scripts/codex_run.py +226 -0
- package/scripts/discover.py +448 -0
- package/scripts/route.py +384 -0
- package/scripts/skill_sandbox.py +601 -0
package/CATALOG.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# CATALOG.md — Fast Rules & CLI Cheat Sheet (1-Page Index)
|
|
2
|
+
|
|
3
|
+
> **Read this file first.** It gives any agent (Claude Code, Codex CLI, Antigravity `agy`) the complete operational rules, live CLI commands, anti-hallucination evidence contract, and reference index in ~150 lines so you do not have to read all `references/*.md` files.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Twelve Golden Rules (How Agents Collaborate)
|
|
8
|
+
|
|
9
|
+
1. **Delegate only when it pays:** Multi-agent runs cost ~5x–15x chat tokens; external CLI calls add ~12.5k (`codex`) to ~19.5k (`agy`) fixed overhead. Do tiny tasks (`<3` tool calls) yourself or via native subagents.
|
|
10
|
+
2. **Hardware-Aware Parallel Orchestration & Specialized Skill Delegation (`batch` + `--skill`):** Any complex task is decomposed into independent sub-agents running **in parallel** with clean KV-cache context (`Zero-Prior Briefs`), shared upstream artifacts (`--context-file`), attached domain-specific skills (`--skill <skill_name>`), and—whenever files are modified—strictly disjoint `--may-write` scopes (or isolated `--worktree` / `Workspace: "branch"`). **Do not reinvent domain workflows inside orchestration:** attach installed specialized skills (`route.py --list-skills`) so workers follow domain-grade tools and instructions. **Always respect machine hardware (`ao_common.probe_hardware()`):** parallel `wip` is automatically throttled by available CPU cores, free RAM (`~1.5 GB` per worker + `2.0 GB` OS reserve), GPU VRAM, and free disk space.
|
|
11
|
+
3. **Three Brief Modes (match ceremony to uncertainty):**
|
|
12
|
+
- `tight` (4 lines: Intent/Done, Context, Scope, Output) → lookups, mechanical edits, small tests.
|
|
13
|
+
- `guided` (Role lens, Intent, DoD, Context, Latitude, Finish line, Scope) → features, code review, docs.
|
|
14
|
+
- `exploratory` (Core problem, Questions/Hypotheses, full read-only freedom) → hard debugging, unfamiliar architecture, research.
|
|
15
|
+
4. **Roles are lenses (a floor, never blinders):** A worker examines its role's core angles AND follows evidence trails wherever they lead, flagging cross-boundary bugs in `open_questions` or `handoff_notes`.
|
|
16
|
+
5. **Premise Challenge Right (`assumptions_challenged`):** If code or data disproves an assumption in the manager's brief, the worker MUST challenge it in `assumptions_challenged` with proof (`file:line` or command output).
|
|
17
|
+
6. **Anti-Hallucination Evidence Law (No Proof = No Claim):**
|
|
18
|
+
- Every conclusion in `summary`, every critique finding, and every item in `assumptions_challenged` **MUST** cite verifiable ground truth (`file:line-line`, `command -> exit/output`, or measured numbers in `evidence[]`).
|
|
19
|
+
- Unbacked skepticism is just a worry (`risks[]`), never a valid objection or blocker.
|
|
20
|
+
- `agent_run.py` automatically audits envelopes and flags `evidence_warnings` in `meta.json` when claims lack concrete anchors.
|
|
21
|
+
7. **Shared Blackboard (`--context-file`) over Lossy Manager Relay:** Never summarize a 10-page upstream artifact into 3 sentences for the next agent. Pass `--context-file <path>` so downstream agents read upstream findings/diffs directly.
|
|
22
|
+
8. **Dynamic Model Discovery (never rely on stale hardcoded lists):** `discover.py` probes live models across all 3 harnesses (`agy models`, `~/.codex/.codex-global-state.json`, `~/.claude/cache/model-catalog/*` & `gateway-models.json`), and `route.py` scores and selects the best live model per tier automatically (`source: live_discovered`).
|
|
23
|
+
9. **Epistemic Independence = Different Model Family (or Single-Host Clean-Context + Alt Family/Lens):** An independent reviewer (`review`, `security-review`, `critique`) must come from a different model family (`openai` vs `google` vs `anthropic`) than the builder (`route.py --builder <vendor>` enforces this). If only 1 agent exists on the machine (`--single-host`), `route.py` automatically switches to an intra-host alternate model family (e.g., `agy` switching from `gemini-4-argon-high` to `claude-opus-5-5-high`) + **Zero-Prior Clean-Context Sub-Agent**.
|
|
24
|
+
10. **Empirical Huddle (Spike before Debate, Synthesis Option C):** When panelists disagree on a testable fact, run a 2-minute micro-spike/command to measure the truth instead of running another prose debate round. On design trade-offs, ask panelists to synthesize a better **Option C**.
|
|
25
|
+
11. **Parent-to-Child Skill Path Sharing & Ephemeral Skill Sandbox (`--skill` + `skill_sandbox.py`):**
|
|
26
|
+
- **Rule 1 — Share Parent Skill Paths First (Never Re-Install What You Can Read):** `route.py --list-skills` scans all parent/host skill directories (`~/.agents/skills`, `~/.claude/skills`, `~/.codex/skills`, `~/.gemini/config/skills`, `plugins/*/skills`, `builtin/skills`). When a parent agent has a matching skill, pass `--skill <name>` in `agent_run.py run`/`batch` (or pass the `SKILL.md` path directly in a native sub-agent's brief). `agent_run.py` automatically injects the `SKILL.md` path and mounts the skill directory (`--add-dir`) so child agents read it directly without installing anything.
|
|
27
|
+
- **Rule 2 — Ephemeral Skill Sandbox (`~/.agent-orchestration/sandbox-skills/`):** Only when NO local parent skill covers the task, run `skill_sandbox.py search <query>` to search curated high-trust registries (`anthropics/skills`, `openai/skills`, `vercel-labs/agent-skills`, `huggingface/skills`, `obra/superpowers`, or verified GitHub repos with `>= 50` stars). **Always ask the user for approval first**, then run `skill_sandbox.py install <repo> [--subpath ...] --approved-by-user`. The skill is security-scanned and stored strictly inside `agent-orchestration`'s own ephemeral sandbox memory (never touching system/global folders) and can be deleted anytime via `skill_sandbox.py remove <name>` or `skill_sandbox.py purge`.
|
|
28
|
+
|
|
29
|
+
12. **Orchestration Anatomy Engine & Keyhole Interlocks — Size Gate, Truth Lock, Settle & Audit to Zero, Change-Ripple Amend, 4x Junction Check (`anatomy.py` + `batch --audit`):**
|
|
30
|
+
- **Size It First (`Micro` <=1 | `Figure` 2–4 | `Hero` 5–8 | `Epic` >8):** Name the scale up front. If `>8` packages (`Epic`), stop and propose a `Hero` slice (`<=8` packages) first unless the user explicitly approves the Epic.
|
|
31
|
+
- **Truth Lock & Keyhole Invariants (`truth_contract` + `--invariant` + `truth_hash`):** Lock user prerequisites and thresholds (`KEY=VAL`, `KEY<=VAL`, `KEY>=VAL`, `must:PAT`, `forbid:PAT`) in `.orch/truth-contract.md` and `plan.json` with a SHA-256 `truth_hash`. Workers cannot write to `truth_contract` directly.
|
|
32
|
+
- **Settle & Audit to Zero (`anatomy.py init|settle|audit` & `agent_run.py batch --audit`):** Solves topological execution waves (`Wave 0, Wave 1, ...`), wires upstream `outputs` + `result.json` into downstream `context_file` mounts, and proves **0 problems** across 8 checks (`clearance`, `cycles`, `terminals`, `support`, `stand_in_briefs`, `skill_mounts`, `truth_contract`, `interlocks`).
|
|
33
|
+
- **Change-Ripple Protocol & Anti-Silent-Conflict (`anatomy.py amend` & `batch --auto-amend`):** Prevents one worker from changing a parameter while sibling workers silently remain on the old value. After each wave, `check_invariant_drift()` and `detect_cross_package_conflicts()` halt the pipeline if any worker violates a locked threshold (`INVARIANT_DRIFT` / `THRESHOLD_VIOLATION`) or defines conflicting constants across packages (`CROSS_PACKAGE_CONFLICT`). Formal changes require `truth_amendments` with proof (`evidence`), triggering `anatomy.py amend` to increment `truth_version`, mount `.orch/truth-amendment-vN.md` into all packages' `context_file`, and flag already-run packages with the old value as `stale_packages`.
|
|
34
|
+
- **1x Macro & 4x Junction Close-Ups (`anatomy.py inspect`):** Post-flight check across every seam verifying `missing_outputs`, `invariant_violations`, `cross_package_conflicts`, `truth_amendments`, `assumptions_challenged`, `open_questions`, and `evidence_warnings`.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 2. Fast CLI Command Matrix (All 3 Agents)
|
|
39
|
+
|
|
40
|
+
Replace `<skill>` with the skill folder path (e.g. `~/.agents/skills/agent-orchestration`).
|
|
41
|
+
|
|
42
|
+
### A. Zero-Token Live Model & Skill Inspection + Routing
|
|
43
|
+
```bash
|
|
44
|
+
# 1. Inspect ALL live available models and installed specialized skills right now (0 tokens)
|
|
45
|
+
python <skill>/scripts/route.py --list-models
|
|
46
|
+
python <skill>/scripts/route.py --list-skills
|
|
47
|
+
|
|
48
|
+
# 2. Refresh full capability snapshot (flags, MCPs, plugins, skills, live models)
|
|
49
|
+
python <skill>/scripts/discover.py --quick # fast version check (exit 10 -> run full)
|
|
50
|
+
python <skill>/scripts/discover.py # full live model & capability snapshot
|
|
51
|
+
|
|
52
|
+
# 3. Compute optimal vendor, live-scored model, matched specialized skills & hardware-safe wip (0 tokens)
|
|
53
|
+
python <skill>/scripts/route.py --task-type review --risk med --builder codex --manager claude
|
|
54
|
+
python <skill>/scripts/route.py --task-type research --need arxiv --manager agy --same-model
|
|
55
|
+
|
|
56
|
+
# 4. Single-Host & Same-Model Mode (when only 1 agent or only 1 model is used across all sub-agents)
|
|
57
|
+
python <skill>/scripts/route.py --task-type design --manager agy --same-model
|
|
58
|
+
python <skill>/scripts/route.py --task-type review --builder agy --manager agy --same-model
|
|
59
|
+
python <skill>/scripts/route.py --task-type design --manager agy --single-host
|
|
60
|
+
|
|
61
|
+
# 5. Orchestration Anatomy: Init Truth + Keyhole Invariants, Audit to Zero, Amend Ripple & 4x Junction Check
|
|
62
|
+
python <skill>/scripts/anatomy.py init --goal "Build & verify auth" \
|
|
63
|
+
--invariant "PORT=8080" --invariant "MAX_LATENCY_MS<=200" \
|
|
64
|
+
--pkg "contract:guided::src/types.py::.orch/auth-schema.md" \
|
|
65
|
+
--pkg "impl:guided:contract:src/auth/::src/auth/handler.py" \
|
|
66
|
+
--pkg "verify:exploratory:impl" --out .orch/plan.json
|
|
67
|
+
python <skill>/scripts/anatomy.py audit .orch/plan.json
|
|
68
|
+
python <skill>/scripts/agent_run.py batch .orch/plan.json [--audit] [--auto-amend]
|
|
69
|
+
python <skill>/scripts/anatomy.py amend .orch/plan.json --set "MAX_LATENCY_MS<=250" \
|
|
70
|
+
--reason "Measured p99 under cold start" --evidence "bench.py:42 -> 235ms"
|
|
71
|
+
python <skill>/scripts/anatomy.py inspect .orch/plan.json
|
|
72
|
+
|
|
73
|
+
# 6. Ephemeral Skill Sandbox (ONLY when parent agent lacks a needed skill; MUST ask user before install)
|
|
74
|
+
python <skill>/scripts/skill_sandbox.py check <keyword>
|
|
75
|
+
python <skill>/scripts/skill_sandbox.py search <query> --min-stars 50
|
|
76
|
+
python <skill>/scripts/skill_sandbox.py install <owner/repo> [--subpath <dir>] --name <slug> --approved-by-user
|
|
77
|
+
python <skill>/scripts/skill_sandbox.py list
|
|
78
|
+
python <skill>/scripts/skill_sandbox.py remove <slug>
|
|
79
|
+
python <skill>/scripts/skill_sandbox.py purge [--expired]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### B. Unified Cross-Agent Runner (`agent_run.py`)
|
|
83
|
+
Works identically from **Claude Code**, **Codex CLI**, or **Antigravity (`agy`)**:
|
|
84
|
+
```bash
|
|
85
|
+
# Call CODEX CLI (surgical logic, deep debugging, refactoring, live web search, isolated worktree)
|
|
86
|
+
python <skill>/scripts/agent_run.py run --agent codex --brief brief.md --name audit-rng \
|
|
87
|
+
--task-type review --tier frontier --mode read --context-file .orch/spec.md [--search]
|
|
88
|
+
|
|
89
|
+
# Call CODEX CLI for isolated parallel writing in a Git Worktree
|
|
90
|
+
python <skill>/scripts/agent_run.py run --agent codex --brief brief.md --name impl-auth \
|
|
91
|
+
--task-type implement --mode write --may-write src/auth/ --worktree
|
|
92
|
+
|
|
93
|
+
# Call CLAUDE CODE CLI (`claude -p`: 1M context gateway/catalog models, bare fast start, USD budget cap, worktree)
|
|
94
|
+
python <skill>/scripts/agent_run.py run --agent claude --brief brief.md --name arch-review \
|
|
95
|
+
--task-type review --tier frontier --mode read --context-file .orch/spec.md [--bare] [--max-budget-usd 0.50]
|
|
96
|
+
|
|
97
|
+
# Call ANTIGRAVITY CLI (`agy -p`: broad context synthesis, Gemini 4 Argon / Claude 5.5 hosting)
|
|
98
|
+
python <skill>/scripts/agent_run.py run --agent agy --brief brief.md --name broad-scout \
|
|
99
|
+
--task-type explore --tier standard --mode read
|
|
100
|
+
|
|
101
|
+
# Resume any session cheaply with only the delta (keeps original scope/sandbox)
|
|
102
|
+
python <skill>/scripts/agent_run.py run --agent codex --brief delta.md --resume <session_id>
|
|
103
|
+
|
|
104
|
+
# Record manager verdict (feeds Earned Autonomy in ~/.agent-orchestration/ledger.jsonl)
|
|
105
|
+
python <skill>/scripts/agent_run.py verdict <run_dir> accept --note "Verified with pytest"
|
|
106
|
+
python <skill>/scripts/agent_run.py stats
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### C. Power Native Commands (Direct Harness Features)
|
|
110
|
+
- **Codex CLI Native:**
|
|
111
|
+
- Non-interactive diff/branch/commit review: `codex review --uncommitted` | `codex review --base main` | `codex review --commit <SHA>`
|
|
112
|
+
- Isolated worktree execution: `codex exec --worktree -s workspace-write - < brief.md`
|
|
113
|
+
- Apply latest agent diff: `codex apply`
|
|
114
|
+
- **Claude Code Native & CLI:**
|
|
115
|
+
- In-session subagent: `Agent(subagent_type="Explore"|"general-purpose", model="haiku"|"sonnet"|"opus", isolation="worktree", prompt="...")`
|
|
116
|
+
- Resume/message subagent: `SendMessage(to="<agent_id>", message="...")`
|
|
117
|
+
- Cloud multi-agent PR/branch review: `claude ultrareview`
|
|
118
|
+
- Background daemon agent: `claude --bg -p "<prompt>"` → manage via `claude agents`, `claude logs <id>`, `claude attach <id>`, `claude stop <id>`
|
|
119
|
+
- Fast cold-start headless call (skips hooks/LSP/auto-discovery): `claude -p --bare --output-format json ...`
|
|
120
|
+
- **Antigravity (`agy`) Native:**
|
|
121
|
+
- Spawn subagent with isolated workspace: `invoke_subagent(TypeName="self"|"research", Role="...", Prompt="...", Model="inherit"|"flash"|"pro", Workspace="inherit"|"branch"|"share")`
|
|
122
|
+
- Direct peer/subagent messaging: `send_message(Recipient="<conversationId>", Message="...")`
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 3. Result Envelope Contract (`assets/result.schema.json`)
|
|
127
|
+
|
|
128
|
+
Every worker returns one JSON object:
|
|
129
|
+
- **Required:**
|
|
130
|
+
- `status`: `"done" | "partial" | "blocked" | "stopped"`
|
|
131
|
+
- `summary`: Conclusion first (1–5 sentences), **citing `[E1]` / `file:line`**.
|
|
132
|
+
- `deliverables`: `["path/to/file", ...]` (never paste huge blobs inline).
|
|
133
|
+
- `evidence`: `["[E1] src/train.py:142 — RNG seeded before optional module", "[E2] pytest tests/ -> 12 passed"]` (**must contain concrete anchors**).
|
|
134
|
+
- `risks`: `["open issue or unverified worry"]`
|
|
135
|
+
- `next_action`: `"what the manager should decide or run next"`
|
|
136
|
+
- **Optional (v3 cognitive & handoff fields):**
|
|
137
|
+
- `confidence`: `"low" | "med" | "high"`
|
|
138
|
+
- `assumptions_challenged`: `["Brief assumed X, but src/foo.py:88 proves Y"]`
|
|
139
|
+
- `open_questions`: `["Emergent lead found in src/bar.py:19"]`
|
|
140
|
+
- `handoff_notes`: `"Direct technical notes/invariants for the next agent"`
|
|
141
|
+
- `truth_amendments`: `[{"key": "PORT", "old_value": "8080", "proposed_value": "9090", "reason": "...", "evidence": "..."}]`
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 4. When to Read Deep Reference Files (`references/`)
|
|
146
|
+
|
|
147
|
+
Only open a reference file when you need its full template or edge-case rules:
|
|
148
|
+
|
|
149
|
+
| File | Open ONLY when... |
|
|
150
|
+
|---|---|
|
|
151
|
+
| [`SKILL.md`](SKILL.md) | You need the full orchestration loop and safety policy |
|
|
152
|
+
| [`references/multi-perspective-and-single-host.md`](references/multi-perspective-and-single-host.md) | **Single-agent mode (e.g. only `agy`)**, Zero-Prior de-biasing, Orthogonal Expert Council, and the 5-stage `Diverge → Falsify → Probe → Synthesize → Plan` workflow |
|
|
153
|
+
| [`references/brief-and-budget.md`](references/brief-and-budget.md) | You need copy-paste templates for `tight`, `guided`, or `exploratory` briefs |
|
|
154
|
+
| [`references/roles.md`](references/roles.md) | You are picking specific examination angles for a specialized role |
|
|
155
|
+
| [`references/huddle.md`](references/huddle.md) | You are calling a multi-model huddle on a Type 1 or deadlocked decision |
|
|
156
|
+
| [`references/team-shapes.md`](references/team-shapes.md) | You are designing a multi-phase pipeline, competing hypotheses, or peer mesh |
|
|
157
|
+
| [`references/gates-and-routing.md`](references/gates-and-routing.md) | You are overriding `route.py` or checking permission blast-radius rules |
|
|
158
|
+
| [`references/verification.md`](references/verification.md) | A worker failed, challenged a premise, or triggered `evidence_warnings` / `violations` |
|
|
159
|
+
| [`references/adapters/codex-cli.md`](references/adapters/codex-cli.md) | You need advanced Codex CLI flags (`codex review`, `--worktree`, `--search`, profiles) |
|
|
160
|
+
| [`references/adapters/claude-code.md`](references/adapters/claude-code.md) | You need advanced Claude CLI flags (`claude -p`, `--bare`, `--worktree`, `--bg`, `ultrareview`, gateway models) |
|
|
161
|
+
| [`references/adapters/antigravity-cli.md`](references/adapters/antigravity-cli.md) | You need `agy` headless permission rules or native `invoke_subagent` details |
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 haulth
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,3 +1,67 @@
|
|
|
1
|
-
#
|
|
1
|
+
# agent-orchestration
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Skill điều phối đa agent và sub-agent (`Claude Code`, `Codex CLI`, `Antigravity / agy`), tập trung vào chia việc chạy song song hiệu quả theo phần cứng máy, chọn model tự động, chia sẻ trực tiếp skill từ agent mẹ sang agent con, và quản lý **Skill Sandbox tạm thời** an toàn.
|
|
4
|
+
|
|
5
|
+
## Điểm cốt lõi
|
|
6
|
+
- **Tự động nhận diện model khả dụng (0 token):** Quét trực tiếp các model đang có trên máy (`route.py --list-models`) và chọn model phù hợp nhất theo độ khó tác vụ (hỗ trợ cả chế độ 1 agent `--single-host` hoặc cùng 1 model `--same-model`).
|
|
7
|
+
- **Chia sẻ trực tiếp Skill từ Agent mẹ sang Agent con (`--skill` — có sẵn là dùng ngay, không cài thêm):** Tự động dò các skill chuyên sâu mà Agent mẹ đang có (`route.py --list-skills`) và truyền thẳng đường dẫn `SKILL.md` + quyền đọc thư mục (`--add-dir`) cho Agent con.
|
|
8
|
+
- **Ephemeral Skill Sandbox (`skill_sandbox.py`):** Khi thiếu skill chuyên sâu chưa có trên máy, chỉ tìm từ các kho chính hãng/uy tín cao (`anthropics/skills`, `openai/skills`, `vercel-labs/agent-skills`, `huggingface/skills`, hoặc repo đạt chuẩn uy tín), **bắt buộc hỏi ý kiến người dùng trước khi cài (`--approved-by-user`)**, quét bảo mật tĩnh và lưu tạm vào bộ nhớ riêng (`~/.agent-orchestration/sandbox-skills/`) — xóa sạch bất cứ lúc nào (`remove` / `purge`) mà không ảnh hưởng hệ thống.
|
|
9
|
+
- **Giải phẫu công việc & Chốt chặn Khóa liên động (`Orchestration Anatomy & Keyhole Interlock` — `anatomy.py` & `batch --audit`):**
|
|
10
|
+
- **Size Gate (`Micro` <=1 | `Figure` 2–4 | `Hero` 5–8 | `Epic` >8):** Định cỡ quy mô ngay từ đầu; nếu vượt quá 8 gói việc (`Epic`), tự động dừng để đề xuất lát cắt `Hero` trước.
|
|
11
|
+
- **Truth Lock & Keyhole Invariants (`truth_contract` + `--invariant` + `truth_hash`):** Khóa chặt các quy chuẩn tiên quyết và thông số ngưỡng của người dùng (`--invariant "PORT=8080" --invariant "MAX_LATENCY_MS<=200" --invariant "must:..." --invariant "forbid:..."`) kèm mã băm `truth_hash` (SHA-256) và khóa quyền ghi `truth-contract.md`.
|
|
12
|
+
- **Chống tự ý đổi ngầm & Lan truyền thay đổi (`check_invariant_drift`, `detect_cross_package_conflicts`, `anatomy.py amend`):** Chặn triệt để tình trạng *"1 ông tự ý đổi thông số, mấy ông khác nín thin dẫn đến xung đột"*. Tự động quét code/output sau mỗi đợt sóng để bắt lỗi lệch ngưỡng (`INVARIANT_DRIFT`, `THRESHOLD_VIOLATION`) hoặc lệch hằng số giữa các gói (`CROSS_PACKAGE_CONFLICT`). Khi cần đổi thông số có bằng chứng (`truth_amendments`), lệnh `anatomy.py amend` (hoặc `batch --auto-amend`) tự động nâng `truth_version`, gắn thông báo `.orch/truth-amendment-vN.md` vào mọi gói việc và đánh dấu các gói đã chạy bằng thông số cũ là `stale_packages` để buộc đồng bộ lại.
|
|
13
|
+
- **Audit to Zero (`anatomy.py audit` / `batch --audit`) & 4x Junction Check (`anatomy.py inspect`):** Kiểm toán tự động **0 lỗi ở 8 hạng mục** trước khi chạy và soi cận cảnh **4x tại các khớp nối** sau khi chạy.
|
|
14
|
+
- **Điều phối song song theo phần cứng thực tế (`batch` & native sub-agents):** Tự động đo **CPU cores, RAM trống, dung lượng ổ cứng và GPU VRAM** (`probe_hardware()`) để giới hạn số luồng song song an toàn (`recommended_wip`), kết hợp ngữ cảnh sạch (`Zero-Prior Brief`), bảng đen dùng chung (`--context-file`) và khóa vùng ghi tách biệt (`--may-write` / `--worktree`).
|
|
15
|
+
- **Luật bằng chứng (`No Proof = No Claim`):** Mọi kết luận và phản biện (`assumptions_challenged`) bắt buộc kèm dẫn chứng kiểm chứng được (`file:line`, `command -> output`, `DOI/arXiv/PMID/URL`).
|
|
16
|
+
|
|
17
|
+
## Lệnh sử dụng nhanh
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# 1. Xem model khả dụng, skill có sẵn trên Agent mẹ và gợi ý định tuyến (0 token)
|
|
21
|
+
python <skill>/scripts/route.py --list-models
|
|
22
|
+
python <skill>/scripts/route.py --list-skills
|
|
23
|
+
python <skill>/scripts/route.py --task-type research --need arxiv --manager agy --same-model
|
|
24
|
+
|
|
25
|
+
# 2. Giải phẫu công việc + Khóa ngưỡng tiên quyết (--invariant) + Audit to Zero + Amend lan truyền & Soi khớp nối 4x
|
|
26
|
+
python <skill>/scripts/anatomy.py init --goal "Triển khai & kiểm chứng module X" \
|
|
27
|
+
--invariant "PORT=8080" --invariant "MAX_LATENCY_MS<=200" \
|
|
28
|
+
--pkg "contract:guided::src/types.py::.orch/contract-out.md" \
|
|
29
|
+
--pkg "impl:guided:contract:src/core/::src/core/engine.py" \
|
|
30
|
+
--pkg "verify:exploratory:impl" --out .orch/plan.json
|
|
31
|
+
python <skill>/scripts/anatomy.py audit .orch/plan.json
|
|
32
|
+
python <skill>/scripts/agent_run.py batch .orch/plan.json [--audit] [--auto-amend]
|
|
33
|
+
python <skill>/scripts/anatomy.py amend .orch/plan.json --set "MAX_LATENCY_MS<=250" \
|
|
34
|
+
--reason "Đo thực nghiệm p99" --evidence "bench.py:42 -> 235ms"
|
|
35
|
+
python <skill>/scripts/anatomy.py inspect .orch/plan.json
|
|
36
|
+
|
|
37
|
+
# 3. Chạy worker đơn lẻ (chia sẻ thẳng path skill của Agent mẹ qua --skill)
|
|
38
|
+
python <skill>/scripts/agent_run.py run --agent agy --brief brief.md --mode read \
|
|
39
|
+
--skill literature-search-arxiv --context-file .orch/spec.md
|
|
40
|
+
|
|
41
|
+
# 4. Skill Sandbox tạm thời (chỉ dùng khi máy chưa có skill; BẮT BUỘC hỏi người dùng trước khi cài)
|
|
42
|
+
python <skill>/scripts/skill_sandbox.py check <keyword>
|
|
43
|
+
python <skill>/scripts/skill_sandbox.py search <query> --min-stars 50
|
|
44
|
+
python <skill>/scripts/skill_sandbox.py install <owner/repo> --subpath <path> --approved-by-user
|
|
45
|
+
python <skill>/scripts/skill_sandbox.py list
|
|
46
|
+
python <skill>/scripts/skill_sandbox.py remove <name>
|
|
47
|
+
python <skill>/scripts/skill_sandbox.py purge [--expired]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Cài đặt & Sử dụng qua NPX
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Cách 1: Cài qua chuẩn Agent Skills CLI (Claude Code, Codex, Antigravity, Cursor...)
|
|
54
|
+
npx skills add haulth/agent-orchestration
|
|
55
|
+
|
|
56
|
+
# Cách 2: Chạy trực tiếp trình cài đặt / kiểm tra hệ thống qua NPX (0 dependencies)
|
|
57
|
+
npx github:haulth/agent-orchestration
|
|
58
|
+
npx github:haulth/agent-orchestration doctor
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Hoặc cài từ bản clone nội bộ:
|
|
62
|
+
```powershell
|
|
63
|
+
.\install\install.ps1 # Windows (đồng bộ vào ~/.claude, ~/.agents, ~/.codex, ~/.gemini/config)
|
|
64
|
+
```
|
|
65
|
+
```bash
|
|
66
|
+
./install/install.sh # macOS / Linux
|
|
67
|
+
```
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-orchestration
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
license: MIT
|
|
5
|
+
description: Manage subagents like a professional manager and coordinate intelligent multi-agent collaboration with low token cost. It covers whether to delegate at all, choosing a team shape, picking the right brief mode (tight, guided, or exploratory so structure never limits agent intelligence), routing to the right model family and vendor (Claude subagents, Codex CLI, Antigravity/agy, `claude -p`), sharing context directly via a Shared Blackboard (`--context-file`) and native peer messaging, running constructive & empirical huddles, and accepting results on evidence. Use it whenever a task could be split across agents or models, whenever you consider spawning subagents, running work in parallel, handing a task to Codex, Antigravity or Claude, getting a second opinion or independent review, or coordinating a multi-step job.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Agent Orchestration
|
|
9
|
+
|
|
10
|
+
> **Fast Start:** Read [`CATALOG.md`](CATALOG.md) in the skill root first for the 1-page cheat sheet of all core rules, CLI invocation commands for **Codex CLI**, **Claude Code CLI**, and **Antigravity (`agy`)**, specialized skill attachment (`--skill`), the Anti-Hallucination Evidence Law, and the reference index.
|
|
11
|
+
|
|
12
|
+
You are the manager and integration owner. Workers own the deliverables and investigations you assign them. You set clear goals and safety boundaries up front, empower workers to think independently and challenge flawed premises, connect them directly to upstream artifacts so nuance is never lost, and judge results once on verifiable evidence.
|
|
13
|
+
|
|
14
|
+
Six principles drive every rule below:
|
|
15
|
+
1. **Multi-agent work has a real token cost — delegate only where it pays.**
|
|
16
|
+
- Published figures: multi-agent systems spend ~5x–15x the tokens of single-turn chat, and external CLI calls carry fixed cold-start overhead (~12.5k tokens on `codex`, ~19.5k on `agy`).
|
|
17
|
+
- Delegate only when **parallelism**, **context protection**, **epistemic independence** (a clean-context reviewer from a different model family), or **specialized capability** beats the cost of briefing and verification.
|
|
18
|
+
2. **Unleash parallel intelligence; isolate or sequence writes.**
|
|
19
|
+
- Extra agents shine at thinking, exploring unknown unknowns, testing competing hypotheses, and auditing from diverse lenses.
|
|
20
|
+
- Concurrent writes to shared files conflict over hidden style and interface assumptions. Keep writes single-threaded in a shared working tree (`agent_run.py batch`), or give parallel writers frozen interfaces and isolated workspaces (`--worktree` on Codex/Claude, Claude `isolation: "worktree"`, or Antigravity `Workspace: "branch"|"share"`).
|
|
21
|
+
3. **Structure must scaffold intelligence, never suffocate it.**
|
|
22
|
+
- Over-prescribing steps or locking an agent into a narrow tunnel causes **cognitive tunneling**: the agent answers your literal question while stepping over the real bug or architectural flaw next door.
|
|
23
|
+
- Match the brief's ceremony to the task's uncertainty (**Three Brief Modes**: `tight`, `guided`, `exploratory`), treat role checklists as a **floor rather than a ceiling**, and honor every worker's **Premise Challenge Right** (`assumptions_challenged`).
|
|
24
|
+
4. **Anti-Hallucination Evidence Law (No Proof = No Claim).**
|
|
25
|
+
- Every critique finding, premise challenge (`assumptions_challenged`), and final conclusion (`summary`) **MUST** carry a verifiable ground-truth anchor in `evidence[]`: exact `file:line-line` + excerpt, `command -> exit code / output`, or measured numbers.
|
|
26
|
+
- Unbacked claims or vague skepticism ("this might be slow", "this seems risky") are never accepted as verdicts or blockers—`agent_run.py` automatically audits result envelopes and flags unanchored claims in `meta.json` (`evidence_warnings`).
|
|
27
|
+
5. **Orchestration Anatomy Engine & Keyhole Interlocks — Size It, Truth Lock, Settle & Audit to Zero, Change-Ripple Amend (`anatomy.py` + `agent_run.py batch --audit`).**
|
|
28
|
+
- **Size It First (`Micro` <=1 | `Figure` 2–4 | `Hero` 5–8 | `Epic` >8):** Name the scale up front. If a plan exceeds 8 packages (`Epic`), **stop and propose a `Hero` slice (`<=8` packages) first** unless the user explicitly approves the Epic (`--allow-epic`).
|
|
29
|
+
- **Truth First & Keyhole Invariant Locks (`truth_contract` + `--invariant` + `truth_hash`):** Lock user prerequisites, constants, and threshold bounds (`--invariant "PORT=8080" --invariant "MAX_LATENCY_MS<=200" --invariant "must:verify_jwt" --invariant "forbid:eval("`) in `.orch/truth-contract.md` and `plan.json` with a SHA-256 keyhole digest (`truth_hash`). Workers are write-locked out of `truth-contract.md` so no single worker can silently drift from user prerequisites.
|
|
30
|
+
- **Settle & Audit to Zero (`anatomy.py init|settle|audit`):** `ao_common.settle_plan()` solves topological execution waves (`Wave 0, Wave 1, ...`) and auto-wires `truth_contract` + upstream `outputs` into downstream `context_file` mounts. `ao_common.audit_plan()` proves **0 structural & interlock defects** across 8 checks (`clearance`, `cycles`, `terminals`, `support`, `stand_in_briefs`, `skill_mounts`, `truth_contract`, and `interlocks`).
|
|
31
|
+
- **Anti-Silent-Mutation & Change-Ripple Protocol (`truth_amendments` + `anatomy.py amend` + Wave Interlock Gate):** Never allow one worker to change a shared constant/threshold while sibling workers silently remain on the old value. After each wave/batch, `check_invariant_drift()` and `detect_cross_package_conflicts()` scan deliverables for threshold drift (`INVARIANT_DRIFT` / `THRESHOLD_VIOLATION`) and conflicting constants across packages (`CROSS_PACKAGE_CONFLICT`). When a threshold genuinely must change, a worker emits `truth_amendments` with proof (`evidence`), and `anatomy.py amend` (or `batch --auto-amend`) increments `truth_version`, broadcasts `.orch/truth-amendment-vN.md` into all packages' `context_file`, and flags already-run packages that used the old value as `stale_packages` requiring re-sync.
|
|
32
|
+
- **1x Macro & 4x Junction Close-Ups (`anatomy.py inspect`):** Post-flight inspection across every producer→consumer seam checking `missing_outputs`, `invariant_violations`, `cross_package_conflicts`, `truth_amendments`, `assumptions_challenged`, `open_questions`, and `evidence_warnings`.
|
|
33
|
+
6. **De-Biased Parallel Sub-Agents, Parent-to-Child Skill Path Sharing & Ephemeral Skill Sandbox (`references/multi-perspective-and-single-host.md`).**
|
|
34
|
+
- In a single session, your own prior tokens create **autoregressive confirmation bias** (making you overconfident in your initial hunch). Even when only **one agent** or **one model** is used (`--single-host` / `--same-model`), break out of context bias by spawning **clean-context parallel sub-agents** (`invoke_subagent`, `Agent()`, or `agent_run.py batch`) with **Zero-Prior (Blinded) Briefs** (passing only verified facts, symptoms, and `file:line` pointers—never leaking your unverified hypothesis).
|
|
35
|
+
- **Share Parent Skill Paths Directly (`--skill` — never re-install readable skills):** Discover all skills readable by the parent agent via `route.py --list-skills` (or `skill_sandbox.py check <kw>`). When the parent agent already has a skill (in `~/.agents/skills`, `~/.claude/skills`, `~/.codex/skills`, `~/.gemini/config/skills`, or plugins), pass `--skill <name>` (or give its `SKILL.md` path in the sub-agent's prompt) so the child agent reads the parent's skill directly without installing a duplicate.
|
|
36
|
+
- **Ephemeral Skill Sandbox (`skill_sandbox.py`):** Only when no local skill covers the domain need, search high-trust, high-reputation sources (`anthropics/skills`, `openai/skills`, `vercel-labs/agent-skills`, `huggingface/skills`, `obra/superpowers`, or repos with `>= 50` stars) via `skill_sandbox.py search <query>`. **Ask the user for permission first**, then install into `~/.agent-orchestration/sandbox-skills/` with `skill_sandbox.py install ... --approved-by-user` (static security audit enforced; removable anytime via `remove` or `purge` with zero impact on the user's system).
|
|
37
|
+
|
|
38
|
+
## The Adaptive Loop
|
|
39
|
+
|
|
40
|
+
1. **Frame the goal & uncertainty.** State the desired outcome and constraints. Decide whether the problem is well-specified (`tight` or `guided` mode) or open-ended with unknown unknowns (`exploratory` mode).
|
|
41
|
+
2. **Economic gate: delegate or do it yourself.** Do it yourself if the brief costs as much as the work, takes <3 tool calls, or requires synthesis only you hold.
|
|
42
|
+
3. **Pick a team shape** from `references/team-shapes.md`: Solo, Scout/Explorer fan-out, Builder + Reviewer, Smart friend, Competing hypotheses, Frozen-interface pipeline, or Interactive Peer Mesh.
|
|
43
|
+
4. **Split the work cleanly:**
|
|
44
|
+
- For file writes and deliverables, scopes must be MECE (disjoint `--may-write` paths or isolated worktrees).
|
|
45
|
+
- For research, debugging, and review, deliberate perspective overlap across model families is encouraged.
|
|
46
|
+
5. **Pass the four gates:** Delegation & Brief Mode → Permission & Isolation → Cognitive Model Routing → Verification (`references/gates-and-routing.md`). Run `scripts/route.py` (zero tokens) to get the recommended vendor, model family, tier, brief mode, verify level, and command. Override freely when you have context it lacks—just state why in one line.
|
|
47
|
+
6. **Issue work orders & connect the Shared Blackboard** (`references/brief-and-budget.md`):
|
|
48
|
+
- Pick the brief mode (`tight` 4-line brief for lookups/small edits; `guided` for standard builds/reviews; `exploratory` for debugging, research, and design).
|
|
49
|
+
- **Avoid lossy manager relays:** when Worker B builds on or reviews Worker A's work, pass Worker A's artifact/diff directly via `--context-file <path>` (or native `send_message`) instead of re-summarizing it yourself.
|
|
50
|
+
7. **Run and wait (Hardware-Aware Parallelism + Specialized Skills).** Launch independent packages in parallel (`agent_run.py batch` or native sub-agents), automatically scaling concurrency (`wip`) to the machine's live CPU cores, free RAM, GPU VRAM, and disk headroom (`ao_common.probe_hardware()`). Attach domain-specific skills via `--skill <skill_name>` when a worker needs specialized tools or workflows. Use `--name <slug>` for descriptive run folders while keeping `--task-type` canonical (`review`, `implement`, `explore`, `debug`...). Never poll or fabricate results.
|
|
51
|
+
8. **Accept once, on evidence & epistemic signals** (`references/verification.md`):
|
|
52
|
+
- Check `assumptions_challenged`, `open_questions`, and `handoff_notes` alongside `status` and `evidence`. If a worker disproved a flawed assumption in your brief with solid evidence, **reward that discovery** and pivot the plan.
|
|
53
|
+
- Run cheap deterministic checks (tests, lint, grep, bounded git diff) before LLM judgment.
|
|
54
|
+
- Record your verdict (`agent_run.py verdict <run-dir> accept|revise|escalate|rollback|takeover`) so the shared ledger adapts future routing.
|
|
55
|
+
9. **Integrate and synthesize.** Write the final user response yourself, conclusion first.
|
|
56
|
+
|
|
57
|
+
## Three Brief Modes & Premise Challenge (`references/brief-and-budget.md`)
|
|
58
|
+
|
|
59
|
+
Never force an open-ended investigation into a rigid assembly-line checklist, and never write a 50-line brief for a 5-line lookup:
|
|
60
|
+
|
|
61
|
+
| Brief Mode | When to use | Structure |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| **`tight`** | Lookups, mechanical edits, simple unit tests | 4 compact items: **Intent & Done**, **Context/Artifacts**, **Scope/Authority**, **Output**. |
|
|
64
|
+
| **`guided`** | Standard implementation, focused analysis, code review | **Role lens** (`roles.md`), **Intent**, **Definition of Done**, **Context & Upstream Artifacts**, **Latitude**, **Finish line**, **Scope & Budget**. |
|
|
65
|
+
| **`exploratory`** | Root-cause debugging, unfamiliar codebase sensemaking, architecture design, huddles | **Role & Lens**, **Core Problem**, **Questions / Hypotheses to Test**, **Known Facts**, **Full read-only freedom to follow evidence trails & challenge premises**. |
|
|
66
|
+
|
|
67
|
+
**Roles are lenses, not blinders (`references/roles.md`):**
|
|
68
|
+
- The 4–6 examination angles in a Role block are a **floor, not a fence**.
|
|
69
|
+
- Replace rigid "Not your job" blinders with **Adjacent owners (flag, don't duplicate)**: if a worker spots a bug, RNG leak, or broken contract outside its write scope, it must not ignore it—it reports it in `assumptions_challenged`, `open_questions`, or `handoff_notes`.
|
|
70
|
+
|
|
71
|
+
## Huddle: Constructive & Empirical Consult (`references/huddle.md`)
|
|
72
|
+
|
|
73
|
+
Call a huddle when facing a hard-to-reverse (Type 1) decision, conflicting evidence, a failed escalation, or a challenged core premise. Never call one for routine work.
|
|
74
|
+
|
|
75
|
+
Protocol in 5 steps:
|
|
76
|
+
1. **Problem Memo (1 page):** Facts, constraints, options known, and what empirical signal would settle the question.
|
|
77
|
+
2. **Independent blind round:** 2–3 panelists with distinct lenses (`Architect`, `Red team`, `Domain expert`, `Implementer`, `User advocate`) and **different model families** answer in parallel without seeing each other's responses. They are explicitly invited to challenge the memo's framing and invent a synthesized **Option C**.
|
|
78
|
+
3. **Crux Map & Empirical Spike Gate:** Extract the cruxes. **Mandatory gate:** if any crux is a testable fact (e.g., "does X permute RNG?", "is Y slow?"), **do not debate it in prose**—run a 2-minute micro-spike or command to measure the truth first.
|
|
79
|
+
4. **Dialectical Synthesis (optional, 1 round, unresolved trade-offs only):** Share anonymized counterarguments and spike data. Ask panelists to concede disproved points or synthesize the best of both worlds (**Option C**).
|
|
80
|
+
5. **Decide & commit:** Decide on evidence (never majority vote). Record the decision, strongest dissent, and reversal trigger.
|
|
81
|
+
|
|
82
|
+
## Dynamic Model Discovery & Cognitive Routing (`references/gates-and-routing.md`)
|
|
83
|
+
|
|
84
|
+
**Models are dynamically discovered, never locked to stale hardcoded strings:**
|
|
85
|
+
- `discover.py` probes live available models across all 3 harnesses at zero token cost (`agy models`, `~/.codex/.codex-global-state.json` & `latest-model.md`, `~/.claude/settings.json`, `gateway-models.json`, and `model-catalog/*-ccd.json`).
|
|
86
|
+
- `route.py` (`ao_common.dynamic_tier_config`) analyzes and scores the live discovered models to select the best model per tier (`fast`, `standard`, `frontier`, `frontier_max`) automatically (`source: live_discovered`), using `assets/models.json` only as a fallback baseline.
|
|
87
|
+
|
|
88
|
+
Match the work to the model family's cognitive strengths:
|
|
89
|
+
- **OpenAI (`codex`):** surgical logic, deep debugging, methodological/statistical auditing, refactoring, non-interactive `codex review`, `--worktree`, and `--search`.
|
|
90
|
+
- **Anthropic (`claude`):** architectural synthesis, 1M-context deep code/prose reasoning (`nghi/claude-opus-5[1m]`, `claude-opus-5-5`, `claude-sonnet-5-5`), fast `--bare` headless runs, `--worktree`, `--bg` daemons, and `claude ultrareview`.
|
|
91
|
+
- **Google (`agy`):** broad-context synthesis, rapid multi-file exploration, multimodal/UI, plus cross-family hosting (`gemini-4-argon-*`, `claude-opus-5-5-*`).
|
|
92
|
+
|
|
93
|
+
**Epistemic Independence:** An independent reviewer (`review`, `security-review`, `critique`) must use a **different model family** from the builder (`route.py --task-type review --builder <vendor>` enforces this automatically).
|
|
94
|
+
|
|
95
|
+
**Channels:**
|
|
96
|
+
- **Native subagents** (`Agent` in Claude, `invoke_subagent` + `send_message` in Antigravity, `spawn_agent` in Codex) for fast in-session work, context forking, and interactive peer messaging.
|
|
97
|
+
- **Unified external runner** (`scripts/agent_run.py run --agent codex|claude|agy`) for cross-family reviews, huddles, and schema-enforced out-of-session execution.
|
|
98
|
+
- Supports `--worktree` (Codex/Claude isolated git worktree), `--search` (Codex live web search), `--bare` and `--max-budget-usd` (Claude fast cold-start & cost cap), `--name <slug>`, `--context-file <path>`, and `--resume <session_id>`.
|
|
99
|
+
|
|
100
|
+
## Reference Map
|
|
101
|
+
|
|
102
|
+
| File | Read when |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `CATALOG.md` | **Read first:** 1-page cheat sheet of all core rules, CLI commands (`codex`, `claude`, `agy`), and Evidence Law |
|
|
105
|
+
| `references/multi-perspective-and-single-host.md` | **Single-agent mode (e.g., only `agy`)**, Zero-Prior de-biasing, Orthogonal Expert Council, and the 5-stage `Diverge → Falsify → Probe → Synthesize → Plan` workflow |
|
|
106
|
+
| `references/team-shapes.md` | Choosing the team structure or setting up parallel workspaces / peer mesh |
|
|
107
|
+
| `references/gates-and-routing.md` | Passing the four gates, matching cognitive strengths, and picking a channel |
|
|
108
|
+
| `references/brief-and-budget.md` | Writing a `tight`, `guided`, or `exploratory` work order and using `--context-file` |
|
|
109
|
+
| `references/roles.md` | Assigning a role lens without creating cognitive tunneling |
|
|
110
|
+
| `references/verification.md` | Judging results, handling `assumptions_challenged`, and recording verdicts |
|
|
111
|
+
| `references/huddle.md` | Running an independent-first huddle with the Empirical Spike Gate & Dialectical Synthesis |
|
|
112
|
+
| `references/management-models.md` | Theoretical foundations (Mission Command, Stigmergy, Sensemaking, Dialectics) |
|
|
113
|
+
| `references/adapters/claude-code.md` | Using Claude Code (`Agent`, `SendMessage`, worktrees, and `claude -p`) |
|
|
114
|
+
| `references/adapters/codex-cli.md` | Using Codex CLI (`agent_run.py --agent codex`, `codex_run.py`, `--worktree`) |
|
|
115
|
+
| `references/adapters/antigravity-cli.md` | Using Antigravity (`invoke_subagent`, `send_message`, `Workspace: branch/share`, `agy -p`) |
|
|
116
|
+
| `references/two-way.md` | Cross-agent calling matrix, Shared Blackboard handoffs, and v3 operational fixes |
|
|
117
|
+
| `references/self-update.md` | Discovering new models/tools (`discover.py`) and promoting candidates |
|
|
118
|
+
| `assets/models.json` | Source of truth for model families, tiers, cognitive strengths, and task routing |
|
|
119
|
+
| `assets/result.schema.json` | v3 result envelope (with optional `confidence`, `assumptions_challenged`, `open_questions`, `handoff_notes`) |
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"updated": "2026-10-25",
|
|
3
|
+
"note": "Baseline fallback tiers and task routing rules. Dynamic live discovery (`discover.py` -> `ao_common.dynamic_tier_config`) automatically scores and selects live available models from `~/.agent-orchestration/capabilities.json` (`source: live_discovered`), falling back to this file when no live snapshot is present.",
|
|
4
|
+
"tier_order": ["fast", "standard", "frontier", "frontier_max"],
|
|
5
|
+
"risk_floor": {"low": "fast", "med": "standard", "high": "frontier"},
|
|
6
|
+
"vendors": {
|
|
7
|
+
"codex": {
|
|
8
|
+
"company": "openai",
|
|
9
|
+
"cognitive_strengths": ["surgical-logic", "deep-debugging", "methodological-audit", "refactoring"],
|
|
10
|
+
"tiers": {
|
|
11
|
+
"fast": {"model": "gpt-5.6-luna", "effort": "low", "family": "openai"},
|
|
12
|
+
"standard": {"model": "gpt-5.6-sol", "effort": "medium", "family": "openai"},
|
|
13
|
+
"frontier": {"model": "gpt-6-astra", "effort": "high", "family": "openai"},
|
|
14
|
+
"frontier_max": {"model": "gpt-6-astra", "effort": "xhigh", "family": "openai"}
|
|
15
|
+
},
|
|
16
|
+
"fallback_model": "gpt-6-astra",
|
|
17
|
+
"overhead_tokens": 12500,
|
|
18
|
+
"resume_overhead_tokens": 1500,
|
|
19
|
+
"notes": [
|
|
20
|
+
"Provider 9router: accepted models can differ from local cache; on model_or_config failure use fallback_model once.",
|
|
21
|
+
"gpt-5.6-luna/low was confirmed by a real call on 2026-09-25 (14.2k tokens). gpt-6-astra is the config default. gpt-5.6-sol/medium was confirmed by a real 871 s, 73k-token code review on 2026-09-26.",
|
|
22
|
+
"A sandboxed Codex worker cannot call agy or claude (network blocked); the manager chains vendors."
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"agy": {
|
|
26
|
+
"company": "google",
|
|
27
|
+
"cognitive_strengths": ["broad-context-synthesis", "multi-file-exploration", "cross-family-hosting", "multimodal-and-ui"],
|
|
28
|
+
"tiers": {
|
|
29
|
+
"fast": {"model": "gemini-3.8-flash-low", "family": "google"},
|
|
30
|
+
"standard": {"model": "gemini-4-argon-medium", "family": "google"},
|
|
31
|
+
"frontier": {"model": "gemini-4-argon-high", "family": "google"},
|
|
32
|
+
"frontier_max": {"model": "claude-opus-5-5-high", "family": "anthropic"}
|
|
33
|
+
},
|
|
34
|
+
"fallback_model": "gemini-3.8-flash-high",
|
|
35
|
+
"overhead_tokens": 19500,
|
|
36
|
+
"resume_overhead_tokens": null,
|
|
37
|
+
"notes": [
|
|
38
|
+
"Updated 2026-10-24 (agy 1.4.4): gemini-3.1-pro-* was replaced by gemini-4-argon-{low,medium,high} and claude-{sonnet,opus}-5-5-{low,medium,high}.",
|
|
39
|
+
"Effort is baked into the model slug; pass --effort only if you need to override.",
|
|
40
|
+
"Review precision on flash was 2/10; use gemini-4-argon-high or claude-opus-5-5-high for high-precision review, and flash for broad scouting.",
|
|
41
|
+
"Headless print mode auto-denies tools that need confirmation and can return SUCCESS with an empty response."
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"claude": {
|
|
45
|
+
"company": "anthropic",
|
|
46
|
+
"cognitive_strengths": ["architecture-synthesis", "nuanced-implementation", "exploratory-reasoning", "human-alignment"],
|
|
47
|
+
"tiers": {
|
|
48
|
+
"fast": {"model": "haiku", "family": "anthropic"},
|
|
49
|
+
"standard": {"model": "sonnet", "family": "anthropic"},
|
|
50
|
+
"frontier": {"model": "opus", "family": "anthropic"},
|
|
51
|
+
"frontier_max": {"model": "opus", "effort": "max", "family": "anthropic"}
|
|
52
|
+
},
|
|
53
|
+
"fallback_model": "sonnet",
|
|
54
|
+
"overhead_tokens": null,
|
|
55
|
+
"resume_overhead_tokens": null,
|
|
56
|
+
"notes": [
|
|
57
|
+
"In-session subagents (Agent tool) have small overhead; `claude -p` from another harness starts cold.",
|
|
58
|
+
"Updated 2026-10-24: Claude Code 2.1.308 under %LOCALAPPDATA%\\Claude-Data is logged in (oauth_token). ao_common.py resolves both AppData and LocalAppData (Claude-Data / Claude-3p) paths."
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"tasks": {
|
|
63
|
+
"lookup": {"base_tier": "fast", "verify_floor": "L1", "brief_mode": "tight", "vendor_preference": ["native", "agy", "codex"], "independent": false, "writes": false},
|
|
64
|
+
"summarize": {"base_tier": "standard", "verify_floor": "L1", "brief_mode": "guided", "vendor_preference": ["native", "agy"], "independent": false, "writes": false},
|
|
65
|
+
"explore": {"base_tier": "standard", "verify_floor": "L1", "brief_mode": "exploratory", "vendor_preference": ["native", "agy", "codex"], "independent": false, "writes": false},
|
|
66
|
+
"mechanical-edit": {"base_tier": "fast", "verify_floor": "L2", "brief_mode": "tight", "vendor_preference": ["native", "agy", "codex"], "independent": false, "writes": true},
|
|
67
|
+
"docs": {"base_tier": "fast", "verify_floor": "L1", "brief_mode": "guided", "vendor_preference": ["native", "agy", "claude"],"independent": false, "writes": true},
|
|
68
|
+
"implement": {"base_tier": "standard", "verify_floor": "L2", "brief_mode": "guided", "vendor_preference": ["native", "codex", "claude", "agy"], "independent": false, "writes": true},
|
|
69
|
+
"system-dev": {"base_tier": "frontier", "verify_floor": "L2", "brief_mode": "guided", "type1_verify": "L3", "vendor_preference": ["native", "codex", "claude", "agy"], "independent": false, "writes": true, "panel": true},
|
|
70
|
+
"test": {"base_tier": "standard", "verify_floor": "L2", "brief_mode": "tight", "vendor_preference": ["native", "codex", "claude"], "independent": false, "writes": true},
|
|
71
|
+
"refactor": {"base_tier": "standard", "verify_floor": "L2", "brief_mode": "guided", "vendor_preference": ["codex", "native", "claude"], "independent": false, "writes": true},
|
|
72
|
+
"debug": {"base_tier": "frontier", "verify_floor": "L2", "brief_mode": "exploratory", "vendor_preference": ["codex", "native", "claude"], "independent": false, "writes": false},
|
|
73
|
+
"design": {"base_tier": "frontier", "verify_floor": "L2", "brief_mode": "exploratory", "type1_verify": "L3", "vendor_preference": ["native", "codex", "claude"], "independent": false, "writes": false},
|
|
74
|
+
"review": {"base_tier": "standard", "verify_floor": "L1", "brief_mode": "guided", "vendor_preference": ["codex", "agy-pro", "claude", "native"], "independent": true, "writes": false},
|
|
75
|
+
"security-review": {"base_tier": "frontier", "verify_floor": "L3", "brief_mode": "guided", "vendor_preference": ["codex", "claude", "native"], "independent": true, "writes": false},
|
|
76
|
+
"critique": {"base_tier": "frontier", "verify_floor": "n/a", "brief_mode": "exploratory", "vendor_preference": ["codex", "agy", "claude", "native"], "independent": true, "writes": false, "panel": true},
|
|
77
|
+
"spike": {"base_tier": "standard", "verify_floor": "L1", "brief_mode": "exploratory", "vendor_preference": ["codex", "native"], "independent": false, "writes": false}
|
|
78
|
+
},
|
|
79
|
+
"task_aliases": {
|
|
80
|
+
"huddle": "critique",
|
|
81
|
+
"multi-angle": "critique",
|
|
82
|
+
"council": "critique",
|
|
83
|
+
"research": "explore",
|
|
84
|
+
"investigate": "explore",
|
|
85
|
+
"sensemaking": "explore",
|
|
86
|
+
"brainstorm": "explore",
|
|
87
|
+
"plan": "design",
|
|
88
|
+
"architecture": "design",
|
|
89
|
+
"fix": "implement",
|
|
90
|
+
"code": "implement",
|
|
91
|
+
"coding": "implement",
|
|
92
|
+
"feature": "implement",
|
|
93
|
+
"build": "system-dev",
|
|
94
|
+
"develop": "system-dev",
|
|
95
|
+
"fullstack": "system-dev",
|
|
96
|
+
"system-build": "system-dev",
|
|
97
|
+
"draft": "docs",
|
|
98
|
+
"judge": "review",
|
|
99
|
+
"verify": "review",
|
|
100
|
+
"audit": "review",
|
|
101
|
+
"methodology-review": "review"
|
|
102
|
+
},
|
|
103
|
+
"vendor_aliases": {"agy-pro": {"vendor": "agy", "min_tier": "frontier"}},
|
|
104
|
+
"candidates": []
|
|
105
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "WorkerResult",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": true,
|
|
6
|
+
"required": ["status", "summary", "deliverables", "evidence", "risks", "next_action"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"status": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"enum": ["done", "partial", "blocked", "stopped"],
|
|
11
|
+
"description": "done = acceptance criteria met; partial = budget hit with useful progress; blocked = cannot proceed without a decision; stopped = andon pulled (anomaly, wrong premise, scope or safety issue)."
|
|
12
|
+
},
|
|
13
|
+
"summary": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Conclusion first, 1-5 sentences. Every key verdict or conclusion MUST cite an item in `evidence` (e.g. [E1], file:line, or command output). Unbacked claims are rejected as hallucination risk."
|
|
16
|
+
},
|
|
17
|
+
"deliverables": {
|
|
18
|
+
"type": "array",
|
|
19
|
+
"items": { "type": "string" },
|
|
20
|
+
"description": "File paths, diff locations or artifact paths. Never paste large content here."
|
|
21
|
+
},
|
|
22
|
+
"evidence": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": { "type": "string" },
|
|
25
|
+
"description": "Verifiable ground-truth proof: `file:line-line` + excerpt, `command -> exit/output`, measured numbers, or URL. One item per claim. Prose opinions without anchors do not count as evidence."
|
|
26
|
+
},
|
|
27
|
+
"risks": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"items": { "type": "string" },
|
|
30
|
+
"description": "Open issues, assumptions, out-of-scope observations."
|
|
31
|
+
},
|
|
32
|
+
"next_action": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "What the manager should do or decide next. Empty string if nothing."
|
|
35
|
+
},
|
|
36
|
+
"confidence": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": ["low", "med", "high"],
|
|
39
|
+
"description": "Optional: worker's epistemic confidence in the result based on evidence strength."
|
|
40
|
+
},
|
|
41
|
+
"assumptions_challenged": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"items": { "type": "string" },
|
|
44
|
+
"description": "Optional: premises in the manager's brief that were falsified or misframed. MUST include a verifiable citation (`file:line` or `command -> output`) or a concrete micro-spike that proves it; unbacked skepticism goes to `risks`, not here."
|
|
45
|
+
},
|
|
46
|
+
"open_questions": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": { "type": "string" },
|
|
49
|
+
"description": "Optional: high-value questions, surprises, or emergent leads discovered during the work, with where they were seen (`file:line`)."
|
|
50
|
+
},
|
|
51
|
+
"handoff_notes": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"description": "Optional: direct technical notes, invariants, or warnings (with `file:line`) for the next agent in a pipeline or review."
|
|
54
|
+
},
|
|
55
|
+
"truth_amendments": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"description": "Optional: formal request to amend a locked prerequisite, threshold, or shared interface in the Truth Contract when empirical evidence proves the initial value is infeasible. Never mutate shared constants silently; declare amendments here with proof so all sibling/downstream packages are updated.",
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"required": ["key", "proposed_value", "reason", "evidence"],
|
|
61
|
+
"properties": {
|
|
62
|
+
"key": { "type": "string", "description": "Invariant or shared parameter/interface name (e.g. MAX_BATCH_SIZE, PORT, API_SCHEMA)." },
|
|
63
|
+
"old_value": { "type": "string", "description": "Previous locked value in Truth Contract." },
|
|
64
|
+
"proposed_value": { "type": "string", "description": "New value proposed by this package." },
|
|
65
|
+
"op": { "type": "string", "enum": ["=", "<=", ">=", "<", ">", "must", "forbid"], "default": "=" },
|
|
66
|
+
"reason": { "type": "string", "description": "Why the amendment is necessary." },
|
|
67
|
+
"evidence": { "type": "string", "description": "Verifiable proof (`file:line` or `command -> output`) justifying the change." },
|
|
68
|
+
"affected_packages": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"items": { "type": "string" },
|
|
71
|
+
"description": "Other packages that must be notified or re-synced if this amendment is adopted."
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|