Skip to content

Review all AI-authored code comments critically, with intent to remove them - #194

Merged
emartynov merged 1 commit into
mainfrom
feature/issue-169-comment-sweep
Aug 28, 2026
Merged

Review all AI-authored code comments critically, with intent to remove them#194
emartynov merged 1 commit into
mainfrom
feature/issue-169-comment-sweep

Conversation

@emartynov

Copy link
Copy Markdown
Contributor

Sweeps every non-KDoc comment in the repository against the standard from #169: a comment survives only if it states a constraint or non-obvious fact the code itself cannot express. Everything that narrates the next line, justifies why a past change was correct, records what the code used to be, or restates adjacent KDoc is gone.

What was removed

CountryCodesTest.kt (the #168 traces the issue names) — the "unlike the array view it replaced" and "what an Array.asList() would have allowed" history narration, the indexOf contract restatement, the ISO 13616 cap rationale (already the KDoc on LONGEST_IBAN_LENGTH_ISO_13616), the cross-check explanation, the lastUpdateDate midnight-UTC block (already the KDoc on CountryCodes.lastUpdateDate, contract wording included) and the "getter re-parses on every call" note.

IbanTest.kt (the #167 trace) — the parse-versus-invoke block duplicated from the KDoc on Iban.parse, the String-versus-CharSequence asymmetry block duplicated from the KDoc on String.toIban, the PUBLICATION lazy-mode block duplicated from the KDoc on Iban.pretty, the "#137 used to parse" and "used to slip past the one-arg calculateCheckDigits" history, and seven comments restating the test name or the assertion below them.

Modulo97Test.kt, RejectionTest.kt, IbanAliasTest.kt — data-table labels and rationale restating the test names, plus the "these used to be accepted" note whose fact is already on Modulo97.transform.

Modulo97.kt, Iban.kt — "Process the string of 9 digits at a time as integers" (the chunked(9) says it), the boundary-order narration in validate, and "The elvis is what keeps this total."

.github/workflows/gradle.yml — three comments trimmed to their constraint, dropping the "which is what renamed every check when id was introduced", "Nothing on push or pull request did either before" and "a green run used to report nothing but BUILD SUCCESSFUL" clauses.

What was kept, and why

  • IbanTest.kt: the private-constructor-wins-over-invoke resolution trap, and the case-bit rationale that explains why @, [, `, {, /, : are the punctuation tested.
  • RejectionTest.kt: the sealed-hierarchy when note — without it the exhaustiveness guard reads as a map waiting to be simplified away.
  • IbanAliasTest.kt: the typealias generates no separate class, which is why identity and not value equality is asserted.
  • Iban.kt: the ordering constraint on the invalid-character scan, the two-arg Modulo97.calculateCheckDigits note at the compose call site, the all-upper-case early return, and the ofValidated-not-Iban(...) traps.
  • The build scripts, the remaining workflow comments and scripts/: operational constraints (why consumption-probe is a build of its own, why mavenLocal() is exclusive, why annotate_only, why the emulator lookup is lazy) rather than change narration.

No load-bearing fact was dropped without a home: each removal above either duplicated KDoc that already states the fact, or restated the test name directly above it.

Verification

./gradlew ktfmtCheck jvmTest apiCheck — BUILD SUCCESSFUL (:library:jvmTest, :library:jvmApiCheck, :library:klibApiCheck all ran). No API dump churn, as expected for a comment-only change. Apple-target and Android-specific tasks were not run here (no Xcode or Android SDK in this sandbox, per CLAUDE.md); nothing in this diff is compiled code, so the full matrix on CI is the remaining check.

Closes #169


Generated by Claude Code

Sweep the repository's comments against the standard that a comment
survives only when it states a constraint or non-obvious fact the code
cannot express. Removed are comments that narrate what the next line
does, justify why a past change was correct, describe what the code used
to be, or restate adjacent KDoc.

The facts worth keeping already live where a reader looks for them: the
midnight-UTC encoding of lastUpdateDate is in its KDoc, the
String-versus-CharSequence asymmetry is on String.toIban, the
PUBLICATION lazy mode is on Iban.pretty, the ISO 13616 maximum is on the
test constant that carries it, and the two-arg
Modulo97.calculateCheckDigits constraint is at the call site in
Iban.compose.

Kept: the private-constructor-versus-invoke resolution trap in IbanTest,
the case-bit rationale behind the punctuation boundary cases, the
sealed-hierarchy exhaustiveness `when` in RejectionTest, the typealias
class-identity note in IbanAliasTest, and the build and workflow
comments that state operational constraints. Three workflow comments
were trimmed to their constraint, dropping the history clause.

Comment-only change: no production behaviour, no public API and no test
assertions were touched.

Co-Authored-By: Claude  <noreply@anthropic.com>
@emartynov
emartynov merged commit ad90b1f into main Aug 28, 2026
21 checks passed
@emartynov
emartynov deleted the feature/issue-169-comment-sweep branch August 28, 2026 16:11
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.

Review all AI-authored code comments critically, with intent to remove them

2 participants