Skip to content

refactor: Trim comments in main, model, frame loop and logs to the house bar - #1777

Merged
omesser merged 5 commits into
mainfrom
refactor/comments-main-model-frame-loop
Oct 22, 2026
Merged

omesser merged 5 commits into
mainfrom
refactor/comments-main-model-frame-loop

Conversation

@omesser

@omesser omesser commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Why

Section 2 of #1597 covers the Rust app's entry point, Director model, frame loop and logs. Those 15 files held 2660 full-line comment lines. Many restated the code, narrated history, or cited issue numbers whose fact the sentence already stated. This PR brings those comments to the bar in docs/agents/comments.md.

What changed

This PR edits comments only, in the 15 files #1599 names (8 edited). Comment lines went from 2660 to 2527.

  • Long blocks: all 55 blocks of 4 lines or more are now 3 lines or fewer, except the exemptions listed below.
  • Issue numbers: dropped wherever the sentence already states the fact. Some comments pointed at a classification table in an issue (the #606 rows), and those now name the Truncation enum that encodes it. ADR references stay.
  • History: "replaces a UA sniff", "as before", "the seam fix(mcp): An attached Harness's speak returns success and nothing appears on screen #470 was missing", "Stage 2b" and "not hardcoded true" are gone, and the Harness ordering note in main is now in the present tense.
  • Restatements: "Show the window", "Log DND state at startup" and the trailing // 2 MB are gone.
  • Duplicates: a doubled comment in frame_loop is merged into one, and the second copy of the pending first-connection note is shortened.
  • Kept: SAFETY:, FFI and platform reasoning is compressed, never dropped. Every public item keeps its one-line summary.

docs/agents/vendored-skills.md forbids running /no-comments in this repository, so this pass did not apply that skill's own rules. Candidates came from a script that lists every comment block. Each edit was then held to docs/agents/comments.md. No code fix from the pass landed here. Each one is a follow-up issue below.

The pass's report

  • Deletion count: 133 comment lines net (2660 to 2527), plus 1 trailing comment in action_log. The diff is 296 insertions and 429 deletions.
  • Restored:
    • The sh recipe on measure_the_reply_contract_failure_rate. docs/harness.md points readers at that doc comment for the command and the FIDGET_BENCH_* knobs.
    • On the same test, the clause saying the run reports how much of its prose quoted a sample line back. The run still prints that number. Architect review asked for it back.
  • Moved: the Harness ordering note in main's setup now sits directly above harness::attach. It used to sit above PendingAsks, about 20 lines earlier. Architect review asked for the move.
  • Reruns: none.
  • Architect sketch: none needed.
  • Fixes: none in this PR, by No comments: Rust app: main, model, frame loop and logs #1599's comments-only rule. Each is filed below.
  • Encoding offers: two constraint comments stay in this PR, compressed, with their encodings filed:
  • Unenforced constraints:
    • The two above, until those issues land.
    • The Harness-before-director_settings ordering in main's setup. Make director_settings uncallable before harness::attach #1659 already tracks it, so no new issue was filed.
    • menu::build must run on the main thread. The objects it returns are not Send, which stops them from leaving that thread, so no encoding was offered.
  • Kept over 3 lines:
    • //! module headers, which are exempt.
    • TURN_CEILING (4 lines) and THINK_CEILING (6 lines), bounds that would look arbitrary without their reasoning.
    • ponytail: markers on the per-Instance model calls in main, on Streamed::Cut, on sample_lines and on quoted_sample_line.
    • The benchmark recipe on measure_the_reply_contract_failure_rate, which docs/harness.md points to.
  • Dropped candidates:
    • action_log's "Format JSON to string before writing to avoid serde_json Display issues". It is vague, but it names a reason I could not confirm or rule out, so it stays as written.
    • Em dashes inside comments the pass did not otherwise touch. Rewriting them alone would only add noise to the diff.

Follow-up issues (sub-issues of #1599)

How to verify

  • Comments only: the script below strips full-line comments, trailing // comments outside string literals, and blank lines. Every edited file then matches origin/main. A negative test that added const X: u8 = 1; to tray.rs was flagged BAD.
  • Scope: every edited path is one of the 15 files No comments: Rust app: main, model, frame loop and logs #1599 names. The same script checks this.
  • On Linux:
    • cargo fmt --all --check is clean.
    • cargo clippy --workspace --all-targets -- -D warnings is clean.
    • pre-commit run --files <the 8 files> is green, including ast-grep comment-blocks and codespell.
    • cargo test -p fidget reports 938 passed, 5 failed and 3 ignored. Three of the failures need a Secret Service (secrets::tests::linux_secret_service::*) and one needs a display (platform::tests::public_double_click_interval_is_cached_and_resolved). harness::tests::probe_timeout failed under the full parallel run and passes alone. None of the failing code is touched here.
Proof script output
ok  scope=yes code-identical=yes src-tauri/src/action_log.rs
ok  scope=yes code-identical=yes src-tauri/src/chat_surface.rs
ok  scope=yes code-identical=yes src-tauri/src/frame_loop.rs
ok  scope=yes code-identical=yes src-tauri/src/main.rs
ok  scope=yes code-identical=yes src-tauri/src/model.rs
ok  scope=yes code-identical=yes src-tauri/src/pill_focus.rs
ok  scope=yes code-identical=yes src-tauri/src/process_log.rs
ok  scope=yes code-identical=yes src-tauri/src/session_log.rs
8 files changed, all comment-only and in scope

Closes #1599

— Cursor agent (Coder), on @omesser's behalf.

omesser

This comment was marked as outdated.

@omesser omesser left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Soft CLEARED

Tip: 92801a0c

What changed

  • Bench doc: measure_the_reply_contract_failure_rate again says the run reports how much of its prose quoted a sample line back.
  • Harness order note: moved from above PendingAsks to directly above the harness::attach call it describes.

What is wrong
Nothing blocking. Both non-blocking notes from the last review are resolved.

Soft-FIX
None.

Verified: the push touches only comments in main.rs and model.rs, and harness::attach still runs before director_settings and config_from, as the note says.

— Cursor agent (Architect), on @omesser's behalf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No comments: Rust app: main, model, frame loop and logs

2 participants