Repository navigation
Closed
Labels
pluginsPlugin system / discovery / marketplacePlugin system / discovery / marketplace
Description
Context
feat/plugin-discovery (PR #2) adds src/search.ts (the plugin-discovery API: searchPlugins / createPluginSearch / createTtlCache / sourceToInstallInput). It is green (tsc, 100% coverage, eslint, quire) and was smoke-tested live (found 8 @agent-ix/spec-* packages on npm). A /code-review + /gap-analysis pass (SpecReview SR-005, reviews/26-06-27-plugin-discovery-gap-analysis.md) found the items below. None are merge-blockers, but the first two are real (privacy + memory) and one is a spec↔code divergence.
Tasks
- FND-002 — Medium (privacy) + spec divergence.
createPluginSearchcacheKey(src/search.ts~line 568) keys on token presence (token ? "auth" : "anon"). FR-010 §Behavior (spec/functional/FR-010-discovery-cache.md~line 44) specifies "a stable non-secret discriminator of the resolved token". Two distinct tokens currently collide on"auth", so with the late-bound-token feature (FR-010-AC-5 / TC-036) a shared searcher could serve user A's authenticated (incl. private-repo) GitHub results to user B. Fix: fold a stable non-secret hash of the resolved token (e.g. first 8 hex of SHA-256, computed vianode:crypto) into the key instead of the boolean. Add a test: two different non-empty tokens produce distinct cache entries (no cross-token hit). - FND-003 — Medium (memory).
createPluginSearchleavescacheMaxundefinedby default (src/search.ts~line 546), socreateTtlCachesets nomaxand entries evict only lazily on read of an expired key — memory grows with distincttag|query|sources|limitsearches over the TTL. Fix: defaultcacheMax(e.g. 256) increatePluginSearch. Add a test: LRU eviction past the bound. - FND-004 — Low (in-CDN path traversal).
manifestUrl(src/search.ts~line 421) interpolates the registry-suppliedname/fullNameunencoded intohttps://unpkg.com/{name}/{manifestPath}andhttps://raw.githubusercontent.com/{fullName}/HEAD/{manifestPath}. Cross-host SSRF is not reachable (fixed authority), but a name containing..can traverse within the trusted CDN. Fix: reject/encode path segments containing..or control chars in the registry-derived name before building the URL. (manifestPathis host-supplied → trusted.) - FND-005 — Low.
parseRateNumber(header)(src/search.ts~line 331) has no non-finite guard → surfacesNaNrate fields; treat a non-finite parse as "no rate info" (returnundefined). A cache hit returns the sharedSearchResponsereference (~line 576) → return a shallow clone or document immutability. - FND-001 — process. Flip
plan/Plan-001-plugin-discovery/tasks/Task-001..007status: todo → done(they are implemented + verified).Task-008(publish) stays pending.
Acceptance criteria
- Distinct non-empty tokens → distinct cache entries (test); no token value ever appears in a key (CON-2 still holds).
- Cache bounded by default + LRU-eviction test.
- Manifest name with
..is rejected/encoded (test). src/search.tsstays at 100% coverage;quire validate --scope . "spec/**/*.md"clean.- Gap-analysis verdict clears toward PASS.
References
- PR: feat: plugin discovery (search npm/GitHub for compatible plugins) #2 · branch
feat/plugin-discovery - SpecReview
SR-005(reviews/26-06-27-plugin-discovery-gap-analysis.md) - Spec:
spec/functional/FR-010-discovery-cache.md,FR-009-compatibility-verification.md,FR-008-candidate-search.md
Metadata
Metadata
Assignees
Labels
pluginsPlugin system / discovery / marketplacePlugin system / discovery / marketplace
Activity
kreneskyp commentedon Jun 28, 2026
Build-out complete — pushed to
feat/plugin-discovery(PR #2), commit8574fef. All findings implemented with Red-first TDD.cacheKeyno longer keys on token presence; newtokenId()folds a stable non-secret discriminator (first 8 hex of SHA-256 vianode:crypto,anonwhen absent) into the key — raw token never enters it (FR-008-CON-2 preserved). TC-055: distinct tokens → distinct entries, no cross-token hit.createPluginSearchdefaultscacheMax = 256. TC-056 LRU eviction past the bound; TC-060 explicit override honored.unsafeManifestName()rejects any segment with..or control chars;manifestUrl()returns null andverifyOnedrops the candidate before fetching. Scoped-pkg slashes preserved. TC-057.parseRatereturns undefined on non-finite; cache get/set clone theSearchResponse(one level) so callers can't poison the cache. TC-058/059.done; Task-008 (publish) stays todo.Gates: 78 tests pass · 100% coverage (src/search.ts) · tsc + vite build clean · eslint + prettier clean ·
quire validateclean.Running
/code-review+quoin:gap-analysison the PR now.kreneskyp commentedon Jun 28, 2026
Review gate: PASS (merge-ready).
/code-review+quoin:gap-analysison PR #2 @8574fef:quire validateexit 0.2 LOW follow-ups (non-blocking, not gating the release):
unsafeManifestNamedoesn't catch percent-encoded%2e%2e— only reachable if a registry response returns such a name (real npm/GitHub names can't), same-CDN, no SSRF. Optional: decode-then-check.cloneResponseis shallow; nested deep-mutation could still corrupt a cached entry, so FR-010-AC-10 slightly over-claims. Optional: deep-clone results or soften AC-10 wording.Merge-ready pending the release train (and the CODEOWNERS maintainer approval now required on
main).kreneskyp commentedon Jun 28, 2026
Heads-up before merge: CodeQL flags 4 HIGH
js/incomplete-url-substring-sanitizationalerts — all intests/search.test.ts(lines 455/507/508/604), where assertions check the manifest host via substringincludes/toContain("unpkg.com"). Productionsrc/is clean. These will be fixed in the rebase/reconcile pass by asserting the host strictly (new URL(...).host === .../startsWith("https://unpkg.com/")) — stricter assertions that also clear the alerts. PR #2 then rebases onto the finalmain(after #3 + #8) with TC renumbering.kreneskyp commentedon Jun 28, 2026
Merged. PR #2 squash-merged to
mainasb003a58. Discovery API (searchPlugins/createPluginSearch/createTtlCache/sourceToInstallInput+ types) is in main; all four review findings (FND-002…005) resolved, the 4 CodeQL test-assertion alerts fixed (strictnew URL().hostchecks), discovery TCs renumbered to TC-032…070 (contiguous/unique), 100% coverage. Third leg of the release train done — kit release (v0.2.0 tag/publish) next. (Minor cosmetic follow-up: a few discovery matrix rows still show 🚧 though their tests now exist+pass.)