Repository navigation
feat(auth): add instance admin roles - #1713
Conversation
|
/review fable |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — fableOverall EvaluationThis PR introduces a durable, database-backed instance role system ( There are, however, several real gaps: read endpoints for settings/agents remain unguarded (information disclosure to members), the legacy-mode "claim" race allows any authenticated user to seize durable admin on upgrade, an unvalidated Findings🔴 Sensitive read endpoints remain unguarded for members — 🔴 Legacy-mode admin claim is first-come-first-served for every authenticated user — 🟡 🟡 🟡 Two extra DB queries on every authenticated API request — 🟡 Bootstrap admins are username-based, undermining the stable-ID story for the break-glass path — 🟡 🟡 Uncertain coverage of the 🟡 Stale client-side permissions — 🟡 Unbounded audit table growth — 🟢 Odd tuple assignment — 🟢 Username regex is looser than GitHub's rules — 🟢 Type duplication between UI and API — 🟢 Audit action 🟢 Audit API has no UI — 🟢 Test imports a core migration across package boundaries — 🟢 ✅ Server-side enforcement first, UI second — Guards on ✅ Sanitized current-user response — ✅ Transactional role mutations with audit and last-admin protection — ✅ Solid, layered test suite — real in-memory SQLite integration tests for the authorization resolver, service invariants (last-admin, claim, implicit member), and route wiring, plus UI tests covering both normal and legacy-claim flows. ✅ Documentation kept in sync — ScoreScore: 7/10 A well-designed, well-tested, and well-documented authorization feature with correct server-side enforcement and sensible upgrade semantics, but it needs fixes for the unguarded sensitive GET endpoints, the legacy-mode claim race, the 🤖 Review Details
🤖 Review by ProPR |
|
/fix don't worry about legacy, this is still greenfield |
|
✅ Applied the requested follow-up changes in commit c88cef0
Summary of ChangesImplemented the PR #1713 follow-up without committing. Key changes:
Verification passed:
🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Implemented the PR #1713 follow-up without committing. Key changes: - Removed legacy/compatibility admin mode and the `PROPR_AGENT_RUNTIME_ADMIN_ANY_USER` bypass. - Restricted initial role storage to `PROPR_ADMIN_USERS` bootstrap admins. - Guarded sensitive configuration and agent read endpoints; added a sanitized member catalog. - Fixed audit-limit validation, environment-admin assignment guards, GitHub username validation, route coverage, stale UI permissions, and audit retention. - Consolidated shared authorization types and updated documentation. Verification passed: - 123 root unit tests - 29 focused API integration tests - 209 UI tests - API/UI lint - Root, core, and API typechecks - Shared, API, UI, and docs production builds - `git diff --check` PR: #1713 Comment by: @integry (ID: 5131119305) Model: gpt-5.6-sol
|
/merge |
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryResolved all four merge conflicts without committing or modifying unrelated files. Conflict resolutions
Verification
One environment issue remains: 🤖 Resolution Details
System-triggered merge conflict resolution |
Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - docs/docs/features/web-ui.md - packages/api/routes/agentRoutes.ts - packages/api/routes/index.ts - packages/api/server.ts PR: #1713 Model: gpt-5.6-sol
Checks FailedLinting or build errors were detected. View Logs |
|
✅ Applied the requested follow-up changes in commit 5094f7f Summary of ChangesUpdated packages/api/server.ts by compacting route entries, reducing ESLint-counted lines from 406 to 400 without behavior changes. Validated:
🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…es/integry/propr/pr-1713-followup-2026-07-30T14-21-34/packages/api/server.ts:288) by compacting route entries, reducing ESLint-counted lines from 406 to 400 without behavior changes. Updated [packages/api/server.ts](/tmp/git-processor/worktrees/integry/propr/pr-1713-followup-2026-07-30T14-21-34/packages/api/server.ts:288) by compacting route entries, reducing ESLint-counted lines from 406 to 400 without behavior changes. Validated: - API lint with `--max-warnings 0` passes - API build passes - `git diff --check` passes - Only `server.ts` changed; no commit created PR: #1713 Comment by: @github-actions[bot] (ID: 5132028887) Model: gpt-5.6-sol
|
/ultrafix |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — claude:claude-opus-4-8Overall EvaluationThis PR introduces a durable instance-role authorization system (admin/member) keyed by stable GitHub numeric user IDs, replacing the previous ad-hoc
The design is clean, well-tested, and the security model is thoughtful (stable-ID keying, server-enforced permissions independent of the UI, sanitized member catalog, self-refresh on stale-permission 403s). Overall quality is high. There are a few concerns worth addressing (a possible TOCTOU on last-admin protection, a per-request DB lookup with no caching, and the previously-failing Findings🟡 TOCTOU race in last-admin protection ( 🟡 Per-request database lookup for every non-bootstrap user ( 🟡 Last-admin protection ignores bootstrap admins ( 🟡 Previously-failing 🟢 Audit retention deletes on every write ( 🟢 🟢 Redundant handler exposure for indexing status ( 🟢 JSX indentation of 🟢 Same-value role change still issues a request ( ✅ Strong sanitization of the current-user and catalog responses — ✅ Stable numeric-ID keying with username snapshots — Keying durable roles on the GitHub numeric ID while retaining usernames only for display/audit correctly avoids rename/recycle hijacking, and the migration/comments make this rationale clear. ✅ Server-enforced permissions with a stable error contract — The ✅ Comprehensive test coverage — ✅ Documentation is thorough and consistent — ScoreScore: 8/10 — A well-architected, well-tested, and well-documented authorization feature; deductions are for the potential last-admin TOCTOU on non-SQLite backends, the uncached per-request DB lookup, and the unverified 🤖 Review Details
🤖 Review by ProPR |
|
/review codex fable |
|
✅ AI Code Review Complete requested by @integry Posted 2 reviews: |
🔍 AI Code Review — codexOverall EvaluationThis PR introduces durable instance roles, permission middleware, an administrator access UI, sanitized member-facing catalog endpoints, and role auditing. The design is generally coherent and well tested, but the new member-accessible indexing-status route needs stronger server-side sanitization before merge. A few bootstrap and authorization-refresh edge cases also deserve attention. Overall: needs minor-to-moderate changes before merging. Findings
ScoreThe core authorization design is strong and close to merge-ready, but the unfiltered member-facing indexing route weakens the intended data boundary and should be corrected first. Score: 7/10 🤖 Review Details
🤖 Review by ProPR |
🔍 AI Code Review — fableOverall EvaluationThis PR introduces durable instance-level roles (admin/member) keyed by stable GitHub numeric user IDs, with a bootstrap path via The implementation quality is high, but there are a few behavioral inconsistencies worth resolving: the PR description promises a "compatibility admin mode" that the code does not actually implement, the runtime-package "redacted read for non-admins" path became unreachable, and demo-mode users now lose visibility they previously had. The PR is close to mergeable — needs minor changes / clarifications. Findings🔴 PR description promises "compatibility admin mode" that the code does not implement — 🟡 Non-admin redacted runtime-package reads are now dead code, and tests mask it — 🟡 Unguarded 🟡 Demo-mode experience regresses — 🟡 Last-admin protection ignores bootstrap admins — 🟡 Per-request DB lookup on every 🟡 🟡 Case-sensitive username comparison in claim fast-path — 🟢 🟢 Audit UI missing — 🟢 Cross-package test import into 🟢 🟢 🟢 ✅ Strong sanitization discipline with regression tests — ✅ Correct identity model — Keying durable roles on the numeric GitHub user ID (with username snapshots for display) is the right defense against username rename/recycling, and the migration comment documents the rationale. ✅ Transactional integrity and audit trail — ✅ Server-side enforcement independent of the UI — Guards are applied at route registration ( ✅ GitHub username validation — The ScoreScore: 8/10 A well-architected, thoroughly tested authorization feature with strong sanitization guarantees; docked for the description/code mismatch around "compatibility admin mode" (a potential upgrade-lockout ambiguity), the now-unreachable runtime redaction path with a misleading test, and the unguarded indexing-status endpoint that may undercut the sanitization goal. 🤖 Review Details
🤖 Review by ProPR |
|
/fix as stated before backward compat is not important |
|
✅ Applied the requested follow-up changes in commit 6515190
Summary of ChangesImplemented the PR follow-ups without compatibility-admin behavior:
Validation passed: unit tests, targeted API/UI tests, hosted-tunnel regressions, all CI lint/build steps, docs build/typecheck, CLI packaging, and Changes remain uncommitted as requested. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ehavior: Implemented the PR follow-ups without compatibility-admin behavior: - Added sanitized member indexing status filtered to enabled repository/branch entries. - Added race-safe last-durable-admin protection and zero-admin startup validation. - Extracted and integration-tested the permission route matrix; API max-lines lint now passes. - Added authorization polling/focus refresh, audit UI, detailed permission errors, and demotion-safe UI state. - Removed unreachable runtime member-redaction behavior and optimized audit pruning. - Updated tests and documentation. Validation passed: unit tests, targeted API/UI tests, hosted-tunnel regressions, all CI lint/build steps, docs build/typecheck, CLI packaging, and `git diff --check`. The standalone UI typecheck still reports pre-existing unrelated type debt; the CI Vite build passes. Changes remain uncommitted as requested. PR: #1713 Comment by: @integry (ID: 5136563326) Model: gpt-5.6-sol
Checks FailedLinting or build errors were detected. View Logs |
|
✅ Applied the requested follow-up changes in commit 26217f0 Summary of ChangesImplemented the requested lint fixes:
Passing:
API lint now reaches three separate complexity warnings in unmodified API handler files. I left those untouched per the instruction to change only the files named in this request. No commit was created. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Implemented the requested lint fixes: - Reduced counted lines in [useContextRefresh.ts](/tmp/git-processor/worktrees/integry/propr/pr-1713-followup-2026-08-01T09-45-18/propr-ui/src/hooks/useContextRefresh.ts:250). - Replaced five positional parameters with a typed options object in [dockerExecutor.ts](/tmp/git-processor/worktrees/integry/propr/pr-1713-followup-2026-08-01T09-45-18/packages/core/src/claude/docker/dockerExecutor.ts:17). Passing: - UI lint/build - Core package lint/build - API build - `git diff --check` API lint now reaches three separate complexity warnings in unmodified API handler files. I left those untouched per the instruction to change only the files named in this request. No commit was created. PR: #1713 Comment by: @github-actions[bot] (ID: 5150884369) Model: gpt-5.6-sol
Checks FailedLinting or build errors were detected. View Logs |
|
✅ Applied the requested follow-up changes in commit 9a9791a Summary of ChangesImplemented the API lint follow-up in the two flagged files.
No commit was created. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Implemented the API lint follow-up in the two flagged files. - Reduced complexity in `generate`, `refine`, and `previewContext` through focused helper extraction. - Preserved existing validation, operation claims, Redis abort handling, and error responses. - API lint passes with zero warnings. - API TypeScript build passes. - `git diff --check` passes. No commit was created. PR: #1713 Comment by: @github-actions[bot] (ID: 5150914399) Model: gpt-5.6-sol
Summary
Upgrade behavior
The migration creates instance_members and instance_role_audit. Existing installations with no durable assignments remain in compatibility admin mode, matching their previous management access except that trusted runtime-package changes still require an explicit administrator. The first claim or role mutation persists the acting administrator before applying the requested change, preventing lockout.
PROPR_ADMIN_USERS remains authoritative while configured and supplies full administrator permissions as an environment-level recovery path.
Verification