Skip to content

fix(review): predict path-independent pre-merge checks and disclaim diff-dependent gates - #1411

Merged
JSONbored merged 1 commit into
mainfrom
claude/predict-gate-parity
Jun 26, 2026
Merged

fix(review): predict path-independent pre-merge checks and disclaim diff-dependent gates#1411
JSONbored merged 1 commit into
mainfrom
claude/predict-gate-parity

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

The pre-submit predict_gate oracle (buildPredictedGateVerdict) ran the advisory + evaluateGateCheck but ignored the repo's review.pre_merge_checks, focus-manifest path policy, and slop score — all of which the LIVE gate enforces. So a PR the gate would auto-close on an enforced title/description rule predicted "success", misleading contributors (audit #11/#18; the slop/manifest arms are #13/#12).

This is part one of a two-part fix (scoped this way per maintainer direction — the rest needs a public-contract change):

  • Evaluate the path-INDEPENDENT pre-merge checks now (empty whenPaths — title / description / label assertions), from the same public .gittensory.yml the predictor already reads. Their inputs (title/body/labels) are exactly the real PR's, so the predicted result is identical to live for those checks — including the enforced → pre_merge_check_required block.
  • Honestly disclaim the rest in the note. Path-gated pre-merge checks, the focus-manifest path policy, and slop all evaluate against the PR's changed files/diff, which doesn't exist pre-submission. The verdict note now states plainly that those are not predicted, so a "success" is not misread as complete.

Follow-up (part two): extend the predict_gate MCP/API input with the contributor's changed paths so manifest-policy + path-gated pre-merge checks reach full parity (and decide how slop is signalled). That's a public-contract change + OpenAPI regen, kept separate.

No GitHub issue — internal review-subsystem audit finding. The PredictedGateVerdict output shape is unchanged, so no OpenAPI regen.

Scope

  • Backend (src/) only — src/rules/predicted-gate.ts
  • No API/schema, DB/migration, wrangler.jsonc, or UI change (verdict output shape unchanged)
  • Narrow, one coherent change

Validation

  • npm run test:ci — green (4469 passed | 4 skipped)
  • npm run test:coverage — every changed line and branch covered (verified against coverage/lcov.info)
  • npm audit --audit-level=moderate — 0 vulnerabilities; typecheck/ui:typecheck/ui:openapi:check clean; git diff --check clean
  • New tests: enforced path-independent check → predicted failure + pre_merge_check_required; satisfied check → pass; non-enforced → warning not blocker; a path-gated check is skipped pre-submit (no false block, no pre_merge_check_unresolved noise) and the note discloses the slop/manifest/path gap.

Safety

  • No secrets / wallets / hotkeys / coldkeys / trust scores / reward values added
  • Public-safe: pre-merge findings already run through publicSafeFinding/sanitizePublicComment; only public .gittensory.yml config is read
  • Honest-by-construction: path-gated/manifest/slop are skipped (never falsely blocked) and explicitly disclaimed

…iff-dependent gates

The predict_gate oracle (buildPredictedGateVerdict) ran the advisory + gate but
ignored the repo's review.pre_merge_checks, focus-manifest path policy, and slop
— all of which the LIVE gate enforces. So a PR the gate would auto-close on an
enforced title/description rule predicted 'success', misleading contributors.

Evaluate the PATH-INDEPENDENT pre-merge checks (empty whenPaths — title /
description / label assertions) from the SAME public .gittensory.yml the
predictor already reads; their inputs are exactly the real PR's, so the result
matches the live gate. Path-gated checks, manifest-policy, and slop need the
PR's changed files/diff (unavailable pre-submission) — they are now explicitly
disclaimed in the verdict note so a 'success' is not misread as complete. Full
parity for those ships when the predictor accepts changed paths (follow-up).

No output-schema change (PredictedGateVerdict shape unchanged), so no OpenAPI
regen.
@dosubot dosubot Bot added the size:S label Jun 26, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.36%. Comparing base (475d07d) to head (31c98db).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1411   +/-   ##
=======================================
  Coverage   95.36%   95.36%           
=======================================
  Files         192      192           
  Lines       20777    20779    +2     
  Branches     7512     7512           
=======================================
+ Hits        19814    19816    +2     
  Misses        383      383           
  Partials      580      580           
Files with missing lines Coverage Δ
src/rules/predicted-gate.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 9b69f3b into main Jun 26, 2026
18 checks passed
@JSONbored
JSONbored deleted the claude/predict-gate-parity branch June 26, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant