Skip to content
LoFi edited this page Jan 26, 2026 · 2 revisions

The Ledger

Verification is Currency.

The Ledger (verification_history.md) is the central accounting system for LoFi Gate. It tracks two things:

  1. Truth: Did your tests pass or fail?
  2. Cost: How many tokens did you spend (or save) finding that out?

πŸ“ Location

The Ledger is always located at the Project Root: ./verification_history.md

Note

For Humans & Agents This log is designed to be read by both. It uses Markdown formatting, emojis, and interactive HTML elements. It works best when viewed in a Markdown previewer or by an LLM Agent.

πŸ“ The Format

Each entry is a transaction record:

- **[TIMESTAMP]** [COMMAND] βœ… **Label**: STATUS (Duration) (Metrics)
  • TIMESTAMP: When the check ran.
  • COMMAND: The exact command executed (e.g., [npm test], [cargo audit]).
  • Label: Functional name of the check (e.g., "Test Suite").
  • STATUS: PASS or FAIL.
  • Metrics: (total token size: 500) (tokens truncated: 0)

πŸ’° Smart Truncation (The Savings)

When a test fails, modern tools spit out thousands of lines of noise. LoFi Gate captures this output but truncates the middle section if it's too long.

Why?

  • Context Window: Providing 10k lines of logs pushes useful code out of the model's memory.
  • Cost: You pay for every input token. Spam logs = burning money.

Interactive Debugging

To keep the log clean, these errors are wrapped in Interactive Dropdowns:

πŸ” View Truncated Error
Error: Something exploded in the core reactor.
...
... [Truncated 12,000 chars] ...
...
Final memory dump: 0xDEADBEEF

Agents can request to "expand" this if they need the deep trace, but usually the Head + Tail is enough.

πŸ“Š The "Sticky" Footer

At the bottom of the Ledger, you will always find the Running Balance:

πŸ“Š Total Token Size: 3625 | πŸ’° Total Token Savings: 2996

  • Total Token Size: The cumulative amount of text (tokens) generated by your tools.
  • Total Token Savings: The cumulative amount of text avoided (deleted) by the Smart Truncation engine.

This number represents raw profit in API costs and Context Window efficiency.

Clone this wiki locally