-
-
Notifications
You must be signed in to change notification settings - Fork 0
Ledger
Verification is Currency.
The Ledger (verification_history.md) is the central accounting system for LoFi Gate. It tracks two things:
- Truth: Did your tests pass or fail?
- Cost: How many tokens did you spend (or save) finding that out?
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.
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:
PASSorFAIL. -
Metrics:
(total token size: 500) (tokens truncated: 0)
To keep LoFi Gate fast and portable, we do not import heavy tokenizers (like tiktoken) into the runtime.
Instead, we use the Standard Heuristic:
4 characters โ 1 token
This allows us to run on any system (Python standard lib only) without downloading massive vocab files, while remaining accurate enough for "Order of Magnitude" cost tracking.
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.
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.
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.