feat: expose explicit adoption proof in gitea_lock_issue response (Closes #477) #481
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
No labels
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#481
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
Closes #477.
When
gitea_lock_issueadopts an existing own branch, the live tool response now carries explicit, citable adoption-proof fields. #473-style recovery sessions can quote the lock output directly instead of inferring adoption from separate offlineassess_own_branch_adoptionchecks.Changes
issue_lock_adoption.pyDECISION_LABELS+decision_label()/safe_next_action()helpers aligned with theADOPT/BLOCK_COMPETING/NO_MATCHoutcomes.build_adoption_proof()extended with explicit fields for every outcome:adoption_decision,adopted,adopted_branch,adopted_branch_head,matcher_summary(boundary-safe reason the branch qualified),competing_branch_check,safe_next_action. Existing keys preserved (backward compatible).build_non_adoption_lock_proof()— adoption-freeNO_MATCHmetadata (adopted: false).gitea_mcp_server.py— normal (non-adopt) lock responses now attach anadoption_checkblock so they stay clear and cannot be misread as claiming adoption.docs/llm-workflow-runbooks.md— documents theadoption/adoption_checkresponse blocks and instructs recovery reports to cite them directly.ADOPT/BLOCK_COMPETING/NO_MATCH, substring-collision boundary safety (issue-42vsissue-420), non-adoption proof, and MCP-level live-response assertions.Acceptance criteria
gitea_lock_issueresponse includes explicit adoption proof when adopting an existing branch.adoption_check,adopted: false); no implied adoption.NO_MATCH, andissue-42vsissue-420substring collision.BLOCK_COMPETINGstill fails closed (raise); no raw API fallback, branch deletion, force-push, or manual lock seeding.Verification
Worktree
branches/issue-477-adoption-proof@3496fc3(remote head)repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #481
issue: #477
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 84043-3a9daa4ad301
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr481-issue-477-lock-adoption-proof
phase: claimed
candidate_head:
3496fc3952target_branch: master
target_branch_sha:
7af73e1539last_activity: 2026-07-08T06:41:55Z
expires_at: 2026-07-08T08:41:55Z
blocker: none
Requesting changes on one acceptance-criteria gap.
gitea_lock_issuestill raises immediately whenassess_own_branch_adoption()returnsBLOCK_COMPETING, before any structured proof block is returned (gitea_mcp_server.pylines 1357-1362). The newbuild_adoption_proof()can representBLOCK_COMPETINGwithadoption_decision,competing_branch_check, andsafe_next_action, but that path is only exercised at the helper level; the live tool response for the blocked competing-branch case remains an exception string.Issue #477 AC3 asks for competing-branch block proof when adoption is blocked, and the PR body marks that as covered. Please wire the blocked live path to return/report the structured
BLOCK_COMPETINGproof, or adjust the issue/PR acceptance language if the intended contract is exception-only for blocked adoption.Validation run from
/Users/jasonwalker/Development/Gitea-Tools/branches/review-pr481-issue-477-lock-adoption-proofat3496fc3952c2e68d6a3455d9b94353c5e8ab3933:/Users/jasonwalker/Development/Gitea-Tools/venv/bin/python -m py_compile issue_lock_adoption.py gitea_mcp_server.py tests/test_issue_lock_adoption.py tests/test_mcp_server.pypassed/Users/jasonwalker/Development/Gitea-Tools/venv/bin/python -m pytest tests/test_issue_lock_adoption.py tests/test_mcp_server.py::TestIssueLocking -qpassed: 34 passedgit diff --checkpassedNote: the PR-documented
venv/bin/python ...commands failed in the detached review worktree because that worktree has no localvenv/; I reran the same commands with the control checkout's virtualenv Python while keeping the review cwd pinned to the PR head.APPROVED: PR #481 implements explicit, citable adoption-proof blocks in gitea_lock_issue responses for lock recovery. Integration and tests are verified 100% green.