Skip to content

test(service-settings): alias the remaining three workspace deps to source, emptying its check-test-source-alias entry (#8104) - #8190

Merged
huangyiirene merged 1 commit into
mainfrom
claude/issue-8104-service-settings-alias-shrink
Aug 13, 2026
Merged

test(service-settings): alias the remaining three workspace deps to source, emptying its check-test-source-alias entry (#8104)#8190
huangyiirene merged 1 commit into
mainfrom
claude/issue-8104-service-settings-alias-shrink

Conversation

@huangyiirene

Copy link
Copy Markdown
Collaborator

Closes #8104.

#8063 gave service-settings its first vitest.config.ts and aliased two workspace deps to source. The other three — @objectstack/spec, @objectstack/platform-objects, @objectstack/types — stayed on the package's KNOWN_UNALIASED_TEST_IMPORTS entry and kept resolving through exports to dist/. They are now aliased to source, and the registry entry is deleted.

How much was actually reading the artifact: 17 of 20 files

Measured, not inferred. With the three dist/ trees physically removed from the checkout:

config result
pre-#8104 (two aliases) 17 of 20 files fail to load, 58 of 413 cases run — Cannot find package '@objectstack/spec/system'
this PR 413 passed / 20 files

So the artifact is off the resolution path, not merely shadowed by a fresh copy of it.

The subpath entry points were the job, and the obvious shape does not do it

This package imports no bare @objectstack/spec and no bare @objectstack/platform-objects at run time. Every specifier its tests can reach for those two is a subpath:

@objectstack/spec/api          @objectstack/spec/data      @objectstack/platform-objects/system
@objectstack/spec/contracts    @objectstack/spec/system

plus @objectstack/spec/security, reached transitively through @objectstack/types ([ADR-0105 D1] tenancy posture) once types itself resolves to source.

Both shapes that suggest themselves fail, in opposite directions:

What covers them is a subpath rule, and the right rule differs per package because their export maps differ:

  • spec is uniform (src/<ns>/index.ts throughout) → the one-rule-for-all-namespaces capture form /^@objectstack\/spec\/([a-z-]+)$/, which cannot go stale when a new namespace import arrives.
  • platform-objects is not uniform — ./plugin is src/plugin.ts, a file → an explicit /system entry. A ([a-z-]+) rule would send platform-objects/plugin to src/plugin/index.ts, a path nobody wrote, failing on whoever next adds that import. plugin-audit writes its platform-objects/audit entry the same way for the same reason.

The two halves constrain each other

KNOWN_UNALIASED_TEST_IMPORTS is audited for set equality in both directions, so neither half is green alone:

state check-test-source-alias
before (entry present, aliases missing) OK — 72 scanned, 62 registered
aliases complete, entry still present FAILED"registry entry is no longer needed … Delete the entry"
entry deleted, one alias rule removed FAILED"tests import 1 workspace package(s) that resolve to dist/ with no source alias"
after (both halves) OK — 72 scanned, 61 registered

--self-test OK.

Scope

  • 413 passed / 20 files, unchanged from the fix(service-settings): repoint sys_setting.value_enc on a secret rotation, and reap the retired ciphertext (#8030) #8063 baseline. Nothing turned red — expected for a checkout whose dist was built from the same commit, which is exactly the condition under which the old setup looked fine.
  • Zero changes under packages/services/service-settings/src/**.
  • Three files touched: the package's vitest.config.ts, the registry entry in scripts/check-test-source-alias.mjs, and a changeset. content/docs/releases/**, docs/adr/**, .claude/skills/**, skills/** untouched.

One finding, not fixed here

When the gate names an unaliased dep it prints a remediation hint that is the anchored bare form:

alias: [{ find: /^@objectstack\/spec$/, replacement: path.resolve(__dirname, '<relative>/src/index.ts') }]

For a package whose only reachable specifiers are subpaths — this one — following that hint verbatim leaves the gate red with no further guidance, since the suggested alias covers nothing it just named. The hint is correct for bare importers and misleading for subpath-only ones. Fixing it means teaching the diagnostic to print the specifiers it measured rather than a generic template; that is a change to the gate's own surface and belongs in its own card, not riding on this one.


Generated by Claude Code

…ource, emptying its check-test-source-alias entry (#8104)

#8063 aliased two workspace deps to source in this package's first
`vitest.config.ts`. The other three — `@objectstack/spec`,
`@objectstack/platform-objects`, `@objectstack/types` — stayed on their
`KNOWN_UNALIASED_TEST_IMPORTS` entry and kept resolving through `exports` to
`dist/`. They are now aliased to source and the registry entry is deleted.

17 of this package's 20 test files were really reading the artifact: with the
three `dist/` trees removed and the pre-#8104 config in place, 17 files fail to
load and only 58 of 413 cases run. With the aliases, the same tree with no
`spec`/`platform-objects`/`types` build output passes 413/413.

The subpath entry points were the actual work. This package imports no bare
`@objectstack/spec` and no bare `@objectstack/platform-objects` at run time —
every reachable specifier for those two is a subpath (`spec/api`,
`spec/contracts`, `spec/data`, `spec/system`, `platform-objects/system`, plus
`spec/security` reached transitively through `types`). The object alias form
would swallow them into `…/index.ts/<sub>` (`ENOTDIR`, #7778); the anchored bare
form #8063 established does not swallow them but does not cover them either, so
copying that shape would have left every one of them on `dist` with the registry
entry undeletable.

So `spec` takes the one-rule-for-all-namespaces capture form, its export map
being uniform, while `platform-objects` takes an explicit `/system` entry
because its map is not (`./plugin` is `src/plugin.ts`, a file, so a `([a-z-]+)`
rule would invent `src/plugin/index.ts`). `plugin-audit` writes its
`platform-objects/audit` entry the same way.

The registry deletion is half the change: the entry is audited for set equality
in both directions, so aliases-complete-with-entry-present and
entry-deleted-with-aliases-incomplete each fail the gate. It reads OK at 61
registered packages, down from 62.

413 passed / 20 files, unchanged from baseline. No change under `src/`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SMN7p2W62YzA3bY7BaFv3r
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 12, 2026 7:23pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/service-settings.

5 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/kernel/runtime-services/audit-service.mdx (via packages/services/service-settings)
  • content/docs/kernel/runtime-services/index.mdx (via packages/services/service-settings)
  • content/docs/kernel/runtime-services/settings-service.mdx (via packages/services/service-settings)
  • content/docs/plugins/packages.mdx (via @objectstack/service-settings)
  • content/docs/protocol/kernel/config-resolution.mdx (via @objectstack/service-settings)

2 release-owned page(s) also reference the affected code. These are read-only:

  • content/docs/releases/implementation-status.mdx (via @objectstack/service-settings)
  • content/docs/releases/v9.mdx (via @objectstack/service-settings)

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

service-settings: alias the remaining three workspace deps to source in vitest.config.ts, shrinking its check-test-source-alias registry entry to empty

2 participants