fix: add data source integrity rule to delegation contract
PR Pipeline — Authorize → Validate → Review → Merge / auth (pull_request) Successful in 5s
PR Pipeline — Authorize → Validate → Review → Merge / validate (pull_request) Successful in 2s
PR Pipeline — Authorize → Validate → Review → Merge / lint (pull_request) Successful in 2s
PR Pipeline — Authorize → Validate → Review → Merge / ai-review (pull_request) Successful in 2s
PR Pipeline — Authorize → Validate → Review → Merge / gate (pull_request) Successful in 1s
PR Pipeline — Authorize → Validate → Review → Merge / auth (pull_request) Successful in 5s
PR Pipeline — Authorize → Validate → Review → Merge / validate (pull_request) Successful in 2s
PR Pipeline — Authorize → Validate → Review → Merge / lint (pull_request) Successful in 2s
PR Pipeline — Authorize → Validate → Review → Merge / ai-review (pull_request) Successful in 2s
PR Pipeline — Authorize → Validate → Review → Merge / gate (pull_request) Successful in 1s
Workers MUST use provided input data, not fetch external sources. Adds: Data Source Integrity section, dispatch guidance example, anti-pattern entry. Root cause of e2e test discrepancies where writer worker queried Proxmox API instead of using raw data.
This commit is contained in:
@@ -66,6 +66,26 @@ Delegation is **mandatory** when any of these apply:
|
|||||||
`curl`, `hermes tools list` — these are decision-making tools. The manager
|
`curl`, `hermes tools list` — these are decision-making tools. The manager
|
||||||
reads them directly.
|
reads them directly.
|
||||||
|
|
||||||
|
## Data Source Integrity (CRITICAL)
|
||||||
|
|
||||||
|
**Workers MUST use the data provided in their task context. They MUST NOT
|
||||||
|
fetch their own data from external sources unless explicitly told to.**
|
||||||
|
|
||||||
|
When a task says "Read file X and format it", the worker reads file X. It does
|
||||||
|
not query a separate API, run its own diagnostics, or pull data from a different
|
||||||
|
system. This is the #1 source of cross-worker inconsistency: one worker gathers
|
||||||
|
SSH data, another queries the Proxmox API, and the report merges two incompatible
|
||||||
|
datasets.
|
||||||
|
|
||||||
|
**Rule:** If a worker needs additional data beyond what's in its task description,
|
||||||
|
it asks the manager (via relay) — it doesn't go find it on its own.
|
||||||
|
|
||||||
|
**This is a hard rule, not a recommendation.** Violating it produces the exact
|
||||||
|
type of discrepancy the kanban pipeline exists to prevent: a review worker finds
|
||||||
|
"5 nodes present" in the raw data but "5/5 online" in the report — even though
|
||||||
|
one of those nodes was unreachable. The report lied because it used data the
|
||||||
|
raw data never provided.
|
||||||
|
|
||||||
## Worker Selection Matrix
|
## Worker Selection Matrix
|
||||||
|
|
||||||
| Worker | Model | Toolsets | Role | Use When |
|
| Worker | Model | Toolsets | Role | Use When |
|
||||||
@@ -100,6 +120,19 @@ dispatch sequentially.
|
|||||||
|
|
||||||
Fire workers via `delegate_task`:
|
Fire workers via `delegate_task`:
|
||||||
|
|
||||||
|
**Critical: Pass the data, not just the goal.** When dispatching a worker that
|
||||||
|
processes output from another worker, include the file path AND explicit
|
||||||
|
instructions to use ONLY that source. Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
delegate_task(
|
||||||
|
goal="Format the cluster check into a clean report",
|
||||||
|
context="Source data is at /tmp/proxmox-check-raw.md. Format ONLY the data
|
||||||
|
in that file. Do NOT query the Proxmox API or any other data source. Use the
|
||||||
|
file as your sole source of truth."
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
**Parallel (independent lanes):**
|
**Parallel (independent lanes):**
|
||||||
```
|
```
|
||||||
delegate_task(
|
delegate_task(
|
||||||
@@ -203,6 +236,7 @@ Only verified results reach Kwame. Format per channel:
|
|||||||
- ❌ Skipping verification → raw worker output never reaches the user
|
- ❌ Skipping verification → raw worker output never reaches the user
|
||||||
- ❌ Delegating single tool calls → keep quick reads/writes at manager level
|
- ❌ Delegating single tool calls → keep quick reads/writes at manager level
|
||||||
- ❌ Firing more than 3 workers in parallel → hard limit
|
- ❌ Firing more than 3 workers in parallel → hard limit
|
||||||
|
- ❌ **Workers fetching their own data sources** → a writer worker that queries the Proxmox API when told to "format the raw file" is fabricating data. Use the input given, not external sources
|
||||||
|
|
||||||
## Emergency Exception
|
## Emergency Exception
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user