Skip to content

refactor(comments): slim verbose comments in shared/cli/relay/preload - #9544

Merged
nwparker merged 1 commit into
mainfrom
nwparker/slim-comments-shared-cli-relay
Jul 20, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/slim-comments-shared-cli-relay

Conversation

@nwparker

@nwparker nwparker commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Slim verbose code comments — shared, cli, relay, preload

Part of a codebase-wide sweep to slim over-verbose comments per AGENTS.md → Document the "Why", Briefly. Comments should state the non-obvious why, not narrate the what/how when the code is already clear; multi-line blocks collapse to a single line.

This PR — shared, cli, relay, preload: 26 files changed, 1039 insertions(+), 3300 deletions(-).

What changed

  • Multi-line Why: paragraphs → one-line why-statements.
  • Deleted comments that merely restated the adjacent code.
  • Kept: license headers, directives (eslint-disable, @ts-expect-error, oxlint-disable, …), TODO/FIXME, JSDoc tags, and every genuine non-obvious reason / external reference (issue numbers, platform quirks, race & ordering constraints).
  • useEffect / regex / bitwise / concurrency: kept a ≤1-line summary where it aids reading.
  • JSX {/* … */} comment text shortened; comments inside template-literal strings left untouched.

Safety

Every file in this PR is comments-only — enforced deterministically by stripping all comments (incl. JSX {/* */}) from both origin/main and the change and confirming the remaining code tokens are identical. pnpm typecheck ✅ · oxlint ✅ (no new findings vs main).

Part of a set of 6 area PRs from one sweep.

🤖 Generated with Claude Code

Made with Orca 🐋

Collapse multi-line explanatory comment blocks into single-line "why" statements
per AGENTS.md ("Document the Why, Briefly"): drop restatements of the code and
mechanism narration; keep the non-obvious reason, external refs, and directives.

Comments-only — verified no code changed via a Babel/esbuild comment-strip
token-equality gate against origin/main; typecheck and oxlint clean.

Area: shared, cli, relay, preload. 26 files changed, 1039 insertions(+), 3300 deletions(-).

Co-authored-by: Orca <help@stably.ai>
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds orchestration compatibility behavior, including lifecycle sender metadata and legacy keepalive markers. It extends terminal output tracking for transient facts and synthetic frames. Git status, worktree, relay, PTY, agent-hook, preload, telemetry, settings, keybinding, and shared type documentation is revised throughout. A text-search argument-building fallback is repositioned, and new Git status helper exports are introduced. Tests primarily receive explanatory comment updates.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing most required template sections, including Screenshots, Testing, AI Review Report, Security Audit, and Notes. Add the missing template sections: Summary, Screenshots, Testing, AI Review Report, Security Audit, and Notes, with concrete results and risks.
Docstring Coverage ⚠️ Warning Docstring coverage is 36.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: slimming comments across shared, cli, relay, and preload files.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f208597a-26be-447f-b74c-8d0b8b0d7978

📥 Commits

Reviewing files that changed from the base of the PR and between 53aeeb7 and 232b4fd.

📒 Files selected for processing (26)
  • src/cli/handlers/orchestration.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/relay/agent-hook-server.ts
  • src/relay/dispatcher.ts
  • src/relay/git-handler-status-ops.ts
  • src/relay/git-handler.test.ts
  • src/relay/git-handler.ts
  • src/relay/pty-handler.ts
  • src/relay/relay-handshake.ts
  • src/relay/relay.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/agent-status-types.test.ts
  • src/shared/agent-status-types.ts
  • src/shared/constants.ts
  • src/shared/git-remote-error.ts
  • src/shared/gitlab-types.ts
  • src/shared/keybindings.ts
  • src/shared/quick-open-filter.ts
  • src/shared/secure-file.ts
  • src/shared/telemetry-events.ts
  • src/shared/terminal-output-side-effects.ts
  • src/shared/terminal-title-status.ts
  • src/shared/text-search.ts
  • src/shared/tui-agent-config.ts
  • src/shared/types.ts

Comment thread src/preload/index.ts
/* eslint-disable max-lines -- Why: the preload bridge is the audited contract between
renderer and Electron. Keeping the IPC surface co-located in one file makes security
review and type drift checks easier than scattering these bindings across modules. */
/* eslint-disable max-lines -- Why: preload is the audited renderer/Electron IPC contract; co-locating the surface eases security and type-drift review. */

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.

📐 Maintainability & Code Quality | 🔴 Critical | ⚡ Quick win

Remove the max-lines ESLint disable directive.

As per coding guidelines, ESLint or Oxlint max-lines rules must never be disabled, including line-specific disables. Please remove the eslint-disable max-lines directive while keeping your explanation intact.

🐛 Proposed fix to align with guidelines
-/* eslint-disable max-lines -- Why: preload is the audited renderer/Electron IPC contract; co-locating the surface eases security and type-drift review. */
+// Why: preload is the audited renderer/Electron IPC contract; co-locating the surface eases security and type-drift review.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/* eslint-disable max-lines -- Why: preload is the audited renderer/Electron IPC contract; co-locating the surface eases security and type-drift review. */
// Why: preload is the audited renderer/Electron IPC contract; co-locating the surface eases security and type-drift review.

Source: Coding guidelines

// last-tool caches) lives on `HookListenerState`. The cache is bounded to one
// entry per paneKey — see docs/design/agent-status-over-ssh.md §5 (Path 3,
// request-driven replay) for the rationale.
/* eslint-disable max-lines -- Why: parsing, replay cache, endpoint writing, and retry state are one lifecycle unit; splitting obscures cleanup ordering across reconnects. */

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove ESLint/Oxlint max-lines disables.

As per coding guidelines, you must never disable ESLint or Oxlint max-lines, including line-specific disables. Please remove these directives across all affected files.

  • src/relay/agent-hook-server.ts#L1-L1: Remove the eslint-disable max-lines comment.
  • src/relay/dispatcher.ts#L1-L1: Remove the eslint-disable max-lines comment.
  • src/relay/git-handler.test.ts#L1-L1: Remove the eslint-disable max-lines comment.
  • src/relay/git-handler.ts#L1-L1: Remove the eslint-disable max-lines comment.
  • src/relay/relay.ts#L2-L4: Remove the oxlint-disable max-lines and eslint-disable max-lines comments.
  • src/shared/text-search.ts#L1-L3: Remove the oxlint-disable max-lines comment.
  • src/shared/agent-hook-listener.ts#L1-L1: Remove the eslint-disable max-lines comment.
📍 Affects 7 files
  • src/relay/agent-hook-server.ts#L1-L1 (this comment)
  • src/relay/dispatcher.ts#L1-L1
  • src/relay/git-handler.test.ts#L1-L1
  • src/relay/git-handler.ts#L1-L1
  • src/relay/relay.ts#L2-L4
  • src/shared/text-search.ts#L1-L3
  • src/shared/agent-hook-listener.ts#L1-L1

Source: Coding guidelines

Comment thread src/shared/keybindings.ts
/* eslint-disable max-lines -- Why: the central shortcut registry, parser,
* formatter, and conflict detector must stay in one shared module so main,
* renderer, browser guests, and Settings cannot drift apart. */
/* eslint-disable max-lines -- Why: keep the shortcut registry, parser, formatter, and conflict detector in one shared module so main/renderer/browser/Settings can't drift. */

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.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Remove the max-lines disable directive.

As per coding guidelines, you must never disable ESLint or Oxlint max-lines, including line-specific disables. Please remove this directive entirely.

🛠 Proposed fix
-/* eslint-disable max-lines -- Why: keep the shortcut registry, parser, formatter, and conflict detector in one shared module so main/renderer/browser/Settings can't drift. */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/* eslint-disable max-lines -- Why: keep the shortcut registry, parser, formatter, and conflict detector in one shared module so main/renderer/browser/Settings can't drift. */

Source: Coding guidelines

@nwparker
nwparker merged commit 0989128 into main Jul 20, 2026
10 of 11 checks passed
@nwparker
nwparker deleted the nwparker/slim-comments-shared-cli-relay branch July 20, 2026 10:34
just-zzp added a commit to just-zzp/orca that referenced this pull request Jul 20, 2026
Resolved 6 adjacency conflicts with the comment-slimming refactors
(stablyai#9542/stablyai#9544/stablyai#9545/stablyai#9546): kept Mission additions and the
useCustomActivationOnly activation guard, adopted main's slimmed
comments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…stablyai#9544)

Collapse multi-line explanatory comment blocks into single-line "why" statements
per AGENTS.md ("Document the Why, Briefly"): drop restatements of the code and
mechanism narration; keep the non-obvious reason, external refs, and directives.

Comments-only — verified no code changed via a Babel/esbuild comment-strip
token-equality gate against origin/main; typecheck and oxlint clean.

Area: shared, cli, relay, preload. 26 files changed, 1039 insertions(+), 3300 deletions(-).

Co-authored-by: Orca <help@stably.ai>
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