Skip to content

Design + wire an advisory-only backtest check for PRs touching ORB/AMS deterministic rules #8089

Description

@JSONbored

Problem

#8083-#8088 (once merged) give Loopover a pure, tested set of primitives — build a corpus, export a snapshot, score a candidate classifier, compare against a baseline, split held-out, render a report — but nothing runs them against a real PR yet. Per the parent epic's (#8082) Boundaries, no rule change should ever be auto-blocked by this without an explicit maintainer design decision first — this repo's auto-tune.ts precedent is human-in-the-loop and tightening-only, and the same posture applies here even more so, since a backtest score is a NEW kind of signal with no live track record yet.

Scope note (expanded): this issue covers wiring the backtest check for BOTH deterministic gate rules and AI-judgment surfaces. The scoring primitives (#8083-#8086) are generic over any ruleId and any classify function — they don't distinguish a deterministic regex from an LLM-backed judgment call. #8101 + #8104 together wire every isConfiguredGateBlocker finding code — deterministic (missing_linked_issue, duplicate_pr_risk, secret_leak, and others) and AI-judgment-backed (linked_issue_scope_mismatch, ai_consensus_defect, ai_review_split) alike — into the same shared calibration module, generically, at one call site.

Corrected scope (important — this issue previously described "candidate = the PR branch's live behavior" imprecisely): BacktestCase (#8083) only stores outcome + metadata — never the original diff/issue text a rule evaluated. That means a classify function can only correctly re-simulate a decision using what's actually IN the corpus. Without raw context, this check can only honestly backtest CONFIG/THRESHOLD changes (e.g. LINKED_ISSUE_SATISFACTION_CONFIDENCE_FLOOR, DEFAULT_AI_REVIEW_CLOSE_CONFIDENCE) — a classify function comparing a stored metadata.confidence against a new threshold value needs no raw content. Backtesting a LOGIC/regex/detection change honestly requires re-running the new logic against the original diff/issue content, which #8129 and #8130 add to the corpus (excluding secret_leak, deliberately, for security reasons — see #8130). This issue is blocked on both landing first, so "candidate = the PR branch's live behavior" is actually achievable rather than a comparison that looks real but isn't measuring what it claims to.

Area

CI wiring + a maintainer-run/maintainer-triggered workflow. Likely .github/workflows/** plus a new script under scripts/ that invokes the calibration primitives from #8083-#8088. Touches how PRs that change deterministic gate rules (src/rules/**, src/review/content-lane/**, src/settings/agent-actions.ts) OR AI-judgment surfaces (src/services/linked-issue-satisfaction.ts, src/services/ai-review.ts) are reviewed. AMS's own policy-check modules remain out of scope (see Boundaries; tracked separately as #8107, blocked on this epic).

Proposal

Deliverables

Resources

Boundaries

No merge-blocking in this issue (see #8105 for that decision). No change to any live gate rule's or AI-judgment surface's actual behavior. AMS-side wiring is out of scope here (ORB only) — tracked separately as #8107, explicitly blocked until this epic is complete. secret_leak never gets logic-change backtesting, by permanent design (see #8130) — this check degrades to threshold-only for that one code, which is acceptable since secret_leak has no tunable threshold to backtest in the first place.

maintainer-only — CI wiring plus a trust/safety-adjacent policy decision, not a build task for contributors.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

Status
Done
Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions