Skip to content

fix(scaffold-core): Stripe keyword no longer dominates SaaS intent#242

Closed
stackbilt-admin wants to merge 1 commit into
mainfrom
auto/bugfix/scaffold-classify-stripe-keyword
Closed

fix(scaffold-core): Stripe keyword no longer dominates SaaS intent#242
stackbilt-admin wants to merge 1 commit into
mainfrom
auto/bugfix/scaffold-classify-stripe-keyword

Conversation

@stackbilt-admin

Copy link
Copy Markdown
Member

Problem

scaffold_classify was misclassifying SaaS architectural intents as Stripe webhook
handlers whenever the word billing appeared alongside stripe.

Reproduction:

"Build me a SaaS billing dashboard with Stripe integration, user management, and usage analytics"

Expected: workers-saas · Got: stripe-webhook (Payment Signal score 2 vs SaaS 1)

Root cause: billing in the Payment Signal's scoring keyword list fired on "billing dashboard"
— an architectural term, not a Stripe webhook signal.

Changes

patterns.ts

  • Payment Signal score(): removes billing from the keyword list; billing now only
    contributes +1 when at least one other payment-action keyword is already present.
  • Webhook Signal guard: removes billing from the payment-action exclusion list.
  • SaaS Signal: adds dashboard, analytics, user management to score keywords.

Tests: 5 new regression cases. Version: 1.7.0 → 1.7.1. 775/775 tests passing.

Downstream

After merging + publishing, run pnpm update @stackbilt/scaffold-core in the
stackbilt-mcp-gateway repo to pick up the fix.

Closes #424

🤖 Generated with Claude Code

…t (#424)

Payment Signal's score() function excluded `billing` from its keyword list
so "billing dashboard" no longer registers as a Stripe webhook handler.
`billing` still counts as +1 when another payment-action keyword is also present
(stripe/subscription/checkout/payment), preserving correct scoring for
"stripe billing webhook" cases.

Webhook Signal guard also narrowed to exclude `billing` from the payment-action
blocklist so "billing webhook" (without Stripe) correctly falls through to the
generic webhook pattern instead of dropping to API fallback.

SaaS Signal gains `dashboard`, `analytics`, and `user management` as scoring
keywords so architectural intent terms outweigh a single vendor name.

Bumps to 1.7.1. 775/775 tests passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@stackbilt-admin

Copy link
Copy Markdown
Member Author

Closing — this PR patches keyword scoring in scaffold-core/src/classify/patterns.ts, which is the wrong abstraction layer. The root fix ships in tarotscript: Workers SaaS API card added to cloudflare-blessed-stacks.deck (b866ce6), SaaS Signal card added to intent-vocabulary.deck, and POST /classify now returns pattern_code + source_pattern so downstream consumers need no lookup tables. The next step is replacing scaffold-core's classify() with an adapter that calls env.TAROTSCRIPT.fetch('/classify') — at which point patterns.ts is retired entirely. No value in keeping this intermediate patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant