Skip to content

fix: bound local iteration checks and show live progress - #34700

Merged
OrcaWin merged 4 commits into
mainfrom
OrcaWin/pn-unchanged
Oct 28, 2026
Merged

OrcaWin merged 4 commits into
mainfrom
OrcaWin/pn-unchanged

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1350 $\color{#cf222e}{\Huge{\mathbf{−}}}$​205 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1145
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1025 $\color{#cf222e}{\Huge{\mathbf{−}}}$​238 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​787

ELI5

Repeated edits could trigger branch-wide checks with buffered test output. pnpm check:iteration --maxWorkers=2 checks uncommitted work against HEAD, while check:changed keeps its branch handoff scope. Both show progress and enforce a deadline per step. Cache and dependency-record repairs prevent the false passes reproduced during review.

What Changed

  • Separate branch/iteration pass caches, normalize inventory and shard settings, fingerprint supported runtime/build context, and rehash inputs before saving a pass. Failed forced or overlapping rechecks invalidate matching earlier passes. Explicit invalid bases fail clearly.
  • Attest the actual dependency-record cache alongside source inputs. Stronger failure records invalidate older passes; newly incomplete records arriving during checks fail the gate. Resolve custom cache paths in a supervised step and bound evidence reads. Successful record updates can be cached immediately; unavailable record data disables caching.
  • Preserve dependency unions after failed/partial tests and retry those suites until success. Revalidate successful records against source closures and resolved configuration/runtime context; retain the existing large-cold-cache static fallback. Deleted sources conservatively select the full inventory for the chosen scope.
  • Print commands, completions, deadlines, 15-second heartbeats, and Vitest progress. Apply worker limits to concurrent check tasks and use the source process runner for bootstrap builds too.
  • Release owned process streams on fallback settlement, handle SIGHUP cancellation, retain bounded stdout/stderr failure tails, and cancel checks when output consumers fail. Bound live forwarding and final drain; the direct CLI exits unsuccessfully after cleanup if Node's protected stdio remains blocked.
  • Preserve the writable CommonJS synchronous-runner export used by existing process instrumentation. Replace incomplete subprocess test doubles with the existing shared fixture backed by real streams, preserving late-close and admission-lifetime assertions.
  • Document the iteration versus handoff commands and how agents should stream/poll checks. The local invocation audit found 148 branch-check calls, all using --maxWorkers=2, with substantial output redirection and repeated calls.

Why

Repeated local feedback needs a smaller explicit scope, visible progress, and trustworthy passing-result reuse. The branch handoff command keeps its existing meaning and CI retains full global-input coverage.

Visual Proof

N/A — developer CLI and test configuration changes; no rendered UI changes.

Testing

  • Full PR workflow passed on ca4436227b57a28c3892ee0c4dea802091f44174, including all five full unit shards, Linux/Windows packaging, compatibility, selected end-to-end checks, and the PR checks passed aggregate.
  • ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2 --stepTimeoutMs=900000: all 36 checks passed, including 479 tests, in 462.7 seconds on the final commit. The default-budget run hit the affected-selection deadline under concurrent machine load; the documented longer per-step budget completed the same checks.
  • The standard pnpm check:changed --maxWorkers=2 then returned the validated cached pass in under one second. All 33 review-pinned source/installed-package hashes still matched, and the worktree remained clean.
  • CI fixture integration follow-up: 43 suites / 457 tests passed against the final synchronous fixture; CLI/node typechecks, lint and formatting passed. The final type-only spy annotation passed all four projects under CI-mode Bun, and independent transpilation confirmed byte-identical JavaScript. Independent review additionally passed 137 tests across 13 files and a real production preload probe, with zero changed test assertions.
  • Full process-host package suite: 161 tests passed. Final six-file selection/cache/runner integration suite: 34 tests passed. An independent adversarial reviewer verified 32 gate/control rows, 22 dependency-record probes, and final metadata/admission controls against the repaired snapshot; no remaining P1/P2 blocker was reproduced.
  • Real subprocess regressions cover inherited descendant pipes, caller exit, SIGINT/TERM/HUP, closed/nonreading output consumers, retained diagnostics, final-summary failure, input mutation, overlapping checks, cold/warm deleted consumers, concurrent failure evidence, configuration-resolution failures/timeouts, and special-file evidence reads. Real Bun/Node fixtures cover failed/partial/stale records, resolved context, import mutation during execution, and more than 100 cold files.
  • Corrected transform instrumentation attaches to both runtime projects and proves observation with known positive controls. Warm records avoid unrelated transforms; the large cold fallback scans import graphs without executing unrelated suites. An independent private-copy rerun passed.
  • Verified canonical patch application and frozen-lockfile installation; preserved the original dependency graph. Verified iteration discovery matches CI inventory; ordinary local discovery retains the additional dedicated-lane files.
  • Runtime evidence is Linux; native macOS/Windows execution was not run locally. No rendered UI changes.

Limits

The deadline applies per step, with additional shutdown time. Escaped POSIX descendants or uncatchable parent termination can require separate cleanup; releasing a pipe is not proof those descendants died. Affected selection still cannot infer arbitrary filesystem/subprocess inputs or never-executed computed imports. Global inputs retain CI's broader coverage, and gates validate materialized working bytes rather than divergent index blobs or an immutable snapshot. Dependency evidence attests observable records: it cannot recover overwritten failure history or make concurrent filesystem changes atomic.

AI Disclosure

Prepared with OpenAI Codex, with independent adversarial review workers.

Review

  • Self-reviewed correctness, performance, cache validity, and resource cleanup; independent adversarial review completed against the final source hashes.
  • Cross-platform process execution uses the existing process-host wrappers; no application/mobile/remote protocol changes. Native macOS/Windows execution remains with CI.
  • This change copies no upstream skill-installer material.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The change adds a worktree iteration check that compares staged, unstaged, and untracked edits with HEAD. The branch check continues to compare changes with a merge base. Both checks use scope-specific pass caching and managed task execution with configurable timeouts and concurrency. Worktree checks select the CI unit inventory. Dependency records now include freshness signatures and context, and incomplete or stale records affect test selection and pass caching. Process execution reports unverified termination and supports bounded live output. Package scripts, documentation, and tests cover the updated behavior.

Priority: Low

Merge Risk: Moderate · up to 59e8c

The shared test fixture fails the TypeScript typecheck in CI, which blocks the static analysis job. Adding explicit type annotations to the mocked kill and unref members should fix it before merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 13.89% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title is concise and accurately summarizes the main changes: bounded local iteration checks and live progress output.
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.
Description check Passed The description is detailed and covers the change, rationale, testing, visual proof, AI disclosure, review notes, limitations, and cross-platform status. It does not include the template's Linked Issu…
Full details: Description check

Explanation

The description is detailed and covers the change, rationale, testing, visual proof, AI disclosure, review notes, limitations, and cross-platform status. It does not include the template's Linked Issue/Fixes # section or the full checklist, but the missing items are non-critical for assessing this change; add them if repository policy requires them, especially for outside contributors.

Full details: Docstring Coverage

Explanation

Docstring coverage is 13.89% which is insufficient. The required threshold is 80.00%. 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 36 functions across 23 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be457964-177b-4f0b-9861-374f2803eb6f
Commits

Reviewing files that changed from the base of the PR and between 6f6aeaa and 59e8cfe.

Files ignored due to path filters: 1
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 25
  • .github/CONTRIBUTING.md
  • AGENTS.md
  • config/patches/[email protected]
  • config/scripts/check-changed-dependency-evidence.mjs
  • config/scripts/check-changed-lifecycle.test.mjs
  • config/scripts/check-changed-pass-cache.mjs
  • config/scripts/check-changed-pass-cache.test.mjs
  • config/scripts/check-changed-task-runner.mjs
  • config/scripts/check-changed-task-runner.test.mjs
  • config/scripts/check-changed.mjs
  • config/scripts/check-changed.test.mjs
  • config/scripts/vitest-affected-tests.test.mjs
  • src/main/computer/macos-computer-use-permissions.test.ts
  • src/main/git/command-runner/gh-exec-file-deadline.test.ts
  • src/main/git/command-runner/git-exec-admission-lifetime.test.ts
  • src/main/git/command-runner/hosted-cli-deadline-log.test.ts
  • src/main/git/runner-command-exec.test.ts
  • src/main/git/runner-gh-account-binding.test.ts
  • src/main/git/runner-wsl-direct-read.test.ts
  • src/main/ssh/system-transport/system-ssh-operations.test.ts
  • src/packages/process-host/src/process-spec.ts
  • src/packages/process-host/src/run-process-sync.ts
  • src/packages/process-host/src/run-process-termination-failure.test.ts
  • src/packages/process-host/src/run-process.ts
  • src/shared/__fixtures__/fake-spawned-child.ts

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

Comment on lines +15 to +16
override kill = vi.fn((_signal?: NodeJS.Signals | number) => true)
override unref = vi.fn()

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.

Major · Functional Correctness · Quick win

Annotate the mocked kill and unref members to fix the CI typecheck.

The exported createFakeSpawnedChild returns a FakeSpawnedChild instance. Declaration emit must name the inferred types of its vi.fn() members. TypeScript cannot name those types without Vitest's internal Procedure type, so it reports TS2883 on Line 16. As a result, pnpm run typecheck:ci fails for config/tsconfig.node.json and config/tsconfig.tc.web.json, and the static analysis job fails. Add explicit Mock<...> annotations. Line 15 has the same inferred-type pattern, so annotate it too.

🐛 Proposed fix
-import { vi } from 'vitest'
+import { vi, type Mock } from 'vitest'
-  override kill = vi.fn((_signal?: NodeJS.Signals | number) => true)
-  override unref = vi.fn()
+  override kill: Mock<(signal?: NodeJS.Signals | number) => boolean> = vi.fn(
+    (_signal?: NodeJS.Signals | number) => true
+  )
+  override unref: Mock<() => void> = vi.fn()
Tools
GitHub Actions: PR 34700 | source ebd8d55 | workflow ebd8d55 | unit full / 15_static analysis and typecheck.txt

[error] 16-16: TypeScript TS2883: The inferred type of 'unref' cannot be named without a reference to Vitest's 'Procedure' type. Add an explicit type annotation. This error caused pnpm run build:mobile-web to fail (bun config/tsconfig.node.json and bun config/tsconfig.tc.web.json exited with code 1).

GitHub Actions: PR 34700 | source ebd8d55 | workflow ebd8d55 | unit full / static analysis and typecheck

[error] 16-16: TypeScript TS2883: The inferred type of 'unref' cannot be named without a reference to Vitest's 'Procedure' type. Add an explicit type annotation. The typecheck failed (bun config/tsconfig.node.json and bun config/tsconfig.tc.web.json; command: pnpm run typecheck:ci --bun-concurrency=2 --bun-threads=2).

Source: Pipeline failures

@OrcaWin
OrcaWin merged commit 0866cb1 into main Oct 28, 2026
90 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.

1 participant