Skip to content

Replace em dashes with context-appropriate punctuation#191

Merged
platypii merged 2 commits into
masterfrom
cleanup/em-dashes
Jun 29, 2026
Merged

Replace em dashes with context-appropriate punctuation#191
platypii merged 2 commits into
masterfrom
cleanup/em-dashes

Conversation

@platypii

Copy link
Copy Markdown
Contributor

What

Removes every em dash (U+2014) from the JS source and test tree. 312 files contained ~1269 em dashes in source plus more in tests, violating the repo's no-em-dash convention.

Fixes were context-aware, not a blanket character swap:

  • Comments / JSDoc: rewritten with the punctuation the sentence actually wants (comma, colon, parentheses, sentence split, or a semicolon joining two independent clauses).
  • Runtime string values (log / CLI / error messages, and the test strings that assert them): replaced deterministically with " - " so a source string and any test asserting it stay byte-identical. This is what keeps the suite green.

Executed as a fan-out of small-model (haiku) subagents, one per batch of 6 files (52 batches), with the source-vs-string distinction baked into each agent's instructions.

Checks

  • npm test - 1485 pass, 0 fail
  • npm run lint - clean
  • npm run typecheck - clean
  • grep confirms zero remaining U+2014 in src, hypaware-core, bin, test

Note: this PR is .js only. Markdown docs (README, AGENTS.md, llp/) are intentionally out of scope.

Second of three cleanup PRs (dead code merged in #190; type-import specifiers next).

platypii added 2 commits June 29, 2026 01:30
Remove every em dash (U+2014) from the JS source and test tree (312 files),
which violated the repo's no-em-dash convention. Rather than a blanket
character swap, fixes were made in context:

- Comments and JSDoc: rewritten with the punctuation the sentence wants
  (comma, colon, parentheses, sentence split, or a semicolon between two
  independent clauses), not a mechanical hyphen.
- Runtime string values (log/CLI/error messages and the test strings that
  assert them): replaced deterministically (" - ") so source and assertions
  stay byte-identical.

Done via a fan-out of small-model subagents, one per batch of files.

Checks: npm test (1485 pass), npm run lint, npm run typecheck all green.
No em dashes remain in src, hypaware-core, bin, or test.
The em-dash cleanup collided with the @ref annotation format, whose gloss
separator was a em dash. Standardize it on a colon instead:

- Normalize all @ref glosses to `@ref LLP NNNN#anchor [relation]: gloss`,
  fixing the inconsistent separators the cleanup left (some hyphens, some
  missing) and 27 annotations where an agent misplaced the colon before the
  relation bracket or added a stray period.
- A structural check confirms every @ref LLP number, anchor, and relation is
  byte-identical to master; only the separator and gloss prose changed.
- Update the format docs to match: AGENTS.md, the ref-check skill, and
  llp/0001. Also add the no-em-dash rule to AGENTS.md Code Style and make
  AGENTS.md and the ref-check skill em-dash-free themselves.

Checks: npm test (1485 pass), lint, typecheck all green. A grammar validator
confirms all 363 @ref occurrences conform to the canonical form.
@platypii

Copy link
Copy Markdown
Contributor Author

Code review + resolution

Ran two finder passes over the diff (semantic string-change risk, and mechanical artifacts), plus follow-up validation.

Finder 1 — string-literal behavior risk: clean. Every changed string is display text (logs, CLI/stderr, error fields, tool descriptions); none are object keys, delimiters, regexes, partition labels, cache keys, or wire formats. Where a string is asserted in a test, both sides were updated together. No behavioral risk.

Finder 2 — mechanical artifacts: found one real category. 53 @ref LLP annotations had their gloss separator damaged by the automated pass (the documented @ref format used an em dash as the separator). This surfaced a convention collision, now resolved:

  • The @ref gloss separator is standardized on a colon: @ref LLP NNNN#anchor [relation]: gloss.
  • All @ref glosses normalized: fixed the inconsistent separators (some hyphens, some missing) and 27 cases where the colon landed before the relation bracket (with a stray period).
  • A structural check confirms every @ref LLP number, anchor, and relation is byte-identical to master; only the separator and gloss prose changed.
  • A grammar validator confirms all 363 @ref occurrences conform to the canonical form.
  • Docs updated to match: AGENTS.md (also gained the no-em-dash Code Style rule), the ref-check skill, and llp/0001.

No other mechanical damage (no merged words, no corrupted code, no broken JSDoc).

Checks: npm test 1485 pass, npm run lint, npm run typecheck all green; zero em dashes remain in src, hypaware-core, bin, test.

Follow-up noted (out of scope here): the broader LLP corpus still has ~936 em dashes across 43 llp/*.md files, plus ~12 in README.md. Worth a separate docs-only sweep.

@platypii
platypii merged commit 01c69b4 into master Jun 29, 2026
6 checks passed
@platypii
platypii deleted the cleanup/em-dashes branch June 29, 2026 08:59
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