Skip to content

feat(gate): re-align planner to close-or-merge (minimize manual review) - #1085

Merged
JSONbored merged 1 commit into
mainfrom
feat/gate-realignment
Jun 23, 2026
Merged

feat(gate): re-align planner to close-or-merge (minimize manual review)#1085
JSONbored merged 1 commit into
mainfrom
feat/gate-realignment

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Re-aligns the auto-maintain planner to the canonical reviewbot decideNonContentGate model, tuned to the operator's minimize-manual goal: every PR ends in merge or close; manual review is the rare exception.

Policy (per PR):

  • Merge — gate passes + CI green + mergeable + approvals + unguarded.
  • Close (one-shot, contributor) — not review-good (gate blockers / red OR unverified CI) OR conflicts with base. Cites the concrete reasons. Closes even on a guarded path — the guardrail withholds a GOOD PR for review, it never rescues a bad one.
  • Manual hold — only (a) a review-good PR on a protected path (approved + held for owner safety review), or (b) any not-good owner/automation PR (never closed). request_changes is the fallback when close isn't at an acting level.

Preserves #1062's fail-safe guardrail (unknown/empty changed paths → treat as guarded, never auto-merge a diff we can't see); reviewGood is computed from the real diff upstream so bad PRs still close accurately.

All 3440 unit tests pass; tsc clean.

…mize manual)

Match reviewbot's decideNonContentGate, tuned to the operator's minimize-manual goal:
- A CONTRIBUTOR PR that is not review-good (gate blockers / red OR unverified CI) OR conflicts with base is CLOSED one-shot (taopedia model — resolve + open a fresh PR), citing the concrete reasons. Closes even on a guarded path: the guardrail withholds a GOOD PR for review, it never rescues a bad one.
- A review-good PR (gate passes + CI green) on a protected path is APPROVED but HELD for the owner's manual safety review (never auto-merged).
- OWNER / automation PRs are NEVER closed — held with request-changes.
- request-changes only fires as a fallback when not closing (owner, or close not at an acting level).
- Manual review is now the rare exception. 3425 unit tests pass.
@dosubot dosubot Bot added the size:L label Jun 23, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored
JSONbored merged commit f1456f3 into main Jun 23, 2026
16 checks passed
@JSONbored
JSONbored deleted the feat/gate-realignment branch June 23, 2026 15:44
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.76%. Comparing base (72387df) to head (c09b89b).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/settings/agent-actions.ts 86.66% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1085      +/-   ##
==========================================
- Coverage   94.77%   94.76%   -0.01%     
==========================================
  Files         153      153              
  Lines       18518    18526       +8     
  Branches     6699     6705       +6     
==========================================
+ Hits        17550    17556       +6     
  Misses        416      416              
- Partials      552      554       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ghost

ghost commented Jun 23, 2026

Copy link
Copy Markdown

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review — blocked

2 files · 2 AI reviewers · no blockers · readiness 93/100 · CI failing · unknown

🛑 Blocked

Review summary
The planner now references the variable `ciReason` before it is declared. This causes a runtime ReferenceError whenever the label action is evaluated, breaking the planning logic and potentially causing CI failures or missed actions.

Suggestions

  • Move the declaration of `ciReason` above the label block, or compute the reason string within the label block without referencing a later variable.
  • Add a unit test that explicitly triggers the label path with various CI states to catch this error.
  • Run the test suite locally after fixing to ensure all label-related tests pass.
  • Consider adding a test case for the scenario where `ciState` is `unverified` and the PR is authored by a contributor. This edge case is mentioned in the code comments but not explicitly tested.
  • The `ciUnverified` variable is used in multiple places. Consider extracting it into a separate function or constant to improve readability and maintainability.

Risks

  • Runtime crashes in the auto-maintain planner, leading to no actions being taken for PRs.
  • Potential loss of automated merges, closes, or approvals, causing manual workload increase.
  • CI pipelines may fail unexpectedly, reducing confidence in automation.
  • The change introduces a new behavior where contributor PRs with unverified CI are closed. This could potentially close valid PRs if the CI verification process is delayed or fails for reasons unrelated to the PR content.

CI checks failing

  • codecov/patch — 86.66% of diff hit (target 94.77%)
  • codecov/project — 94.76% (-0.01%) compared to 72387df
  • codecov/project — 94.76% (-0.01%) compared to 72387df
  • codecov/patch — 86.66% of diff hit (target 94.77%)
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Review load ✅ 20/20 Readiness component derived from cached public PR metadata and labels.
Validation evidence ✅ 25/25 PR body includes validation/test evidence.
Open PR queue ✅ 10/10 0 open PR(s), 0 likely reviewable.
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 84 PR(s), 254 issue(s).
Gate result ✅ Passing No configured blocker found.
Nits — 1 non-blocking
  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, JavaScript, Ruby, Go, Kotlin, MDX, Shell
  • Official Gittensor activity: 84 PR(s), 254 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Review load = cached public PR metadata such as size labels, changed paths, and preflight status.
  • Open PR queue = repo-wide review pressure; it is not a PR quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
Review details

Generated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative.

The planner now references the variable `ciReason` before it is declared. This causes a runtime ReferenceError whenever the label action is evaluated, breaking the planning logic and potentially causing CI failures or missed actions.

Suggestions

  • Move the declaration of `ciReason` above the label block, or compute the reason string within the label block without referencing a later variable.
  • Add a unit test that explicitly triggers the label path with various CI states to catch this error.
  • Run the test suite locally after fixing to ensure all label-related tests pass.
  • Consider adding a test case for the scenario where `ciState` is `unverified` and the PR is authored by a contributor. This edge case is mentioned in the code comments but not explicitly tested.
  • The `ciUnverified` variable is used in multiple places. Consider extracting it into a separate function or constant to improve readability and maintainability.

Risks

  • Runtime crashes in the auto-maintain planner, leading to no actions being taken for PRs.
  • Potential loss of automated merges, closes, or approvals, causing manual workload increase.
  • CI pipelines may fail unexpectedly, reducing confidence in automation.
  • The change introduces a new behavior where contributor PRs with unverified CI are closed. This could potentially close valid PRs if the CI verification process is delayed or fails for reasons unrelated to the PR content.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@ghost ghost added gittensory:reviewed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jun 23, 2026

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory requests changes — CI is not green:

  • CI is failing (codecov/patch, codecov/project, codecov/project, codecov/patch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant