Skip to content

Sweep comments to the load-bearing minimum - #5

Merged
lesnik512 merged 1 commit into
mainfrom
comment-sweep
Aug 21, 2026
Merged

Sweep comments to the load-bearing minimum#5
lesnik512 merged 1 commit into
mainfrom
comment-sweep

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Applies one rule repo-wide: no comment unless the code would read as a bug
without it, and then a single line.
Rationale moves to architecture/ and
planning/changes/, which is where this repo already keeps it.

Full write-up in
planning/changes/2026-08-21.04-comment-sweep.md.

Numbers

before after
app/ 127 19
tests/ 54 5
migrations/ (authored) 6 1

Alembic's 16 # ### autogenerate markers stay — they come from the renderer,
not our template, so deleting them restarts the fight on every migration.
# revision identifiers, used by Alembic. did come from our
migrations/script.py.mako, so it is gone at the source as well as from the
four existing files.

What survives

The whole permitted category, and nothing else:

  • a setting that reads as arbitrary or inert — join_transaction_mode,
    populate_existing, capture_parameters=False, path_separator
  • orm.foreign() on a column carrying no ForeignKey
  • a return from inside an async with self.transaction: block
  • discarded work that is not dead code — AuthenticateUserUseCase hashing a
    password for an unknown username
  • an import kept only for its side effect

What went, and where it went

Most of the deleted prose duplicated architecture/*.md verbatim — the
Transaction.__aexit__ hazard was written out three times in app/use_cases/
and once more in chats.md. Most test comments explained what the test proved,
which is the test name's job: test_non_author_member_cannot_edit_message
carried # bob is a member of the chat but not the author.

Every block was grepped against architecture/ before deletion. One gap turned
up and was filled rather than dropped: service_debug's echo/echo_pool log
bound parameters including password_hash on every registration. That had no
doc home and now sits in architecture/auth.md beside the
capture_parameters=False note it parallels.

CLAUDE.md states the rule and enumerates the permitted category, and its one
pointer at a source comment (orm.DeclarativeBase.metadata) now carries the
reason inline instead.

Verification

  • just test — 109 passed, 100% coverage.
  • just test-migrations — 4 passed.
  • just lint, just check-planning — clean.

The suites are the check that matters: this change removes no code, so green
means every deletion was in fact a comment.

One rule applied repo-wide: no comment unless the code would read as a bug
without it, and then a single line. Rationale moves to architecture/ and
planning/changes/, which is where this repo already keeps it.

Authored comment lines go from 203 to 25 - app/ 127 to 19, tests/ 54 to 5,
migrations/ 6 to 1. Most of what went duplicated architecture/*.md verbatim;
the Transaction.__aexit__ hazard alone was written out three times in
app/use_cases/ and once more in chats.md. Most test comments explained what
the test proved, which the test name already did.

Each block was checked against architecture/ before deletion. One gap turned
up and is now documented rather than dropped: service_debug's echo/echo_pool
log bound parameters including password_hash, which had no doc home and now
sits in architecture/auth.md beside the capture_parameters=False note.

# revision identifiers came from our own script.py.mako, so it is gone at the
source as well as from the four existing migrations. Alembic's # ###
autogenerate markers stay - the renderer reintroduces them every time.

CLAUDE.md now states the rule and enumerates what may keep a comment.
@lesnik512
lesnik512 merged commit 7359e2a into main Aug 21, 2026
3 checks passed
@lesnik512
lesnik512 deleted the comment-sweep branch August 21, 2026 19:23
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