feat(mcp): publish an unpublished local commit on a registered issue worktree (Closes #812) #814
Merged
sysadmin
merged 1 commits from 2026-07-22 16:40:55 -05:00
feat/issue-812-publish-unpublished-commit into master
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#814
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.
Closes #812
Implements AC20 only. Head:
99fda93bccbedfe90e4c058200a65241d15f4da8.The defect this closes
Entry point B of #812: an author's work has already advanced to a local commit. The worktree is registered, clean, on its issue branch, and carries the only copy of the implementation — but the branch has never been published. Two individually correct predicates then close a cycle:
issue_lock_renewal.assess_exact_owner_lease_renewal(lines 328-332) refuses to renew an expired lease without an observable remote head. An unpublished branch has none.gitea_commit_files,gitea_create_pr— is lock-derived under #618. Nothing can create that remote head without first holding the lock that renewal would grant.assess_expired_lock_reclaimcannot break the tie either: it requires a dead owner pid or a missing worktree, and in the live case the recorded pid belongs to the long-running MCP daemon while the worktree is present.What this adds
One tool,
gitea_publish_unpublished_issue_branch, plus the pure modulebranch_publish.pyholding its assessor, executor, and read-after-write verifier. It publishes an already-committed local head to its remote branch, so exact-owner renewal has the evidence its model requires. Publication is the whole of its authority — it renews, reclaims, rebinds, and clears nothing.Why this is not a lock bypass
The operation can publish only a branch whose durable issue-lock record already names the caller as claimant. Ownership is read from the lock file on disk, never asserted by the caller, so the tool cannot manufacture a claim it does not already hold. With no lock record it refuses outright.
Guard strictness does not regress (AC15). Each of these fails closed, and each has its own test:
git worktree listinventory (#713)is_stable_refexpected_headvs observed HEADmerge-base --is-ancestorThe refspec names the commit SHA explicitly and never forces, so git itself rejects a non-fast-forward as a final independent guard. An open PR on this branch is this work's own PR and is correctly not treated as a rival claim.
Record separation (AC23)
The durable issue-lock file and the control-plane workflow lease are distinct records. This reads the former as ownership evidence and writes neither. A regression asserts the lock file is byte-for-byte unchanged across a successful publication and that
lock_generationis not advanced. Both success and refusal payloads reportissue_lock_record_mutated: falseandworkflow_lease_touched: false.Truthful process evidence (AC24)
The recorded owner pid's liveness is never consulted or asserted. That pid routinely belongs to the MCP daemon rather than an active author client, which is why the reclaim predicate can never be satisfied while that daemon runs. Publication does not require a dead process, so it never claims one —
owner_pid_liveness_consultedis reported asfalse. A regression pins the recorded pid to a live process, proves publication still succeeds, and provesassess_expired_lock_reclaimstill refuses for that very pid. The routed-around predicate is not softened.Scope
AC20 only. AC21 cannot unblock on its own — reclaim needs a dead pid, and renewal still needs the published head that AC20 creates — so the two are separable and only the smaller one is implemented. AC1-AC19 and AC22-AC24 beyond what is stated above stay open under #812's entry point A.
Tests
36 new cases in
tests/test_issue_812_publish_unpublished_commit.py, against synthetic fixtures only: a real git repository with a real local bare remote, so publication and read-after-write verification are genuinely executed rather than mocked. Coverage includes successful publication, idempotent retry reportingalready_published, dry-run reporting intent without publishing, dry-run and apply agreeing on a refusal, honest fast-forward, renewal refused before publication then sanctioned after it, and every refusal in the table above.AC17 is honoured. No test, fixture, or implementation step reads or references the protected
#635worktree; a regression asserts that absence in both new files. That worktree was verified read-only during this work and remains at its unpublished local commit with all seven content hashes matching its durable record.Full suite: 11 failed, 4354 passed, 6 skipped, 533 subtests passed. The 11 failures are the documented pre-existing drift baseline at
9eb0f29intest_commit_payloads.py,test_issue_702_review_findings_f1_f6.py,test_mcp_server.py,test_post_merge_moot_lease.py, andtest_reconciler_supersession_close.py— unchanged in count and identity. Baseline captured on this branch before any edit.Reviewer notes
task_capability_map.publish_unpublished_branchreuses the existinggitea.branch.pushpermission deliberately: a new operation name would silently strip the capability from every already-configured author profile.tests/test_task_capability_role_invariants.pygains one entry. That constant is a deliberate tripwire requiring a conscious update whenever a role-exclusive task is added; this is that update.docs/mcp-tool-inventory.mdwas regenerated with the documented generator command, not hand-edited.mirror_refs.shagainst a throwaway cache clone, or merely judges a caller-asserted push string.repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #814
issue: #812
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 18189-bad3e1a23746
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-814-99fda93
phase: claimed
candidate_head:
99fda93bcctarget_branch: master
target_branch_sha:
9eb0f29ceflast_activity: 2026-07-22T21:27:43Z
expires_at: 2026-07-22T21:37:43Z
blocker: none
Independent review — PR #814 (AC20 only)
Reviewer: sysadmin / prgs-reviewer (author is jcwalker3)
Pinned head:
99fda93bccbedfe90e4c058200a65241d15f4da8Base: master @
9eb0f29cefa85fd0ecbbb5f923ebc748bffa81f8Slice: AC20 only — publish clean, locally committed, unpublished issue branch
Verdict: APPROVE
Independent assessment of head
99fda93confirms the PR safely implements the smallest separable AC20 publication route without claiming AC21 or entry-point A.Decisive evidence
gitea_publish_unpublished_issue_branch+ purebranch_publish.pyassessor/executor/verifier{sha}:refs/heads/{branch}gitea.branch.push+ ROLE_EXCLUSIVE_TASKS); reviewer/merger/reconciler cannot publishIndependent tests (review worktree)
Protected asset
#635 worktree untouched at
b2f6e9a, cleanCanonical PR State
STATE: approved_at_current_head
WHO_IS_NEXT: merger
NEXT_ACTION: Eligible merger merges PR #814 only if live head remains
99fda93bccand all merge gates pass; then restart daemon for runtime AC20 availability before #635 recoveryNEXT_PROMPT:
WHAT_HAPPENED: Independent reviewer (sysadmin/prgs-reviewer) validated PR #814 AC20 implementation at pinned head, ran focused and baseline-file tests, and submitted APPROVE via native MCP
WHY: AC20 gates are correctly fail-closed; publication is not a lock bypass; tests cover success, refusals, lock immutability, and RAW verification; AC21 not falsely claimed
ISSUE: #812
HEAD_SHA:
99fda93bccREVIEW_STATUS: approved / approval_at_current_head
MERGE_READY: true
BLOCKERS: none for this review; post-merge daemon restart still required before live #635 publication
VALIDATION: pytest tests/test_issue_812_publish_unpublished_commit.py tests/test_task_capability_role_invariants.py -> 47 passed; baseline five files -> 11 failed (pre-existing identities), 254 passed; head pin reconfirmed before submit
NATIVE_REVIEW_PROOF: transport=native_mcp; entrypoint=mcp_server; token_fingerprint=34b998c0bf85070e
LAST_UPDATED_BY: sysadmin (prgs-reviewer)
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #814
issue: #812
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 32120-10bd20512910
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-814-99fda93
phase: claimed
candidate_head:
99fda93bcctarget_branch: master
target_branch_sha:
9eb0f29ceflast_activity: 2026-07-22T21:40:31Z
expires_at: 2026-07-22T21:50:31Z
blocker: none
Stale #332 review-decision lock cleanup (#594)
Status: APPLIED
sysadminprgs-merger2026-07-22T21:40:56.927664+00:00approveon PR feat(mcp): publish an unpublished local commit on a registered issue worktree (Closes #812) (#814)closed(merged=True)910b6edbdcf0dec64cdf139b1a1dbac4bd38c1ef1prgs-reviewerManual deletion of session-state files is not the workflow.
This path only clears a lock when the referenced PR is merged/closed.