Dirty same-claimant rebind cannot continue its owning open PR because no sanctioned path mints continuation evidence (#864 AC5 unmet) #947
Open
opened 2026-07-27 02:38:19 -05:00 by jcwalker3
·
0 comments
No Branch/Tag Specified
master
feat/issue-664-break-glass-restart
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
feat/issue-708-mcp-namespace-attachment
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
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
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Scaled-Tech-Consulting/Gitea-Tools#947
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.
Summary
gitea_rebind_dirty_same_claimant_author_session(#864) succeeds on a dirty registered worktree whose owning PR is already open, and then the very next ordinary author commit preflight refuses the commit withduplicate_commit_prevented.The rebind is the only sanctioned capability that operates on a dirty worktree, and it is the only one that does not write owning-PR continuation evidence in a form any enforcement path reads. The two capabilities that do write that evidence — exact-owner lock renewal and dead-session recovery — both require a clean worktree, which a rebind subject by definition does not have.
The result is a closed set with no exit: the state that makes a rebind necessary is exactly the state in which no sanctioned path can mint the evidence the next preflight demands. #864 AC5 is therefore unmet at the system level even though the rebind operation itself behaves to spec.
Supported owning-PR continuation workflow
Continuing an already-open owning PR through the sanctioned author path requires the duplicate-work gate to receive an owning-PR exemption token. There are exactly two writers of the durable evidence that token is rebuilt from:
gitea_lock_issueon a lock the caller already owns.issue_lock_renewalrefuses unless the registered worktree exists, is on the branch, and is clean (issue_lock_renewal.py:311-322, "AC4"). On successgitea_mcp_server.py:4344persistsdata["lease_renewal"].issue_lock_recoveryrefuses unless the worktree is clean (issue_lock_recovery.py:467-473: "worktree has tracked local edits; recovery requires a clean worktree"). On successgitea_mcp_server.py:4336persistsdata["dead_session_recovery"].Every later author mutation re-derives the exemption from the durable lock, because the live assessment ended when the lock call returned. On
masterataab54d4825270f5a5c6f9c1abc1ab09eb4f3e218that rebuild isissue_lock_recovery.recovered_owning_pr_from_lock, wired at three sites:gitea_mcp_server.py:2859_enforce_locked_issue_duplicate_recheck->gitea_commit_files,gitea_create_prgitea_mcp_server.py:5143gitea_assess_work_issue_duplicate(read-only assessor)gitea_mcp_server.py:19427That rebuild reads exactly one key (
issue_lock_recovery.py:848):Chronological reproduction
gitea_rebind_dirty_same_claimant_author_session. It succeeds: every dirty byte and fingerprint is preserved, the stale session pointer is atomically replaced, heads are unmoved, and structured read-after-write evidence is returned.First divergence
Step 6 succeeds and step 7 fails. That is the defect boundary: a successful sanctioned rebind immediately followed by a failed normal author commit preflight, with no intervening state change, no head movement, and no foreign actor.
The refusal shape is:
owning_pr_recovery_notes: []is the diagnostic signature — the gate did not evaluate and reject continuation evidence, it never found any evidence to evaluate.Violated #864 AC5 contract
Closed issue #864, acceptance criterion 5, verbatim:
The second clause holds. The first clause does not hold whenever the rebound issue has an owning open PR. #864 was accepted on the strength of the rebind operation's own read-after-write evidence; the AC5 clause about the next preflight was never exercised against an owning open PR, so the gap shipped.
Authoritative evidence
Observed on the live control plane at
masteraab54d4825270f5a5c6f9c1abc1ab09eb4f3e218:Scaled-Tech-Consulting/Gitea-Toolson remoteprgsf49e781102b9f363834c28c055f69639d16290c9masterataab54d4825270f5a5c6f9c1abc1ab09eb4f3e218fix/issue-943-runtime-context-helpersbranches/issue-943-runtime-context-helpersjcwalker3prgs-authorduplicate_commit_prevented,owning_pr_recovery_exempted: falseEvery ownership, branch, head, identity, profile, repository, and session binding matched. The refusal was not caused by any mismatch.
Clean-worktree-only continuation-evidence writers
Both writers gate on cleanliness before producing evidence, using the shared
reviewer_worktree.parse_dirty_tracked_fileshelper:issue_lock_renewal.py:311-322— renewal AC4, refuses on any dirty tracked file.issue_lock_recovery.py:444-479— recovery, refuses on any dirty tracked file, and its module docstring atissue_lock_recovery.py:28states outright that "recovery needs a clean worktree".Neither restriction is wrong. Both exist so that evidence cannot be minted over unknown local bytes. The consequence, however, is that the dirty case has no writer at all.
The unconsumed
rebind_recordboundaryThe rebind does persist a durable artifact.
dirty_same_claimant_session_rebind.py:1392writes:and
dirty_same_claimant_session_rebind.py:1508echoes it back in the returned evidence.A repository-wide search for
rebind_recordoutside the branches root returns exactly three hits: the writer, the echo, and one assertion intests/test_dirty_same_claimant_session_rebind.py:261. No enforcement path consumes it. It is written, returned to the caller, and then read by nothing.So the missing element is not a decision — the rebind already established, verified, and durably recorded that this claimant owns this issue, branch, worktree, and heads. The missing element is the bridge:
rebind_recordis not in a shape, or in a key, that the shared duplicate-gate rebuild will read.Implementation and test locations
Implementation:
dirty_same_claimant_session_rebind.py— rebind assessment and apply;:1392writer,:1508echo.gitea_mcp_server.py:4876—gitea_rebind_dirty_same_claimant_author_sessiontool entry.gitea_mcp_server.py:2821—_enforce_locked_issue_duplicate_recheck, called from:5344and:9860.gitea_mcp_server.py:2859,:5143,:19427— the three exemption-rebuild call sites.issue_lock_recovery.py:829-848—recovered_owning_pr_from_lock, the recovery-only rebuild.issue_lock_renewal.py:311-322,:383— renewal cleanliness gate and grant-time evidence builder.issue_work_duplicate_gate.py:16,:296—duplicate_commit_preventedoutcome and the live-PR-state exemption policy.task_capability_map.py:53,issue_lock_provenance.py:20— #864 capability and provenance registration.Tests:
tests/test_dirty_same_claimant_session_rebind.py— the only #864 rebind suite. A search acrosstests/shows no rebind test referencesduplicate_commit_prevented,_enforce_locked_issue_duplicate_recheck, orcommit_files. Post-rebind commit preflight with an owning open PR is uncovered.tests/test_issue_755_owning_pr_recovery.py,tests/test_issue_772_unpublished_claim_recovery.py— owning-PR evidence coverage, clean-worktree paths only.Correctly fail-closed duplicate protection compared with the missing evidence bridge
The duplicate gate is not malfunctioning and must not be loosened. Given no continuation evidence, refusing the commit is the correct, safe answer — an open PR alone must never grant an exemption, and
issue_work_duplicate_gate._assess_owning_pr_exemptionmust remain the sole authority on what makes a token acceptable.The defect is one layer earlier. A sanctioned capability verified ownership to a higher standard than either clean-worktree writer applies — including dirty-path fingerprint pinning and dead-PID proof — and then failed to express that verification in the one form the next gate can read. The fix is to mint narrowly scoped evidence at rebind time, not to teach the gate to accept less.
Model-agnostic impact
The defect is entirely server-side, in the durable lock record and the shared enforcement rebuild. It does not depend on prompt wording, client identity, model family, or session transcript. Any conforming client — any LLM, any IDE, any scripted caller — that performs a sanctioned dirty same-claimant rebind on an issue with an owning open PR and then attempts the next ordinary author commit will be refused identically. No prompt-level instruction can produce evidence the server never wrote.
Operational consequence: a dirty worktree holding completed, reviewed repair work becomes undeliverable through the sanctioned path. Committing is refused by the duplicate gate, while other author mutations are refused by dirty-workspace binding enforcement. Clearing the dirty state to escape would destroy, relocate, or bypass the very work the rebind existed to preserve.
Scope
Non-goals
gitea_lock_issueorbind_session_lock.issue_work_duplicate_gate._assess_owning_pr_exemptionaccepts as a valid token.Safety invariants
Acceptance criteria
Prior work consulted
Canonical next step