Long context is a reliability risk.
Context policy must be scanned before dispatch, not discovered after a task is already deep into execution.
{
"soft_warning_pct": 55,
"hard_compression_pct": 65,
"emergency_stop_pct": 80,
"checkpoint_interval_minutes": 45,
"checkpoint_after_phase": true,
"checkpoint_after_fix_review_rounds": 2,
"compression_target_pct_min": 15,
"compression_target_pct_max": 25,
"fallback_triggers": [
"user_interruption_resume",
"wrong_project_or_tool_target_confusion",
"two_fix_review_rounds",
"before_new_roadmap_task_after_long_task"
]
}
| Role | Soft warning | Hard compression | Emergency stop |
|---|---|---|---|
| coordinator | 50% | 60% | 80% |
| implementer | 55% | 65% | 80% |
| reviewer | 60% | 70% | 80% |
| prototype | 60% | 70% | 80% |
| other | 60% | 70% | 80% |
Context policy is not passive metadata. Before dispatch, the validator or
runtime adapter must check whether the Leader-declared Agent is already at or above
hard_compression_pct or explicitly marked compression_required.
If so:
do not send the dispatch
request/write context compression handoff
re-read task state and evidence
rerun routing if the task, project, or tools changed
The coordinator or leader must keep worker dispatches short. A good dispatch is not a transcript; it is a precise assignment with file refs.
The complete generated dispatch has strict role-specific ceilings:
| Primary role | Max characters | Max reference tokens |
|---|---|---|
| coordinator | 3000 | 750 |
| implementer | 2800 | 700 |
| reviewer | 2400 | 600 |
| prototype or researcher | 2400 | 600 |
| other | 2200 | 550 |
The portable reference-token estimator is ceil(chars / 4). It is a
deterministic budget proxy, not a provider-tokenizer claim. Adapters with exact
tokenizers enforce the lower limit. routing.json records configured and
actual dispatch sizes; context-pack.json records each Leader-declared Agent’s
role budget.
Dispatch should contain:
task.md, automation-policy.json, routing.json,
context-selection.json, context-pack.json, mask-list.json,
evidence-board.json, and skill-recommendations.json.Only task.md, context-pack.json, and skill-recommendations.json need to be
in the starting worker prompt. Other task-local refs can be named as on-demand
progressive disclosure. Coordinator, implementer, reviewer, prototype, and
researcher prompts should receive only their role-specific evidence and
attention slice.
Dispatch should not paste:
task.md is available;context-pack.json.HTML can render dashboards or reports, but the canonical worker dispatch should remain readable plain text or Markdown unless the runtime exports the same concise assignment and receipt evidence.
Measure the checked-in legacy baseline against the current generator with:
python3 scripts/benchmark-dispatch-size.py
The benchmark reports only Unicode character counts and percentage reduction.
## Context Compression
Active project:
Active task:
My role:
Current phase:
Completed:
Not completed:
Evidence paths:
Known blockers:
Next safe action:
Do not use / stale context:
If exact context percentage is not available, force compression after: