feat(mcp): add cache list to inspect cached decision packs - #1800
Conversation
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-06-30 06:44:12 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
8285d23 to
4dcd419
Compare
`gittensory-mcp cache` could report only an aggregate count (`status`) and remove everything (`clear`), with no way to see what is actually cached. Add `cache list` (alias `ls`): it prints the offline decision-pack cache entries, newest first, with the login, when each was cached, and its API/package version and size. `--json` for tooling. It surfaces only safe metadata — never the cached payload or the auth-cache key (a token hash) — consistent with the cache's local-only redaction. A test asserts the listing names the login but leaks neither the token nor the auth-cache key.
4dcd419 to
393f636
Compare
Summary
gittensory-mcp cachecould only report an aggregate count (status) or wipe everything (clear) — there was no way to see what is in the offline decision-pack cache. Addscache list(aliasls):Entries are newest-first. It follows the existing
inspectDecisionPackCache()pattern (used bycache status).Privacy
It surfaces only safe metadata — login,
cachedAt, API/package version, and byte size — and never the cached payload or theauthCacheKey(a token hash). A test asserts the listing names the login but leaks neither the configured token nor the auth-cache key, consistent with the cache's existing local-only redaction.Scope
packages/gittensory-mcp/bin/gittensory-mcp.js—list/lsbranch inrunCacheCli, thelistDecisionPackCache()helper, and the cache + main help text.test/unit/mcp-cli-packets.test.ts— a test that populates the cache viadecision-pack, lists it, and asserts the safe-metadata shape + no token/auth-key leak (and the empty-cache case).packages/gittensory-mcp/README.md— documentcache list.Packages-only; no
src/**, UI, schema, migration, or OpenAPI changes.Validation
Run locally on Node v24.18.0 (engine floor is 22):
npm run build:mcp→ passnpm run typecheck→ pass, 0 errors (full project)npx vitest run test/unit/mcp-cli-packets.test.ts→ 17/17 pass, including the newlists cached decision packs with safe metadata onlynpm pack --workspace @jsonbored/gittensory-mcp --dry-run→ package file list unchanged (allowed set only; no new files, no secrets)cache list/cache list --jsonon an empty cache and the help text verifiedNote:
npm run test:mcp-packcan't run on my Windows box (its harnessspawnSync("npm", …)can't resolvenpm.cmdwithout a shell) — verified package contents withnpm pack --dry-runinstead. It passes on CI.Safety
No auth, cookie, CORS, GitHub App output, identity, contributor-evidence, or scoring changes. No secrets/wallets/hotkeys/trust/reward terms. The listing deliberately omits the cached payload and the auth-cache key.