Home

boring / v2

publicBoring-Software-Inc/v2
Overview Code History Branches Pull requestsIssuesInsights Campfire Docs
main
HomeOverview Code PRsIssues

fix(sdk): gate the inner verb of not against the signal kind

closed
#181 opened by detail-app[bot]detail/bug-fix/fix-sdk-gate-the-inner-verb-of-not-against-the-sig-03b005→main
Conversation4
detail-app[bot]
Commits
0
Files changed…
opened this pull request
Author
· 2 weeks ago

Detail bug report: View on Detail

Closes #168

Bug

storedRuleIssue (the author-time gate that runs on every custom-rule save) applied the verb-vs-signal-kind gate (VERBS_FOR_KIND) only to the top-level comparison. The not branch of argIssue recursed into the inner comparison's arg-type check without ever verifying the inner verb applied to the signal kind — so a rule like { kind: "not", args: [{ kind: "under", args: [7] }] } on a text signal passed validation but threw SignalEvaluationError at every evaluation. The worker caught the throw and recorded the rule as skipped, so any saved rule with a cross-kind verb inside not never enforced and degraded the run to "A rule could not run." The gap was reachable through the MCP save_custom_rule tool and the CLI, which accept arbitrary definition JSON.

Fix

In the not branch of argIssue in packages/sdk/src/stored-rule.ts, the inner verb is now checked against VERBS_FOR_KIND[kind] before recursing — mirroring the top-level gate and the evaluator's per-kind switch, which dispatches the inner comparison through the same kind-gated logic. A cross-kind inner verb now returns ${innerVerb} does not apply to this signal instead of passing through to the arg-type check.

Testing

  • Added two test cases to packages/sdk/src/stored-rule.test.ts:
    • Cross-kind verbs nested in not are rejected across all kind crossings (number-only on text/boolean/textList, text-only on number/boolean/textList, list-only on text/number/boolean, equals on textList) plus a double-negation case.
    • Valid same-kind verbs nested in not still pass for each kind, double negation passes, and the arg-type gate still runs inside not.
  • Unit tests, typecheck, Biome check, and boundary check all pass. No regressions in the SDK (56 tests), DB (349 tests), MCP (45 tests), CLI (68 tests), or web builder (10 tests) suites.
  • Verified end-to-end that the MCP save_custom_rule tool rejects a cross-kind-in-not rule before storage and accepts a valid same-kind-in-not rule, using a real throwaway Postgres container. Confirmed the CLI forwards both definitions unchanged to the server.
  • Verified at the worker runtime that a valid not rule evaluates with status: "evaluated" (not skipped, no throw) and that the "custom rule threw — treated as skipped (bug)" log line does not appear.

Automatic Fixes PRs can be configured here.

unkey-deploy[bot]commented· 2 weeks ago

The latest updates on your projects. Learn more about Unkey Deploy

NameStatusPreviewInspectUpdated (UTC)
tripwire / web (preview)ReadyVisit PreviewInspectNov 7, 2026 6:53am

Changes requested

tripwire-sh[bot] · 2 weeks ago

Blocked. See the comment.

tripwire-sh[bot]commented· 2 weeks ago

@detail-app[bot], Tripwire blocked this change request.

Rate limit: You opened 54 change requests in a short time. Wait before you open another.

View on Tripwire

How do I fix this?

A new commit will not fix this.

If you think it should merge anyway, say so in a comment. A maintainer will decide.

Review

capy-ai[bot] · 2 weeks ago

Capy found no issues.

View 2 other findings in Capy.

Open in Capy

Sign in to comment.

Merge readiness

Checking mergeability after the indexing worker computes the current branch state.

Autopilot

Debug

Reviews

Approved0
ReviewersNone yet

Configure an OpenRouter key in repository settings.