[P0] Isolate tests from live workflow state #888

Open
opened 2026-07-24 21:10:05 -05:00 by jcwalker3 · 0 comments
Owner

Parent epic: #887
Priority: P0

Problem

Running the #663 tests mutated live workflow state: lock generation counters advanced 3 -> 7 -> 8, /tmp/gitea_issue_lock.json was rewritten, and the global current-issue pointer was repointed. Tests and production share the same absolute state paths, so a test run is indistinguishable from a real author run at the storage layer.

Acceptance criteria

  • Every test receives a unique temporary state root.
  • Tests cannot resolve production lock, lease, cache, session, or pointer paths — resolution is redirected, not merely discouraged.
  • Any attempt to touch a production state path during a test fails immediately and loudly, rather than succeeding silently.
  • Parallel test processes have mutually isolated state roots.
  • A full-suite canary proves live workflow state is byte-for-byte unchanged before and after the run.
  • A regression test reproduces the #663 generation 3 -> 7 -> 8 contamination and fails on the pre-fix code.

Duplicate verdict

NOT a duplicate.

  • #738 pins the pytest runner and excludes branches/ worktrees from collection — that is collection scope, not state isolation.
  • #716 covers MCP session state dirtying Git worktrees, not test processes writing production workflow state.
Parent epic: #887 Priority: P0 ## Problem Running the #663 tests mutated live workflow state: lock generation counters advanced `3 -> 7 -> 8`, `/tmp/gitea_issue_lock.json` was rewritten, and the global current-issue pointer was repointed. Tests and production share the same absolute state paths, so a test run is indistinguishable from a real author run at the storage layer. ## Acceptance criteria - Every test receives a unique temporary state root. - Tests cannot resolve production lock, lease, cache, session, or pointer paths — resolution is redirected, not merely discouraged. - Any attempt to touch a production state path during a test fails immediately and loudly, rather than succeeding silently. - Parallel test processes have mutually isolated state roots. - A full-suite canary proves live workflow state is byte-for-byte unchanged before and after the run. - A regression test reproduces the #663 generation `3 -> 7 -> 8` contamination and fails on the pre-fix code. ## Duplicate verdict NOT a duplicate. - #738 pins the pytest runner and excludes `branches/` worktrees from collection — that is collection scope, not state isolation. - #716 covers MCP session state dirtying Git worktrees, not test processes writing production workflow state.
jcwalker3 added the testingstatus:readyworkflow-hardeningsafetytype:bug labels 2026-07-24 21:10:05 -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#888