fix(kit): decide a module's kind in one place - #42
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (13)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughMetadata kind selection is centralized for kit and script consumers. The store catalog validates tags before searching them, and tests compare its results with the shared rule. ChangesMetadata Kind Classification
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The change aligns metadata classification across consumers and safely handles malformed tags in the Store. No actionable blocker is identified; merge after normal checks pass. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change aligns metadata decisions without establishing a new execution capability or weaker control. Risk is low, with uncertainty remaining around loader recovery and concurrent state changes. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 12 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the tags at dawn, Comment |
Summary
Several places decided a module's kind from
metadata.jsonon their own, and three of them disagreed withkindOfMeta(kindwins,tagsis the fallback, unknown kinds are ignored):kit dev's in-page push check and the stdlib boundary check called{ kind: "extension", tags: ["theme"] }a theme; the push check also did so for{ tags: ["theme", "extension"] }and a stringtags: "theme".kindOftreated a stringtagsfield as a list.Now:
kindOfMeta(packages/kit/src/vault-metadata.ts) is the one rule for the kit and scripts. The push script runs in Spotify's page and can't import, so it getsKIND_OF_META_SOURCE, a string form of the same rule built from the sameKINDSlist.stdlib-boundary.tsandscripts/preview.ts(which had its own kinds list) usekindOfMeta.kindOf, so no kit code enters the client bundle, but now only acceptstagsas an array. Store bumped to 1.8.1..tagsread inpackages/kit/srcorscripts/outside the helper.Testing
packages/kit/test/kind-cases.ts) drive: the in-page rule againstkindOfMetain a VM; the full push script against a fake loader, for each shape as the pushed and the installed module; and the Store'skindOfagainstkindOfMeta. Restoring the old push check fails 3 of them; restoring the old boundary check fails its new test; the Store test failed ontags: "theme"before its fix.push.ts,stdlib-boundary.tsandpreview.ts.release.ts status --soft: ok.Summary by CodeRabbit