07. The Curated Engine Specification: Eliminating Marketplace Chaos#
Status: Approved Architecture Decision
Decision DRI: Alex (Lead Product Manager)
Date: 2026-11-25
1. The Strategic Pivot: Curated Golden Path vs. Uncurated Marketplace#
Marketplace-style products may present agent extensions (such as Ponytail, Chisle, Caveman, Serena, Codebase Memory, Context7, and RTK) as individually configurable add-ons.
Marketplace Integration Challenges:#
- User Misconfiguration: Users enabled Chisle, Caveman, and Ponytail simultaneously. Chisle was explicitly designed to replace Caveman and Ponytail. Running all three injected competing, contradictory prompt instructions, degrading response quality and wasting prompt tokens.
- The MCP Schema Bomb: Users toggled every available MCP server on. Each server injected full JSON schemas on every turn, adding 5,000+ tokens of dead schema overhead per request.
- Plumbing Failures: Users were expected to manage terminal PATHs, Node.js versions, and shell hooks manually. When hooks failed silently (like RTK on Windows), users received zero feedback.
The LeanToken Rule:#
In v0.1, we take away the toggles. LeanToken ships as an opinionated, pre-harmonized, zero-configuration engine. The user runs a single command (
lean init), and LeanToken activates a mathematically tuned, conflict-free golden stack.
2. The Locked-In Golden Stack (v0.1)#
Instead of 8 independent plugins fighting for context, LeanToken bakes in 4 tightly orchestrated, non-overlapping subsystems:
3. Subsystem Detailed Specifications#
Subsystem 1: Unified Output & Diff Engine (Prompt Level)#
- What it replaces: The mess of choosing between Caveman, Ponytail, and Chisle.
- Implementation: A single, mathematically optimized 350-word instruction block injected permanently at the static cache root of
CLAUDE.md/ system prompt. - Behavior:
- Telegraphic Responses: Strictly eliminates introductions, pleasantries, transitions, and conversational conclusions.
- The YAGNI Ladder: Standard library native syntax inline single-file edits. Explicitly bans unrequested refactoring.
- Diff Formatting: Strictly requires compact patch blocks or line-specific edits.
Subsystem 2: Deterministic Tool Pruner (Execution Level)#
- What it replaces: Unreliable, manually managed shell hooks.
- Implementation: Native cross-platform hook bundled directly in the LeanToken CLI.
- Behavior:
- Automatically wraps command executions for
git status,git log,npm test,pytest,cargo test. - Passing tests 1-line summary (
[TESTS PASSED]: 48 passed in 1.1s). - Failing tests Only failure name, assertion mismatch, and innermost 5 stack frames.
- Large JSON / Directory dumps Truncated with summary count.
- Safety Net (CCR): Full raw unpruned stdout always spools to
.lean/logs/last-command.log.
- Automatically wraps command executions for
Subsystem 3: Lean Symbol Navigator (Retrieval Level)#
- What it replaces: Heavy knowledge-graph MCP servers (
codebase-memory-mcp) and bloated multi-tool schema servers that inject 5,000 tokens on every turn. - Implementation:
- Exposes only 2 lightweight tools to the agent:
lean_symbol_find(symbol_name): Returns file path, line range, and definition signature (< 100 tokens).lean_file_outline(file_path): Returns classes and method signatures without function bodies (< 150 tokens).
- Total schema overhead: < 250 tokens (vs. 5,000+ tokens for 4 external MCPs).
- Exposes only 2 lightweight tools to the agent:
Subsystem 4: Autonomous Session Learner (Memory Level)#
- What it replaces: Session-learning functionality that may otherwise be bundled with a particular proxy product.
- Implementation:
- Registers as an asynchronous exit hook when the agent session closes.
- Scans session transcript:
- Counts file read frequency if file read times, extracts its path and exports its role to
MEMORY.md. - Detects failed shell commands records the working syntax fix.
- Counts file read frequency if file read times, extracts its path and exports its role to
- Zero turn latency. Fully automated.
4. User Experience: The “Zero-Toggle” Promise#
A developer interacts with LeanToken in exactly two steps:
What the user sees:#
- No addon checkboxes to guess or misconfigure.
- No competing prompt instructions.
- Instant response times (no 1.5s ONNX delay).
- A lean terminal status indicator:
[LeanToken]: Output: -42% | Tools: -68% | Cache: 100% | Latency: +0ms