Skip to content

docs(sleep): name MinedBandCounts and export the referenced types so the API tier renders them - #201

Closed
laithalsaadoon wants to merge 1 commit into
mainfrom
docs/sleep-doc-shapes
Closed

laithalsaadoon wants to merge 1 commit into
mainfrom
docs/sleep-doc-shapes

Conversation

@laithalsaadoon

Copy link
Copy Markdown
Contributor

What

Type-only and doc-comment changes under packages/sleep/src so @memhtml/sleep can join the docs site's API tier brace-free. This is PR A for the sleep slice, the same shape as #170 (llm), #185 (html) and #199 (index). PR B (the starlightTypeDoc instance, a packages/sleep/README.md, an api/index.md row) follows once this is on main.

Found by running the typedoc CLI over packages/sleep/src/index.ts with the settled apps/docs options (outputFileStrategy: "modules", parametersFormat: "list", excludeExternals, disableSources), with @memhtml/html and @memhtml/index resolved from #185's and #199's source through a paths entry so only sleep's own debt shows. Before: 15 warnings, 1 MDX brace hit. After: 0 and 0.

Changes

  • phases/relationship-mining.ts: mineAllBands returned an inline { readonly mined: number; readonly deepMined: number } literal inside Effect<…>. typedoc-plugin-markdown renders a literal inside a type argument as escaped brace prose, which apps/docs/tests/figures.test.ts rejects (the one brace hit). It now returns the exported interface MinedBandCounts, re-exported through phases/index.ts and so through the package root. Same fields, same readonly-ness; the one call site (relationshipMining) is unchanged.
  • index.ts: CandidateEntityLike (consolidator.ts, reached through CandidateMemoryLike.entities) and EntityClaim (sql.ts, the row type of entityClaims) were referenced by exported signatures but not re-exported. Both are now export type members, so the API page links them instead of printing bare names.
  • Fourteen {@link} targets became code spans: eight resolve to private names (indentBody, advanceOverlap, applyMarks, reindex, SLEEP_EXCLUDED_TYPES, contradictionFinding, aliasPairs, freePath), one to a sibling package's non-exported constant (NEAR_DUPLICATE_THRESHOLD, three sites), and three to nothing: manifestRowsFor never existed under that name (the grouper is the trace-consolidation phase, so the sentence now says traceConsolidation), STANCE_CONFIDENCE_FLOOR is EDGE_CONFIDENCE_FLOOR, and isStateWriteMark is a contract.ts export that the package root does not re-export.

Why open-only

It adds public type names under packages/*/src (MinedBandCounts, and the two re-exports), which is the boundary the maintenance authority stops at. No runtime behavior changes; no test is touched.

Verification

  • typedoc CLI on the branch: 0 warnings, 0 errors; brace probe (mdxExpressions over the generated tree): 0 hits. Logs: typedoc-sleep-probe.log (before), typedoc-sleep-after.log (after) in the maintenance workspace.
  • The generated page is one 10,669-line index.md for the whole package; PR B will decide whether to split it into per-module entry points the way @memhtml/contracts is split.
  • mise run check on 2e9a838: see the gate comment below.

…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.
@laithalsaadoon

Copy link
Copy Markdown
Contributor Author

Local gate on 2e9a838: mise run check exit 0, 68/68 tasks, 206 s (2026-09-17 07:06-07:10Z). Open-only per the maintenance authority (new public type names under packages/sleep/src); left for Laith. The typedoc CLI on this head renders @memhtml/sleep with 0 warnings and 0 MDX brace hits (15 and 1 on main).

Copilot AI lite review requested due to automatic review settings September 17, 2026 07:12

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.

@laithalsaadoon
laithalsaadoon requested a lite review from Copilot September 18, 2026 07:03

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.

@laithalsaadoon
laithalsaadoon requested a lite review from Copilot September 21, 2026 07:03

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.

@laithalsaadoon

Copy link
Copy Markdown
Contributor Author

Closed in favor of #264, which consolidates the four API-tier PRs (#185 html document shapes, #186 the @memhtml/html API page, #199 index types, #201 sleep types) into one branch built by merge commits from main a1c6913. The slice conflict on apps/docs/astro.config.ts and api/index.md was resolved by appending the html block after llm; the block is byte-identical to #186's. Gate 68/68, including the docs build that writes /api/html/ and the MDX brace probe. The branch here is kept, so this PR can be reopened if the parts should land apart.

laithalsaadoon added a commit that referenced this pull request Oct 20, 2026
… @memhtml/html to it (#264)

Three type-only edits under `packages/*/src` plus the `@memhtml/html` API page. No runtime line changes: the emitted JavaScript is identical.

What changes:
- `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.
- `@memhtml/html` API page: a `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.
- `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.

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: 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. With these on main, the index API page (`/api/index/`) can follow as a docs-only slice.

One caveat: 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.

Consolidates #185, #186, #199 and #201, closed in favor of this branch. The `packages/sleep` part of the original branch no longer applies: 0.16.0 removed that package.
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