Home

boring / v2

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

feat(custom-rules): runtime catalog, stored rules, generic evaluation

3 months ago

67bd714
Authored
grim7/22/2026, 10:27:05 PM
a custom rule is a rule defined in data: the stored definition is the
serialized sdk shape, one jsonb column (migration 0015), deserializing
straight into evaluateSignalRule. resolveCatalog merges built-ins with a
repo's custom rows at read time; validateWorkflowForEnable takes the
catalog as a parameter. the worker's makeEvaluator is a two-source
resolver: custom refs evaluate through the github forge's producers over
one shared memoized signal ctx, emitting the same RuleResult envelope a
built-in does. evidence is the observed value only; thresholds stay
gated. safe verbs enforced in the schema; nothing branches on isCustom
for behavior.

Parent2401994

25 files changed
  • apps/web/package.json+1−0
  • apps/worker/package.json+1−0
  • apps/worker/src/index.ts+6−0
  • apps/worker/src/jobs/custom-rules.test.ts+202−0
  • apps/worker/src/jobs/custom-rules.ts+121−0
  • apps/worker/src/jobs/process-event.ts+4−0
  • apps/worker/src/jobs/run-workflows.ts+103−20
  • bun.lock+2
−0
  • packages/contracts/src/custom-rules-display.test.ts+104−0
  • packages/contracts/src/custom-rules-display.ts+330−0
  • packages/contracts/src/custom-rules.test.ts+146−0
  • packages/contracts/src/custom-rules.ts+162−0
  • packages/contracts/src/index.ts+2−0
  • packages/contracts/src/workflow-validate.ts+15−2
  • packages/db/drizzle/0015_demonic_speed.sql+11−0
  • packages/db/drizzle/meta/0015_snapshot.json+2259−0
  • packages/db/drizzle/meta/_journal.json+7−0
  • packages/db/src/schema/repos.ts+22−0
  • packages/db/src/services/repos.ts+59−0
  • packages/db/src/services/workflows.ts+17−2
  • packages/forge-github/src/index.ts+1−0
  • packages/sdk/src/index.ts+1−0
  • packages/sdk/src/stored-rule.test.ts+67−0
  • packages/sdk/src/stored-rule.ts+85−0
  • scripts/check-boundaries.ts+1−1