feat(cli): ratify ./console as a public subpath export — the out-of-repo consumer #13123 predicted - #13662
Merged
Merged
Conversation
…-repo consumer #13123 predicted #13123 sealed the CLI behind an `exports` map, and its own body names the remedy for a consumer that was reading `dist/` paths: ratify the subpath as public surface rather than keep the deep read. That consumer exists — cloud's `objectos-runtime` node server mounts the Console SPA through the CLI's self-contained static-serve util (`resolveConsolePath` / `hasConsoleDist` / `createConsoleStaticPlugin`, fs/path only, no oclif) via what was `@objectstack/cli/dist/utils/console.js`. Under the sealed map that specifier throws ERR_PACKAGE_PATH_NOT_EXPORTED at BOTH layers: tsup's DTS build refuses (TS2307), and at runtime the consumer's defensive catch silently degrades every boot to API-only — a working deployment loses its console with nothing but a warn line. `./console` maps to exactly the module that was being consumed (`dist/utils/console.{js,d.ts}`), so the surface grows by one deliberate door, not back to "everything under dist/". check:published-files' GATED invariant stays green (the map still names real entries), and the census floor is untouched. Gates run at this head: full 71-package build, full-repo lint, check:published-files, check-empty-changeset — all exit 0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hotlong
enabled auto-merge
August 31, 2026 05:38
Contributor
📓 Docs Drift Check
What this run could not see
Coarse fallback — 23 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
This was referenced Sep 4, 2026
baozhoutao
pushed a commit
that referenced
this pull request
Sep 5, 2026
…e exports maps An `exports` map is a PACKAGING contract, and inside this monorepo nothing is sealed: every in-repo consumer reaches any file through a relative import, a vitest alias or a `paths` entry. So the repo could not observe a sealing regression at all, by construction — twice the seal 17.3.0 introduced (#13123) was found after publish, by the consumer, during an upgrade (#13662, #15325). `consumer-specifiers.ledger.json` imports that knowledge from outside: the bare specifiers named out-of-repo consumers import, each with the consumer, a date and the card that ratified it. The suite packs each ledgered package with `pnpm pack`, unpacks it into a throwaway `node_modules` outside the workspace, and resolves every specifier from there with Node's real resolver under both the `require` and `import` conditions — failing with a message that names the specifier AND the consumer it breaks. Option A of #15589 only. Option B (a changeset-gated seal declaration in `check:published-files`) is deliberately not here. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
One deliberate door in the CLI's
exportsmap:"./console"→dist/utils/console.{js,d.ts}— the self-contained static-serve util (resolveConsolePath/hasConsoleDist/createConsoleStaticPlugin+ drift-guard helpers; fs/path only, no oclif).Why
#13123 sealed the CLI behind an
exportsmap and its own body names this exact remedy for an out-of-repo consumer: ratify the subpath as public surface rather than readdist/paths. That consumer exists — cloud'sobjectos-runtimenode server mounts the Console SPA through this util, formerly via@objectstack/cli/dist/utils/console.js. Under the sealed map that specifier now fails at both layers:ERR_PACKAGE_PATH_NOT_EXPORTED, which the consumer's defensive catch turns into a silent API-only boot — a working deployment loses its console with nothing but a warn line.Duplicating the util in cloud was rejected: it is 654 lines carrying the objectui-pin drift guards (#7752) and the mount-decision policy — a fork would drift by construction.
Scope
The surface grows by ONE named door, not back to "everything under
dist/".check:published-files' GATED invariant stays green (the map names real entries); census floor untouched. Changeset:@objectstack/climinor.Gates at this head
Full 71-package build, full-repo lint,
check:published-files,check-empty-changeset— all exit 0. Cloud-side consumer verified against a locally patched checkout of this exact map: runtime resolution returns all three functions, objectos-runtime DTS builds green, and cloud's five harness suites pass.🤖 Generated with Claude Code