Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Heuristic:2akouwu Reverify Full Sheet Scoring

From Leeroopedia
Knowledge Sources
Domains Verification, Context_Engineering, LLMs
Last Updated 2026-10-24 12:00 GMT

Overview

Scoring always uses the full fact sheet even when the model sees a trimmed view, so hiding a fact during prompt compaction can never make restating it profitable.

Description

When the prompt exceeds the character budget, `compact_facts` trims the fact sheet shown to the model. However, the verifier's `summarize` function always scores claims against the full, untrimmed fact sheet. This creates an asymmetry: the model may not see a fact (because it was trimmed for budget), but if it guesses that fact and submits it as a claim, the claim is still marked `trivial` (weight 0) because the scorer can see the fact in the full sheet. This prevents a gaming strategy where the model waits for facts to be trimmed and then "rediscovers" them for free credit.

Usage

Use this heuristic when reasoning about the safety of prompt compaction. It is the invariant that makes `Prompt_Compaction_Ladder` safe: no matter how aggressively the view is trimmed, the scoring is never weakened. Apply when designing any compaction or context-trimming strategy for verification loops.

The Insight (Rule of Thumb)

  • Action: Pass the full `facts` dict (not the compacted `view`) to `verifier.verify_all` for scoring.
  • Value: `report = self.verifier.verify_all(claim_objs, facts=facts, ...)` — always the original, never the trimmed copy.
  • Trade-off: The model may be unable to observe trimmed values through the prompt alone, but it can always re-observe them through tools (`observe: true`). The scorer is never fooled.
  • Compatibility: Works with any compaction strategy. The `view` is for the prompt; `facts` is for scoring.

Reasoning

If scoring used the trimmed view, a model could exploit compaction: wait for a fact to page out, then re-assert it as a "new" claim to earn weight. By scoring against the full sheet, this strategy always yields `trivial` (weight 0) — the fact is still in the full sheet, so restating it says nothing new. This invariant is what makes aggressive compaction safe: the model's information budget is always measured against ground truth, not against what it happens to see.

Code Evidence

Scoring against full facts from `agent.py:465-466`:

# Score against the FULL fact sheet, whatever the model was shown.
report = self.verifier.verify_all(claim_objs, facts=facts, min_information=self.min_information)

Compaction produces a separate view from `agent.py:441-443`:

view, steps, prompt_chars = compact_facts(
    facts, self.prompt_budget, goal, established, feedback, known_false
)
prompt = build_prompt(goal, view, established, feedback, known_false)

Trivial detection uses the full sheet in `verifier.py:1200`:

r["trivial"] = derivable_from_facts(r, facts)

Compaction comment from `agent.py:356-361`:

"""Shrink the fact sheet *shown* to the model until the whole prompt fits ``budget`` chars.
...
Only the view is trimmed: the caller keeps scoring against the full sheet, so hiding
a fact can never make restating it profitable, and everything trimmed stays observable
through the tools."""

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment