Home

boring / v2

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

feat(core,worker): toggles become real — derive the default workflow from rules

4 months ago

c485503
Authored
grim7/12/2026, 12:26:59 AM
live-test surprise #1: the worker never read rule_configs (only the web UI did),
so /rules toggles were cosmetic — a disabled rule evaluated anyway. execution
ran the hardcoded DEFAULT_WORKFLOW; derive.ts didn't exist.

- core/workflow/derive.ts: repos with no saved workflow get a workflow DERIVED
  from enabled rules (baseline = contracts DEFAULT_WORKFLOW, retired as an
  executed constant). baseline rule runs unless a toggle disables it; toggle
  config overrides; enabled non-baseline rule opts in
- executor: injected isRuleDisabled(ref) — a disabled rule in a saved workflow
  records `disabled`, conducts as pass, and is excluded from the degradation floor
- worker run-workflows: reads rule_configs, derives or runs saved, passes
  disabledRefs; DEFAULT_WORKFLOW no longer executed (worker/default-workflow.ts
  deleted)
- web: hasEnabledWorkflow → "managed by your workflow" tag on rule cards
- tests: derive unit tests + executor disabled test + toggles integration
  (off⇒absent, config edit⇒reflected, saved+disabled⇒skipped:disabled)
- DECISIONS: derived-default model, fresh-repo overlay decision, display residual

checks: biome clean · 12/12 typecheck · boundaries ok · 138 tests, 0 fail

Parentb221093

12 files changed
  • DECISIONS.md+32−0
  • apps/web/src/components/rules/rule-config-form.tsx+5−0
  • apps/web/src/lib/rules.functions.ts+9−1
  • apps/worker/src/default-workflow.ts+0−13
  • apps/worker/src/jobs/run-workflows.ts+35−3
  • apps/worker/src/toggles.integration.test.ts+218−0
  • packages/core/src/index.ts+4−0
  • packages/core/src/workflow/derive.test.ts
+84
−0
  • packages/core/src/workflow/derive.ts+106−0
  • packages/core/src/workflow/executor.ts+41−3
  • packages/core/src/workflow/workflow.test.ts+19−0
  • packages/db/src/services/repos.ts+22−0