Skip to content

fix(settings): authorize circuit-breaker hold labels via merge/close autonomy - #3363

Merged
loopover-orb[bot] merged 1 commit into
mainfrom
fix/circuit-breaker-manual-review-label-autonomy
Jul 5, 2026
Merged

fix(settings): authorize circuit-breaker hold labels via merge/close autonomy#3363
loopover-orb[bot] merged 1 commit into
mainfrom
fix/circuit-breaker-manual-review-label-autonomy

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • downgradeMergeToHold and downgradeCloseToHold (the accuracy/close-precision circuit breakers) drop a would-merge/would-close action and substitute a manual-review hold label. That substitute label was tagged autonomyClass: "review_state_label" — a separate, default-OFF autonomy class, independent of merge/close. The executor re-resolves autonomy per-action at execution time via autonomyClass ?? actionClass and denies the action if that class isn't acting.
  • Net effect: a repo with only merge/close autonomy enabled (no explicit review_state_label opt-in, which is the documented minimal one-shot-mode config) hits the breaker, correctly drops the merge/close, but the substitute hold label is silently denied — the PR ends up unlabeled with no visible sign of why it stopped merging.
  • Every other manual-review-label application in this same file already piggybacks on merge/close autonomy for exactly this reason (see the comment at agent-actions.ts around the guardrail-hold label) — the two circuit-breaker functions were the only ones that didn't follow that pattern. Fix: tag each breaker's substitute label with the disposition class it is actually downgrading (merge / close), matching every other call site.
  • No issue filed — this is a small, self-evident, narrowly-scoped bug fix discovered via direct code investigation (tracing the executor's autonomy re-check into the two breaker functions and confirming the mismatch), not a reported incident.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint (via npm run test:ci)
  • npm run typecheck
  • npm run test:coverage locally (via npm run test:ci); the two changed lines are plain object-literal field values with no new branches, and the two new regression tests in test/unit/agent-actions.test.ts exercise them directly.
  • npm run test:workers (via npm run test:ci)
  • npm run build:mcp (via npm run test:ci)
  • npm run test:mcp-pack (via npm run test:ci)
  • npm run ui:openapi:check (via npm run test:ci) — no API/schema change in this PR
  • npm run ui:lint (via npm run test:ci)
  • npm run ui:typecheck (via npm run test:ci)
  • npm run ui:build (via npm run test:ci)
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — added a regression test for downgradeMergeToHold and one for downgradeCloseToHold, both exercising the default (review_state_label unset) case where the bug previously manifested. Also ran the full agent-approval-queue, agent-action-executor, precision-breakers-chain, and queue suites directly since they exercise these two functions end to end — all pass unchanged.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. — N/A, no auth/session/CORS change.
  • API/OpenAPI/MCP behavior is updated and tested where needed. — N/A, no API/OpenAPI/MCP surface changed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. — N/A, no UI change.
  • Visible UI changes include a UI Evidence section below. — N/A, no visible UI change.
  • Public docs/changelogs are updated where needed. — N/A, no user-facing behavior change; internal-only labeling reliability fix.

Notes

  • This is PR 1 of a small sequence auditing repo-policy config consistency; the other items surfaced by that audit turned out not to be real drift (verified against the current source) and are documented separately rather than acted on.

…autonomy

downgradeMergeToHold and downgradeCloseToHold tagged their substitute
manual-review label with autonomyClass "review_state_label", which
defaults off independently of merge/close. A repo with only merge or
close autonomy enabled would have the breaker correctly drop the
disposition but silently fail to post the hold label, since the
executor re-checks autonomy per-action at execution time. Tag the
label with the class actually being downgraded instead, matching the
pattern already used for every other manual-review label in this file.
@superagent-security

Copy link
Copy Markdown
Contributor

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

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 5, 2026
@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-05 05:01:41 UTC

2 files · 1 AI reviewer · no blockers · readiness 93/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This change fixes the two breaker downgrades at the right layer: the synthetic manual-review label now inherits the disposition autonomy class being suppressed, so a repo with merge/close autonomy enabled and review_state_label unset still gets a visible hold. The added regression tests exercise real planner output for merge/close-only autonomy before calling the downgrade functions, so they do not fabricate the payload. I don't see a correctness blocker in the visible diff.

Nits — 3 non-blocking
  • nit: test/unit/agent-actions.test.ts:986 and test/unit/agent-actions.test.ts:1097 stop at asserting the planned label's autonomyClass; an executor-level regression would more directly prove the documented autonomyClass ?? actionClass allow/deny behavior.
  • test/unit/agent-actions.test.ts:986: consider extending one regression through executeAgentMaintenanceActions with review_state_label unset so the test proves the label posts under merge autonomy, not just that the downgrade tags it correctly.
  • test/unit/agent-actions.test.ts:1097: mirror that executor-path assertion for close autonomy if the existing test helpers can stub the GitHub label mutation cheaply.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
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.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 56 registered-repo PR(s), 46 merged, 416 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 56 PR(s), 416 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 56 PR(s), 416 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.
  • No action.
  • 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.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 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

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.88%. Comparing base (3f8e024) to head (0a9326b).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3363   +/-   ##
=======================================
  Coverage   93.88%   93.88%           
=======================================
  Files         280      280           
  Lines       30562    30562           
  Branches    11132    11132           
=======================================
  Hits        28694    28694           
  Misses       1211     1211           
  Partials      657      657           
Files with missing lines Coverage Δ
src/settings/agent-actions.ts 95.93% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 1afb2ed into main Jul 5, 2026
10 checks passed
@loopover-orb
loopover-orb Bot deleted the fix/circuit-breaker-manual-review-label-autonomy branch July 5, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant