feat(advise): migrate-or-packageize advisories for DIY capability patterns - #63
Conversation
…geization recommendations Added the `starlog_advise` tool to assist users in identifying DIY capability code and recommending whether to migrate to safe libraries or packageize when no alternatives exist. This includes enhancements to the CLI for advising actions, pattern tracking, and integration with the existing corpus of facts. Updated documentation and added playbooks for common migration scenarios, including support for Clerk, Auth0, and Supabase. - Introduced `starlog_advise` for migration/packageize decisions. - Enhanced CLI commands for advising and pattern management. - Updated CHANGELOG for version 0.9.0 with new features and improvements.
…rn scan Enhanced the `checkPrivateOverlays` function to include a warning when `patterns.json` is missing, nudging users to run a pattern scan. This change improves user guidance for managing DIY patterns and ensures better visibility into potential issues with pattern tracking.
Three fixes to the migrate-or-packageize advisor, all verified against the existing tests: - runAdvise passed a project `context` to runSearch, which triggers search()'s per-candidate LLM enrichment (vs_custom/context_fit/tradeoffs). Advise never reads those fields, so every call paid a multi-second OpenRouter round-trip (and token cost) for discarded output — and it made the two integration tests exceed vitest's 5s default whenever a rank key was in the environment. Ranking is independent of context, so dropping it is behaviour-preserving for the advice itself and removes the wasted call. - The migrate/packageize branches re-called upsertPattern purely to set the pattern status, but upsertPattern always increments occurrences — so every actioned advise counted the same observation twice, inflating the recurrence threshold. Switched to updatePatternStatus, which sets status without incrementing. - Fixed a no-op `category.replace(/-/g, '-')` in the packageize suggested name. Tests: isolate the global pattern store via a per-test $HOME so recurrence counts can't leak in from the developer's real ~/.starlog store (the source of the flaky watch/threshold assertion), and add regression guards for both the no-context and single-increment behaviours. Full suite green (606 passed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…able" The packed-tarball smoke test grepped doctor's post-init handshake output for the literal "starlog_search available". This PR changed doctor's success detail to "starlog_search + starlog_advise available" (both tools present), which does not contain that substring — so the gate failed on a *healthy* install on both Node 20 and 22. Update the grep to the new success wording. Verified: `npm pack` + isolated smoke run → 19 passed, 0 failed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Merged — thanks @kavin0x, this is a genuinely well-structured feature. The layering (detect → safety gate → migrate/packageize/watch), the playbook fallbacks, the corpus + L2 facts additions, and the doctor wiring were all solid, and it came with real tests. 🙏 I folded in three maintainer tweaks before merge so it went in green:
Also isolated the global pattern store behind a per-test $HOME so recurrence counts can't leak in from a developer's real Full suite green (606 passing) and packed smoke 19/0 on Node 20 + 22. Nice work — looking forward to more. |
|
@kavin0x a bit of direct feedback now that it's in — you clearly put real thought into this, so this is meant as "carry it forward," not nitpicking. What was genuinely strong
Two things worth internalizing (they caused the red build)
Minor code notes (left as-is, for next time)
Process: CI didn't auto-run because it's a fork PR (needs maintainer approval), so you couldn't see it was red — that's on our side, not yours. Really nice first contribution. If you're up for more, per CONTRIBUTING the highest-leverage thing is new capability manifests — and you've now got the safety-gate context to add strong ones. Thanks again. 🙌 |
Drop the (unreleased) marker now that the migrate-or-packageize advisor (#63) is on main and about to be tagged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
starlog_advise(MCP + CLI) to track DIY capability patterns and recommend MIGRATE to safe corpus libraries (e.g. Clerk/Auth0/Supabase) when they pass a facts safety gate, or PACKAGEIZE only when no safe alternative exists (WATCH below recurrence threshold)..starlog/patterns.jsonscanning/store (starlog patterns scan|list) plusstarlog advise packageizescaffolding for private corpus/facts.starlog_advisehandshake.