feat: reap route, reap apm, and gap payload-quality (closes #7 #8 #9)#10
Merged
Merged
Conversation
…n noise Closes #7. Adds a second utilization axis: when an MCP tool fires, is the result signal or noise? usage.Stats now correlates each mcp__ tool_use with its tool_result and scores the payload (base64 blobs, data URIs, HTML soup, repeated boilerplate) into useful-vs-noise chars. reap gap surfaces a per-tool quality column and flags 'fires often + mostly noise' tools that load-utilization marks green. text/--json/--md parity.
Closes #9. Adds an opt-in 'reap route' that organizes skills surviving a prune into category routers driven by real firing evidence, not text similarity. Frequently-fired skills stay exposed; the rare long tail is pushed behind leaf routers (by namespace, else dominant firing project) loaded on demand. Output is a proposed plan (text/--json/--md), never auto-applied; never routes blind (no-evidence skills stay exposed). Leads with the 'below ~150 skills, native loading is enough' caveat and points at 'reap mute' for the description-stripping half.
Closes #8. Adds a read-only 'reap apm' that turns per-repo firing evidence into a Microsoft APM apm.yml proposal. KEEP→include, REAP→omit, REVIEW→never auto-omit. --diff <apm.yml> reconciles: suggests adding fired-but-undeclared skills and dropping declared-but-cold ones (REVIEW protected). Upstream coordinates are recovered from apm.lock.yaml when present; otherwise a clearly marked TODO placeholder rather than an invented coordinate. Hand-emitted YAML (no new dep). text(yaml)/--json/--md. First cut: skills only.
apm: - LoadAPMManifest only harvests coordinates from dependency list items and strips inline comments, so the emitted '# repo:' header, the 'owner/repo/path' TODO hint, and URLs no longer inject phantom declared/drop entries (was self-triggering bogus drops on the tool's own output). - encodeProject now mirrors Claude Code's full [^A-Za-z0-9]→'-' bucket encoding, so repos whose path has '.', '_' or spaces no longer emit an empty manifest. - Repo header uses cwd verbatim (encode→decode round-trip corrupted it). - emit 'apm: []' when there are no active deps so the YAML parses as a list. route: - --route-min-skills skip now renders in every format (was leaking prose into --json/--md, breaking parity); deterministic category tiebreaker on source; dead suffix-merge branch removed; Rate doc corrected. gap/payload: - payload rows sort flagged-noisy first so a single 0%% anecdote can't outrank a high-volume offender; comment corrected. Adds regression tests: encodeProject vs CC encoding, manifest round-trip with no phantom harvest, route skip parity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements all three open enhancement issues, evidence-driven and reversible, with text/
--json/--mdparity throughout.Closes #7 — payload-quality axis (
reap gap)A second utilization axis: when an MCP tool fires, is the result signal or noise?
usage.Statsnow correlates eachmcp__*tool_use with its tool_result and scores the payload (base64 blobs, data URIs, HTML soup, repeated boilerplate) into useful-vs-noise chars.reap gapadds a per-tool quality column and flags⚑ noisytools that fire often and return mostly noise — the class load-utilization marks green and mute never catches.Live:
get_viewport_screenshot(81×, ~316 KB base64) → 0% quality, flagged;execute_blender_code(478×, 99%) → correctly clean.Closes #9 — usage-informed routing (
reap route)Opt-in, secondary to pruning. Organizes the skills that survive a prune into category routers driven by real firing evidence (not BM25/text similarity): frequently-fired skills stay exposed, the rare long tail is pushed behind leaf routers (by namespace, else dominant firing project) loaded on demand. Output is a plan — proposed, never auto-applied; never routes blind (no-evidence skills stay exposed). Leads with the "below ~150 skills native loading is enough" caveat; points at
reap mutefor the description-stripping half. Flags:--route-threshold,--route-min-skills.Closes #8 — APM manifest (
reap apm)Read-only: turns a repo's firing evidence into a proposed Microsoft APM
apm.yml(skills only, first cut). KEEP→include, REAP→omit, REVIEW→never auto-omit.--diff apm.ymlreconciles: suggests adding fired-but-undeclared skills and dropping declared-but-cold ones (REVIEW protected). Upstream coordinates are recovered fromapm.lock.yamlwhen present; otherwise a clearly-markedTODOcomment, never an invented coordinate. Hand-emitted YAML (no new dependency).Quality
Designed and built per-issue, then put through an adversarial multi-agent review (16 agents). Confirmed findings were fixed and locked with regression tests:
LoadAPMManifestno longer harvests phantom coordinates from comments/headers/URLs (was self-triggering bogus drops);encodeProjectnow matches Claude Code's exact[^A-Za-z0-9]→-bucket encoding (repos with./_/space were silently emitting empty manifests).--route-min-skillsskip now renders in every format (was leaking prose into--json/--md); deterministic category ordering.Test plan
go build ./...,go test ./...,go vet ./...all greenreap gap/reap route/reap apm(incl.--json/--md) against real~/.claudetranscripts🤖 Generated with Claude Code