Skip to content

test: synchronize worktree containment cleanup - #1041

Merged
dennisonbertram merged 1 commit into
mainfrom
codex/issue-1039-worktree-containment-ci
Jul 31, 2026
Merged

test: synchronize worktree containment cleanup#1041
dennisonbertram merged 1 commit into
mainfrom
codex/issue-1039-worktree-containment-ci

Conversation

@dennisonbertram

@dennisonbertram dennisonbertram commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace the containment regression's implicit buffered-event timing assumption with a bounded test-provider release handshake
  • retain the real bash tool, exact worktree pwd, sentinel file, no daemon-cwd leak, tool-error, and terminal-event assertions
  • preserve the test-only boundary; no production code or workspace lifetime behavior changed

Rebuild

TDD evidence

The red fixture deliberately allowed terminal cleanup to win before consuming stored events; the existing test then failed with both out.txt and marker.txt absent. The provider handshake now holds only the terminal test turn until the subscriber completes the live worktree assertions, then permits normal cleanup.

Verification at 986e1372af758989dfc64ab91647b14d6f715f74

  • focused normal: go test ./internal/harness -run '^TestWorktreeContainment_ToolCwdIsWorktree$' -count=100 — PASS
  • focused race: go test -race ./internal/harness -run '^TestWorktreeContainment_ToolCwdIsWorktree$' -count=100 — PASS
  • complete harness normal: go test ./internal/harness/... — PASS
  • complete harness race: go test -race ./internal/harness/... — PASS
  • unchanged foreground non-TTY ./scripts/test-regression.sh — PASS
    • normal tests — PASS
    • full race tests — PASS
    • coverage gate — PASS (total=85.6%, zero-functions=0)

Closes #1039

Related #1000
Related #1033

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copy link
Copy Markdown
Owner Author

Deterministic red/green evidence and the complete normal/race/coverage gate are recorded in the PR body. Exact head: 5a8905b0.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 5a8905b01d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Owner Author

Rebased and re-verified at exact head bd0682c4 (bd0682c4 full SHA on the pushed branch), onto origin/main b3afc7ec487c60762a91a1219ceb92c523ef0e78. Focused normal/race containment tests passed 100 consecutive runs each; complete internal/harness/... normal/race passed; unchanged foreground non-TTY ./scripts/test-regression.sh passed normal, full race, and coverage (85.6%, zero uncovered functions). The diff remains test/docs-only with production code unchanged.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: bd0682c428

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Owner Author

Rebased again onto exact current main 8906149e29f5d1b93860ab7b88f860a668fd890d after merged #1063. Exact pushed head: 91678c7bbdb1060956250f1cd03f91adf5137d2c.

The six-file test/docs-only scope is preserved, including current-main Issue #1062 entries and the #1039 entries. Focused normal/race containment tests passed 100 consecutive runs each, and unchanged foreground non-TTY ./scripts/test-regression.sh passed normal, full race, and coverage (85.6%, zero uncovered functions).

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 91678c7bbd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dennisonbertram
dennisonbertram force-pushed the codex/issue-1039-worktree-containment-ci branch from 91678c7 to 986e137 Compare July 31, 2026 07:42

Copy link
Copy Markdown
Owner Author

Rebuilt from exact merged #1066 main 0868ac075cc61fb6d6e6ad7bfc83785b29a79f08 plus only the original #1039 commit. Exact pushed head: 986e1372af758989dfc64ab91647b14d6f715f74. Merge-base equals the requested main tip; the net diff is six intended test/docs files with current-main #1062/#1064/#1049/#1044 entries preserved and no production or unrelated test changes. Focused normal/race containment stress, complete harness normal/race, and unchanged foreground non-TTY full regression all pass; coverage is 85.6% with zero uncovered functions. @codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 986e1372af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dennisonbertram
dennisonbertram merged commit 986e137 into main Jul 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Worktree containment test races workspace teardown after tool completion

1 participant