Honor the create-issue bootstrap in anti-stomp preflight #757
Closed
opened 2026-07-19 01:01:46 -05:00 by jcwalker3
·
1 comment
No Branch/Tag Specified
master
feat/issue-609-prepared-review-verdict-resume
issue-723-role-poisoning
fix/issue-723-capability-role-invariants
docs/mcp-stable-control-runtime-policy
fix/issue-695-native-quarantine-v2
chore/issue-681-preserve-review-session-wip
fix/issue-673-remediate-regressions-part2
feat/issue-610-live-remote-parity
feat/issue-503-reviewer-active-worktree
feat/issue-470-preflight-contract
feat/issue-440-lock-recovery
feat/issue-440-branch-recovery
feat/issue-458-queue-fail-closed-copy
feat/issue-400-early-duplicate-work-gate
feat/issue-308-reconcile-inventory-pagination
feat/issue-308-reconcile-pagination-proof
docs/issue-261-agent-temp-artifact-cleanup
feat/issue-262-map-commit-files
fix/infra-stop-conflict-marker-false-positive
feat/issue-139-role-aware-task-routing
feat/issue-188-continuation-selection-wall
feat/issue-189-continuation-mode-proofs
feat/issue-232-refresh-wiki-proof-heads
feat/issue-210-block-workspace-edits
feat/issue-204-exact-issue-lock
docs/issue-80-label-taxonomy
docs/issue-79-safety-boundary-updates
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#757
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
The sanctioned
create_issuebootstrap shipped by #749/#750 is unreachable in production. Two independent guards assess the same workspace for the same task and reach opposite conclusions: the #274 branches-only guard consults the bootstrap and permits a clean canonical control checkout, then the #604 anti-stomp preflight — which never consults the bootstrap — rejects that same checkout aswrong_worktree.The #749 deadlock is therefore reproduced through a second gate, and #750's remedy is effectively dead code on the live path.
Verified against master
bde5c5fb20fbf6aec9cd6b802341c43078921d13.Observed behavior
A native
gitea_create_issuecall from the clean canonical control checkout — clean tree, attached tomaster, at exactlybde5c5fb20fbf6aec9cd6b802341c43078921d13, which matched liverefs/heads/masteronprgs— failed pre-API:Returned with
mutation_stage: "preflight_purity",reason_code: "internal_error",retryable: false,success: false. No Gitea mutation occurred.The error text is decisive about which guard fired. A #274 rejection is formatted as
Branches-only mutation guard (#274): ...(author_mutation_worktree.py:225-234). The message received is the #604 format (anti_stomp_preflight.format_anti_stomp_error). The #274 guard had therefore already passed — the bootstrap worked exactly as #750 intended — and the later, bootstrap-blind guard overrode it.Root cause
Guard order and the disagreement
gitea_create_issueinvokes the shared preflight atgitea_mcp_server.py:3018-3026:Inside
verify_preflight_purity(gitea_mcp_server.py:1117), the two guards run in sequence:gitea_mcp_server.py:1251—_enforce_branches_only_author_mutation(worktree_path, task=task)— the #274 guard.gitea_mcp_server.py:1258—_run_anti_stomp_preflight(..., raise_on_block=True)— the #604 guard.The #274 guard is bootstrap-aware. At
gitea_mcp_server.py:861-886it importscreate_issue_bootstrap, callsassess_create_issue_bootstrap(...)with the workspace, canonical root, branch, head SHA, porcelain status, resolved remote master SHA, and task, and returns cleanly when the assessment reportsallowed:The #604 guard is not.
create_issueis a declared member of its mutation set atanti_stomp_preflight.py:76, so the check definitely runs, andtaskis in scope there astask_name. But its worktree check atanti_stomp_preflight.py:574-604calls the underlying assessor directly, with no bootstrap consultation and no task-sensitivity at all:and on
wt["block"]appendsBLOCKER_WRONG_WORKTREE(anti_stomp_preflight.py:47).create_issue_bootstrapappears zero times inanti_stomp_preflight.py.assess_author_mutation_worktree(author_mutation_worktree.py:194-205) blocks unconditionally when the workspace equals the project root — which is precisely the control-checkout condition the bootstrap module (create_issue_bootstrap.py:30,:55) was written to permit forCREATE_ISSUE_TASKS.Why this is a wiring defect, not a policy disagreement
Both guards are correct in isolation given what they are told. The defect is that the bootstrap decision is computed in one guard and discarded, while a second guard re-derives a conflicting answer from a lower-level assessor that has no notion of the bootstrap phase. There is no single source of truth for "may this task mutate from this workspace".
Impact
branches/worktree, which the issue-first rule forbids creating before an issue number exists.Required implementation investigation
anti_stomp_preflight.py— worktree check,MUTATION_TASKS, blocker construction, and howtaskis threaded intoassess_anti_stomp_preflight.create_issue_bootstrap.py—assess_create_issue_bootstrap,CREATE_ISSUE_TASKS,is_create_issue_task.gitea_mcp_server.py—_enforce_branches_only_author_mutation,_run_anti_stomp_preflight,verify_preflight_purityordering and argument threading.author_mutation_worktree.py—assess_author_mutation_worktreeas the shared lower-level assessor.root_checkout_guard.resolve_remote_master_sha— remote base-head resolution used by the bootstrap.Preferred direction: compute the bootstrap assessment once, in a single place, and have both guards consume that same result. Do not duplicate the bootstrap logic into
anti_stomp_preflight.py, and do not relaxassess_author_mutation_worktree, which correctly serves every non-create_issue author mutation.Acceptance criteria
AC1. The anti-stomp preflight recognizes the server-derived
create_issuebootstrap decision for bothcreate_issueandgitea_create_issue.AC2. The exemption applies only to issue creation from the exact clean canonical control checkout.
AC3. The checkout must be on an allowed stable base branch, at the live remote base head, clean, attached, canonical, and runtime-current.
AC4. Dirty, detached, stale, noncanonical, non-base, or remote-divergent control checkouts remain blocked.
AC5. All non-
create_issueauthor mutations remain subject to the branches-only worktree requirement.AC6. No caller-controlled boolean can manufacture bootstrap eligibility. Eligibility is derived from inspected repository state only.
AC7. The #604 and #274 guards consume the same bootstrap assessment and cannot disagree.
AC8. An end-to-end regression invokes native
gitea_create_issuefrom a qualifying clean control checkout and proves both guards permit it.AC9. Rejection tests cover dirty, stale, detached, incorrect-task, and wrong-repository cases.
AC10. No issue or PR number is special-cased in production behavior.
Validation expectations
Linkage and ownership boundary
Canonical issue state
[THREAD STATE LEDGER] Issue #757 — author implementation landed on a branch; PR #759 opened at head
adc61255b2What is true now:
adc61255b2bde5c5fb20bde5c5fb3586 passed / 2 failed / 6 skipped / 400 subtests; identical 2 failures on pristine masterWhat changed:
adc61255b2pushed; PR #759 opened; issue moved to status:pr-openWhat is blocked:
Who/what acts next:
adc61255b2and evaluate AC1-AC10 of this issue against that SHAadc61255b2Canonical Issue State
STATE:
PR_OPEN_AWAITING_INDEPENDENT_REVIEW
WHO_IS_NEXT:
reviewer
NEXT_ACTION:
Start a fresh independent Grok reviewer session pinned to PR #759 head
adc61255b2and evaluate AC1-AC10 of this issue against that exact SHA.NEXT_PROMPT:
WHAT_HAPPENED:
The author phase implemented the shared bootstrap-assessment fix for this issue, added focused regression coverage, ran the full test suite against a pristine baseline checkout at
bde5c5fb20, pushed commitadc61255b2, and opened PR #759 against master. The root cause in the issue body was independently reverified before any edit: create_issue was already in the #604 mutation set, its worktree check called assess_author_mutation_worktree directly, and create_issue_bootstrap appeared zero times in anti_stomp_preflight.py.WHY:
The create_issue bootstrap from #749/#750 was unreachable: the #274 guard consulted the bootstrap and permitted the clean canonical control checkout, then the bootstrap-blind #604 anti-stomp preflight refused the identical checkout as wrong_worktree. The bootstrap decision is now computed once and interpreted by one shared predicate, so the two guards cannot reach opposite conclusions on identical evidence.
RELATED_PRS:
PR #759 (this issue's fix, open, head
adc61255b2). Historical context only, not reopened and not modified by this task: #750 (the remedy that landed for #749), #749 (closed, original deadlock), #604 (closed, parent anti-stomp feature), #274 (branches-only guard). Adjacent open work not touched: #713, #618, #711.BLOCKERS:
No blocker. The author phase is complete and requires no unblock condition.
VALIDATION:
Focused #757 suite 38 passed / 26 subtests. Affected guard and preflight suites 236 passed / 42 subtests (create-issue bootstrap, create-issue workspace guard, anti-stomp, author-mutation-worktree, root-checkout, remote-repo, stale-runtime, workflow-scope, preflight-read-survival, namespace-binding, #751 checks assessor). Full suite on this branch 3624 passed / 2 failed / 6 skipped / 426 subtests. Baseline at
bde5c5fb20on a fresh clean detached worktree 3586 passed / 2 failed / 6 skipped / 400 subtests; both failures reproduce identically on pristine master and are not caused by this change (test_issue_702_review_findings_f1_f6 F1 worktree recovery; test_reconciler_supersession_close org/repo forwarding). Baseline worktree removed afterward. git diff --check clean. py_compile passes on all five changed sources. All 38 new tests fail against the unfixed sources, and the end-to-end case reproduces the production error text verbatim.LAST_UPDATED_BY:
author (jcwalker3 / prgs-author)
Author execution record
bde5c5fb20on the author, merger, and reconciler namespaces (in_parity, restart_required false). Local master matched live prgs/master exactly. The reviewer namespace parity probe was declined by a client-side permission prompt; it is not required for an author task and no reviewer capability was used.bde5c5fb20.NATIVE_REVIEW_PROOF: none — this is an author handoff; no review verdict was recorded by this session and the prgs-author profile forbids gitea.pr.approve, gitea.pr.request_changes, and gitea.pr.merge.