fix(mcp): include untracked files in preflight porcelain parsing (Closes #700, Closes #697) #921

Open
jcwalker3 wants to merge 2 commits from fix/issue-700-durable-walls into master
Owner

Closes #700
Closes #697

Acceptance Criteria Satisfied

  • Fixes Issue #697 (canonical order item 2 for Issue #700 durable walls).
  • Removed line.startswith("??") exclusion in _parse_porcelain_entries in gitea_mcp_server.py so untracked files are included in porcelain parsing.
  • Ensures native preflight fails closed when untracked files are present.
  • Added unit tests in tests/test_issue_697_untracked_preflight.py.
Closes #700 Closes #697 ## Acceptance Criteria Satisfied - Fixes Issue #697 (canonical order item 2 for Issue #700 durable walls). - Removed `line.startswith("??")` exclusion in `_parse_porcelain_entries` in `gitea_mcp_server.py` so untracked files are included in porcelain parsing. - Ensures native preflight fails closed when untracked files are present. - Added unit tests in `tests/test_issue_697_untracked_preflight.py`.
jcwalker3 added 1 commit 2026-07-25 18:12:43 -05:00
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #921
issue: #697
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 18879-0b5d9cf95cf5
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr921-00e5265-s2
phase: claimed
candidate_head: 00e526512a
target_branch: master
target_branch_sha: c30b381eb2
last_activity: 2026-07-27T15:03:42Z
expires_at: 2026-07-27T15:13:42Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #921 issue: #697 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 18879-0b5d9cf95cf5 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr921-00e5265-s2 phase: claimed candidate_head: 00e526512a25b92d2a6caf8724b882f1af386ab4 target_branch: master target_branch_sha: c30b381eb2756c4ba9cbb2bf7c3f2d6f31b701e7 last_activity: 2026-07-27T15:03:42Z expires_at: 2026-07-27T15:13:42Z blocker: none
sysadmin requested changes 2026-07-27 10:05:33 -05:00
sysadmin left a comment
Owner

REQUEST_CHANGES — PR #921 at head 00e526512a25b92d2a6caf8724b882f1af386ab4

Independent review by sysadmin / prgs-reviewer; author jcwalker3, so independence holds. Validated in a fresh session-owned worktree branches/review-pr921-00e5265-s2, detached at exactly this head, clean before and after. Merge base 2b4e43042a34f4e29617378ae79a7f5a3d312688; target master re-fetched at c30b381eb2756c4ba9cbb2bf7c3f2d6f31b701e7, and the head is not an ancestor of it, so the already-landed gate does not fire.

The change itself is correct and minimal: removing line.startswith("??") from _parse_porcelain_entries does make that parser report untracked files, and the two new tests pass. The problem is not what the patch does — it is how much of #697 the patch is claimed to cover, and what it leaves untouched.

B1 — BLOCKER: the codebase holds four answers to "is this checkout dirty", and this changes the one wired to reporting while both wired to enforcement keep the old answer

_parse_porcelain_entries is not the dirty-state authority. Enumerated at this head:

site after this PR wired to
gitea_mcp_server._parse_porcelain_entries includes ?? gitea_get_runtime_context reporting, delta walls
reviewer_worktree.parse_dirty_tracked_files:54-56 still excludes ?? root_checkout_guard.py:82 — the enforced guard
gitea_mcp_server.py:19658-19661 inline copy still excludes ?? gitea_update_pr_branch_by_merge gate
dirty_same_claimant_session_rebind.py:143 still excludes ?? rebind path

Reproduced by direct invocation at this head, not inferred:

UNTRACKED-ONLY  guard proven=True  dirty_files=[]
                #921 reporting parser sees: ['tests/test_leaked_task_file.py']
TRACKED EDIT    guard proven=False dirty_files=['gitea_mcp_server.py']
                #921 reporting parser sees: ['gitea_mcp_server.py']

So after this change the runtime context reports the untracked file while assess_root_checkout_guard — the gate that actually refuses the mutation — still returns proven=True, dirty_files=[]. That is the #913 control-checkout untracked blind spot, and it is unchanged by this fix. Issue #697 is about dirty-state parity; a fix that moves one of four definitions increases the divergence it was filed to remove.

reviewer_worktree.parse_dirty_tracked_files also still carries the docstring justifying the old behavior ("Untracked entries (??) are ignored — they do not block reviewer work"), so the two definitions now actively disagree in prose as well as in code.

B2 — BLOCKER: the porcelain is captured at git's default -u normal, so an untracked directory collapses and the delta walls stay blind

_get_workspace_porcelain runs ["git", "status", "--porcelain"] (gitea_mcp_server.py:566-571) with no --untracked-files=all. Verified against real git in a throwaway repo:

porcelain default, 1 file under new dir : ?? newdir/
porcelain default, 2 files under same dir: ?? newdir/     <-- byte-identical
porcelain -uall                          : ?? newdir/sub/one.py
                                           ?? newdir/sub/two.py

_new_tracked_changes_since compares parsed porcelain snapshots, so a byte-identical capture yields an empty delta. Confirmed by driving the real function:

write under EXISTING untracked dir -> delta: []
brand-new untracked file at root   -> delta: ['leaked.py']
tracked edit                       -> delta: ['gitea_mcp_server.py']

All three delta walls consume that function — whoami (:878), capability (:899), and reviewer/merger (:1526). So writing any number of files beneath an already-untracked directory passes every one of them. The PR closes #697 on the strength of the ?? filter, but the capture mode silently caps how much the filter can ever see. Without -uall, B1's fix is partial even for the reporting path it does change.

B3 — BLOCKER: Closes #700 retires a security-incident umbrella on the strength of one sub-item

The PR body reads Closes #700 / Closes #697. Issue #700 is incident: contaminated controller run (PR #696/#695) — credential exposed via shell args/curl…, an open incident carrying six required durable walls (secret-redaction, credential-incident escalation, evidence-handling, native-provenance, process-termination guardrail, report-honesty) and a four-item canonical order. This PR delivers order item 2 (#697) only — and per B1/B2, partially.

Gitea closes on PR-body keywords, so landing this retires the incident issue with five of six walls unbuilt. The commit message on this very head already gets it right — fix(mcp): include untracked files in preflight porcelain parsing (Closes #697, Ref #700). The body should match the commit: Ref #700, not Closes #700.

B4 — BLOCKER: the guard message now misattributes untracked files as "modifying tracked workspace files"

gitea_mcp_server.py:1528-1532 raises:

{role} role violation: profile is forbidden from modifying tracked workspace files (fail closed). Offending files: ...

reviewer_delta is now fed by the ??-inclusive parser, so this fires on untracked files while still asserting "tracked". In a shared control checkout that means a reviewer session that wrote nothing gets told it modified tracked files because some other session left an untracked artifact — and a reviewer may not clean a shared checkout, so the message names no action the recipient can take. Either the wording drops "tracked", or the wall distinguishes the two cases.

Validation

worktree : branches/review-pr921-00e5265-s2 (detached at 00e52651, clean before and after)
baseline : branches/baseline-pr921-2b4e430-s2 (detached at 2b4e4304, merge base)

head : venv/bin/python -m pytest tests/test_issue_697_untracked_preflight.py -q
       -> 2 passed

head : venv/bin/python -m pytest tests/ -q -k "preflight or porcelain or dirty or root_checkout or worktree or untracked"
       -> 10 failed, 533 passed, 4974 deselected, 59 subtests
base : same command, in the baseline worktree
       -> 10 failed, 531 passed, 4974 deselected, 59 subtests

failing test id sets: comm -23 and comm -13 both empty -> IDENTICAL

Official PR-head validation status: baseline-equivalent failure accepted. The ten failures reproduce at the merge base with a byte-identical set of failing test ids, so none originates here; the +2 passes are exactly this PR's two new tests. No regression is introduced.

Validation failure history: an earlier attempt at the head-vs-base id comparison was run entirely inside the head worktree, because the second pytest invocation in that command never changed directory — it compared head against head and was therefore meaningless. It was discarded and the baseline run was re-executed in branches/baseline-pr921-2b4e430-s2 with pwd and git rev-parse HEAD proof. Only the corrected run is reported above.

Canonical PR State

STATE: PR #921 is open at head 00e526512a and now carries a formal REQUEST_CHANGES verdict from sysadmin recorded at that exact head. Four blocking findings are open. The two-line production change is correct in isolation and introduces no test regression against merge base 2b4e43042a.

WHO_IS_NEXT: author

NEXT_ACTION: Author jcwalker3 must bring the enforced dirty-state definitions into parity with the reporting one, capture porcelain with untracked-files=all, correct the PR body to Ref #700, fix the misattributing guard message, add a regression test per blocker, push, and publish a new head-pinned handoff for a fresh independent review.

NEXT_PROMPT:

Address the REQUEST_CHANGES review on PR #921 (Closes #697, Ref #700) in
Scaled-Tech-Consulting/Gitea-Tools on remote prgs.

Invoke the canonical gitea-workflow skill first. Use the gitea-author namespace,
profile prgs-author, identity jcwalker3. Reviewed head was
00e526512a25b92d2a6caf8724b882f1af386ab4; merge base 2b4e43042a34f4e29617378ae79a7f5a3d312688.

B1 (blocker) — the repository holds four answers to "is this checkout dirty" and
this PR changes only the reporting one. reviewer_worktree.parse_dirty_tracked_files
lines 54-56 still skips "??" and feeds root_checkout_guard.py:82, the enforced
guard; the inline copy at gitea_mcp_server.py:19658-19661 still skips it and feeds
the update_pr_branch_by_merge gate; dirty_same_claimant_session_rebind.py:143 also
still skips it. Proven at this head: assess_root_checkout_guard with porcelain
"?? tests/test_leaked_task_file.py" returns proven=True, dirty_files=[], while the
patched _parse_porcelain_entries reports the same file. Bring the enforced
definitions into parity, or centralize on one shared parser, and update the
parse_dirty_tracked_files docstring that still justifies the old behavior.

B2 (blocker) — _get_workspace_porcelain at gitea_mcp_server.py:566-571 runs
git status --porcelain at git's default -u normal, so an untracked directory
collapses to a single "?? dir/" line. Verified against real git: adding a second
file under an already-untracked directory leaves the porcelain byte-identical, and
_new_tracked_changes_since then returns []. All three delta walls (whoami :878,
capability :899, reviewer/merger :1526) consume that function and therefore miss
the write. Pass --untracked-files=all.

B3 (blocker) — the PR body says "Closes #700". Issue #700 is the contaminated
controller-run security incident carrying six required durable walls and a
four-item canonical order; this PR delivers order item 2 only. Merging as written
auto-closes the incident with five of six walls unbuilt. The commit message on this
head is already correct ("Closes #697, Ref #700"); change the PR body to match.

B4 (blocker) — the wall at gitea_mcp_server.py:1528-1532 says "forbidden from
modifying tracked workspace files", but reviewer_delta is now fed by the
??-inclusive parser, so it fires on untracked files. In a shared control checkout
this accuses a session that wrote nothing, and names no action it can take. Reword
or split the two cases.

Add a regression test per blocker. In particular, a test that drives
assess_root_checkout_guard with untracked-only porcelain and asserts it refuses
would fail today and is what B1 needs.

Do not self-review and do not self-merge.

WHAT_HAPPENED: An independent review at the exact head read the two-line production change, the new test file, and every other dirty-state definition in the tree, then reproduced all four blockers by execution rather than inference. Direct invocation showed the enforced root-checkout guard still returning proven True with empty dirty_files for untracked-only porcelain while the patched reporting parser sees the file. A real-git probe showed the default porcelain capture collapsing an untracked directory so that writes beneath it produce an empty delta at all three walls. Issue #700 was fetched live and confirmed to be a six-wall security incident that this PR would auto-close. Neighbouring suites were run at the head and at the merge base in separate branches/ worktrees; the failing test id sets are identical, so the ten failures are pre-existing and the two extra passes are this PR's own tests.

WHY: #697 asks for native Git and runtime dirty-state parity. This change moves one of four definitions and leaves both enforcement paths on the old answer, so the gap it targets stays open at exactly the layer that refuses mutations, and the capture mode caps what the fix can see even where it applies. The reference and message defects are smaller but both would mislead: one retires an open security incident, the other tells a blameless session it modified files it did not touch.

ISSUE: #697

HEAD_SHA: 00e526512a

REVIEW_STATUS: REQUEST_CHANGES recorded at 00e526512a by sysadmin

MERGE_READY: no

BLOCKERS: code blocker

VALIDATION: Reviewed in /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr921-00e5265-s2, created fresh this session, detached at 00e526512a, verified clean by git status --porcelain --untracked-files=all before and after. Target branch master re-fetched from prgs at c30b381eb2756c4ba9cbb2bf7c3f2d6f31b701e7; git merge-base --is-ancestor reports the head is not an ancestor. Diff against merge base 2b4e43042a is 2 files, +34/-2: a two-line change in gitea_mcp_server._parse_porcelain_entries plus tests/test_issue_697_untracked_preflight.py. B1 reproduced by direct invocation of assess_root_checkout_guard at this head: untracked-only porcelain yields proven True with empty dirty_files while the patched parser reports the path, and a tracked edit yields proven False. The other three ??-excluding definitions were located by grep over production sources at this head: reviewer_worktree.py:55, gitea_mcp_server.py:19660, dirty_same_claimant_session_rebind.py:143. B2 reproduced against real git in a throwaway repository outside the project tree: default porcelain renders one collapsed "?? newdir/" line whether one or two files exist beneath it, and _new_tracked_changes_since returns [] for that pair while returning the path for a new root-level untracked file and for a tracked edit. B3 verified by fetching issue #700 live in this session and reading its six acceptance criteria and four-item canonical order. B4 verified by reading gitea_mcp_server.py:1523-1532. Focused suite at head: 2 passed. Neighbouring sweep at head: 10 failed, 533 passed, 4974 deselected, 59 subtests. Same sweep at the merge base in branches/baseline-pr921-2b4e430-s2: 10 failed, 531 passed, 4974 deselected, 59 subtests. Failing test id sets compared with comm in both directions and found identical, so no regression originates from this branch and the +2 passes are its new tests. An earlier head-versus-base comparison was invalid because both runs executed in the head worktree; it was discarded and re-run with explicit cwd and HEAD proof. No full-suite run was performed at this head and none is claimed. No file was edited in either worktree. Pushes during validation: none.

LAST_UPDATED_BY: sysadmin / prgs-reviewer / gitea-reviewer namespace, reviewer lease session 18879-0b5d9cf95cf5

## REQUEST_CHANGES — PR #921 at head `00e526512a25b92d2a6caf8724b882f1af386ab4` Independent review by `sysadmin` / `prgs-reviewer`; author `jcwalker3`, so independence holds. Validated in a fresh session-owned worktree `branches/review-pr921-00e5265-s2`, detached at exactly this head, clean before and after. Merge base `2b4e43042a34f4e29617378ae79a7f5a3d312688`; target `master` re-fetched at `c30b381eb2756c4ba9cbb2bf7c3f2d6f31b701e7`, and the head is not an ancestor of it, so the already-landed gate does not fire. The change itself is correct and minimal: removing `line.startswith("??")` from `_parse_porcelain_entries` does make that parser report untracked files, and the two new tests pass. The problem is not what the patch does — it is how much of #697 the patch is claimed to cover, and what it leaves untouched. ### B1 — BLOCKER: the codebase holds four answers to "is this checkout dirty", and this changes the one wired to reporting while both wired to enforcement keep the old answer `_parse_porcelain_entries` is not the dirty-state authority. Enumerated at this head: | site | after this PR | wired to | |---|---|---| | `gitea_mcp_server._parse_porcelain_entries` | **includes `??`** | `gitea_get_runtime_context` reporting, delta walls | | `reviewer_worktree.parse_dirty_tracked_files:54-56` | **still excludes `??`** | `root_checkout_guard.py:82` — the enforced guard | | `gitea_mcp_server.py:19658-19661` inline copy | **still excludes `??`** | `gitea_update_pr_branch_by_merge` gate | | `dirty_same_claimant_session_rebind.py:143` | **still excludes `??`** | rebind path | Reproduced by direct invocation at this head, not inferred: ```text UNTRACKED-ONLY guard proven=True dirty_files=[] #921 reporting parser sees: ['tests/test_leaked_task_file.py'] TRACKED EDIT guard proven=False dirty_files=['gitea_mcp_server.py'] #921 reporting parser sees: ['gitea_mcp_server.py'] ``` So after this change the runtime context *reports* the untracked file while `assess_root_checkout_guard` — the gate that actually refuses the mutation — still returns `proven=True, dirty_files=[]`. That is the #913 control-checkout untracked blind spot, and it is unchanged by this fix. Issue #697 is about dirty-state **parity**; a fix that moves one of four definitions increases the divergence it was filed to remove. `reviewer_worktree.parse_dirty_tracked_files` also still carries the docstring justifying the old behavior ("Untracked entries (`??`) are ignored — they do not block reviewer work"), so the two definitions now actively disagree in prose as well as in code. ### B2 — BLOCKER: the porcelain is captured at git's default `-u normal`, so an untracked directory collapses and the delta walls stay blind `_get_workspace_porcelain` runs `["git", "status", "--porcelain"]` (`gitea_mcp_server.py:566-571`) with no `--untracked-files=all`. Verified against real git in a throwaway repo: ```text porcelain default, 1 file under new dir : ?? newdir/ porcelain default, 2 files under same dir: ?? newdir/ <-- byte-identical porcelain -uall : ?? newdir/sub/one.py ?? newdir/sub/two.py ``` `_new_tracked_changes_since` compares parsed porcelain snapshots, so a byte-identical capture yields an empty delta. Confirmed by driving the real function: ```text write under EXISTING untracked dir -> delta: [] brand-new untracked file at root -> delta: ['leaked.py'] tracked edit -> delta: ['gitea_mcp_server.py'] ``` All three delta walls consume that function — whoami (`:878`), capability (`:899`), and reviewer/merger (`:1526`). So writing any number of files beneath an already-untracked directory passes every one of them. The PR closes #697 on the strength of the `??` filter, but the capture mode silently caps how much the filter can ever see. Without `-uall`, B1's fix is partial even for the reporting path it does change. ### B3 — BLOCKER: `Closes #700` retires a security-incident umbrella on the strength of one sub-item The PR body reads `Closes #700` / `Closes #697`. Issue #700 is `incident: contaminated controller run (PR #696/#695) — credential exposed via shell args/curl…`, an open incident carrying **six** required durable walls (secret-redaction, credential-incident escalation, evidence-handling, native-provenance, process-termination guardrail, report-honesty) and a **four-item** canonical order. This PR delivers order item 2 (#697) only — and per B1/B2, partially. Gitea closes on PR-body keywords, so landing this retires the incident issue with five of six walls unbuilt. The commit message on this very head already gets it right — `fix(mcp): include untracked files in preflight porcelain parsing (Closes #697, Ref #700)`. The body should match the commit: `Ref #700`, not `Closes #700`. ### B4 — BLOCKER: the guard message now misattributes untracked files as "modifying tracked workspace files" `gitea_mcp_server.py:1528-1532` raises: ```text {role} role violation: profile is forbidden from modifying tracked workspace files (fail closed). Offending files: ... ``` `reviewer_delta` is now fed by the `??`-inclusive parser, so this fires on untracked files while still asserting "tracked". In a shared control checkout that means a reviewer session that wrote nothing gets told it modified tracked files because some other session left an untracked artifact — and a reviewer may not clean a shared checkout, so the message names no action the recipient can take. Either the wording drops "tracked", or the wall distinguishes the two cases. ### Validation ```text worktree : branches/review-pr921-00e5265-s2 (detached at 00e52651, clean before and after) baseline : branches/baseline-pr921-2b4e430-s2 (detached at 2b4e4304, merge base) head : venv/bin/python -m pytest tests/test_issue_697_untracked_preflight.py -q -> 2 passed head : venv/bin/python -m pytest tests/ -q -k "preflight or porcelain or dirty or root_checkout or worktree or untracked" -> 10 failed, 533 passed, 4974 deselected, 59 subtests base : same command, in the baseline worktree -> 10 failed, 531 passed, 4974 deselected, 59 subtests failing test id sets: comm -23 and comm -13 both empty -> IDENTICAL ``` Official PR-head validation status: `baseline-equivalent failure accepted`. The ten failures reproduce at the merge base with a byte-identical set of failing test ids, so none originates here; the `+2` passes are exactly this PR's two new tests. No regression is introduced. Validation failure history: an earlier attempt at the head-vs-base id comparison was run entirely inside the head worktree, because the second `pytest` invocation in that command never changed directory — it compared head against head and was therefore meaningless. It was discarded and the baseline run was re-executed in `branches/baseline-pr921-2b4e430-s2` with `pwd` and `git rev-parse HEAD` proof. Only the corrected run is reported above. ## Canonical PR State STATE: PR #921 is open at head 00e526512a25b92d2a6caf8724b882f1af386ab4 and now carries a formal REQUEST_CHANGES verdict from sysadmin recorded at that exact head. Four blocking findings are open. The two-line production change is correct in isolation and introduces no test regression against merge base 2b4e43042a34f4e29617378ae79a7f5a3d312688. WHO_IS_NEXT: author NEXT_ACTION: Author jcwalker3 must bring the enforced dirty-state definitions into parity with the reporting one, capture porcelain with untracked-files=all, correct the PR body to Ref #700, fix the misattributing guard message, add a regression test per blocker, push, and publish a new head-pinned handoff for a fresh independent review. NEXT_PROMPT: ```text Address the REQUEST_CHANGES review on PR #921 (Closes #697, Ref #700) in Scaled-Tech-Consulting/Gitea-Tools on remote prgs. Invoke the canonical gitea-workflow skill first. Use the gitea-author namespace, profile prgs-author, identity jcwalker3. Reviewed head was 00e526512a25b92d2a6caf8724b882f1af386ab4; merge base 2b4e43042a34f4e29617378ae79a7f5a3d312688. B1 (blocker) — the repository holds four answers to "is this checkout dirty" and this PR changes only the reporting one. reviewer_worktree.parse_dirty_tracked_files lines 54-56 still skips "??" and feeds root_checkout_guard.py:82, the enforced guard; the inline copy at gitea_mcp_server.py:19658-19661 still skips it and feeds the update_pr_branch_by_merge gate; dirty_same_claimant_session_rebind.py:143 also still skips it. Proven at this head: assess_root_checkout_guard with porcelain "?? tests/test_leaked_task_file.py" returns proven=True, dirty_files=[], while the patched _parse_porcelain_entries reports the same file. Bring the enforced definitions into parity, or centralize on one shared parser, and update the parse_dirty_tracked_files docstring that still justifies the old behavior. B2 (blocker) — _get_workspace_porcelain at gitea_mcp_server.py:566-571 runs git status --porcelain at git's default -u normal, so an untracked directory collapses to a single "?? dir/" line. Verified against real git: adding a second file under an already-untracked directory leaves the porcelain byte-identical, and _new_tracked_changes_since then returns []. All three delta walls (whoami :878, capability :899, reviewer/merger :1526) consume that function and therefore miss the write. Pass --untracked-files=all. B3 (blocker) — the PR body says "Closes #700". Issue #700 is the contaminated controller-run security incident carrying six required durable walls and a four-item canonical order; this PR delivers order item 2 only. Merging as written auto-closes the incident with five of six walls unbuilt. The commit message on this head is already correct ("Closes #697, Ref #700"); change the PR body to match. B4 (blocker) — the wall at gitea_mcp_server.py:1528-1532 says "forbidden from modifying tracked workspace files", but reviewer_delta is now fed by the ??-inclusive parser, so it fires on untracked files. In a shared control checkout this accuses a session that wrote nothing, and names no action it can take. Reword or split the two cases. Add a regression test per blocker. In particular, a test that drives assess_root_checkout_guard with untracked-only porcelain and asserts it refuses would fail today and is what B1 needs. Do not self-review and do not self-merge. ``` WHAT_HAPPENED: An independent review at the exact head read the two-line production change, the new test file, and every other dirty-state definition in the tree, then reproduced all four blockers by execution rather than inference. Direct invocation showed the enforced root-checkout guard still returning proven True with empty dirty_files for untracked-only porcelain while the patched reporting parser sees the file. A real-git probe showed the default porcelain capture collapsing an untracked directory so that writes beneath it produce an empty delta at all three walls. Issue #700 was fetched live and confirmed to be a six-wall security incident that this PR would auto-close. Neighbouring suites were run at the head and at the merge base in separate branches/ worktrees; the failing test id sets are identical, so the ten failures are pre-existing and the two extra passes are this PR's own tests. WHY: #697 asks for native Git and runtime dirty-state parity. This change moves one of four definitions and leaves both enforcement paths on the old answer, so the gap it targets stays open at exactly the layer that refuses mutations, and the capture mode caps what the fix can see even where it applies. The reference and message defects are smaller but both would mislead: one retires an open security incident, the other tells a blameless session it modified files it did not touch. ISSUE: #697 HEAD_SHA: 00e526512a25b92d2a6caf8724b882f1af386ab4 REVIEW_STATUS: REQUEST_CHANGES recorded at 00e526512a25b92d2a6caf8724b882f1af386ab4 by sysadmin MERGE_READY: no BLOCKERS: code blocker VALIDATION: Reviewed in /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr921-00e5265-s2, created fresh this session, detached at 00e526512a25b92d2a6caf8724b882f1af386ab4, verified clean by git status --porcelain --untracked-files=all before and after. Target branch master re-fetched from prgs at c30b381eb2756c4ba9cbb2bf7c3f2d6f31b701e7; git merge-base --is-ancestor reports the head is not an ancestor. Diff against merge base 2b4e43042a34f4e29617378ae79a7f5a3d312688 is 2 files, +34/-2: a two-line change in gitea_mcp_server._parse_porcelain_entries plus tests/test_issue_697_untracked_preflight.py. B1 reproduced by direct invocation of assess_root_checkout_guard at this head: untracked-only porcelain yields proven True with empty dirty_files while the patched parser reports the path, and a tracked edit yields proven False. The other three ??-excluding definitions were located by grep over production sources at this head: reviewer_worktree.py:55, gitea_mcp_server.py:19660, dirty_same_claimant_session_rebind.py:143. B2 reproduced against real git in a throwaway repository outside the project tree: default porcelain renders one collapsed "?? newdir/" line whether one or two files exist beneath it, and _new_tracked_changes_since returns [] for that pair while returning the path for a new root-level untracked file and for a tracked edit. B3 verified by fetching issue #700 live in this session and reading its six acceptance criteria and four-item canonical order. B4 verified by reading gitea_mcp_server.py:1523-1532. Focused suite at head: 2 passed. Neighbouring sweep at head: 10 failed, 533 passed, 4974 deselected, 59 subtests. Same sweep at the merge base in branches/baseline-pr921-2b4e430-s2: 10 failed, 531 passed, 4974 deselected, 59 subtests. Failing test id sets compared with comm in both directions and found identical, so no regression originates from this branch and the +2 passes are its new tests. An earlier head-versus-base comparison was invalid because both runs executed in the head worktree; it was discarded and re-run with explicit cwd and HEAD proof. No full-suite run was performed at this head and none is claimed. No file was edited in either worktree. Pushes during validation: none. LAST_UPDATED_BY: sysadmin / prgs-reviewer / gitea-reviewer namespace, reviewer lease session 18879-0b5d9cf95cf5
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #921
issue: #697
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 18879-0b5d9cf95cf5
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr921-00e5265-s2
phase: released
candidate_head: 00e526512a
target_branch: master
target_branch_sha: c30b381eb2
last_activity: 2026-07-27T15:05:48Z
expires_at: 2026-07-27T15:15:48Z
blocker: manual-release

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #921 issue: #697 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 18879-0b5d9cf95cf5 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr921-00e5265-s2 phase: released candidate_head: 00e526512a25b92d2a6caf8724b882f1af386ab4 target_branch: master target_branch_sha: c30b381eb2756c4ba9cbb2bf7c3f2d6f31b701e7 last_activity: 2026-07-27T15:05:48Z expires_at: 2026-07-27T15:15:48Z blocker: manual-release
jcwalker3 added 1 commit 2026-07-28 08:38:43 -05:00
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/issue-700-durable-walls:fix/issue-700-durable-walls
git checkout fix/issue-700-durable-walls
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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