permission_report misclassifies stale-runtime mutation blocks as missing permissions and recommends profile switching #897
Closed
opened 2026-07-24 21:40:26 -05:00 by jcwalker3
·
3 comments
No Branch/Tag Specified
master
fix/issue-987-native-mcp-bootstrap
feat/issue-985-project-scoped-launcher-identity
fix/issue-983-cross-repo-base-ref
feat/issue-980-stale-worker-retirement
fix/issue-975-client-identity-heartbeat
fix/issue-973-cross-repo-canonical-roots
fix/issue-970-safely-resolve-missing-worktrees
fix/issue-969-native-mcp-bootstrap
feat/issue-664-break-glass-restart
feat/issue-708-mcp-namespace-attachment
feat/issue-665-restart-audit
fix/issue-700-durable-walls
fix/issue-704-prevent-env-workspace-bindings
feat/issue-707-cross-project-boundaries
fix/issue-690-review-profile-switch-guard
fix/issue-953-bootstrap-lock-provenance
feat/issue-949-native-fleet-inventory
fix/issue-943-runtime-context-helpers
fix/issue-945-owning-pr-renewal-evidence
fix/issue-941-scope-guard-bootstrap-wiring
docs/issue-930-remote-mcp-coupling-inventory
fix/issue-892-author-bootstrap-deadlock
fix/issue-686-detect-reject-manual-mcp
fix/issue-672-mcp-config-drift
fix/issue-689-deterministic-mcp-namespace
feat/issue-666-concurrent-mcp-restart-tests
feat/issue-659-maintenance-drain-mode
feat/issue-648-notifications-console
fix/issue-670-direct-master-incident
feat/issue-644-console-recovery
feat/issue-650-providers-insights
feat/issue-669-scoped-component-recovery
docs/issue-668-mcp-ha-rolling-restart
feat/issue-667-console-restart-controls
feat/issue-645-linkage-console
feat/issue-643-request-preview-initiate
fix/issue-897-permission-stale-runtime-classification
feat/issue-641-runtime-session-view
feat/issue-663-restart-classes
feat/issue-661-drain-proof-hard-gate
fix/issue-854-semantic-container-exclusion
issue-640
fix/issue-682-starlette-httpx2
v1.1.0
Labels
Clear labels
allocator
anti-stomp
architecture
bug
chore
codex
concurrency
contamination
control-plane
dashboard
database
design
documentation
enhancement
gitea
glitchtip
important
incident
incident-bridge
integration
jenkins
labels
leases
mcp
mcp-health
mcp-menu
multi-project
mutating
nice-to-have
observability
portability
preflight
protected-branch
queue
read-only
reconnect
recovery
refactor
release
reliability
resumable-review
reviewer
roadmap
safety
security
self-hosted
sentry
stale-runtime
status:blocked
status:in-progress
status:pr-open
status:ready
terminal-lock
testing
tracker
type:bug
type:feature
type:feature
type:guardrail
visibility
workflow
workflow-hardening
workflow-hardening
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
Controller-owned work allocator
Prevent concurrent LLM session stomping
Architecture / structural design
OpenAI Codex client / workflow session surface
Concurrent session safety
Workflow or session contamination incident
MCP control-plane coordination and allocation authority
MCP operational dashboard/queue view
Internal coordination storage (SQLite/Postgres)
Design / investigation, no implementation
Docs / runbooks
New feature or improvement
Gitea MCP workflow
GlitchTip integration
Operational or process incident requiring durable audit trail
Sentry-to-Gitea incident bridging
Integration testing
Jenkins integration
Label taxonomy management
Lease adopt/release/expire lifecycle
MCP server / tooling
MCP namespace and runtime health
MCP menu surface
Work spanning multiple monitoring projects or Gitea repos
Mutating action; requires gating
Observability, metrics, traces, error reporting
Cross-platform / portability
Shared preflight gates before mutation
Protected branch / stable-branch policy concern
Work queue visibility and allocation
Read-only, no mutation
MCP client reconnect/reload recovery path
Recovery paths for stale/foreign leases
Code refactor / restructure
Release / versioning
Reliability / failure handling
Persist and resume prepared review verdicts across sessions
Reviewer workflow tooling
Roadmap / umbrella issue
Safety rails and fail-closed mutation guards
Security / trust boundary
Self-hosted infrastructure integration
Sentry error monitoring integration
Stale backend daemon / runtime-vs-master parity failures
Issue is blocked
Issue is being worked on
Issue has an open pull request
Issue is ready for work
Terminal review lock (#332) path
Tests / test coverage
Issue tracker hygiene / meta
Bug or defect
Feature or enhancement
Feature or enhancement
Safety gate or guardrail
Workflow state visibility for LLMs/operators
Cross-tool workflow
LLM workflow coordination hardening
LLM workflow coordination hardening
Something is not working
This issue or pull request already exists
New feature
Need some help
Something is wrong
More information is needed
This won't be fixed
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Scaled-Tech-Consulting/Gitea-Tools#897
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
When a mutating tool is refused because the serving process is stale relative to master, the refusal is returned to the caller as a permission denial, carrying a
permission_reportthat names a permission the active profile actually holds and instructs the agent to switch profiles. Both the diagnosis and the prescribed action are wrong, and the prescribed action is hazardous.Observed shape:
gitea_create_issueblocked while the daemon was behind live master returned apermission_reportreportingmissing_permission: gitea.issue.createand a next action of switching profile / MCP session — whilegitea_whoamion the same session provedprgs-authorallowsgitea.issue.create.Root cause (verified at master
a4c73766f4b0cc32f7c3808688eceeb6fee74335)_profile_operation_gate(gitea_mcp_server.py:14080) returns stale-runtime reasons from_master_parity_block(op)(:14095) and runtime-mode reasons from_runtime_mode_block(op)(:14098) through the same return channel as genuine profile-permission denials._profile_permission_block(:14344) treats any non-empty reason list as a permission denial and unconditionally attachespermission_report: _permission_block_report(required_operation)(:14363)._permission_block_report(:13823) never consults parity or runtime mode. It hardcodesmissing_permissionandrequired_permissionto the requested operation (:13835–:13836), then emits one of two next actions:Call gitea_activate_profile with a profile that allows ...(:13892) orSwitch to the {role} MCP session ...(:13898).The reason strings are therefore the only signal distinguishing a stale runtime from a real permission denial, and the structured field the agent is meant to trust contradicts them.
Why the prescribed action is hazardous
Acceptance criteria
permission_report, and never names a permission the active profile holds._permission_block_reportverifies the active profile actually lacks the operation before reporting it missing; if the profile holds it, the report fails closed as a diagnostic defect instead of fabricating a missing permission.gitea_activate_profileor an MCP session switch.gitea_assess_master_parity, so the caller can confirm the classification.permission_report); fresh runtime plus forbidden operation (expectpermission_report, no runtime blocker); stale runtime plus forbidden operation (both causes reported, unambiguously separated).gitea_create_issueon a stale daemon underprgs-authornever returnsmissing_permission: gitea.issue.create.Linkage
runtime_reconnect_required; it never touched the_profile_operation_gate->_permission_block_reportpath, which still misclassifies.Duplicate verdict
NOT a duplicate. Verified against all open issues at master
a4c73766f4b0cc32f7c3808688eceeb6fee74335. No open issue covers the classification of a staleness refusal as a permission denial, and #685, the only issue that touched adjacent code, is closed and scoped to the resolver.Issue claim heartbeat
[THREAD STATE LEDGER]
what is true now: PR #901 remains in open state against base
master. Live PR head is54559aebc3668f4911943dcad93a3a04a1926789; live base head is715863799f7b42521acaa7c2d3636a113bf87cf9.commits_behind=0,mergeable=true,has_conflicts=false,approval_at_current_head=false.what changed: merge result: base
master@715863799f7b42521acaa7c2d3636a113bf87cf9was brought into the PR branch by a sanctioned update-by-merge commit54559aebc3668f4911943dcad93a3a04a1926789(parents =6e6ca9433873056c7a84d2a1ef3590323ea5a636,715863799f7b42521acaa7c2d3636a113bf87cf9; no rebase, no force-push, first-parent lineage reaches the prior head). The resulting tree7c47ece670a955fa156a0ab31312250d5aa3ca16is byte-identical to a locally simulated clean merge of those two commits, so the sync carries zero conflict-resolution edits and zero out-of-scope content. Effective diff versus live base is confined togitea_mcp_server.pyandtests/test_issue_897_permission_stale_runtime_classification.py. The prior review verdict recorded at former head6e6ca943no longer applies to the current head and is treated as superseded, not reusable.what is blocked: nothing on the author side. Blocker classification: no blocker.
who/what acts next: reviewer role (
prgs-reviewer) performs a fresh independent formal review pinned to head54559aebc3668f4911943dcad93a3a04a1926789.Server-side decision state: PR #901 open;
recommended_next_action=fresh_review_required;approval_valid_for_merge=false;stale_approval=true; no reviewer lease and no merger lease active.Local verdict/state: author sync objective satisfied at head
54559aebc3668f4911943dcad93a3a04a1926789; worktreebranches/issue-897-permission-stale-runtimefast-forwarded to that exact head and clean.Next actor: prgs-reviewer (sysadmin)
Required action: acquire the reviewer PR lease for #901, review the full effective diff at head
54559aebc3668f4911943dcad93a3a04a1926789, run the focused and regression suites against the current master baseline, then record a formal verdict at that exact head.Blocker classification: no blocker
Do not do: do not reuse the former-head review verdict from
6e6ca943; do not rebase or force-push this branch; do not merge before a formal verdict exists at the exact current head.Canonical Issue State
STATE: author-sync-complete
WHO_IS_NEXT: reviewer
NEXT_ACTION: fresh independent formal review of PR 901 at head
54559aebc3NEXT_PROMPT:
WHAT_HAPPENED: The PR branch was synchronized with live base master via update-by-merge, advancing the head from
6e6ca94338to54559aebc3. Ancestry, parent set, and resulting tree were verified against a locally simulated clean merge and match exactly.commits_behindis now 0 and the PR reports mergeable with no conflicts.WHY: Branch protection required the PR branch to contain the current base after PR #898 landed on master, and the head advance invalidates any verdict recorded at the former head.
RELATED_PRS: #901
BLOCKERS: none
VALIDATION: sync assessment reports pr_head_sha=54559aebc3668f4911943dcad93a3a04a1926789, base_head_sha=715863799f7b42521acaa7c2d3636a113bf87cf9, commits_behind=0, mergeable=true, has_conflicts=false; local ancestry proof
merge-base --is-ancestor 715863799f7b 54559aebsucceeds; merge tree7c47ece670equalsmerge-tree --write-tree 6e6ca943 715863799f.LAST_UPDATED_BY: prgs-author (jcwalker3)
[THREAD STATE LEDGER]
what is true now: PR #901 remains in open state at head
54559aebc3668f4911943dcad93a3a04a1926789against base master715863799f7b42521acaa7c2d3636a113bf87cf9. Review 592 carries an APPROVE review verdict recorded via the review API at that exact head (approval_at_current_head=true,review_feedback_stale=false). Former-head review 588 is now dismissed and reported stale.commits_behind=0,mergeable=true,has_conflicts=false,checks_status=not_required.what changed: a fresh independent formal review was carried out at the post-sync head and recorded as review 592 by
sysadminunderprgs-reviewer. The former-head verdict was not reused. Evidence: the sync commit's parents are exactly6e6ca9433873056c7a84d2a1ef3590323ea5a636and715863799f7b42521acaa7c2d3636a113bf87cf9, and its tree7c47ece670a955fa156a0ab31312250d5aa3ca16is byte-identical to a locally simulated clean merge, so the branch sync contributed no content. Focused suite at this head: 23 passed, 12 subtests passed. Full suite at this head: 23 failed, 5267 passed, 6 skipped, 926 subtests passed. Master baseline at715863799ffrom a separatebranches/worktree: 23 failed, 5256 passed, 6 skipped, 914 subtests passed. The two failure sets are identical line-by-line — no new failures and none fixed — and the delta is exactly the 11 new test methods plus 12 new subtests this PR adds. Two mutation probes confirm the new tests are not vacuous: neutering_reason_is_stale_runtimeproduced 11 failures, and restoring the pre-PR short-circuit in_profile_operation_gateproduced 1. A live probe at the tool boundary reproduced all three typed refusal classes.what is blocked: nothing on the reviewer side. Blocker classification: no blocker.
who/what acts next: merger role (
prgs-merger) merges PR #901 pinned to head54559aebc3668f4911943dcad93a3a04a1926789.Server-side decision state: PR #901 open; review 592 APPROVED at
54559aebc3668f4911943dcad93a3a04a1926789;approval_valid_for_mergesatisfied at that head;has_blocking_change_requests=false; reviewer lease held by session18549-06adf7e9875eand available for sanctioned merger adoption.Local verdict/state: three non-blocking observations recorded on review 592 (O1 unconverted
gitea.pr.mergegate return ingitea_acquire_merger_pr_lease, proven unreachable while stale because the precedinggitea.pr.commentgate is typed and trips first; O2 latentreproofsubstring mismatch for namespace re-proof reasons, unreachable because nonamespaceis passed on that path; O3 the no-short-circuit accumulation lacks a direct test). None changes behaviour for the shipped paths.Next actor: prgs-merger (sysadmin)
Required action: adopt the active reviewer lease through the sanctioned merger capability, then merge PR #901 with
expected_head_sha=54559aebc3668f4911943dcad93a3a04a1926789.Blocker classification: no blocker
Do not do: do not re-review at this head; do not merge at any other head; do not create a competing lease while the reviewer lease remains adoptable.
Canonical Issue State
STATE: reviewer-approved
WHO_IS_NEXT: merger
NEXT_ACTION: merge PR 901 at head
54559aebc3NEXT_PROMPT:
WHAT_HAPPENED: A fresh independent review at the post-sync head recorded review 592 with an APPROVE verdict. The update-by-merge was audited as content-free, the full effective diff re-read, the #897 acceptance criteria re-verified against the real reason strings emitted by
master_parity_gateandstable_control_runtime, and the full-suite failure set compared against the current master baseline.WHY: The fix holds at this exact head, the sync introduced nothing of its own, no regression appeared against baseline, and the new tests demonstrably fail when the fix is neutered.
RELATED_PRS: #901
BLOCKERS: none
VALIDATION: focused pytest tests/test_issue_897_permission_stale_runtime_classification.py tests/test_permission_reports.py at
54559aeb-> 23 passed, 12 subtests; full suite at54559aeb-> 23 failed / 5267 passed; baseline at715863799f-> 23 failed / 5256 passed; failure sets identical; mutation probes MUT=1 -> 11 failed, MUT=2 -> 1 failed.LAST_UPDATED_BY: prgs-reviewer (sysadmin)
NATIVE_REVIEW_PROOF: transport=native_mcp; entrypoint=mcp_server; token_fingerprint=3f9d215f6de35cd6