Skip to content

chore: fix stale code comments, dead test patterns, and docs claims - #2190

Merged
rdimitrov merged 2 commits into
mainfrom
chore/stale-comments-sweep
Oct 8, 2026
Merged

rdimitrov merged 2 commits into
mainfrom
chore/stale-comments-sweep

Conversation

@rdimitrov

Copy link
Copy Markdown
Member

Summary

Follow-up to #2157, #2169, and #2187. A verification pass after those merged found code comments that still contradict the code, CI patterns that name tests that don't exist, and a few docs inaccuracies. Stale comments were the biggest remaining source of wrong answers in headless agent runs, so this fixes them.

Commit 1: targeted fixes

Comments that contradicted the code

  • server/service.go relayEvent: said seven log-only kinds are not relayed, including the two authorization events. The code relays both; five kinds are log-only.
  • server/service.go CreateSessionWithMCP / CreateSessionWithProfile: no-spec sessions can still get a per-session engine (MCP broker, learned skills); SessionEngineWithTools also satisfies the factory check; the error text was wrong.
  • server/schedule_manager.go: claimed Singleton=false from the wire is honored. It is always overridden to true.
  • server/doc.go: Converse also accepts a first Retry frame and CancelChild/Steer/SteerCancel controls.
  • server/errors.go: ErrChildNotFound already covers parallel branches, team members, and shell jobs.
  • cmd/mecatui/embed/embed.go: the import-boundary claim was wrong (ui reaches grpc/contracts through client and customization).
  • internal/app/slots.go: "three" call slots are six.

Behavior and tooling

  • logSlotConfigFacts skipped the reflection slot, so a mistyped reflection binding never warned at Build. Added it, with a regression test.
  • Taskfile.yml fuzzed FuzzReadOnlyBash, which no longer exists. go test -fuzz printed a warning and exited 0, so the shell read-only fuzzer silently never ran. Now FuzzReadOnlyShell.
  • ci.yml and Taskfile.yml -run patterns named TestInvariant_ProviderSetupFollowup_TerminalCancellationAndSecretSafety and TestMicroVMDefaultPlacementUsesNormalCreateSessionAndExactReattach, neither of which exists. They now point at the tests that cover those contracts.
  • scripts/server-cli-reference.py: the CLI wraps its own help text, so a long checkout path split across lines and leaked into server-cli.md. Path substitution now tolerates the wrap.

Docs

  • api-surface.md / architecture.md: five log-only relay kinds, not three.
  • providers.md: the slot table restated config keys; replaced with the design points and a link to the model-routing page.
  • docs/README.md: "What goes where" lists docs/examples/ and .claude/agents/.
  • Drafts drop their Status: lines; the drafts index already marks them non-current.
  • The panel-review skill pointed at docs/adr/; it now points at the architecture chapters.

Commit 2: history sweep (comment-only)

Removes delivery provenance ("cloud-native Phase N", "Wave 6a", slice tags, ADR citations, "previously / no longer / for now / once X lands") across 270+ Go files, rewritten as present-tense behavior. Issue references stay. Stage names the code itself uses (dispatch's read-batch phases, catalog "Phase A", hook phases) stay.

The sweep also corrected comments that made false behavioral claims, including:

  • the ModelSlots doc: project-tier rebinding exists, eight call slots, and plan defaults to reasoning
  • SchedulerEnabled's default
  • approval replay on the memstore path
  • TrustRemembered, documented as "never produced" but produced
  • schedule-overlay create and the mecatui keymap/caps wiring, described as unbuilt but built
  • skillfs IncludeProjectTier, said to default to true but passed through unchanged
  • the permstore durability note

A token-level comparison of every changed Go file against its parent shows no non-comment changes. user-docs/reference/configuration.md is regenerated from the edited permconfig/schema.go comments.

Not in this PR

  • docs/architecture/mecatl.modelith.yaml still cites ADR 0022/0030/0038. Fixing it needs task docs:model with a private modelith revision.
  • The microVM unsupported_platform string still says "Linux amd64 with KVM" only.
  • Review-provenance labels ("MUST-FIX N", "AC2.1") are left in place.

Test plan

  • task docs: 0 broken links, anchors, orphans, or unreachable pages
  • task generate: only the expected configuration.md / skeleton regeneration
  • task lint: 0 issues across all modules
  • TestLogSlotConfigFactsCoversReflection fails before the fix and passes after
  • task fuzz target FuzzReadOnlyShell runs; the renamed -run patterns match and pass
  • go run ./cmd/mecademo shows tool call, permission ask/approval, and result
  • Comment-only check over all changed Go files in the sweep commit
  • task test:race on macOS: 173 packages pass. Every failure also fails on the parent commit (37583f5a7) in the same environment (microVM, path-symlink, and kind-qualification tests), or passes when rerun alone (load flakes in agenthook and environment/microvm). This branch adds no new failures.

🤖 Generated with Claude Code

rdimitrov and others added 2 commits October 8, 2026 13:21
- Correct server comments that contradicted the code: relayEvent's log-only
  kinds, CreateSessionWithMCP/WithProfile engine selection, the schedule
  singleton default, Converse frames, ErrChildNotFound coverage.
- Correct the mecatui embed import-boundary comment and slot counts.
- Narrate the reflection model slot at Build like the other call-slots.
- Point CI/Taskfile -run/-fuzz patterns at tests that exist; FuzzReadOnlyBash
  matched nothing and silently skipped fuzzing.
- Keep long checkout paths out of the generated server CLI reference.
- Docs: five log-only relay kinds, slot table replaced by a link, docs/README
  lists examples/ and .claude/agents/, drafts drop Status headers,
  panel-review skill stops pointing at docs/adr/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Remove delivery-history provenance from comments across engine/, internal/,
cmd/, provider/, and e2e/: milestone tags ("cloud-native Phase N", "Wave 6a",
"S3"), ADR citations, and "previously / no longer / for now / once X lands"
wording, rewritten as present-tense behavior. Issue references stay.

The sweep also corrects comments whose behavioral claims the code
contradicts, e.g. the ModelSlots doc (project-tier rebinding, slot count,
plan's reasoning default), SchedulerEnabled's default, approval replay on the
memstore path, the TrustRemembered state, schedule-overlay create support,
the mecatui keymap and caps wiring, the permstore durability note, and the
skillfs IncludeProjectTier default.

Comment-only: a token-level comparison of every changed Go file against the
parent commit shows no non-comment changes. The configuration reference is
regenerated from the edited schema comments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rdimitrov
rdimitrov merged commit c4770e1 into main Oct 8, 2026
67 of 68 checks passed
@rdimitrov
rdimitrov deleted the chore/stale-comments-sweep branch October 8, 2026 11:56
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Oct 13, 2026
2 tasks

This branch was successfully deployed

1 active deployment
Preview — 162f1659 Deployed Oct 8, 2026 by vercel[bot]
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