Skip to content

test(session-store): ignore the checkout path in the secret-word check - #197

Merged
howdeploy merged 1 commit into
howdeploy:mainfrom
BIackFIame:pr159/test-reliability
Nov 2, 2026
Merged

howdeploy merged 1 commit into
howdeploy:mainfrom
BIackFIame:pr159/test-reliability

Conversation

@BIackFIame

@BIackFIame BIackFIame commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Split out of #159 and rebased on current main (2367505): fix 12 of #159, unchanged in substance. Small and independent; it does not depend on the other parts of #159. Fix 11 of #159 (the engine-tabs click race) is not included: main already fixes it in 6e36e98 (ready(tabId, afterRevision)).

Problem

"terminal window descriptors persist atomically without scrollback or environment" in tests/terminal-session-store.test.mjs fails on every run when the checkout path contains "environment", "token", "buffer" or "capability" (for example ~/environment/CanvasTTY, or a worktree named after an environments feature).

Cause

The saved descriptor's cwd is process.cwd(), and the test scanned the whole saved file, cwd included, against /buffer|environment|capability|token/. The checkout path alone matched.

Fix

The scan leaves the descriptor's own cwd value out (it is replaced by "" before matching). Everything else in the file is checked as before, so a leaked buffer, environment, capability or token field still fails the test. One test file changes (+2/-1); no product code changes.

Test

  • The same file, run from a folder named environment-check: on 2367505 without the fix, 1 of 7 tests fails (this one, doesNotMatch); with the fix, 7 of 7 pass. From a normal checkout path both pass.

Verification

  • npm run build (includes typecheck) and npm run audit:secrets: pass.
  • Full suite (macOS arm64, throw-away HOME/XDG/CLI homes): 2,689 tests, 2,683 pass, 0 fail, 6 skipped, the same as main.
  • The renderer is untouched.

Summary by CodeRabbit

  • Tests
    • Updated terminal-session persistence checks to account for the serialized working-directory value when verifying stored data. The checks continue to confirm that buffer, environment, capability, and token values are not included. This change affects test coverage only; it does not change the behavior of the product.

"terminal window descriptors persist atomically without scrollback or
environment" saves a descriptor whose cwd is process.cwd() and then
checks the whole file against /buffer|environment|capability|token/.
Run from a checkout whose path contains one of those words (for example
a worktree named after an environments feature), the cwd alone matched
and the test failed on every run. The check now leaves the descriptor's
own cwd value out; everything else in the file is checked as before.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T21:36:23.008552Z e8b4c61 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Owner

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f5463050-73c2-48c0-ad2c-1ed96ddd90b8
Commits

Reviewing files that changed from the base of the PR and between 2367505 and e8b4c61.

Files selected for processing: 1
  • tests/terminal-session-store.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Walkthrough

The persistence test removes the serialized cwd value before checking whether stored data contains forbidden terms.

Changes: Persistence test

Layer / File(s) Summary
Persistence assertion
tests/terminal-session-store.test.mjs
The assertion excludes the serialized cwd path before checking for buffer, environment, capability, or token.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Other

Suggested reviewers: howdeploy

Merge Risk: Minimal · up to e8b4c

This test-only change removes checkout-path false failures without changing application behavior.

Architecture risk: Low · up to e8b4c

The change affects 1 system.

Changed systems: tests

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — tests (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in tests/terminal-session-store.test.mjs: The persistence assertion now excludes the serialized cwd path before checking for forbidden terms, so a matching word in the checkout path does not affect the test.
Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the test-only change: excluding the checkout path from the secret-word check in the session store test.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

2 participants