CHL is a validation lens, not a new subsystem. Each principle already exists in code (
context/, compaction/, runtime harness, eval/loop.py). This page unifies them under one rubric and links to the evaluators that score them.1. Principles
1.1 Context Engineering
Context Engineering governs what the model sees on every turn: keeping token usage within budget, compacting history without losing meaning, injecting the right artifacts, and handing off cleanly between agents.| Sub-principle | Meaning | Code anchor |
|---|---|---|
| Budget | Total prompt tokens stay within a configured budget | context/ (token budgeter), eval/tokens.py |
| Compaction | History is compressed with high semantic retention | compaction/ (6 strategies) |
| Injection | Relevant files/artifacts are added deterministically | context/ (artifacts, fast context) |
| Handoff | Context transfers between agents without loss | agent/ handoff, ContextAgent PRP |
1.2 Harness Engineering
Harness Engineering guarantees that the environment the agent runs in during testing matches production: identical tool schemas, reproducible turn context, and required trace/artifact outputs.| Sub-principle | Meaning | Code anchor |
|---|---|---|
| Parity | PreparedTurnContext tool schemas match runtime exactly | runtime/turn_context.py |
| Traces | Each turn emits a structured, replayable trace | trace/, harness runner |
| Artifacts | Required output files are present after a run | interactive test harness / CSV runner |
1.3 Loop Engineering
Loop Engineering makes autonomous iteration converge safely: reaching a quality threshold in a bounded number of iterations while doom-loop guards prevent unproductive repetition.| Sub-principle | Meaning | Code anchor |
|---|---|---|
| Convergence | Iterations reach the target score within a bound | eval/loop.py (EvaluationLoop) |
| Guardrails | Doom-loop / repeat guards fire on stagnation | agent/autonomy.py, loop guards |
| Efficiency | Fewest iterations for a given quality target | eval/loop.py iteration metrics |
2. Measurable rubric
Each row maps a principle to a metric, a pass threshold, and the evaluator that produces the score. Targets are defaults — override per project via config.| Principle | Metric | Target | Evaluator |
|---|---|---|---|
| Context handoff | handoff score 0–10 | ≥ 8.0 | ContextEvaluator |
| Context budget | tokens ≤ budget | 100% compliance | ContextEvaluator |
| Compaction loss | semantic retention (judge score) | ≥ 7.0 | ContextEvaluator |
| Harness parity | tool schema hash match | 100% | HarnessEvaluator |
| Harness artifacts | required files present | 100% | HarnessEvaluator |
| Loop convergence | iterations to threshold | ≤ N (configurable) | LoopEvaluator |
| Doom-loop safety | guard fires on repeat fixture | required | LoopEvaluator |
The
ContextEvaluator, HarnessEvaluator, and LoopEvaluator classes are tracked as follow-up work (PA-CHL-001–004). Until they land, the equivalent checks can be run with today’s building blocks: estimate_tokens / count_tokens (praisonaiagents.eval), the compaction judge, the interactive test harness, and EvaluationLoop.Interpreting scores
Context
All three context rows must pass for a build to be “context-compliant”.
Harness
Parity is a hard gate — any schema drift fails the harness pillar.
Loop
Convergence + guard firing together certify safe autonomy.
3. Cross-links
3.1 CLI commands
3.2 Python entry points
3.3 Related docs
Context Management
Token budgeting, compaction strategies, overflow prevention.
ContextAgent
PRP methodology and Context Engineering handoff.
Autonomy
Autonomous loops and doom-loop guardrails.
Evaluation
The evaluation framework these evaluators plug into.
4. Running a CHL eval suite
Once the dedicated evaluators land, a CHL suite runs like any other evaluation:5. Summary
| Pillar | Question it answers | Rubric rows |
|---|---|---|
| Context | Does the agent see the right, budgeted, well-compacted context? | budget, compaction, handoff |
| Harness | Does the test environment match production exactly? | parity, artifacts |
| Loop | Does autonomy converge safely without doom loops? | convergence, doom-loop safety |

