Skip to content

feat(core): publish an ./extraction subpath — html→markdown for the SD7 capture seam - #581

Merged
KnockOutEZ merged 1 commit into
studio-handoff-corefrom
sd-402-feat-core-publish-an-extraction
Sep 3, 2026
Merged

feat(core): publish an ./extraction subpath — html→markdown for the SD7 capture seam#581
KnockOutEZ merged 1 commit into
studio-handoff-corefrom
sd-402-feat-core-publish-an-extraction

Conversation

@KnockOutEZ

Copy link
Copy Markdown
Owner

Closes #402.

What changed

wigolo/extraction is now a published subpath carrying exactly two names:

  • htmlToMarkdown (src/extraction/markdown.ts)
  • extractMetadata (src/extraction/metadata.ts)

The full extraction graph already shipped in dist/, but no legal specifier reached
any of it — 16 subpaths, no wildcard, and none of them re-exporting a markdown symbol.
SD7's capture-on-settle seam (wigolo-studio-run#365, packages/studio-core) has the
page's HTML from SessionDrive.readCurrentPage() and no way to turn it into the
markdown body recordVisit stores.

Two named functions rather than pipeline.ts: the seam runs on the navigation path in
the DB-owning child, so the provider/registry graph — and a native module with it —
must not arrive there for a string conversion. src/extraction/index.ts is the barrel;
markdown.ts pulls turndown + lang-hints, metadata.ts pulls linkedom, and nothing
else.

Zero behaviour change: two export lines, one exports entry, one test entry.

Verification (local; CI deferred — quota)

  • npm test — 934 files, 11,543 passed / 20 skipped / 7 todo, 0 failed
  • npx tsc --noEmit — clean
  • npm run gate:studio — green (tests/ type-check debt holds at baseline 341)
  • npm run build — clean; dist/extraction/index.{js,d.ts} emitted

The exports pin grows the subpath with both halves the A4 rule demands (declared target

  • a real import() in a child Node process), and with an EMPTY types set — a pin, not
    an omission, so the pipeline's types cannot arrive later without a measured import site.

Mutations run and restored byte-identical:

  • drop extractMetadata from the barrel → reds the runtime probe AND the .d.ts pin
    (expected [ 'htmlToMarkdown' ] to deeply equal [ 'extractMetadata', 'htmlToMarkdown' ])
  • point the exports entry at a path that is not on disk → reds the declared-target arm
    and fails the real import() (ERR_MODULE_NOT_FOUND), which is the exact lie a
    resolve-only probe would have told

Fresh install of built core (npm pack → clean dir):

17 subpaths: . ./types ./companion-broker ./cache/db ./config ./account ./companion
./companion-contract ./security ./fetch-tiers ./extraction ./cache ./cache/library
./embedding-queue ./search-tokens ./logger ./daemon

wigolo/extraction keys: [ 'extractMetadata', 'htmlToMarkdown' ]
markdown: "# Hi\n\na [link](https://x.dev)"
title: "Settled page"

Territory

lane-extra: package.json and tests/unit/package-exports.test.ts — a subpath cannot
be published without the exports map, and the pin for it is an exact list that travels
with that map. Both are named in the issue's own files hint; same pair as
wigolo-studio-run#363/#370.

CI deferred — quota.

…actMetadata

The SD7 capture seam has to turn a settled page into the markdown body
recordVisit stores, and the extraction graph shipped in dist/ with no legal
specifier reaching any of it — no subpath, no wildcard, and no other published
barrel re-exporting a markdown symbol.

Two named functions rather than pipeline.ts: the seam runs on the navigation
path in the DB-owning child, so pulling the provider/registry graph (and a
native module with it) onto that path to convert an HTML string it already
holds is the cost this shape avoids. The exports pin grows the subpath with an
empty type set, which is what keeps the pipeline's types from arriving later
without anyone measuring an import site for them.
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 8cd58298-d375-4e4b-8e5e-1e57c04c1453

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@KnockOutEZ
KnockOutEZ merged commit 19449a4 into studio-handoff-core Sep 3, 2026
9 of 20 checks passed
@KnockOutEZ
KnockOutEZ deleted the sd-402-feat-core-publish-an-extraction branch September 3, 2026 07:25
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