Skip to content

fix(test): isolate runtime worktree env fixtures - #75

Open
bouillipx wants to merge 1 commit into
mainfrom
fix/runtime-worktree-baseline-gate
Open

fix(test): isolate runtime worktree env fixtures#75
bouillipx wants to merge 1 commit into
mainfrom
fix/runtime-worktree-baseline-gate

Conversation

@bouillipx

Copy link
Copy Markdown

What

  • Isolate install/runtime worktree test subprocess environments from ambient runtime session variables.
  • Add shared sanitizers for runtime worktree fixture tests so active session values do not change fixture branch/dir expectations.
  • Scope is test harness only: two files under packages/api/test.

Why

The scheduler missed-ledger branch was blocked by unrelated baseline gate failures. The failing install/runtime worktree suites inherited active session variables such as CAT_CAFE_RUNTIME_BRANCH and CAT_CAFE_RUNTIME_DIR, while their fixtures expected runtime/main-sync. That made main red under this local runtime session and hid the scheduler signal.

Issue Closure

  • None. Patrol baseline gate cleanup discovered during scheduler review.

Original Requirements

  • Source: scheduled patrol mission, 2026-07-12 00:00 Asia/Shanghai.
  • Excerpt: inspect Clowder Code / Cat Cafe for imperfect, improvable, competitiveness-relevant areas; verify truth sources and evidence first; close executable findings through lifecycle, implementation, gate, review, and completion records.
  • Operator pain: scheduler work should not be blocked by unrelated environment-sensitive baseline tests.
  • Reviewer check: this PR should only remove ambient env pollution from test fixtures, not change runtime behavior.

Plan / ADR

  • Plan: patrol finding from scheduler baseline gate attribution.
  • ADR: none.
  • BACKLOG: none.

Tips Contribution

  • Added or updated tips
  • Existing tip sourceRef still covers this user-visible change
  • tips_exempt: internal test harness stabilization; no user-visible capability change.

Tradeoff

This does not change runtime-worktree.sh behavior. It confines the fix to test subprocess env setup so production/runtime semantics remain untouched.

Test Evidence

  • Targeted RED before fix: install/runtime worktree suites had 40 pass / 5 fail under inherited runtime env.
  • Targeted GREEN after fix: with Node 24 and shared-state preflight disabled, install/runtime worktree suites pass 45/45.
  • pnpm check: pass.
  • pnpm gate: pass on fix/runtime-worktree-baseline-gate at f5d7997, rebased onto origin/main.
  • git diff --check origin/main...HEAD: clean.
  • Root artifact guard: no root media/design artifacts.

Open Questions

  • Please verify the env sanitizer is narrow enough: clears runtime fixture pollution without hiding variables each test intentionally sets.

Local Review: [x] Maine Coon GPT-5.4 reviewed f5d7997 and gave scoped APPROVE.
Cloud Review: [ ] PR comment trigger pending after creation.

Why: Gate tests should validate scripted runtime behavior, not inherit the caller's active CAT_CAFE_RUNTIME_* environment. The leaked branch/dir config made origin/main red when run from a synced runtime session and blocked unrelated scheduler work.

[砚砚/gpt-5.5🐾]
@bouillipx
bouillipx requested a review from zts212653 as a code owner July 12, 2026 17:00
@bouillipx
bouillipx changed the base branch from develop to main July 12, 2026 17:01
@bouillipx

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: f5d799702d

ℹ️ 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".

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.

1 participant