Skip to content

fix(review): approval-gate manual review labels - #3623

Merged
JSONbored merged 2 commits into
mainfrom
codex/fix-manual-review-labels-approval-issue
Jul 6, 2026
Merged

fix(review): approval-gate manual review labels#3623
JSONbored merged 2 commits into
mainfrom
codex/fix-manual-review-labels-approval-issue

Conversation

@JSONbored

@JSONbored JSONbored commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Manual-review label actions for guardrails, migration-collisions, unlinked-issue-match fallbacks, and the final manual-hold fallback were being created with requiresApproval: false, which allowed auto_with_approval repos to apply public labels immediately and bypass the maintainer approval gate. This restores the intended approval boundary.

Closes #3661

Description

  • Derive requiresApproval for the guardrail manual-review label from the governing autonomy using approval("merge") instead of hard-coding false.
  • Derive requiresApproval for the migration-collision manual-review fallback from approval("merge") instead of hard-coding false.
  • Derive requiresApproval for the two unlinked-issue-match manual-review fallbacks (added by the credibility-gate-farming guardrail after this PR branch was originally cut, surfaced while resolving the rebase conflict with main) from approval("merge") as well — same bug, same fix.
  • Compute the manual-hold label's governing autonomy class once (merge vs close) and set requiresApproval via approval(manualHoldAutonomyClass) so close-governed holds respect auto_with_approval as well.
  • Add unit tests in test/unit/agent-actions.test.ts that assert manual-review labels are emitted with requiresApproval: true when the governing class is configured as auto_with_approval, and remain false under plain auto where appropriate — including new coverage for the two unlinked-issue-match fallbacks.

Testing

  • npx vitest run test/unit/agent-actions.test.ts — 233/233 passing (was 203; +2 new test cases covering all 5 fixed call sites)
  • npm run typecheck — clean
  • npx vitest run test/unit/agent-actions.test.ts --coverage --coverage.include='src/settings/agent-actions.ts' — every changed line is 100% line+branch covered (verified by diffing changed hunks against the v8 uncovered-line report; the file's overall 98.3% branch figure is a pre-existing, unrelated gap elsewhere in this large file)

Codex Task

@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-06 00:35:51 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR replaces five hard-coded `requiresApproval: false` label actions with values derived from `approval("merge")` / `approval(manualHoldAutonomyClass)`, closing the auto_with_approval bypass described in #3661. The manual-hold site is refactored to compute the governing autonomy class once and reuse it for both `autonomyClass` and the `approval()` call, which is correct and avoids re-deriving the ternary. Tests added directly exercise all five call sites under both `auto_with_approval` and `auto`, matching the described fix; the change is narrow, test-backed, and tied to the linked issue.

Nits — 5 non-blocking
  • src/settings/agent-actions.ts: the guardrail, migration-collision, and two unlinked-issue-match sites all repeat the literal `approval("merge")`; consider hoisting a single `const mergeRequiresApproval = approval("merge")` above the block the way `manualHoldAutonomyClass` was hoisted, for consistency and to avoid four redundant evaluations.
  • Cannot verify from the diff that `approval` accepts an `AgentActionClass` argument matching the type used for `manualHoldAutonomyClass` — worth a quick confirm that its signature covers both "merge" and "close" (likely already true given the PR's stated clean typecheck).
  • src/settings/agent-actions.ts: extract the repeated `approval("merge")` into a local constant near the top of the four guardrail/collision/unlinked-issue blocks to mirror the `manualHoldAutonomyClass` pattern and keep the fix consistent across all five sites.
  • test/unit/agent-actions.test.ts: the new tests cover `auto_with_approval` and `auto` for merge- and close-governed paths; if `approval()` supports additional autonomy states (e.g. a manual/off value) it'd be worth one more assertion to lock in behavior there too.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #3661
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 (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 55 registered-repo PR(s), 46 merged, 464 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 55 PR(s), 464 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: 55 PR(s), 464 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • No action.
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 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.28%. Comparing base (db9ffb2) to head (8131241).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3623   +/-   ##
=======================================
  Coverage   93.28%   93.28%           
=======================================
  Files         314      314           
  Lines       32054    32054           
  Branches    11747    11747           
=======================================
  Hits        29903    29903           
  Misses       1517     1517           
  Partials      634      634           
Files with missing lines Coverage Δ
src/settings/agent-actions.ts 97.59% <100.00%> (ø)
🚀 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 added the manual-review Gittensor contributor context label Jul 6, 2026
JSONbored added 2 commits July 5, 2026 17:28
…e (1d/1e)

The rebase onto main surfaced two more manual-review label call sites
(unlinkedIssueMatchHold/unlinkedIssueMatchClose fallbacks) added by the
credibility-gate-farming guardrail after this PR branched, which had the
same hardcoded requiresApproval: false bug this PR already fixes elsewhere.
Apply the same approval("merge") derivation and pin it with a test.
@JSONbored
JSONbored force-pushed the codex/fix-manual-review-labels-approval-issue branch from 16b6e09 to 8131241 Compare July 6, 2026 00:29
@JSONbored
JSONbored merged commit 2156f42 into main Jul 6, 2026
10 checks passed
@JSONbored
JSONbored deleted the codex/fix-manual-review-labels-approval-issue branch July 6, 2026 00:41
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. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

fix(review): manual-review label actions hardcode requiresApproval: false, bypassing auto_with_approval

1 participant