Home

boring / v2

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

fix: hold legacy min-merged-prs v1 configs instead of silently upgrading to v2

closed
#188 opened by detail-app[bot]detail/bug-fix/fix-hold-legacy-min-merged-prs-v1-configs-instead-c6a048→main
Conversation4
detail-app[bot]
Commits
0
Files changed…
opened this pull request
Author
· 2 weeks ago

Detail bug report: View on Detail

Bug

resolveEffectiveRuleConfig (the §6 b upgrade policy) treated "config parses under the new schema" as "lossless upgrade" and auto-advanced the effective rule version. For min-merged-prs, the v2 schema gives trustedAfter a Zod default of 1, so every v1-authored config {min: N} (the only shape authorable under v1) parsed under v2 and silently auto-advanced to min-merged-prs@2. There, min means a different signal ("merged PRs in other people's repos" instead of "merged PRs in this repo") and a new trustedAfter: 1 exemption was auto-created — a moderation gate silently weakened in production with no proactive disclosure (the hold guard was dead code for this rule, the Rules page showed no badge).

Closes #175

Fix

Added an optional carriesForward shape-gate predicate to the RULE_CATALOG entry type. For min-merged-prs, the predicate checks that the config has trustedAfter (the field v2 introduced) — a config without it was authored under v1 and must be HELD for re-confirmation, not silently re-interpreted. The resolver now ANDs the shape gate with schema-parse success:

const carriesForward =
  entry.configSchema.safeParse(row.config).success &&
  ("carriesForward" in entry ? entry.carriesForward(row.config) : true);

Rules whose config schema is identical across versions (e.g. ai-review) don't declare a carriesForward gate, so schema-parse success alone remains sufficient for them — no regression to the lossless upgrade path.

  • packages/contracts/src/rules.ts — added carriesForward to the catalog type and the min-merged-prs entry; updated resolveEffectiveRuleConfig and the ResolvedRuleConfig.held docstring.
  • packages/contracts/src/rules.resolve.test.ts — added tests for the v1-shape hold ({min} only), the empty-object hold, and the ai-review lossless auto-advance case.

Testing

  • Unit tests (packages/contracts/src/rules.resolve.test.ts, packages/core/src/rules/min-merged-prs.test.ts) — 16 pass, covering the v1-shape hold, empty-object hold, unparseable-config hold, v2-shape auto-advance, ai-review lossless auto-advance, already-current, never-bumped, and unknown-rule paths.
  • End-to-end repro (scratch test, run then removed): a v1 {min: 5} config now resolves HELD on min-merged-prs@1, where a contributor with 1 local merge is blocked — confirming the silent weakening no longer occurs. The v2 path that would have passed them via the trustedAfter: 1 default still exists when the config is genuinely v2-shaped.
  • Integration tests (packages/db/src/services/, apps/worker/src/jobs/) — 447 pass, confirming the DB service layer (listRuleViews/saveRuleConfig) and the worker's run path that consume resolveEffectiveRuleConfig have no regressions.
  • Broader sweep (packages/contracts/src/, packages/core/src/) — 1405 pass.
  • Typecheck (tsrs, all 15 workspaces), Biome check, boundary check (§3 arrows), and anti-slop lint all clean.

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

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 61 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.

detail-app[bot]commented· 2 weeks ago

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

The tripwire check is failing with Blocked by Rate limit (per github.com/Boring-Software-Inc/…/188) — 61 change requests opened in a short window. This is an infrastructure/rate-limit block, not a code issue: no PR-side commit can resolve it. The PR is otherwise MERGEABLE with no other failing checks. Leaving for a maintainer to decide whether to merge/override.

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.