Skip to content

Restore main static analysis by extracting crew runtime operations - #37174

Merged
nwparker merged 1 commit into
mainfrom
brennanb2025/lt1031-main-lint-automation-ops
Nov 1, 2026
Merged

nwparker merged 1 commit into
mainfrom
brennanb2025/lt1031-main-lint-automation-ops

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Main CI is red because #36543 and #34890 together grew automation-operations.ts to 301 nonblank, noncomment lines, above the 300-line limit. This blocks the static analysis and typecheck job on otherwise unrelated PRs.

Move the crew snapshot and subscription operations added in #34890 into the neighboring crew-operations.ts runtime layer. The moved code is unchanged; database binding becomes protected so its existing call sites remain in the automation layer. The original file is now 295 physical lines (263 counted by the configured rule), and the new file is 49 physical lines. No lint rules or user behavior change.

Plan: extract one coherent crew read/subscription concept, retain the existing runtime inheritance pattern and public methods, and run the existing crew/runtime and automation publication tests. No saved data, wire format, new checks, defaults, or product choices change. Older phone/server/CLI flows and saved data stay compatible; no UI or conflicting ruling is involved.

Review classification: full path under the current literal criteria (a pure move, but in the orchestration runtime).

  • Small: 97 changed production lines across two files, below approximately 150 lines / five files.
  • Outside risky areas: does not qualify because these are orchestration runtime modules; their bodies and behavior are unchanged.
  • Not a repeat: file history has no prior repair for this max-lines failure in the last 30 days. The growth came from the two merges above.
  • Local effect: this repairs CI through a production-module move; it does not meet the enumerated local-effect categories.

Validation: all four existing named test files passed through tc-gate (19 tests): crew read-model, default-pane acquisition, main-terminal acquisition, and automation change-publication. The standard pre-commit hook passed all staged-file checks. Head CI static analysis and typecheck passed (4m6s). The fail-fast watcher stopped on unrelated Source Control test failures in shards 4 and 12: their mock stores lack remoteOperations, read by use-worktree-context.ts:76 after #37093 landed on main. CI tested merge d63b546 with main 9599d71; the Source Control subtree is identical to that main commit. Linux/Windows packaging and persistence passed; some other checks were still pending. No new tests are needed for a byte-preserving move. No difference from the existing mechanism is introduced.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

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: fc4877b8-4e4e-4283-a1b2-585036de1831
Commits

Reviewing files that changed from the base of the PR and between 9599d71 and df03fa9.

Files selected for processing: 2
  • src/main/runtime/workspaces/persisted-surfaces/automation-operations.ts
  • src/main/runtime/workspaces/persisted-surfaces/crew-operations.ts
  • 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

@brennanb2025

brennanb2025 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Review status

The problem. Main's "static analysis and typecheck" CI job was failing for every open PR. Two changes merged today (#36543 and #34890) pushed automation-operations.ts past the 300-line limit. Users weren't affected, but no PR could get a green CI run.

The change. The crew snapshot and subscription code that #34890 added moves unchanged out of automation-operations.ts into a new runtime layer, crew-operations.ts, which sits in the same inheritance chain right below it. Users see no difference. The only edit to the moved code is bindCrewChanges going from private to protected, so the existing database-binding calls in the automation layer can still reach it.

What was verified (full review path, one round, no findings):

  • I diffed the moved block against main byte for byte. Undoing that one private→protected change makes it identical. A reviewer also rebuilt the original file from this head and got main's file exactly.
  • Imports: everything left in each file is still used, and the new module adds no import cycle.
  • Callers: the crew RPC (crew-methods.ts:23-24), the crew CLI and terminal tests, and the subclass chain all resolve to the same code. Nothing overrides or redeclares the moved fields.
  • Construction order: the moved fields now initialize one class level earlier. The CrewReadModel constructor only stores callbacks (crew-read-model.ts:20-23), the automation layer no longer has any field initializers, and no constructor in the chain touches these fields. Nothing reads them early.
  • CI on this head: "static analysis and typecheck" passes, and so do both package jobs. The existing crew and runtime tests are the coverage for this move. This is a tests row, so there was no app run (qa=tests): code moved unchanged is covered by the tests that already cover it.

Not green yet, and not caused by this PR. Test shards 4, 9 and 12 fail in four Source Control renderer test files with s.remoteOperations.findLast undefined. #37093 (merged today with those same shards failing) added that store read in use-worktree-context.ts:76, and the test store mocks never got the field. The fix is in its own PR, tracked in #37186. Once that lands, this PR needs a main sync and a CI rerun. A merge-only sync keeps this review's evidence.

Deferred (for Brennan, not this PR): these runtime layers keep getting re-split under line-limit pressure (#34890 split the database binding out of this same class, and this PR splits out crew). It's a structural pattern worth a look someday. It isn't a defect.

For Brennan's review

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