Skip to content

Spec 013 T023 done: search and service in TypeScript, and no plain JS left in tools/ - #652

Merged
adamjohnwright merged 1 commit into
mainfrom
spec013/t023-content-6
Oct 24, 2026
Merged

adamjohnwright merged 1 commit into
mainfrom
spec013/t023-content-6

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Spec 013, T023: the last batch. Batch 6 was #651. This completes T023.

What changed. Three specs are converted: tools/content-node's search and service specs (service is the largest, at 2,215 lines) and the library-update spec. They held 252 errors with checkJs on. Each is now a typed .ts spec, held at zero on both counts.

search:

  • The stand-in Solr's answer is typed as (request, form, response).
  • The queue tests' held responses and settled answers are typed.
  • An extended collation is passed as a value rather than as a literal, which its type would refuse.

service:

  • Strict helpers: endpoints, answers and the error envelope are read through helpers that throw where the old reads crashed. These cover the declared normalisation, an answer's envelope, a node's children and parents, and the nth item.
  • Graph rows: rows that lack a property are passed as rows, and the code says so.
  • Fakes: the ones standing in for an Express request and response are each cast once, naming the fields the code reads.
  • Java-shaped tables are typed as tuples.

No plain JS left in tools/.

  • No .mjs remains.
  • checkJs stays off, because the scripts the tools import from scripts/ and e2e/ are not part of this check.
  • So tools/load.spec.ts now fails on any plain JavaScript module added under tools/. I showed it failing on a probe file.

Checked:

  • search and service run the same 249 tests as their .mjs versions, and the library spec runs 4, all passing.
  • All 1,181 tools tests pass.
  • Types pass, and lint (1,329 warnings) and dead code (131) are unchanged.

🤖 Generated with Claude Code

… left in tools/

The last batch of the .mjs specs: tools/content-node's search and service
specs (the largest, 2,215 lines) and the library-update spec, 252 errors
with checkJs on. Each is now a .ts spec, typed and held at zero on both
counts.

- search: the stand-in Solr's answer typed as (request, form, response);
  the queue tests' held responses and settled answers typed; an extended
  collation passed as a value rather than a literal its type would refuse.
- service: endpoints, answers and the error envelope read through helpers
  that throw where the old reads crashed (the declared normalisation, an
  answer's envelope, a node's children and parents, the nth item); graph
  rows that lack a property passed as rows, saying so; the fakes standing
  in for an Express request and response cast once each, naming the fields
  the code reads; Java-shaped tables typed as tuples.

No .mjs is left in tools/. checkJs stays off, because the scripts the
tools import from scripts/ and e2e/ are not part of this check, so
tools/load.spec.ts now fails on any plain JavaScript module added under
tools/ (shown failing on a probe file). T023 is complete.

Same 249 tests as the .mjs versions of search and service, and 4 for the
library spec, all passing; all 1,181 tools tests pass; types, lint (1,329)
and dead code (131) unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 1280eed into main Oct 24, 2026
7 checks passed
@adamjohnwright
adamjohnwright deleted the spec013/t023-content-6 branch October 24, 2026 04:49
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