Commit b29ead6
`scripts/check-init-service-contract.mjs` (#4471, ADR-0116) matched one callee
name — `getService` — while the kernel resolves named services through three:
`getService` (PluginContext), `getServiceAsync` (ObjectKernel) and
`getServiceScoped` (PluginContext, whose kernel body is the same
`pluginLoader.getService(name, scopeId)` call `getServiceAsync` makes). The
ordering hazard belongs to the registry, not to a method name, so the guard was
answering its own question about a third of the surface.
#4772 went through that gap: pre-fix `AuthPlugin.init()` (`f2eb85007^`) resolved
the workspace-provided `cache` service via
`(ctx as { getServiceAsync?: … }).getServiceAsync?.('cache')` with nothing in its
declarations covering it — the exact verdict this guard prints — and the edge was
never constructed.
- `SERVICE_LOOKUP_CALLEES` is now the named vocabulary, with membership argued
per accessor from `packages/core`. `hasService` stays out: `hasAnyService` is
private and `PluginLoader.hasService` is not reachable from a plugin.
- The `scan()` pre-filter derives from that set instead of hardcoding a
substring that only accidentally covers today's names.
- Each edge records the accessor it was made through; `--list` and the failure
message quote it as written instead of normalising every reader to
`getService('X')`.
- Self-test grows to 19 cases. 13 is the #4772 pre-fix shape verbatim (optional
call, cast `ctx`, best-effort try/catch) and asserts plugin, provider and call
line in the message; narrowing the set back to `['getService']` turns it red.
The repo audit stays green — today's `getServiceAsync` call sites are all on
request-time paths, in no plugin's `init()`.
Claude-Session: https://claude.ai/code/session_018iARDqtrhQgz6fVHDeDkbQ
Co-authored-by: Claude <noreply@anthropic.com>
1 parent db82f2e commit b29ead6
2 files changed
Lines changed: 292 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
0 commit comments