Skip to content

fix: bind recipe boolean params as SQLite 0/1 - #222

Merged
SutuSebastian merged 3 commits into
mainfrom
fix/recipe-boolean-sqlite-bind
Aug 10, 2026
Merged

fix: bind recipe boolean params as SQLite 0/1#222
SutuSebastian merged 3 commits into
mainfrom
fix/recipe-boolean-sqlite-bind

Conversation

@SutuSebastian

@SutuSebastian SutuSebastian commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Recipe type: boolean params were coerced to JS true/false, which fails at bind time on Node — defaults alone broke recipes like churn-complexity-hotspots and stale-imports.
  • Resolve-time coerce to INTEGER 0/1; narrow QueryBindValue; introduce ResolvedRecipeParamValue for bind-ready lists.
  • CI Node smoke runs churn-complexity-hotspots after the minimal fixture index so Bun-only tests cannot mask a regression.

Test plan

  • bun test src/application/recipe-params.test.ts (+ action-template / cmd-query pins)
  • bun run typecheck
  • Local Node: node dist/index.mjs query --json --recipe churn-complexity-hotspots (and stale-imports) against fixtures/minimal
  • CI “Node smoke (boolean recipe params bind)” green

Summary by CodeRabbit

  • Bug Fixes

    • Fixed boolean recipe parameters so they bind correctly as SQLite-compatible 0 or 1 values.
    • Recipes such as churn-complexity-hotspots and stale-imports now execute successfully with their default settings.
    • Updated rendered query and command output to display resolved boolean values consistently.
  • Tests

    • Added automated coverage to verify boolean parameters work in Node and resolve to valid database-compatible values.

better-sqlite3 rejects JS booleans; coerce type:boolean params to
integers at resolve time so defaulted recipes (e.g. churn-complexity-hotspots)
run on Node. Narrow QueryBindValue; add CI Node smoke.
@changeset-bot

changeset-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bb4735d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stainless-code/codemap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@SutuSebastian, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 15db5a9d-3a0c-47fb-b109-d0f472c0481b

📥 Commits

Reviewing files that changed from the base of the PR and between cb31d7b and bb4735d.

📒 Files selected for processing (2)
  • src/application/recipe-params.test.ts
  • src/application/recipe-params.ts
📝 Walkthrough

Walkthrough

Boolean recipe parameters now resolve to SQLite-compatible 0 or 1 values. Query binding types and consumers use the resolved value type. Tests, CLI expectations, CI smoke coverage, and release metadata reflect the change.

Changes

Boolean Bind Resolution

Layer / File(s) Summary
Parameter resolution contract
src/application/recipe-params.ts, src/application/query-engine.ts, src/application/recipe-params.test.ts
Boolean inputs resolve to numeric 0 or 1. Resolved values use a SQLite-ready type that excludes JavaScript booleans.
Resolved bind value propagation
src/cli/cmd-query.ts, src/application/tool-handlers.ts, scripts/agent-eval/*, scripts/query-golden/resolve-golden-query.ts
Query, tool, probe, and golden-query paths use ResolvedRecipeParamValue for bind values.
Execution validation and release metadata
src/application/apply-command-template.test.ts, src/cli/cmd-query.test.ts, .github/workflows/ci.yml, .changeset/boolean-sqlite-bind.md
Tests and Node CI smoke coverage expect numeric boolean bindings. The changeset records the patch release.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: binding recipe boolean parameters as SQLite-compatible 0/1 values.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/recipe-boolean-sqlite-bind

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/application/recipe-params.ts`:
- Around line 18-25: Remove null from the RecipeParamValue union and update
resolveRecipeParams to reject runtime null inputs before any type-specific
coercion, while preserving resolver-generated null values for omitted optional
parameters in ResolvedRecipeParamValue.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e5405ee8-9151-4f98-b1b5-ccf4eea69455

📥 Commits

Reviewing files that changed from the base of the PR and between 77e5d55 and cb31d7b.

📒 Files selected for processing (12)
  • .changeset/boolean-sqlite-bind.md
  • .github/workflows/ci.yml
  • scripts/agent-eval/probe-tokens.ts
  • scripts/agent-eval/run-probes.ts
  • scripts/query-golden/resolve-golden-query.ts
  • src/application/apply-command-template.test.ts
  • src/application/query-engine.ts
  • src/application/recipe-params.test.ts
  • src/application/recipe-params.ts
  • src/application/tool-handlers.ts
  • src/cli/cmd-query.test.ts
  • src/cli/cmd-query.ts

Comment thread src/application/recipe-params.ts Outdated
Callers must omit optional keys; Number(null)/String(null) were
silently becoming 0/"null". Keep resolver-assigned null on the bind list.
@SutuSebastian
SutuSebastian merged commit 8f45212 into main Aug 10, 2026
23 of 25 checks passed
@SutuSebastian
SutuSebastian deleted the fix/recipe-boolean-sqlite-bind branch August 10, 2026 20:48
@github-actions github-actions Bot mentioned this pull request Aug 10, 2026
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