Skip to content

test(safe-bash): preserve browser and copy regressions in CI - #794

Closed
kamilio wants to merge 13 commits into
mainfrom
codex/recover-browser-snapshot
Closed

kamilio wants to merge 13 commits into
mainfrom
codex/recover-browser-snapshot

Conversation

@kamilio

@kamilio kamilio commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Browser snapshot and retained-copy regressions need to stay covered while the workspace test suites run without CPU contention. This PR retains regression cases for large snapshot scans, grep backpressure, copy rejection identity, bounded device reads, and browser cleanup recovery, and caps workspace Vitest pools at one worker.

The browser recovery and guarded cross-device move implementations are already on main. The remaining diff adds tests and CI scheduling; it preserves the complete test discovery and all case deadlines.

Scope

  • packages/safe-bash/tests: verify exact output and resource/error ownership, and update matcher-budget fixtures so optimized literal rejection cannot bypass the intended budget path.
  • packages/safe-playwright-cloudflare/tests: verify cleanup retains ownership through inspection exhaustion and removes the directory only after a later successful inspection.
  • .github/workflows: retain serial workspace stages, set the existing VITEST_MAX_WORKERS=1 override, and add a 600-second file watchdog above the suite's existing 400-second case allowance.

Verification

Final local integration: all 498 focused Safe Bash regression tests and six guardian tests pass, all 36 dependency builds complete, and workflow lint passes. CI on the final commit remains required. Earlier validation also covered 158 browser unit tests, 12 real-browser scenarios, 376 staging tests, and guarded repository lint over 17,956 inputs with zero errors and no scan gaps. Those earlier results support the upstreamed implementation; final CI remains the delivery gate.

The one-worker setting passed 666 focused replay/budget/presentation tests without changing their 5-second deadline. Full API parity and production-room acceptance are not claimed. Additional findings remain tracked in hey-boss; opaque destination identity is tracked in #1097 and copy rejection coverage in #1240.

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes: mv -u now skips before same-file detection.

Comment thread packages/safe-bash/src/commands/move.ts Resolved
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: preserve GNU same-file errors in update-mode
preflight and after cross-device rename failure. Keep no-clobber
skips successful.

Add same-path, hardlink, authoritative-alias, and post-EXDEV
regressions; align the existing unscoped fixture with its retained
destination identity rejection.

Addresses review: #794. Tracks hey-boss #1125.

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes: snapshot batch cancellation/deadlines are dropped in the adapter wrapper.

kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: forward optional per-call cancellation controls through
tracked reference connectivity and resolution. Add two cancellation
regressions; 145 adapter, controller and snapshot tests pass.

Addresses review: #794. Tracks hey-boss #1126.

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kamilio
kamilio force-pushed the codex/recover-browser-snapshot branch from 3b68a1b to dfe4a40 Compare September 25, 2026 05:10
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: preserve GNU same-file errors in update-mode
preflight and after cross-device rename failure. Keep no-clobber
skips successful.

Add same-path, hardlink, authoritative-alias, and post-EXDEV
regressions; align the existing unscoped fixture with its retained
destination identity rejection.

Addresses review: #794. Tracks hey-boss #1125.
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: forward optional per-call cancellation controls through
tracked reference connectivity and resolution. Add two cancellation
regressions; 145 adapter, controller and snapshot tests pass.

Addresses review: #794. Tracks hey-boss #1126.
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: preserve GNU same-file errors in update-mode
preflight and after cross-device rename failure. Keep no-clobber
skips successful.

Add same-path, hardlink, authoritative-alias, and post-EXDEV
regressions; align the existing unscoped fixture with its retained
destination identity rejection.

Addresses review: #794. Tracks hey-boss #1125.
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: forward optional per-call cancellation controls through
tracked reference connectivity and resolution. Add two cancellation
regressions; 145 adapter, controller and snapshot tests pass.

Addresses review: #794. Tracks hey-boss #1126.
@kamilio
kamilio force-pushed the codex/recover-browser-snapshot branch from dfe4a40 to 4071b5f Compare September 25, 2026 05:13

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kamilio
kamilio force-pushed the codex/recover-browser-snapshot branch from 4071b5f to 1878446 Compare September 25, 2026 05:30
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: preserve GNU same-file errors in update-mode
preflight and after cross-device rename failure. Keep no-clobber
skips successful.

Add same-path, hardlink, authoritative-alias, and post-EXDEV
regressions; align the existing unscoped fixture with its retained
destination identity rejection.

Addresses review: #794. Tracks hey-boss #1125.
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: forward optional per-call cancellation controls through
tracked reference connectivity and resolution. Add two cancellation
regressions; 145 adapter, controller and snapshot tests pass.

Addresses review: #794. Tracks hey-boss #1126.

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kamilio
kamilio force-pushed the codex/recover-browser-snapshot branch from 1878446 to 6a1e30e Compare September 25, 2026 05:55
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: preserve GNU same-file errors in update-mode
preflight and after cross-device rename failure. Keep no-clobber
skips successful.

Add same-path, hardlink, authoritative-alias, and post-EXDEV
regressions; align the existing unscoped fixture with its retained
destination identity rejection.

Addresses review: #794. Tracks hey-boss #1125.
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: forward optional per-call cancellation controls through
tracked reference connectivity and resolution. Add two cancellation
regressions; 145 adapter, controller and snapshot tests pass.

Addresses review: #794. Tracks hey-boss #1126.

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: preserve GNU same-file errors in update-mode
preflight and after cross-device rename failure. Keep no-clobber
skips successful.

Add same-path, hardlink, authoritative-alias, and post-EXDEV
regressions; align the existing unscoped fixture with its retained
destination identity rejection.

Addresses review: #794. Tracks hey-boss #1125.
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: forward optional per-call cancellation controls through
tracked reference connectivity and resolution. Add two cancellation
regressions; 145 adapter, controller and snapshot tests pass.

Addresses review: #794. Tracks hey-boss #1126.
@kamilio
kamilio force-pushed the codex/recover-browser-snapshot branch from 3285885 to 350a2cb Compare September 25, 2026 07:32
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: preserve GNU same-file errors in update-mode
preflight and after cross-device rename failure. Keep no-clobber
skips successful.

Add same-path, hardlink, authoritative-alias, and post-EXDEV
regressions; align the existing unscoped fixture with its retained
destination identity rejection.

Addresses review: #794. Tracks hey-boss #1125.
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: forward optional per-call cancellation controls through
tracked reference connectivity and resolution. Add two cancellation
regressions; 145 adapter, controller and snapshot tests pass.

Addresses review: #794. Tracks hey-boss #1126.
@kamilio
kamilio force-pushed the codex/recover-browser-snapshot branch from 350a2cb to 2439a2d Compare September 25, 2026 07:35
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: preserve GNU same-file errors in update-mode
preflight and after cross-device rename failure. Keep no-clobber
skips successful.

Add same-path, hardlink, authoritative-alias, and post-EXDEV
regressions; align the existing unscoped fixture with its retained
destination identity rejection.

Addresses review: #794. Tracks hey-boss #1125.
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: forward optional per-call cancellation controls through
tracked reference connectivity and resolution. Add two cancellation
regressions; 145 adapter, controller and snapshot tests pass.

Addresses review: #794. Tracks hey-boss #1126.
@kamilio
kamilio force-pushed the codex/recover-browser-snapshot branch from 2439a2d to bf8c636 Compare September 25, 2026 07:38

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: preserve GNU same-file errors in update-mode
preflight and after cross-device rename failure. Keep no-clobber
skips successful.

Add same-path, hardlink, authoritative-alias, and post-EXDEV
regressions; align the existing unscoped fixture with its retained
destination identity rejection.

Addresses review: #794. Tracks hey-boss #1125.
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: forward optional per-call cancellation controls through
tracked reference connectivity and resolution. Add two cancellation
regressions; 145 adapter, controller and snapshot tests pass.

Addresses review: #794. Tracks hey-boss #1126.
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: preserve GNU same-file errors in update-mode
preflight and after cross-device rename failure. Keep no-clobber
skips successful.

Add same-path, hardlink, authoritative-alias, and post-EXDEV
regressions; align the existing unscoped fixture with its retained
destination identity rejection.

Addresses review: #794. Tracks hey-boss #1125.
kamilio added a commit that referenced this pull request Sep 25, 2026
packages/safe-bash: forward optional per-call cancellation controls through
tracked reference connectivity and resolution. Add two cancellation
regressions; 145 adapter, controller and snapshot tests pass.

Addresses review: #794. Tracks hey-boss #1126.
@kamilio
kamilio force-pushed the codex/recover-browser-snapshot branch from d3cba0f to 7e45b21 Compare September 25, 2026 13:51
packages/safe-bash:
Reject subjects missing an unconditional literal run before restarting the NFA at every offset. Preserve match preference, captures, work limits and cooperative cancellation.

Add regressions for a 20001-row browser snapshot, linear missing-literal work, matching semantics, explicit budgets and cancellation. Keep existing NFA limit tests on inputs that enter the matcher.

Validation: reproduce-first failures; 941 text-program tests, 129 Playwright tests, workspace build, source/test and 26 consumer type groups pass. Guarded root lint exits 0 with two existing ls-inode warnings. Installed private candidate passes all four 1100/20001-row match and no-match controls.

Tracks hey-boss poe-code #684.
packages/safe-bash:
Route pure ASCII ERE literal alternatives through the existing bounded KMP matcher. Preserve per-pattern priority, leftmost-longest spans, UTF-8 validation, case/whole/word semantics, cancellation and resource limits.

Add reproduce-first default-budget snapshot regressions, semantic controls, explicit budget checks and cancellation/worker-reuse coverage.

Validation: 695 regex/search tests pass with one existing unavailable GNU-oracle skip; workspace build, source/test and 26 consumer type groups pass; guarded root lint exits 0 with two existing ls-inode warnings. Original 4/16 KiB differential reproductions match native grep; oversized input remains bounded.

Tracks hey-boss poe-code #686.
packages/safe-bash: keep the step-limit and in-match cancellation cases on a nonliteral NFA pattern. The literal no-match optimization legitimately finishes the old inputs before those boundaries. Preserve all assertions, limits and cancellation reasons.

Validation: reproduced 3 failures in 9 tests; all 9 pass with character-class patterns.
packages/safe-bash: give the synthetic traversal host stable identities and
explicit retained readers. Observe completed streaming writes so depth,
partial-progress and output-backpressure assertions cover the current path.

Verification: all 38 recursive admission tests pass, including falsey
cancellation and depth boundaries. Maintained typecheck and guarded lint pass.
packages/safe-bash: carry the permission-denial proxy into confined views and
explicitly disable retained reads for buffered-only profiles. Verify diff's
bounded retained reads and reader closure independently of pathname fallback.

Verification: all 48 device-view tests pass. Maintained source/test and
consumer typecheck passes; guarded lint completes with zero errors.
packages/safe-bash: Update retained-copy/staged-move authority assertions and current regex cancellation checkpoints after upstream integration. Preserve exact refusal effects and supported transfer namespaces.

packages/safe-playwright-cloudflare: Exercise the current process-inventory cleanup retry seam.

packages/safe-playwright: Remove duplicate unlimited-default cases now covered upstream.

Verification: affected browser/regex, copy/authority and core-ordering regressions pass.
.github/workflows: Apply a ten-minute per-file Node test deadline to the complete serial Safe Bash suite. This exceeds the existing 400-second test allowance and reports hanging children instead of leaving the suite pending indefinitely.

Verification: npm run lint:workflows passed. Read-only colleague review confirmed Node22 file-level timeout and ordinary runner argument forwarding.
packages/safe-bash: Adopt the upstream bare-multiplier case and assert exact leading or trailing bytes for numeric multipliers. This resolves the overlapping test additions while preserving stronger output checks.

Validation: all43 count tests pass; complete guarded lint passed17,946 inputs with zero errors; three-way file merge succeeds.
.github/workflows: avoid overlapping independent two-worker suites and native tasks on the same runner. Preserve all tests, hooks, assertions and deadlines.

All 623 tests across six SafeJS CI failure files pass with one local worker and with the CI two-worker setting in isolation. Colleague review and workflow lint pass. Full GitHub CI remains required.

Tracks hey-boss #1137.
packages/safe-bash: Restore output backpressure after the upstream batch optimization for both synchronous and worker regex providers, preserving max-count exits and per-line synchronous processing.

The existing worker regression and new synchronous exact-output regression both failed before the fix. All252 focused grep/count/move/copy/browser tests,440 filesystem tests, the134-workspace root build,36-package focused rebuild, and complete guarded lint passed.

Tracks hey-boss #1139.
.github/workflows: Use the existing worker override after independent Linux validation found replay failures even with workspace stages serialized. Preserve every command, assertion and deadline.

Validation: resolved Vitest configuration uses one worker and5000ms; focused replay/budget/presentation tests and workflow lint pass. Full exact-head CI remains required.

Tracks hey-boss #1137.
packages/safe-bash: track failed copying independently from its rejection value and drain retained-reader cleanup before rethrowing the original reason.

Six direct regression cases cover Error and undefined rejection values, secondary cleanup failures, successful-copy cleanup failure, and single-close behavior. Two cases failed before the fix; all 88 copy/predicate tests pass. Addresses hey-boss #1240.
@kamilio kamilio changed the title fix(safe-bash): recover browser sessions and bind cross-device moves test(safe-bash): preserve browser and copy regressions in CI Sep 25, 2026
packages/safe-bash/tests: remove an unused import left after reconciling upstream retained-copy fixtures.

Validation: all 498 remaining Safe Bash regression tests and six guardian cases pass; 36 dependency builds complete and workflow lint passes.
@kamilio
kamilio force-pushed the codex/recover-browser-snapshot branch from 7e45b21 to c102b88 Compare September 25, 2026 14:00

@poe-code-agent poe-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kamilio kamilio closed this Sep 25, 2026
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