Skip to content

test: assert worktree guard output status - #2642

Merged
Chris0Jeky merged 1 commit into
mainfrom
issue-1855/exit-status
Sep 5, 2026
Merged

test: assert worktree guard output status#2642
Chris0Jeky merged 1 commit into
mainfrom
issue-1855/exit-status

Conversation

@Chris0Jeky

Copy link
Copy Markdown
Owner

Summary

  • make the shell expect_sh_output helper require both the expected NOTE and exit 0
  • add a synthetic NOTE-then-failure canary so output alone cannot satisfy a success case
  • align the two stale common-directory pointer expectations with the guard's documented fatal exit 1 contract
  • keep guard production code, PowerShell implementation, submodule coverage, path normalization, and other residual decisions out of scope

Verification

  • baseline self-test: 33 passed, 2 pre-existing failures in the common-directory pointer expectations (expected 2, current documented guard contract returns 1)
  • final bash scripts/worktree_guard.tests.sh: 36 passed, 0 failed, 0 skipped
  • final bash -n scripts/worktree_guard.tests.sh: passed
  • git diff --check: passed
  • two coordinator review passes: no blocking findings

Automatic Codex review is unavailable because the account review quota is exhausted. Hosted checks remain pending.

Refs #1855

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Chris0Jeky

Copy link
Copy Markdown
Owner Author

Review gate (Codex review credits exhausted, SC-9; D-12 ruled 2026-09-05: the Codex session's PRs are reviewed and merged by the coordinator): one fresh-context read-only reviewer (Opus 5) on head a47b0bcb3. Verdict: SHIP.

Checked by reading: with .git rewritten to point at the primary .git, the git dir equals the common dir, which fails substance check 1 and takes the _wt_fatal / return 1 path at scripts/worktree_guard.sh:103-114 (mirrored in the PowerShell guard), so the 2-to-1 change records the code rather than weakening the contract; local code=$? after the assignment is correct (the identical idiom already works in expect_sh); the canary prints the needle and then returns 1, so under the old helper it would have passed on output alone; the suite runs without set -e, so the new return 1 cannot abort the run; the only real expect_sh_output call already asserts exit 0; only the test script is touched.

Findings and disposition (all LOW, tracked on #1855):

  • this suite runs in no workflow (reusable-docs-governance.yml runs only the three PowerShell harnesses), which is why the two expectations sat red unnoticed; a Linux step is a separate issue.
  • the rewritten comment attributes the malformed-pointer exit 2 to the guard's layout check, but it comes from git failing repository discovery.
  • the canary swallows the subshell's diagnostics on failure.

Issue disposition: slice of #1855 (PowerShell implementation, submodule and path-normalization residuals parked by the body).

@Chris0Jeky
Chris0Jeky merged commit 67ab09a into main Sep 5, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from Pending to Done in Taskdeck Execution Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant