fix(scope): wire author bootstrap scope into workflow scope guard #941

Closed
opened 2026-07-26 04:03:35 -05:00 by jcwalker3 · 2 comments
Owner

Follow-up defect discovered after PR #926 merged (8c1d22a658ecb5715e3f4db6eb7ebb408830c101).

Problem

PR #926 implemented the canonical task_scope=author_issue_bootstrap permission for the clean-control-checkout bootstrap and wired it into the branches-only and anti-stomp decisions.

A third enforcement path remains unwired in workflow_scope_guard.py.

The guard's clean-root author branch uses _cib.is_create_issue_task(mutation_task) instead of the canonical bootstrap_permits_control_checkout(...) decision and its validated task-scope evidence.

The actual operation uses the task name:

bootstrap_author_issue_worktree

That task is not one of the create-issue task literals. Consequently, the workflow raises workflow_scope_guard.ProductionGuardError with reason missing_issue_worktree before assess_author_issue_bootstrap can evaluate task_scope=author_issue_bootstrap.

This leaves the #892 bootstrap deadlock partially present and prevents issue #931 from receiving a sanctioned author worktree.

Reproduction evidence

Repository state at reproduction

  • master SHA: 8c1d22a658ecb5715e3f4db6eb7ebb408830c101
  • Live prgs/master, control checkout HEAD, MCP startup_head, daemon_start_head, local_head, and current_head all reported that SHA.
  • Parity: in_parity:true, stale:false, live_stale:false, restart_required:false, mutation_safe:true.
  • Control checkout clean under git status --porcelain --untracked-files=all.
  • Identity jcwalker3, profile prgs-author, role author, namespace gitea-author.

Canonical operation and task literal

  • MCP tool: gitea_bootstrap_author_issue_worktree
  • Capability task literal: bootstrap_author_issue_worktree (gitea_mcp_server.py:10157)
  • Capability resolution succeeded before each attempt: required_operation_permission=gitea.branch.create, allowed_in_current_session:true, restart_required:false, stop_required:false, no blocker_kind.

Failure form 1 — default arguments (dry run)

Arguments: issue_number=931, assignment_id, lease_id, expected_base_sha=8c1d22a658ecb5715e3f4db6eb7ebb408830c101, dry_run=true.

Workflow scope guard (#683) [missing_issue_worktree]: author source/test mutation
from the stable control checkout is forbidden; bind an issue-backed worktree
under branches/ first. exact_next_action:
exception_class: workflow_scope_guard.ProductionGuardError
reason_code: internal_error
retryable: false

Failure form 2 — explicit branch_name and worktree_path (dry run)

Arguments added: branch_name=issue-931, worktree_path=<repo>/branches/issue-931-transport-bind-seam. Preceded by its own gitea_whoami and gitea_resolve_task_capability with the identical worktree_path.

Byte-identical refusal to form 1, including the missing_issue_worktree reason and the same ProductionGuardError class. Supplying the optional path arguments does not change the outcome, because the guard raises before path binding is considered.

Reason code

missing_issue_worktree (workflow_scope_guard.py:48, BLOCKER_MISSING_WORKTREE).

Decision path in workflow_scope_guard.py

The clean-root author branch at approximately lines 333-344 reads:

if (
    not under_branches
    and workspace == root
    and not dirty_src
    and role == "author"
):
    if _cib is not None and _cib.is_create_issue_task(mutation_task):
        # #749: clean-root create_issue is the sanctioned bootstrap path.
        create_issue_bootstrap = True
    else:
        reasons.append(
            "author source/test mutation from the stable control checkout is "
            "forbidden; bind an issue-backed worktree under branches/ first"
        )
        blocker_kind = BLOCKER_MISSING_WORKTREE

The exemption test is a task-name allowlist:

# create_issue_bootstrap.py:30
CREATE_ISSUE_TASKS = frozenset({"create_issue", "gitea_create_issue"})

# create_issue_bootstrap.py:50-52
def is_create_issue_task(task: str | None) -> bool:
    """True when *task* is the create_issue mutation (or tool alias)."""
    return (task or "").strip() in CREATE_ISSUE_TASKS

bootstrap_author_issue_worktree is absent from CREATE_ISSUE_TASKS, so the author bootstrap always takes the else arm.

workflow_scope_guard.py does not consult the canonical predicate

$ grep -c 'bootstrap_permits_control_checkout' workflow_scope_guard.py
0

PR #926 modified create_issue_bootstrap.bootstrap_permits_control_checkout and author_issue_bootstrap.assess_author_issue_bootstrap, and wired the two guards named in its own description (the #274 branches-only enforcer and the #604 anti-stomp preflight). workflow_scope_guard holds an independent copy of the clean-root author decision that never routes through that predicate, so the #926 waiver is unreachable on this path.

Control-plane state released

A temporary author allocation was created to reproduce the defect and was released through the sanctioned path:

  • Assignment asn-bd6f939293414a51status: released
  • Lease lease-e44a6485417b489fstatus: released, released_at 2026-07-26T08:54:38Z, prior_status: active
  • Released via gitea_release_workflow_lease by owning session prgs-author-14609-a7c703a4; verified by re-inspection.
  • Repository-wide active lease count afterwards: 0.

No #931 repository artifacts were created

  • Control checkout HEAD unchanged at 8c1d22a658ecb5715e3f4db6eb7ebb408830c101, working tree clean.
  • No local branch matching *931*.
  • No remote branch matching refs/heads/*931* on prgs.
  • No registered worktree under branches/ for issue 931.
  • No pull request for issue 931; open-PR inventory returned inventory_complete:true with no such entry.
  • Issue #931 remains open, status:ready, unassigned.

Acceptance criteria

  • workflow_scope_guard uses the canonical bootstrap authorization decision rather than maintaining a separate task-name allowlist for this case.
  • A correctly scoped author_issue_bootstrap operation may proceed from a clean control checkout far enough to create and bind its issue-backed worktree.
  • Ordinary author source or test mutation from the control checkout remains forbidden.
  • Missing, malformed, incorrect, or mismatched task-scope evidence fails closed.
  • Incorrect issue, branch, worktree, repository, profile, role, or session bindings fail closed.
  • Existing sanctioned create-issue behavior remains unchanged.
  • The protections associated with #274, #604, #618, and #683 are not weakened.
  • Regression tests exercise the real bootstrap_author_issue_worktree call path through every applicable guard, not only the central helper in isolation.
  • Tests demonstrate that the failure occurs before the fix and passes afterward.

Non-goals

  • Do not implement #931's transport-neutral bind seam.
  • Do not add remote transport support.
  • Do not change role permissions.
  • Do not weaken the branches-only rule.
  • Do not add a manual worktree escape hatch.
  • Do not perform unrelated refactoring.

Blocking relationship

Issue #931 is blocked by this issue. #931 cannot obtain a sanctioned author worktree until this guard path is wired, and every documented substitute path is forbidden.

No sanctioned MCP capability exists for an author session to create a durable dependency edge directly: gitea_list_dependency_edges is read-only and never creates an edge, and edges are derived by the allocator from a Depends on: declaration in the body of the dependent issue. Recording this edge durably therefore requires editing the body of issue #931, which is outside the scope of this issue-creation task and was not performed. The blocking relationship is stated here explicitly instead, with no fallback mutation path used.

Origin

This defect is the residue of #892, which PR #926 closed. #892 covered the four-door bootstrap deadlock; #926 fixed two of the three enforcement paths. This issue covers the third.

Follow-up defect discovered after PR #926 merged (`8c1d22a658ecb5715e3f4db6eb7ebb408830c101`). ## Problem PR #926 implemented the canonical `task_scope=author_issue_bootstrap` permission for the clean-control-checkout bootstrap and wired it into the branches-only and anti-stomp decisions. A third enforcement path remains unwired in `workflow_scope_guard.py`. The guard's clean-root author branch uses `_cib.is_create_issue_task(mutation_task)` instead of the canonical `bootstrap_permits_control_checkout(...)` decision and its validated task-scope evidence. The actual operation uses the task name: ``` bootstrap_author_issue_worktree ``` That task is not one of the create-issue task literals. Consequently, the workflow raises `workflow_scope_guard.ProductionGuardError` with reason `missing_issue_worktree` before `assess_author_issue_bootstrap` can evaluate `task_scope=author_issue_bootstrap`. This leaves the #892 bootstrap deadlock partially present and prevents issue #931 from receiving a sanctioned author worktree. ## Reproduction evidence **Repository state at reproduction** - `master` SHA: `8c1d22a658ecb5715e3f4db6eb7ebb408830c101` - Live `prgs/master`, control checkout HEAD, MCP `startup_head`, `daemon_start_head`, `local_head`, and `current_head` all reported that SHA. - Parity: `in_parity:true`, `stale:false`, `live_stale:false`, `restart_required:false`, `mutation_safe:true`. - Control checkout clean under `git status --porcelain --untracked-files=all`. - Identity `jcwalker3`, profile `prgs-author`, role `author`, namespace `gitea-author`. **Canonical operation and task literal** - MCP tool: `gitea_bootstrap_author_issue_worktree` - Capability task literal: `bootstrap_author_issue_worktree` (`gitea_mcp_server.py:10157`) - Capability resolution succeeded before each attempt: `required_operation_permission=gitea.branch.create`, `allowed_in_current_session:true`, `restart_required:false`, `stop_required:false`, no `blocker_kind`. **Failure form 1 — default arguments (dry run)** Arguments: `issue_number=931`, `assignment_id`, `lease_id`, `expected_base_sha=8c1d22a658ecb5715e3f4db6eb7ebb408830c101`, `dry_run=true`. ``` Workflow scope guard (#683) [missing_issue_worktree]: author source/test mutation from the stable control checkout is forbidden; bind an issue-backed worktree under branches/ first. exact_next_action: exception_class: workflow_scope_guard.ProductionGuardError reason_code: internal_error retryable: false ``` **Failure form 2 — explicit `branch_name` and `worktree_path` (dry run)** Arguments added: `branch_name=issue-931`, `worktree_path=<repo>/branches/issue-931-transport-bind-seam`. Preceded by its own `gitea_whoami` and `gitea_resolve_task_capability` with the identical `worktree_path`. Byte-identical refusal to form 1, including the `missing_issue_worktree` reason and the same `ProductionGuardError` class. Supplying the optional path arguments does not change the outcome, because the guard raises before path binding is considered. **Reason code** `missing_issue_worktree` (`workflow_scope_guard.py:48`, `BLOCKER_MISSING_WORKTREE`). **Decision path in `workflow_scope_guard.py`** The clean-root author branch at approximately lines 333-344 reads: ```python if ( not under_branches and workspace == root and not dirty_src and role == "author" ): if _cib is not None and _cib.is_create_issue_task(mutation_task): # #749: clean-root create_issue is the sanctioned bootstrap path. create_issue_bootstrap = True else: reasons.append( "author source/test mutation from the stable control checkout is " "forbidden; bind an issue-backed worktree under branches/ first" ) blocker_kind = BLOCKER_MISSING_WORKTREE ``` The exemption test is a task-name allowlist: ```python # create_issue_bootstrap.py:30 CREATE_ISSUE_TASKS = frozenset({"create_issue", "gitea_create_issue"}) # create_issue_bootstrap.py:50-52 def is_create_issue_task(task: str | None) -> bool: """True when *task* is the create_issue mutation (or tool alias).""" return (task or "").strip() in CREATE_ISSUE_TASKS ``` `bootstrap_author_issue_worktree` is absent from `CREATE_ISSUE_TASKS`, so the author bootstrap always takes the `else` arm. **`workflow_scope_guard.py` does not consult the canonical predicate** ``` $ grep -c 'bootstrap_permits_control_checkout' workflow_scope_guard.py 0 ``` PR #926 modified `create_issue_bootstrap.bootstrap_permits_control_checkout` and `author_issue_bootstrap.assess_author_issue_bootstrap`, and wired the two guards named in its own description (the #274 branches-only enforcer and the #604 anti-stomp preflight). `workflow_scope_guard` holds an independent copy of the clean-root author decision that never routes through that predicate, so the #926 waiver is unreachable on this path. **Control-plane state released** A temporary author allocation was created to reproduce the defect and was released through the sanctioned path: - Assignment `asn-bd6f939293414a51` — `status: released` - Lease `lease-e44a6485417b489f` — `status: released`, `released_at 2026-07-26T08:54:38Z`, `prior_status: active` - Released via `gitea_release_workflow_lease` by owning session `prgs-author-14609-a7c703a4`; verified by re-inspection. - Repository-wide active lease count afterwards: 0. **No #931 repository artifacts were created** - Control checkout HEAD unchanged at `8c1d22a658ecb5715e3f4db6eb7ebb408830c101`, working tree clean. - No local branch matching `*931*`. - No remote branch matching `refs/heads/*931*` on `prgs`. - No registered worktree under `branches/` for issue 931. - No pull request for issue 931; open-PR inventory returned `inventory_complete:true` with no such entry. - Issue #931 remains open, `status:ready`, unassigned. ## Acceptance criteria - `workflow_scope_guard` uses the canonical bootstrap authorization decision rather than maintaining a separate task-name allowlist for this case. - A correctly scoped `author_issue_bootstrap` operation may proceed from a clean control checkout far enough to create and bind its issue-backed worktree. - Ordinary author source or test mutation from the control checkout remains forbidden. - Missing, malformed, incorrect, or mismatched task-scope evidence fails closed. - Incorrect issue, branch, worktree, repository, profile, role, or session bindings fail closed. - Existing sanctioned create-issue behavior remains unchanged. - The protections associated with #274, #604, #618, and #683 are not weakened. - Regression tests exercise the real `bootstrap_author_issue_worktree` call path through every applicable guard, not only the central helper in isolation. - Tests demonstrate that the failure occurs before the fix and passes afterward. ## Non-goals - Do not implement #931's transport-neutral bind seam. - Do not add remote transport support. - Do not change role permissions. - Do not weaken the branches-only rule. - Do not add a manual worktree escape hatch. - Do not perform unrelated refactoring. ## Blocking relationship Issue #931 is blocked by this issue. #931 cannot obtain a sanctioned author worktree until this guard path is wired, and every documented substitute path is forbidden. No sanctioned MCP capability exists for an author session to create a durable dependency edge directly: `gitea_list_dependency_edges` is read-only and never creates an edge, and edges are derived by the allocator from a `Depends on:` declaration in the body of the dependent issue. Recording this edge durably therefore requires editing the body of issue #931, which is outside the scope of this issue-creation task and was not performed. The blocking relationship is stated here explicitly instead, with no fallback mutation path used. ## Origin This defect is the residue of #892, which PR #926 closed. #892 covered the four-door bootstrap deadlock; #926 fixed two of the three enforcement paths. This issue covers the third.
jcwalker3 added the status:readyworkflow-hardeningpreflightsafetytype:bug labels 2026-07-26 04:03:35 -05:00
Author
Owner

Canonical Issue State

STATE: in-progress — author worktree created and bound under a one-time operator-authorized bootstrap exception; implementation not yet started.
WHO_IS_NEXT: author
NEXT_ACTION: Write the failing real-path regression for gitea_bootstrap_author_issue_worktree, then wire workflow_scope_guard to the canonical bootstrap_permits_control_checkout decision, validate, commit, push, and open the PR for #941.
NEXT_PROMPT:

Continue the #941 author workflow in worktree
/Users/jasonwalker/Development/Gitea-Tools/branches/issue-941-scope-guard-bootstrap-wiring
on branch fix/issue-941-scope-guard-bootstrap-wiring at base
8c1d22a658ecb5715e3f4db6eb7ebb408830c101, holding assignment
asn-15133423bf614c11 and lease lease-ecf79c663f354894. Write the failing
real-path regression through verify_preflight_purity ->
_enforce_issue_scope_guard -> workflow_scope_guard first, then implement the
narrow correction, run focused and broader suites, commit and push through
sanctioned gitea-author capabilities, and open the PR with Closes #941.

WHAT_HAPPENED: The canonical bootstrap for this issue is blocked by the defect this issue repairs. gitea_bootstrap_author_issue_worktree failed closed with Workflow scope guard (#683) [missing_issue_worktree]: author source/test mutation from the stable control checkout is forbidden; bind an issue-backed worktree under branches/ first (workflow_scope_guard.ProductionGuardError). Every other sanctioned worktree-producing route requires a worktree that does not yet exist: gitea_lock_issue refuses with the #274 "worktree path does not exist" branch, gitea_publish_unpublished_issue_branch requires worktree_path on an already registered clean worktree, gitea_recover_dirty_orphaned_issue_worktree requires source_worktree_path, and gitea_rebind_dirty_same_claimant_author_session requires worktree_path. gitea_create_issue_comment was also refused from the stable control checkout before the worktree existed, with Durable author worktree resolution blocked (#618): author mutation blocked: workspace is the stable control checkout; author mutation requires an explicit validated worktree_path or a worktree derived, which is why this record is posted immediately after worktree creation and binding rather than before it. Under a one-time operator authorization scoped to issue #941 alone, exactly one local branch and one local worktree were created with a single git worktree add -b from the verified live master SHA, then bound through gitea_lock_issue. No existing worktree was reused or modified, the stable control checkout was not edited, and no remote branch was created manually.
WHY: Issue #941 is recursively blocked by the guard path it must repair, so no sanctioned route could produce its worktree. The operator authorized a single narrowly scoped local bootstrap to break the recursion, on the condition that every subsequent Gitea mutation remains MCP-mediated.
RELATED_PRS: none yet for #941. Prior context: PR #926 (merged, closed #892) wired the canonical bootstrap decision into the #274 branches-only and #604 anti-stomp guards but not into workflow_scope_guard. PR #940 delivered #930.
BLOCKERS: none currently blocking author progress. Issue #931 remains blocked by #941 until this correction is reviewed, merged, deployed, and commissioned.
VALIDATION: Base SHA 8c1d22a658ecb5715e3f4db6eb7ebb408830c101 agreed across control checkout HEAD, live prgs/master, MCP startup_head, daemon_start_head, local_head, and current_head. Parity reported in_parity:true, stale:false, live_stale:false, restart_required:false, mutation_safe:true. Control checkout clean under git status --porcelain --untracked-files=all, and still clean and on master after the exception. Fleet: exactly five MCP servers, one per PRGS profile, all client-managed under a single client, with no duplicate profile processes and no unsupported GITEA_* worktree overrides. Mutation resolver green for comment_issue, lock_issue, and bootstrap_author_issue_worktree. Identity jcwalker3, profile prgs-author, role author, namespace gitea-author. Branch fix/issue-941-scope-guard-bootstrap-wiring and worktree /Users/jasonwalker/Development/Gitea-Tools/branches/issue-941-scope-guard-bootstrap-wiring did not exist locally or remotely beforehand; worktree head is the base SHA and the worktree was clean at creation. gitea_lock_issue returned adoption_decision: NO_MATCH, competing_branch_check: clear, and lock proof acquired issue #941; branch fix/issue-941-scope-guard-bootstrap-wiring; owner prgs-author; freshness live; no competing live lock. Claim asn-15133423bf614c11 / lease-ecf79c663f354894 under session prgs-author-14609-c5ebad14 was obtained through the canonical allocator using a read-only preview followed by an apply pinned to candidate-set fingerprint cff68d1a0929ef9c834ae91ba921244cf663a68d9c848398409fc1182cb3e367, with issue #931 explicitly excluded from the candidate set. No test or source file has been edited yet.
LAST_UPDATED_BY: author / jcwalker3 / prgs-author / session prgs-author-14609-c5ebad14

Scope and expiry of the authorization

The authorization covered only: repository Scaled-Tech-Consulting/Gitea-Tools, issue #941, one #941-specific branch, one #941-specific worktree under the canonical branches/ directory, the exact verified live master SHA, and immediate registration and binding through the sanctioned author workflow.

It did not cover reusing or borrowing any existing worktree, editing the stable control checkout, creating a worktree for #931 or another issue, direct Gitea API access, manual push, manual PR creation, credential access, weakening any guard, or treating this as a general-purpose worktree escape hatch.

The exception is now expired. It was consumed exactly once, by the single git worktree add -b recorded above. Issue #931 receives no assignment, lease, worktree, branch, commit, or PR from this session.

## Canonical Issue State STATE: in-progress — author worktree created and bound under a one-time operator-authorized bootstrap exception; implementation not yet started. WHO_IS_NEXT: author NEXT_ACTION: Write the failing real-path regression for `gitea_bootstrap_author_issue_worktree`, then wire `workflow_scope_guard` to the canonical `bootstrap_permits_control_checkout` decision, validate, commit, push, and open the PR for #941. NEXT_PROMPT: ```text Continue the #941 author workflow in worktree /Users/jasonwalker/Development/Gitea-Tools/branches/issue-941-scope-guard-bootstrap-wiring on branch fix/issue-941-scope-guard-bootstrap-wiring at base 8c1d22a658ecb5715e3f4db6eb7ebb408830c101, holding assignment asn-15133423bf614c11 and lease lease-ecf79c663f354894. Write the failing real-path regression through verify_preflight_purity -> _enforce_issue_scope_guard -> workflow_scope_guard first, then implement the narrow correction, run focused and broader suites, commit and push through sanctioned gitea-author capabilities, and open the PR with Closes #941. ``` WHAT_HAPPENED: The canonical bootstrap for this issue is blocked by the defect this issue repairs. `gitea_bootstrap_author_issue_worktree` failed closed with `Workflow scope guard (#683) [missing_issue_worktree]: author source/test mutation from the stable control checkout is forbidden; bind an issue-backed worktree under branches/ first` (`workflow_scope_guard.ProductionGuardError`). Every other sanctioned worktree-producing route requires a worktree that does not yet exist: `gitea_lock_issue` refuses with the #274 "worktree path does not exist" branch, `gitea_publish_unpublished_issue_branch` requires `worktree_path` on an already registered clean worktree, `gitea_recover_dirty_orphaned_issue_worktree` requires `source_worktree_path`, and `gitea_rebind_dirty_same_claimant_author_session` requires `worktree_path`. `gitea_create_issue_comment` was also refused from the stable control checkout before the worktree existed, with `Durable author worktree resolution blocked (#618): author mutation blocked: workspace is the stable control checkout; author mutation requires an explicit validated worktree_path or a worktree derived`, which is why this record is posted immediately after worktree creation and binding rather than before it. Under a one-time operator authorization scoped to issue #941 alone, exactly one local branch and one local worktree were created with a single `git worktree add -b` from the verified live master SHA, then bound through `gitea_lock_issue`. No existing worktree was reused or modified, the stable control checkout was not edited, and no remote branch was created manually. WHY: Issue #941 is recursively blocked by the guard path it must repair, so no sanctioned route could produce its worktree. The operator authorized a single narrowly scoped local bootstrap to break the recursion, on the condition that every subsequent Gitea mutation remains MCP-mediated. RELATED_PRS: none yet for #941. Prior context: PR #926 (merged, closed #892) wired the canonical bootstrap decision into the #274 branches-only and #604 anti-stomp guards but not into `workflow_scope_guard`. PR #940 delivered #930. BLOCKERS: none currently blocking author progress. Issue #931 remains blocked by #941 until this correction is reviewed, merged, deployed, and commissioned. VALIDATION: Base SHA `8c1d22a658ecb5715e3f4db6eb7ebb408830c101` agreed across control checkout HEAD, live `prgs/master`, MCP `startup_head`, `daemon_start_head`, `local_head`, and `current_head`. Parity reported `in_parity:true`, `stale:false`, `live_stale:false`, `restart_required:false`, `mutation_safe:true`. Control checkout clean under `git status --porcelain --untracked-files=all`, and still clean and on `master` after the exception. Fleet: exactly five MCP servers, one per PRGS profile, all client-managed under a single client, with no duplicate profile processes and no unsupported `GITEA_*` worktree overrides. Mutation resolver green for `comment_issue`, `lock_issue`, and `bootstrap_author_issue_worktree`. Identity `jcwalker3`, profile `prgs-author`, role `author`, namespace `gitea-author`. Branch `fix/issue-941-scope-guard-bootstrap-wiring` and worktree `/Users/jasonwalker/Development/Gitea-Tools/branches/issue-941-scope-guard-bootstrap-wiring` did not exist locally or remotely beforehand; worktree head is the base SHA and the worktree was clean at creation. `gitea_lock_issue` returned `adoption_decision: NO_MATCH`, `competing_branch_check: clear`, and lock proof `acquired issue #941; branch fix/issue-941-scope-guard-bootstrap-wiring; owner prgs-author; freshness live; no competing live lock`. Claim `asn-15133423bf614c11` / `lease-ecf79c663f354894` under session `prgs-author-14609-c5ebad14` was obtained through the canonical allocator using a read-only preview followed by an apply pinned to candidate-set fingerprint `cff68d1a0929ef9c834ae91ba921244cf663a68d9c848398409fc1182cb3e367`, with issue #931 explicitly excluded from the candidate set. No test or source file has been edited yet. LAST_UPDATED_BY: author / jcwalker3 / prgs-author / session prgs-author-14609-c5ebad14 ### Scope and expiry of the authorization The authorization covered only: repository `Scaled-Tech-Consulting/Gitea-Tools`, issue #941, one #941-specific branch, one #941-specific worktree under the canonical `branches/` directory, the exact verified live master SHA, and immediate registration and binding through the sanctioned author workflow. It did not cover reusing or borrowing any existing worktree, editing the stable control checkout, creating a worktree for #931 or another issue, direct Gitea API access, manual push, manual PR creation, credential access, weakening any guard, or treating this as a general-purpose worktree escape hatch. **The exception is now expired.** It was consumed exactly once, by the single `git worktree add -b` recorded above. Issue #931 receives no assignment, lease, worktree, branch, commit, or PR from this session.
jcwalker3 added status:pr-open and removed status:ready labels 2026-07-26 05:03:28 -05:00
Author
Owner

Canonical Issue State

STATE: ready-for-review — PR #942 is open against master at head a09c485fc0eba75b35986a1833dba986be6c2101, mergeable: true.
WHO_IS_NEXT: reviewer
NEXT_ACTION: Independently review PR #942 at exact head a09c485fc0eba75b35986a1833dba986be6c2101 against the #941 acceptance criteria. Do not self-review or self-merge.
NEXT_PROMPT:

Review PR #942 in Scaled-Tech-Consulting/Gitea-Tools using only the sanctioned
gitea-reviewer namespace. Pin the review to exact head
a09c485fc0eba75b35986a1833dba986be6c2101 on branch
fix/issue-941-scope-guard-bootstrap-wiring, base master at
8c1d22a658ecb5715e3f4db6eb7ebb408830c101. Call get_pr_review_feedback before
any review work to confirm reviews are empty. Verify against the #941
acceptance criteria: that workflow_scope_guard consults the canonical
bootstrap authorization decision rather than a task-name allowlist; that a
correctly scoped author_issue_bootstrap can proceed from a clean control
checkout; that ordinary author source or test mutation from the control
checkout remains forbidden; that missing, malformed, incorrect, or mismatched
scope evidence fails closed; that create_issue behaviour is unchanged; that
protections tied to #274, #604, #618, and #683 are not weakened; and that the
regression exercises the real bootstrap_author_issue_worktree call path rather
than the authorization helper in isolation.

WHAT_HAPPENED: Implemented and published the #941 correction. workflow_scope_guard.assess_root_source_mutation now accepts a server-derived bootstrap_assessment and, in the clean-root author case, consults create_issue_bootstrap.bootstrap_permits_control_checkout instead of the module-local task-name allowlist; assess_production_mutation_guards forwards it; _enforce_issue_scope_guard accepts and threads the identical assessment the #274 and #604 guards already consume, and derives the pre-ownership issue-lock waiver from that one canonical decision rather than a second task-name allowlist; verify_preflight_purity passes the already-computed assessment at both call sites. A second instance of the defect was found during implementation: after the missing_issue_worktree block cleared, the bootstrap task failed on missing_issue_scope because require_lock also keyed on is_create_issue_task. Both were corrected the same way. The worktree was created under the one-time operator authorization recorded in comment 17385; that authorization was consumed exactly once and is expired.
WHY: PR #926 closed #892 by teaching the canonical predicate to accept task_scope=author_issue_bootstrap and wiring it into the two guards its description named. A third enforcement path in workflow_scope_guard kept an independent copy of the decision keyed on a task-name allowlist that never contained bootstrap_author_issue_worktree, so the waiver was unreachable and gitea_bootstrap_author_issue_worktree raised ProductionGuardError(missing_issue_worktree) before assess_author_issue_bootstrap was consulted. That left the #892 deadlock partially present and blocked #931.
RELATED_PRS: PR #942 (open, this correction, Closes #941). PR #926 (merged, closed #892, wired only the #274 and #604 guards). PR #940 (merged, delivered #930).
BLOCKERS: none blocking review. Issue #931 stays blocked until PR #942 is independently approved, merged, deployed, and the fleet restarted and commissioned, because the running servers execute the pre-fix guard until then.
VALIDATION: New regression tests/test_issue_941_scope_guard_bootstrap_wiring.py, 24 tests, drives the real enforcer through verify_preflight_purity -> _enforce_issue_scope_guard -> workflow_scope_guard. Pre-fix on unmodified code: 5 failed, 19 passed, with ProductionGuardError: Workflow scope guard (#683) [missing_issue_worktree]. Post-fix: 24 passed in 1.92s. Focused sweep across the 941, 892, 683, 757, create-issue-bootstrap, author-issue-bootstrap, anti-stomp, root-checkout-guard, and 618 suites: 218 passed, 47 subtests passed. Full suite from the branches worktree: 28 failed, 5525 passed, 6 skipped, 994 subtests passed in 147.74s; the failure count matches the standing repository baseline of 28, and the four failures touching these guards were each re-run on unmodified master 8c1d22a658ecb5715e3f4db6eb7ebb408830c101 and fail identically there (4 failed in 2.92s, no local changes). A full-suite baseline run on unmodified master was still executing when the PR was opened; that comparison is verified only for those four failures until the run is posted. Diff is 3 files, +408 / -2, with no secret-like strings and no unrelated changes. Control checkout remained clean on master at 8c1d22a658ecb5715e3f4db6eb7ebb408830c101 throughout. Commit a09c485fc0eba75b35986a1833dba986be6c2101 was published through gitea_commit_files; PR #942 through gitea_create_pr; no manual push and no manual PR creation.
LAST_UPDATED_BY: author / jcwalker3 / prgs-author / session prgs-author-14609-c5ebad14

Reviewer handoff pin

  • PR: #942
  • Base: master at 8c1d22a658ecb5715e3f4db6eb7ebb408830c101
  • Branch: fix/issue-941-scope-guard-bootstrap-wiring
  • Exact head SHA: a09c485fc0eba75b35986a1833dba986be6c2101
  • Commits vs base: 1 (a09c485)
  • Changed files: workflow_scope_guard.py, gitea_mcp_server.py, tests/test_issue_941_scope_guard_bootstrap_wiring.py
  • Mergeable at handoff: true
  • Assignment asn-15133423bf614c11, lease lease-ecf79c663f354894, author session prgs-author-14609-c5ebad14

Any advance of the head invalidates this pin; re-pin before recording a verdict. Issue #931 received no assignment, lease, worktree, branch, commit, or PR from this session and was explicitly excluded from the allocator candidate set.

## Canonical Issue State STATE: ready-for-review — PR #942 is open against master at head `a09c485fc0eba75b35986a1833dba986be6c2101`, `mergeable: true`. WHO_IS_NEXT: reviewer NEXT_ACTION: Independently review PR #942 at exact head `a09c485fc0eba75b35986a1833dba986be6c2101` against the #941 acceptance criteria. Do not self-review or self-merge. NEXT_PROMPT: ```text Review PR #942 in Scaled-Tech-Consulting/Gitea-Tools using only the sanctioned gitea-reviewer namespace. Pin the review to exact head a09c485fc0eba75b35986a1833dba986be6c2101 on branch fix/issue-941-scope-guard-bootstrap-wiring, base master at 8c1d22a658ecb5715e3f4db6eb7ebb408830c101. Call get_pr_review_feedback before any review work to confirm reviews are empty. Verify against the #941 acceptance criteria: that workflow_scope_guard consults the canonical bootstrap authorization decision rather than a task-name allowlist; that a correctly scoped author_issue_bootstrap can proceed from a clean control checkout; that ordinary author source or test mutation from the control checkout remains forbidden; that missing, malformed, incorrect, or mismatched scope evidence fails closed; that create_issue behaviour is unchanged; that protections tied to #274, #604, #618, and #683 are not weakened; and that the regression exercises the real bootstrap_author_issue_worktree call path rather than the authorization helper in isolation. ``` WHAT_HAPPENED: Implemented and published the #941 correction. `workflow_scope_guard.assess_root_source_mutation` now accepts a server-derived `bootstrap_assessment` and, in the clean-root author case, consults `create_issue_bootstrap.bootstrap_permits_control_checkout` instead of the module-local task-name allowlist; `assess_production_mutation_guards` forwards it; `_enforce_issue_scope_guard` accepts and threads the identical assessment the #274 and #604 guards already consume, and derives the pre-ownership issue-lock waiver from that one canonical decision rather than a second task-name allowlist; `verify_preflight_purity` passes the already-computed assessment at both call sites. A second instance of the defect was found during implementation: after the `missing_issue_worktree` block cleared, the bootstrap task failed on `missing_issue_scope` because `require_lock` also keyed on `is_create_issue_task`. Both were corrected the same way. The worktree was created under the one-time operator authorization recorded in comment 17385; that authorization was consumed exactly once and is expired. WHY: PR #926 closed #892 by teaching the canonical predicate to accept `task_scope=author_issue_bootstrap` and wiring it into the two guards its description named. A third enforcement path in `workflow_scope_guard` kept an independent copy of the decision keyed on a task-name allowlist that never contained `bootstrap_author_issue_worktree`, so the waiver was unreachable and `gitea_bootstrap_author_issue_worktree` raised `ProductionGuardError(missing_issue_worktree)` before `assess_author_issue_bootstrap` was consulted. That left the #892 deadlock partially present and blocked #931. RELATED_PRS: PR #942 (open, this correction, Closes #941). PR #926 (merged, closed #892, wired only the #274 and #604 guards). PR #940 (merged, delivered #930). BLOCKERS: none blocking review. Issue #931 stays blocked until PR #942 is independently approved, merged, deployed, and the fleet restarted and commissioned, because the running servers execute the pre-fix guard until then. VALIDATION: New regression `tests/test_issue_941_scope_guard_bootstrap_wiring.py`, 24 tests, drives the real enforcer through `verify_preflight_purity` -> `_enforce_issue_scope_guard` -> `workflow_scope_guard`. Pre-fix on unmodified code: 5 failed, 19 passed, with `ProductionGuardError: Workflow scope guard (#683) [missing_issue_worktree]`. Post-fix: 24 passed in 1.92s. Focused sweep across the 941, 892, 683, 757, create-issue-bootstrap, author-issue-bootstrap, anti-stomp, root-checkout-guard, and 618 suites: 218 passed, 47 subtests passed. Full suite from the branches worktree: 28 failed, 5525 passed, 6 skipped, 994 subtests passed in 147.74s; the failure count matches the standing repository baseline of 28, and the four failures touching these guards were each re-run on unmodified master `8c1d22a658ecb5715e3f4db6eb7ebb408830c101` and fail identically there (4 failed in 2.92s, no local changes). A full-suite baseline run on unmodified master was still executing when the PR was opened; that comparison is verified only for those four failures until the run is posted. Diff is 3 files, +408 / -2, with no secret-like strings and no unrelated changes. Control checkout remained clean on master at `8c1d22a658ecb5715e3f4db6eb7ebb408830c101` throughout. Commit `a09c485fc0eba75b35986a1833dba986be6c2101` was published through `gitea_commit_files`; PR #942 through `gitea_create_pr`; no manual push and no manual PR creation. LAST_UPDATED_BY: author / jcwalker3 / prgs-author / session prgs-author-14609-c5ebad14 ### Reviewer handoff pin - PR: **#942** - Base: `master` at `8c1d22a658ecb5715e3f4db6eb7ebb408830c101` - Branch: `fix/issue-941-scope-guard-bootstrap-wiring` - Exact head SHA: **`a09c485fc0eba75b35986a1833dba986be6c2101`** - Commits vs base: 1 (`a09c485`) - Changed files: `workflow_scope_guard.py`, `gitea_mcp_server.py`, `tests/test_issue_941_scope_guard_bootstrap_wiring.py` - Mergeable at handoff: `true` - Assignment `asn-15133423bf614c11`, lease `lease-ecf79c663f354894`, author session `prgs-author-14609-c5ebad14` Any advance of the head invalidates this pin; re-pin before recording a verdict. Issue #931 received no assignment, lease, worktree, branch, commit, or PR from this session and was explicitly excluded from the allocator candidate set.
sysadmin removed the status:pr-open label 2026-07-26 06:20:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#941