Skip to content

fix(orb): add 3 documented maintainer-session routes to the path allowlist - #8710

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
kai392:fix/critical-issue-session-allowlist-routes
Jul 26, 2026
Merged

fix(orb): add 3 documented maintainer-session routes to the path allowlist#8710
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
kai392:fix/critical-issue-session-allowlist-routes

Conversation

@kai392

@kai392 kai392 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #8653

Root cause

canSessionAccessPath (src/api/routes.ts) is the coarse pre-route allowlist that runs in middleware for every non-operator browser session. Three routes call requireRepoMaintainer internally and each documents itself as maintainer-session-reachable — but none had a predicate in the allowlist, so a real non-operator maintainer session hit the coarse 403 before the handler's own guard could admit it:

  • automation-state — comment: "Maintainer-gated like /settings" (which is allowlisted)
  • ams-miner-cohort — comment: "mirrors maintainer-noise" (which is allowlisted)
  • pulls/:number/chat-qa — comment: exposes to the maintainer panel; confirmed live — apps/loopover-ui/.../chat-qa-panel.tsx calls it with credentials: "include"

Fix

Added three path predicates (isRepoAutomationStatePath, isRepoAmsMinerCohortPath, isRepoChatQaPath), mirroring the existing isRepoMaintainerNoisePath shape exactly, and wired them into canSessionAccessPath. This only decides whether a session may reach the path — each route's own requireRepoMaintainer still enforces per-repo authority, so a maintainer of A reaching B still gets 403 forbidden_repo.

Tests

Added to test/unit/access-boundary.test.ts following its established template — for all 3 routes, a maintainer session reaches its own repo (200) and is rejected on a different maintainer's repo (403 forbidden_repo). No AI mock was needed for chat-qa: with the default settings (advisoryAiRouting.chatQa off), the real answer service returns a 200 disabled status, so a seeded PR is enough to prove reachability.

Validation

  • test/unit/access-boundary.test.ts: 12 passed, on a branch rebased onto current main
  • lcov scoped to routes.ts: every added line and both branches of each new predicate covered
  • npm run typecheck clean; oxlint clean on the changed lines; git diff --check clean

@kai392
kai392 requested a review from JSONbored as a code owner July 26, 2026 00:08
@superagent-security

Copy link
Copy Markdown
Contributor

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

…wlist

automation-state, ams-miner-cohort, and pulls/:number/chat-qa each documented
themselves as reachable by a maintainer's browser panel (and chat-qa is called
with credentials:include from apps/loopover-ui), but were missing from
canSessionAccessPath, so a real non-operator maintainer session hit the coarse
403 before the route's own requireRepoMaintainer guard could admit it. Adds the
three allowlist predicates; each route's guard still scopes per-repo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.02%. Comparing base (63497bd) to head (4e1ad31).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8710      +/-   ##
==========================================
+ Coverage   90.56%   91.02%   +0.46%     
==========================================
  Files          96       97       +1     
  Lines       22490    24901    +2411     
  Branches     3884     4659     +775     
==========================================
+ Hits        20367    22665    +2298     
- Misses       1945     1971      +26     
- Partials      178      265      +87     
Flag Coverage Δ
backend 95.31% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/api/routes.ts 95.31% <100.00%> (ø)

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

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-26 00:15:29 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 adds three narrowly-scoped regex predicates to the coarse session path allowlist (`canSessionAccessPath`) mirroring the exact shape of the existing `isRepoMaintainerNoisePath` entry, closing a real gap where maintainer sessions hit a 403 before reaching each route's own `requireRepoMaintainer` guard. Each new route retains its own per-repo guard (confirmed unchanged in the full file), so the fix does not widen authority — it only fixes reachability, matching the stated intent exactly. Tests follow the established template and cover both same-repo (200) and cross-repo (403 forbidden_repo) cases for all three routes, including a legitimate non-mocked path for chat-qa via the default-disabled AI routing flag.

Nits — 4 non-blocking

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8653
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: 152 registered-repo PR(s), 81 merged, 6 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kai392; Gittensor profile; 152 PR(s), 6 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Review context
  • Author: kai392
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 152 PR(s), 6 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@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.

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

@loopover-orb
loopover-orb Bot merged commit c6fad5d into JSONbored:main Jul 26, 2026
8 checks passed
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.

fix(orb): session allowlist is missing 3 routes that explicitly document themselves as maintainer-session routes

2 participants