fix(core): PHASE2_IMPLEMENTATION.md imports from the root barrel, not an undeclared subpath - #16205
Merged
zhuangjianguo merged 1 commit intoSep 6, 2026
Conversation
… an undeclared subpath
`packages/core/PHASE2_IMPLEMENTATION.md` sections 4 and 5 told readers to write
`import { … } from '@objectstack/core/security'`. `packages/core/package.json`
declares exactly two `exports` entries, `.` and `./logger`, with no `./security`
and no wildcard, so that specifier resolves for no consumer of the published
package. Measured live at this head:
ERR_PACKAGE_PATH_NOT_EXPORTED - Package subpath './security' is not defined
by "exports" in packages/core/package.json
with `@objectstack/core/logger` resolving on the same command as the control.
Both classes are real and both are exported from the ROOT barrel, reached by
`export * from './security/index.js'` in `packages/core/src/index.ts`. So the
symbols exist and only the path is wrong. Both lines now name `@objectstack/core`.
Verified against the built root entry that the repaired specifier is true:
`PluginPermissionManager` and `PluginSandboxRuntime` are both declared in
`dist/index.d.ts` and both load from `dist/index.cjs`, with the retired
`PluginSecurityScanner` absent as the negative control and `PluginHealthMonitor`
present as the positive one.
No contract change: `packages/core/package.json` is untouched. Adding a
`./security` entry would widen the published surface on no evidence of demand
and remains the maintainer's call.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
Contributor
📓 Docs Drift Check
What this run could not see
Coarse fallback — 24 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
This was referenced Sep 6, 2026
Contributor
Author
|
Backlinks for the two things this PR reports but does not change, both filed unassigned and ungraded:
Generated by Claude Code |
zhuangjianguo
marked this pull request as ready for review
September 6, 2026 07:02
zhuangjianguo
enabled auto-merge
September 6, 2026 07:02
zhuangjianguo
deleted the
claude/issue-15931-phase2-doc-root-barrel-import
branch
September 6, 2026 07:31
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.
Fixes #15931
Route (2) of the two the card names, as ruled at dispatch: repoint the document at the root barrel.
packages/core/package.jsonis untouched — no./securityexportsentry, nofileschange. Widening the published surface to make a document true stays the maintainer's call and this PR does not foreclose it.The defect, measured live at this head
packages/core/PHASE2_IMPLEMENTATION.mdsections 4 and 5 told readers to writefrom '@objectstack/core/security'. That subpath is declared in noexportsentry, so it is refused outright rather than merely untyped:The control fires on the same command and scope, so the refusal is a reading and not a broken probe.
exportskeys re-derived on this tree: exactly['.', './logger'], no wildcard.files:['dist','README.md','CHANGELOG.md'].The repair, and the proof it is true
Both lines now name
@objectstack/core. Both classes are exported from the root barrel viaexport * from './security/index.js'inpackages/core/src/index.ts, and the repaired specifier was checked against the built root entry rather than against the source:PluginPermissionManagerPluginSandboxRuntimePluginSecurityScanner(retired)PluginHealthMonitordist/index.d.ts(the.typestarget)declare class@ 1577declare class@ 1680dist/index.cjs(the.requiretarget)functionfunctionundefinedfunctionBoth controls fire in the direction they should, so neither column is a vacuous read.
Counted, not eyeballed
Occurrences of the bad specifier over the whole document before editing: 2, at lines 161 and 219 — the card's arithmetic holds and its line numbers are exact, not stale. Firing control on the same command and file:
@objectstack/corewithout the/securitytail counted 5. After the edit: 0 bad, and the two repaired lines join the four that already named the root barrel.Repo-wide, the import-statement shape
from '@objectstack/core/security'existed in exactly these 2 places plus one prose row indocs/qa/platform-checklist/FOLLOW-UPS.mdthat describes this very defect (control on the same command and scope: the same shape on the real./loggersubpath returns 2 files). The other 14 files carrying the string carry it as prose, changelog history, or a@moduletag — none is an import instruction. Everyfrom '@objectstack/...'specifier in this document was swept: only two distinct ones exist,@objectstack/core(now 6) and the repaired subpath (now 0).Two prose notes that this PR makes stale — flagged, deliberately not edited
Both describe the residue as still present, and both stop being true when this lands. They are named here rather than fixed, because neither repair is mechanically pinned and one of them sits in a test file whose suite this diff otherwise does not touch:
docs/qa/platform-checklist/FOLLOW-UPS.md— "sections 4 and 5 still tell readers toimport … from '@objectstack/core/security'… Deliberately left".packages/core/src/security/security-scanner-retirement.pin.test.ts— a comment reading "PHASE2_IMPLEMENTATION.mdsections 4 and 5 still teach it; filed separately". No assertion in that file reads the document, so nothing there goes red.Contract and publishing
Clause-②: no — re-derived from this diff, not predicted. The diff is one markdown file that reaches no published artefact: untouched text from the document appears in 0 files under
packages/core/dist/, while three firing controls on the same command and scope reach 6, 6 and 4 dist files — the third taken from a source comment, which proves sourcemapsourcesContentwas inside the compared set and the zero is not a scope artefact.npm pack --dry-runoverpackages/corelists 16 files;PHASE2_IMPLEMENTATION.mdis not among them, while the controlsREADME.mdanddist/index.d.tsare. No accept set moves, no exported symbol moves.No changeset,
skip-changesetlabel instead — measured by that samenpm packreading rather than assumed: this diff publishes nothing from any released package.Gates
All 36 families derived by
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(derived from the real change set, not from a hand-written list) were run, 36/36 green, on the final commit9b833a084against a clean tree — exit codes captured by redirect-then-read, never through a pipe. The family was not narrowed for being markdown:check:system-context-censusand the other anchor/census families were run in full, and separately noPHASE2_IMPLEMENTATION.md:LINEanchor exists anywhere in the tree (0 hits, with a firing control proving 45 files underdocs/do carryPATH:LINEanchors). The diff changes no line count regardless: 375 lines before and after.Two of the 36 first returned
PREREQUISITE NOT MET(exit 3, which is not a red and not a pass); a fullpnpm build— 72/72 tasks — was run under the shared verify lock and both were re-run to a real green:check:dual-build-cjs-loadsover 103 entries / 66 packages / 619 CJS files, andcheck:dts-closureover 72 built packages with@objectstack/corein the swept set.check:published-readme-exportswas also run to a real green over its full population — 60 published documents across 79 workspace packages — and confirms the card's account of why no gate saw this:PHASE2_IMPLEMENTATION.mdis not one of the 60, becausepackages/coredoes not publish it.Generated by Claude Code