Repository navigation
Commit 228a2f0
committed
test(dogfood): type the federated-RLS lookups by their slot contracts (#7835)
CI runs `eslint . --no-inline-config`, so the two `eslint-disable` comments this
file carried were inert on the runner and `slot-lookup/no-any-assignment` fired
on both service lookups. The rule's own prescription is to stop erasing the
lookup, which is what this does:
ql -> IObjectQLEngine
security -> ISecurityService
Both are declared in `packages/spec/src/contracts/core-service-contracts.ts` as
the contracts of the `objectql` and `security` slots, and `ObjectKernel
.getService` is already generic over them — so the `stack.kernel as any` handle
was not buying anything either and is gone with them. No assertion changed.
One edge needed a narrowing rather than a type: `IObjectQLEngine.getSchema`
declares `unknown` on purpose (the engine's own return is `ServiceObject |
undefined`, but the contract keeps its edges loose so `spec` never depends on
the engine package, and tells consumers to narrow at the call site). The
PREMISE case reads `schema.external`, so it narrows to the `ServiceObject` the
implementation already declares — a named spec type the package already
depends on, not a re-erasure.
Reverse-verified in both directions, since "the honest types compiled" is only
worth something if tsc actually reads the file: dropping the `ServiceObject`
narrowing turns typecheck red (TS2339 `Property 'external' does not exist`),
and misspelling `getReadFilter` turns it red against `ISecurityService`
(TS2551). Both confirm the contracts are live rather than inferred as `any`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D6Qi9sYxhaRwj7TYiD5MWg1 parent e0d3160 commit 228a2f0
1 file changed
Lines changed: 16 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 70 | + | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
94 | 101 | | |
95 | 102 | | |
96 | 103 | | |
| |||
0 commit comments