Skip to content

chore: clean up code comments and hand-written docs - #1092

Draft
isadeks wants to merge 3 commits into
mainfrom
chore/comment-doc-cleanup
Draft

isadeks wants to merge 3 commits into
mainfrom
chore/comment-doc-cleanup

Conversation

@isadeks

@isadeks isadeks commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Removes about 50,000 lines of code comments (net) and restyles the hand-written docs. No code changes.

This is a draft for discussion. It has no approved issue yet, which ADR-003 requires before it can leave draft.

Area

  • cdk — infrastructure, handlers, constructs
  • agent — Python runtime / Docker image
  • cli — bgagent client
  • docs — guides or design sources (docs/guides/, docs/design/)
  • tooling — root mise.toml, scripts, CI workflows

Also web.

Related

None yet.

Changes

The three commits can be reviewed separately.

1. chore: remove comments that restate code, history and rationale (968 files, 54,267 lines deleted, 3,931 added)

  • Deleted: comments that narrate the code, record how it got this way, or argue for its design. Also section banners and commented-out code.
  • Kept: licence headers, tool directives (eslint-disable, noqa, nosemgrep, pinned-action versions), doc comments that state a public contract, and issue or ADR references that state a constraint. Kept comments were cut down to that fact.

2. docs: edit hand-written docs for plain technical style (171 files, of which 79 are regenerated Starlight mirrors)

  • Sentence-level rewrite of the guides, design docs, ADRs, READMEs and AGENTS.md files: one idea per sentence, active voice, no dashes as punctuation.
  • Headings, fenced code blocks, link targets and table shapes are unchanged, so anchors still resolve.
  • file:line citations that the comment removal moved now point at the right lines. The research doc and the two verification runbooks keep their numbers, because they are pinned to a past commit.
  • Accepted ADRs record the rewording in Last-updated and ## Changelog, as docs/decisions/README.md requires.

3. chore: keep comments that state facts about outside systems (293 files, 801 lines added)

  • Commit 1 was too strict in one way: it removed facts about AWS services, GitHub, Linear, Jira, Slack, the Claude CLI, libraries and tools when the fact could not be re-proven from inside the repository. This commit puts 566 of them back, each as one or two lines at the code it explains.

Not touched: generated files, lockfiles, fixtures, snapshots, the accepted-finding ledgers, licence files, and the prompt files under .abca/commands/ and docs/abca-plugin/.

How the "no code changes" claim was checked

Every changed code file was compared with its version on main after comments were stripped:

  • TypeScript and JavaScript: the compiler's printer output without comments is identical.
  • Python: the AST without docstrings is identical.
  • YAML and TOML: the parsed data is identical.
  • Shell and Dockerfiles: the non-comment lines are identical.

Two files differ only in whitespace between JSX children, where a JSX comment was removed. ruff format and eslint --fix adjusted whitespace where a removed comment had left it. A second, independent comparison of all Python, TypeScript and JavaScript files found no code change.

mise run build, mise run lint and mise run security:sast:masking pass, with the same test totals as main (cdk 9,596, cli 1,684, agent 3,275, web 555).

What a reviewer should weigh

  • CodeQL shows two alerts as new. Both exist on main. They are alert 32 (clear-text logging in scripts/orchestration_debug.py, open) and alert 42 (password hash in linear-oauth-resolver.ts, dismissed as a false positive). CodeQL says it could not attribute alerts because the change is too large. They need to be dismissed on this PR.
  • Information loss. Many deleted comments stated a rule that nothing else enforces, such as "keep in sync with X" or "do not reorder". About 2,000 of these were recorded during the cleanup, along with about 1,800 places where a rename, a type or an extracted function would make the removed comment unnecessary. None of that follow-up is in this PR. The list is available on request.
  • Docs meaning. The rewrite was fact-checked in repeated passes until a pass found nothing to repair, and 147 meaning changes were repaired on the way. That is evidence, not proof. The docs most worth a human read are the ADRs and the setup guides.
  • AGENTS.md files were restyled too. Every rule and its force (always, never, ask first) was kept, but these files steer coding agents, so their wording deserves a look.
  • Stale statements found, not fixed. The fact checks flagged about 300 doc statements that look wrong or out of date against the code. They were left as written, because this PR does not change what the docs say.

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

Delete comments from the code and configuration that narrate the code,
record how it got this way, or argue for its design. Keep licence
headers, tool directives, public API contracts, facts about outside
services, and issue or ADR references that state a constraint.

No code changes. Each changed file was compared with its previous
version after comments were stripped: the TypeScript printer output,
the Python AST without docstrings, and the parsed YAML and TOML data
are identical. The formatter and ESLint --fix adjusted whitespace where
a removed comment had left it.
Rewrite sentences in the guides, design docs, ADRs, READMEs and
AGENTS.md files: one idea per sentence, active voice, no dashes as
punctuation, one name per thing. Meaning is unchanged. Headings, code
blocks, link targets and tables keep their shape.

Also:
- re-point file:line citations that the comment removal moved;
- correct three statements about code comments that no longer exist;
- record the rewording in Last-updated and the Changelog of the
  accepted ADRs, as docs/decisions/README.md requires;
- regenerate the Starlight mirrors.
Put back 566 short comments that the cleanup removed although they
state something the code cannot: how an AWS service, GitHub, Linear,
Jira, Slack, the Claude CLI, a library or a tool behaves, and the
issue or vendor reference that goes with it. Each is one or two lines
at the code it explains. Rationale about our own design stays removed.

Comments only. Doc citations that the restored lines moved are
renumbered.

This branch has not been deployed

No deployments
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