Skip to content

Refactor: cut the narrative out of the longest comments - #13

Merged
SandObserver merged 1 commit into
mainfrom
refactor/trim-comment-narratives
Aug 9, 2026
Merged

SandObserver merged 1 commit into
mainfrom
refactor/trim-comment-narratives

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Trim 13 comment blocks to the invariant and the constraint, at three sentences or fewer: scripts/is-prerelease.js, scripts/check-frontend-paths.js, scripts/bump-cache-busting.js, api/src/routes/icons.js, api/src/routes/system.js, api/src/routes/config.js, api/src/routes/badges.js, api/src/auth.js (two), api/src/widget-i18n.js, api/src/secret-scope.js, ui/js/link-url.js, ui/js/dashboard-logic.js, ui/js/admin-logic.js (two).
  • What went: the past-bug narrative, the rejected alternative, and the warning about hypothetical future edits. What stayed: what must remain true, and why the obvious change would break it.
  • Deliberately untouched: security invariants (svg-sanitize.js, widget-settings.js, widget-secrets.js, badge-headers.js), measured limits (poll-limits.js, which the project requires to be explainable), and JSDoc parameter tables such as widget-toolbox.js's poll options and badge-logic.js's typedef.

Testing
All green. No new tests: comment-only. Verified mechanically — with comments stripped and whitespace collapsed, all 13 files are byte-identical to their previous revision, so no code moved.

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.
  • CHANGELOG.md updated under Unreleased if the change is user-visible.

Thirteen blocks explained a past bug, why the obvious alternative was rejected,
and what would happen if someone changed the code, at a length that buried the
invariant a reader needed. Each is now the invariant and the constraint, in
three sentences or fewer.

Nothing about the code changed: the token streams are byte-identical with
comments stripped. Security invariants, measured limits and JSDoc parameter
tables were left alone.
@SandObserver SandObserver added the refractor Code improvement / cleanup, no behavior change label Aug 9, 2026
@SandObserver
SandObserver merged commit 3950863 into main Aug 9, 2026
4 checks passed
@SandObserver
SandObserver deleted the refactor/trim-comment-narratives branch August 9, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refractor Code improvement / cleanup, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant