Skip to content

docs(api): name the html and index shapes the API tier needs, and add @memhtml/html to it (open-only) - #264

Merged
laithalsaadoon merged 12 commits into
mainfrom
docs/api-doc-shapes
Oct 20, 2026
Merged

laithalsaadoon merged 12 commits into
mainfrom
docs/api-doc-shapes

Conversation

@laithalsaadoon

Copy link
Copy Markdown
Contributor

Open for review, not for an automatic merge: three of its four parts are type-only edits under packages/*/src, which sit outside the maintenance job's merge authority even though no runtime line changes. This PR consolidates #185, #186, #199 and #201 into one branch; those four are closed in favor of it, and their bodies keep the probe details.

What changes

Part Change From
packages/html/src/document.ts The six document shapes (MemoryMetas, MemoryLink, Facet, Citation, ArticleExtractions, MemoryDoc) become interfaces that extend typeof X.Type, so the const and the interface merge under one name and every import site compiles unchanged. #185
@memhtml/html API page A sixth starlightTypeDoc instance writes /api/html/ from the package's single import path; a new packages/html/README.md opens the page; the tier index gains a row and the sidebar a group. #186
packages/index/src type exports for five interfaces that exported signatures already reference (ArchivedMatch, EmbedMissingOptions, StoreChangedPath, StoreStatusEntry, StoreTreeEntry); IndexStateRow becomes an interface the same way as the html shapes; six {@link}s to private names become code spans. #199
packages/sleep/src mineAllBands returns the new exported interface MinedBandCounts (same fields) instead of an inline literal; CandidateEntityLike and EntityClaim are re-exported; fourteen {@link}s to private or missing names become code spans. #201

Why

typedoc expands a typeof X.Type alias inline wherever a signature uses it, and typedoc-plugin-markdown prints an inline object literal inside a type argument as escaped \{ prose, which apps/docs/tests/figures.test.ts rejects. The interfaces and named types render as links instead. Measured with the typedoc CLI when each part was opened: html went from 7 brace hits and 6 warnings to 0 and 0; index from 12 warnings and 1 hit (plus 13 hits from html's aliases) to 0 and 0; sleep from 15 warnings and 1 hit to 0 and 0.

With all four on main, the index and sleep API pages (/api/index/, /api/sleep/) can follow as docs-only slices.

One caveat to weigh

An interface does not get the implicit index signature an object-literal type alias gets, so an out-of-tree consumer that assigned a MemoryDoc or an IndexStateRow to Record<string, unknown> would stop compiling. The workspace typecheck finds no such site.

How the branch was built

Branched from main a1c6913, then merge commits of docs/html-doc-shapes, docs/index-doc-shapes and docs/sleep-doc-shapes (clean) and of docs/api-html. The last conflicted on apps/docs/astro.config.ts and apps/docs/src/content/docs/api/index.md, the usual slice conflict where two branches each append a plugin instance, a sidebar group and a table row after the llm ones. It was resolved by keeping main's file and appending #186's html block, group and row after the llm ones; the html plugin block is byte-identical to #186's.

Verified

  • mise run check on 3dd743a: 68/68 in 478 s, including the docs build that now writes /api/html/, the MDX brace probe over the generated pages, the link checks and the a11y and Lighthouse tiers.
  • Every commit on the branch is signed and verified.

…r renders them

MemoryMetas, MemoryLink, Facet, Citation, ArticleExtractions and MemoryDoc
were `export type X = typeof X.Type` aliases. TypeDoc expanded each inline
wherever a signature used it, and typedoc-plugin-markdown rendered the nested
literals as escaped braces (7 hits across metaPairs, serializeMemory and
parseMemory) that the figures probe rejects; the 6 {@link MemoryMetas.status}
references also failed to resolve against the const. As interfaces extending
the same Schema.Struct type the const and the type merge under one name, every
import site compiles unchanged, and the page renders 0 hits and 0 warnings.
Type-only; no runtime line changes. mise run check 68/68.
Sixth slice of the generated reference: one more starlightTypeDoc instance
writing api/html/ from the package's single import path, a package README
that opens the generated page and maps every exported symbol to its module,
a row in the tier index, and a sidebar group. Stacked on the document-shape
interfaces (docs/html-doc-shapes), without which the page renders seven
escaped braces.

Measured on the branch: typedoc CLI exit 0 with zero warnings and zero brace
hits, astro build exit 0, denylist scan of dist 0 files, a11y 33/33 and
Lighthouse 5 URLs x 3 runs green with /api/html/ temporarily in the gate
lists and then restored, mise run check 68/68.
…e API tier renders them

TypeDoc over packages/index/src/index.ts reported twelve warnings and one brace hit of its own
(the rest belong to @memhtml/html's aliases and go away with #185). Five interfaces were
referenced from exported signatures but not exported themselves (ArchivedMatch,
EmbedMissingOptions, StoreChangedPath, StoreStatusEntry, StoreTreeEntry): they join the
package's type exports. Six {@link}s pointed at module-private or closure-local names
(runMigrations, truncateForRebuild x4, EMBED_PERSIST_SLICE) that no reader can follow: they
become code spans. IndexStateRow was `export type X = typeof X.Type`, which TypeDoc inlines as
a literal in readIndexState's return type; as an interface extending the same Schema.Struct
type it renders as a linked reference, the pattern #185 uses for the html shapes.

Type-only and doc-comment-only; no runtime line changes. tsc and biome pass on the package.
…the API tier renders them

Type-only and doc-comment changes under packages/sleep/src, found by running the typedoc CLI over
src/index.ts with the settled apps/docs options (15 warnings, 1 MDX brace hit before; 0 and 0 after).

- `mineAllBands` returned an inline `{ mined, deepMined }` literal inside `Effect<...>`, which
  typedoc-plugin-markdown renders as escaped brace prose (the one brace hit). It now returns the
  exported interface `MinedBandCounts`, re-exported through phases/index.ts. Same shape, same fields.
- `CandidateEntityLike` (consolidator.ts) and `EntityClaim` (sql.ts) were referenced by exported
  signatures but not re-exported from index.ts; both are now `export type` members.
- Fourteen `{@link}` targets that resolve to private names, or to nothing (`manifestRowsFor` never
  existed under that name; the grouper is the trace-consolidation phase; `STANCE_CONFIDENCE_FLOOR` is
  `EDGE_CONFIDENCE_FLOOR`), are now code spans, matching the treatment in #170 and #199.

No runtime behavior changes; no test touched. Open-only: adds public type names under packages/*/src.
Copilot AI balanced review requested due to automatic review settings October 12, 2026 16:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

0.16.0 removed packages/sleep, so this merge drops the branch's edits to
its eleven files and keeps main's deletion. The html shapes, the index
type exports and the @memhtml/html API instance merge unchanged.
@laithalsaadoon

Copy link
Copy Markdown
Contributor Author

Merged main (09c9830, 0.16.0) into this branch with a merge commit (c8d232f), so the PR is mergeable again.

  • 0.16.0 removed packages/sleep, so the merge keeps main's deletion of the eleven sleep files this branch had edited. The sleep half of this PR (naming MinedBandCounts, re-exporting CandidateEntityLike and EntityClaim) no longer applies, and the next API slice will not be @memhtml/sleep.
  • What remains is 8 files against main: the six @memhtml/html document shapes named as interfaces, the @memhtml/index type exports and the IndexStateRow interface, and the @memhtml/html API instance (apps/docs/astro.config.ts, api/index.md, packages/html/README.md).
  • mise run check on the merged tree: 75/75 tasks, 232 s, including the docs build that generates /api/html/ and the brace probe over the generated pages.

Still open-only: it adds public names under packages/*/src.

@laithalsaadoon laithalsaadoon changed the title docs(api): name the html, index and sleep shapes the API tier needs, and add @memhtml/html to it (open-only) docs(api): name the html and index shapes the API tier needs, and add @memhtml/html to it (open-only) Oct 19, 2026
@laithalsaadoon

Copy link
Copy Markdown
Contributor Author

Merged main again (6708d25) with a merge commit (5f2ee3b), because #298 added the @memhtml/head API instance at the same spots this branch adds @memhtml/html.

  • apps/docs/astro.config.ts: head's instance and sidebar group stay as merged, and html's follow them unchanged.
  • apps/docs/src/content/docs/api/index.md: html's row follows head's, at the table's existing width.
  • mise run check on the merged tree: 75/75 tasks, 184 s.

Still open-only: it adds public names under packages/*/src.

…o the API doc-shapes branch

# Conflicts:
#	apps/docs/astro.config.ts
#	apps/docs/src/content/docs/api/index.md
@laithalsaadoon

Copy link
Copy Markdown
Contributor Author

Merged main (8df19f6) into this branch as 4e3fbea, a signed merge commit. Main had gained the @memhtml/telemetry API slice (#304), which conflicted with this branch on apps/docs/astro.config.ts and apps/docs/src/content/docs/api/index.md because both append after the last instance, sidebar group and table row. Both files were rebuilt from main with this branch's @memhtml/html instance, sidebar group and row appended after telemetry's. The PR's own diff against main is unchanged: the same 8 files, +99/-14. mise run check is 75/75 on 4e3fbea. This PR is still left for a maintainer, because it changes packages/html/src and packages/index/src.

…fix) into the API doc-shapes branch

Brings the branch current with main before the merge Laith approved on
2026-10-20 (bench card 63). Main gained #297 and #216 since the last
merge; none of this branch's eight files changed in that range.
@laithalsaadoon
laithalsaadoon merged commit 7859192 into main Oct 20, 2026
11 checks passed
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.

2 participants