Home

boring / v2

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

fix(rerun): include standalone custom rules in re-run gate and preview

closed
#180 opened by detail-app[bot]detail/bug-fix/fix-rerun-include-standalone-custom-rules-in-re-ru-1f6d0b→main
Conversation7
detail-app[bot]
Commits
0
Files changed…
opened this pull request
Author
· 2 weeks ago

Detail bug report: View on Detail

Closes #167

Bug

The manual "Re-run rules" gate and confirm dialog (executableRuleNames in apps/web/src/lib/activity.functions.ts) computed "rules that would run" using only builtin rule configs (listRuleConfigs) + saved workflows (listEnabledWorkflows), then filtered exclusively over the static RULE_CATALOG. Enabled standalone custom rules are stored separately and are not in the static catalog, so they never appeared in the list — even though the worker (apps/worker/src/jobs/run-workflows.ts) explicitly joins enabled standalone custom rules into the derived toggle set via listCustomRules + deriveDefaultWorkflow and would evaluate them on a re-run.

For a repo whose only enabled rules are standalone custom rules, the web app returned { status: "no-workflow" }, removed the Re-run button, and told the admin to "install a rule" — while the worker would actually run those custom rules. The confirm dialog also under-reported the rules that would evaluate for any repo with standalone custom rules.

This was drift introduced when the re-run preview/gate shipped (3504b0a4, 2026-07-20) two days before the worker's custom-rule toggle join landed (67bd7145, 2026-07-22); the web-side mirror was never updated.

Fix

executableRuleNames now accepts a customRules parameter and folds enabled standalone custom rules into the name list, mirroring the worker's run-workflows.ts custom-rule toggle join:

  • Workflow-node branch: custom rule nodes in saved workflows show their stored name instead of the generic "Custom rule" fallback from ruleDisplayName; a new leftover-custom-rules loop adds enabled standalone custom rules not owned by any workflow (with ownership exclusion, matching deriveDefaultWorkflow).
  • No-workflows branch: enabled custom rules are appended after catalog rules.
  • Both callers (getRerunPreview, rerunChangeRequest) now fetch repoServices.listCustomRules(db, repo.id) alongside configs/workflows and pass the custom rules through.

Testing

  • Unit tests (executable-rule-names.test.ts, 18 tests): the pure function across custom-rule-only repos, disabled custom rules, builtin+custom mixes, workflowed custom rules (stored name, ownership exclusion, kill-switch), dedup, and the dangling-ref edge case.
  • Integration tests (executable-rule-names.integration.test.ts, 5 tests, real Postgres): seeds repos via repoServices and fetches the exact data the web handlers use (listEnabledWorkflows + listRuleConfigs + listCustomRules), asserting the custom-rule-only repo returns the custom rule name (not []), a disabled custom rule yields nothing, a builtin repo still works, an empty repo is still refused, and a mixed repo lists both.
  • Worker integration test (rerun.integration.test.ts, 6 pre-existing tests): the rerunChangeRequest → runWorkflows path against real Postgres confirms the worker-side rule evaluation is unaffected.
  • Regression: the full apps/web suite (1025 tests) passes; typecheck (all 15 packages), Biome check, and the boundary check are clean.
  • UI verification (not run): confirming the Re-run button renders and the confirm dialog shows the custom rule name requires a browser, since getRerunPreview/rerunChangeRequest only fire on user interaction (dialog open / button click), not on page load. The rendering is a direct consequence of the server function results verified above — RerunRunButton renders its action when unavailable is null (i.e., not no-workflow), and the dialog copy is rerunRulesLine(preview.data.ruleNames) which is non-empty for custom-rule-only repos.

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:52am

Review

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 53 change requests in a short time. Wait before you open another.

This result is out of date. See the newer comment below.

Review

capy-ai[bot] · 2 weeks ago

Capy found no issues.

View 2 other findings in Capy.

Open in Capy

detail-app[bot]commented· 2 weeks ago

Re: github.com/Boring-Software-Inc/…/180

The only failing check is Tripwire's account rate-limit rule (pr-rate-limit@1, count: 53), not a code issue. All other Tripwire rules pass — max-files-changed (3 files), account-age, english-only, crypto-address, honeypot — and the verdict comment itself states a new commit will not fix this. No code change on this PR would clear it. I believe it can merge as-is; a maintainer should decide.

detail-app[bot]commented· 2 weeks ago

Re: github.com/Boring-Software-Inc/…/180

This review's substance is the rate-limit block in the linked comment, already addressed in github.com/Boring-Software-Inc/…/180. The verdict comment states a new commit will not fix it; no PR-side change clears an account rate-limit rule. A maintainer should decide whether to merge.

tripwire-sh[bot]commented· 2 weeks ago

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

Tripwire checked this again with the current rules.

View on Tripwire

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.