Skip to content

fix(plugins): sweep the plugin composition roots' slot lookups — 35 sites typed, two alias-only HTTP reads fixed (#4251 B5) - #6790

Merged
os-project-manager merged 1 commit into
mainfrom
claude/issue-4251-slot-sweep-b5
Aug 9, 2026
Merged

os-project-manager merged 1 commit into
mainfrom
claude/issue-4251-slot-sweep-b5

Conversation

@os-project-manager

Copy link
Copy Markdown
Collaborator

Batch B5 of the #4251 sweep: the seven remaining packages/plugins/* composition roots. Every service-lookup result that had been erased to any now carries the slot's contract, so the compiler checks what each plugin actually calls on the service it resolved.

Ratchet: 143 sites / 32 files → 108 / 25. All seven files leave the baseline entirely; no keys added.

Two real defects, both the shape this sweep exists to surface

Approvals' ADR-0043 action-link pages and sharing's public share-link REST routes each read the HTTP server under http-server only — the deprecated alias. The ledger records http.server as canonical and as the only name present on every provider path: runtime.ts's config.server path registers no alias at all.

On that path both lookups threw, the surrounding catch swallowed it, and the routes silently never mounted — approval e-mail action links 404'd and the share-link surface was absent, with nothing in the log to say so. This is the same latent alias-only miss #4393 fixed in metadata and cloud-connection, and the same one still recorded as open on the cloud side.

Both reads are now canonical-first with the alias as fallback, each name in its own try — getService throws on an empty slot, so a() ?? b() inside one try never reaches b. That is exactly the trap #4393 documented after CI caught it.

Typing follows the B2/B3 method

Site class Choice
Pure data-plane consumer the narrow contract — IDataEngine in reports, whose ReportEngine is find/findOne/insert/update/delete only
Binds hook / middleware seams the engine seen whole — IObjectQLEngine in approvals, sharing, pinyin-search, which is what the objectql slot's ledger entry describes ("the SAME instance as data, seen whole")
Slot has no contract a named local surface, never any

Named surfaces used: plugin-email's new MailSettingsSurface (the four members it calls on the optional service-settings, change-bus types taken from @objectstack/spec/system rather than re-declared), plus the surfaces the consuming packages already declared — ApprovalMessagingSurface, SharingSecurityProbe, ReportEmail.

One slot turned out to be better off than assumed: hierarchy-scope-resolver has a real spec contract (IHierarchyScopeResolver), already required by the option it feeds. It takes that, not a local surface.

plugin-pinyin-search reads IObjectQLEngine through the @objectstack/core barrel, which re-exports it — a slot's contract is not a reason to add a @objectstack/spec dependency to a package that has none.

Scope

  • Out of scope, deliberately: plugin-approvals/src/status-mirror-cascade.integration.test.ts (3 sites) sits inside plugin-*/src/** but is a test file, which the batch table assigns to B11. Left in the baseline.
  • No rule changes. No contract changes. The batch's site count came in at 35 rather than the 26 last recorded, because 9 of them are the fix(lint,runtime,core): 槽查找护栏认出分体声明形态 —— 越清扫越显得干净的那个盲区 (#4251) #4373 fourth shape (let engine: any; split declaration) firing on the same lines as the type-argument shape — the same double-count B4 recorded for env-registry.

Verification

Full turbo run build --filter='./packages/*' ran before the ratchet re-count, so the count is not measured against stale dist.

  • turbo run typecheck test build over the seven packages + deps — 42/42 tasks green (446 approvals tests among them)
  • pnpm lint (eslint . --no-inline-config) — clean
  • pnpm check:slot-lookup enforcing — ✓ 108 unswept site(s) in 25 file(s), none new, key set verified against 64d764e, no files added
  • Repo gates run green rather than assumed: check:query-options-erasure, check:verify-stand-in, check:service-providers, check:engine-double-contract, check:init-service-contract, check:durability-log-level, check:kernel-hook-pairs, check:authz-resolver, check:startup-registry-verdict, check:type-check-coverage, check:empty-changeset

Changeset included (touches published package source).

⛔ This PR does not close #4251 — B6–B11 remain, plus the cloud-side alias readers and the MetadataWatchEvent dual source (#4411).

Part of #4251


Generated by Claude Code

…ites typed, two alias-only HTTP reads fixed (#4251 B5)

Batch B5 of the #4251 sweep: the seven remaining `packages/plugins/*`
composition roots. Every service-lookup result that had been erased to `any`
now carries the slot's contract, so the compiler checks what each plugin
actually calls on the service it resolved. Ratchet: 143 sites / 32 files →
108 / 25, seven files out of the baseline entirely.

Two real defects, both the shape the sweep exists to surface. Approvals'
ADR-0043 action-link pages and sharing's public share-link REST routes each
read the HTTP server under `http-server` only — the deprecated alias. The
ledger records `http.server` as canonical and as the only name present on
every provider path (`runtime.ts`'s `config.server` path registers no alias).
On that path both lookups threw, the surrounding catch swallowed it, and the
routes silently never mounted: approval e-mail action links 404'd and the
share-link surface was absent, with nothing in the log to say so. Both reads
are now canonical-first with the alias as fallback, each name in its own try —
`getService` throws on an empty slot, so `a() ?? b()` inside one try never
reaches `b` (the correction #4393 made in metadata and cloud-connection).

Typing follows the B2/B3 method. Pure data-plane consumers take the narrow
contract (`IDataEngine` in reports, whose `ReportEngine` is find/insert/
update/delete only); consumers that bind hook or middleware seams take the
engine seen whole (`IObjectQLEngine` in approvals, sharing, pinyin-search),
which is what the `objectql` slot's ledger entry describes. Slots with no
contract get a named local surface, never `any`: plugin-email's new
`MailSettingsSurface`, plus the surfaces the consuming packages already
declared — `ApprovalMessagingSurface`, `SharingSecurityProbe`, `ReportEmail`.
`hierarchy-scope-resolver` turned out to have a real contract already
(`IHierarchyScopeResolver`), so it takes that.

pinyin-search reads `IObjectQLEngine` through the `@objectstack/core` barrel,
which re-exports it — the slot's contract is not a reason to add a spec
dependency to a package that has none.

Out of scope and deliberately left: `plugin-approvals/src/status-mirror-
cascade.integration.test.ts` (3 sites) is a test file and belongs to B11.

No contract changes. B6-B11 remain, plus the cloud-side alias readers and
#4411 — this does not close #4251.

Part of #4251

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

vercel Bot commented Aug 8, 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 8, 2026 5:43pm

Request Review

@github-actions github-actions Bot added the size/m label Aug 8, 2026
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 7 package(s): @objectstack/plugin-approvals, @objectstack/plugin-audit, @objectstack/plugin-email, @objectstack/plugin-pinyin-search, @objectstack/plugin-reports, @objectstack/plugin-sharing, @objectstack/plugin-webhooks.

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

  • content/docs/api/client-sdk.mdx (via @objectstack/plugin-reports)
  • content/docs/automation/approvals.mdx (via @objectstack/plugin-approvals)
  • content/docs/automation/flows.mdx (via @objectstack/plugin-email)
  • content/docs/automation/webhooks.mdx (via packages/plugins/plugin-webhooks)
  • content/docs/data-modeling/queries.mdx (via @objectstack/plugin-pinyin-search)
  • content/docs/deployment/cli.mdx (via @objectstack/plugin-audit)
  • content/docs/deployment/environment-variables.mdx (via @objectstack/plugin-email, @objectstack/plugin-pinyin-search)
  • content/docs/deployment/production-readiness.mdx (via @objectstack/plugin-audit)
  • content/docs/kernel/runtime-services/examples.mdx (via @objectstack/plugin-sharing)
  • content/docs/kernel/runtime-services/sharing-service.mdx (via @objectstack/plugin-sharing)
  • content/docs/kernel/services-checklist.mdx (via @objectstack/plugin-approvals, @objectstack/plugin-sharing)
  • content/docs/permissions/authorization.mdx (via packages/plugins/plugin-sharing)
  • content/docs/permissions/permissions-matrix.mdx (via packages/plugins/plugin-sharing)
  • content/docs/plugins/packages.mdx (via @objectstack/plugin-approvals, @objectstack/plugin-audit, @objectstack/plugin-email, @objectstack/plugin-reports, @objectstack/plugin-sharing, @objectstack/plugin-webhooks)
  • content/docs/protocol/kernel/index.mdx (via @objectstack/plugin-email)
  • content/docs/protocol/objectql/security.mdx (via packages/plugins/plugin-sharing)
  • content/docs/releases/implementation-status.mdx (via @objectstack/plugin-approvals, @objectstack/plugin-audit, @objectstack/plugin-sharing, @objectstack/plugin-webhooks)
  • content/docs/releases/v15.mdx (via @objectstack/plugin-pinyin-search)
  • content/docs/releases/v9.mdx (via @objectstack/plugin-approvals)

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.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Aug 8, 2026
@os-project-manager
os-project-manager marked this pull request as ready for review August 8, 2026 23:29
@os-project-manager
os-project-manager added this pull request to the merge queue Aug 9, 2026
Merged via the queue into main with commit 2465133 Aug 9, 2026
24 checks passed
@os-project-manager
os-project-manager deleted the claude/issue-4251-slot-sweep-b5 branch August 9, 2026 00:36
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 tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The service-lookup any rule misses getService<any>(...) — 80 sites erase the slot contract, 3 of them inside the rule's own scope

2 participants