Two Effect service convention violations in the new ThreadAutoSettleReactor service. The rest of apps/server/src already follows the canonical single-module make + layer shape (e.g. vcs/VcsStatusBroadcaster.ts, background/BackgroundPolicy.ts), so the new service is the outlier here. Everything else in the diff (namespace subpath imports, dependency acquisition via yield* Foo, pure-config options, test-only Layer.succeed/Layer.mock seams, VcsStatusBroadcaster.peekStatus addition, contracts/settings moves) looks consistent with the conventions.
Posted via Macroscope — Effect Service Conventions
bfa8139Open thread| … | … | @@ -0,0 +1,217 @@ | |
| 214 | + | export const makeThreadAutoSettleReactorLive = (options?: ThreadAutoSettleReactorLiveOptions) => | |
| 215 | + | Layer.effect(ThreadAutoSettleReactor, makeThreadAutoSettleReactor(options)); | |
| 216 | + | ||
| 217 | + | export const ThreadAutoSettleReactorLive = makeThreadAutoSettleReactorLive(); | |
Layers/ThreadAutoSettleReactor.ts:217
This module owns construction of the only implementation, so the canonical export names are make and layer rather than makeThreadAutoSettleReactorLive / ThreadAutoSettleReactorLive (the *Live suffix is reserved for abstract-port modules with several implementations). Suggest exporting the existing constructor as make and adding export const layer = Layer.effect(ThreadAutoSettleReactor, make()), then updating server.ts and the test import.
| 1 | -const makeThreadAutoSettleReactor = (options?: ThreadAutoSettleReactorLiveOptions) => |
| 2 | +export const make = (options?: ThreadAutoSettleReactorOptions) => |
| 3 | ... |
| 4 | -export const makeThreadAutoSettleReactorLive = (options?: ThreadAutoSettleReactorLiveOptions) => |
| 5 | - Layer.effect(ThreadAutoSettleReactor, makeThreadAutoSettleReactor(options)); |
| 6 | - |
| 7 | -export const ThreadAutoSettleReactorLive = makeThreadAutoSettleReactorLive(); |
| 8 | +export const layer = Layer.effect(ThreadAutoSettleReactor, make()); |
No longer relevant as of f5ee144326035566857dea093aa1a5c6cd267497
Fixed in c514c22cc alongside the module consolidation: exports are now make (options-taking) and layer, with server.ts importing the namespace and the test building Layer.effect(ThreadAutoSettleReactor, make()).
bfa8139Open thread| … | … | @@ -0,0 +1,35 @@ | |
| 32 | + | export class ThreadAutoSettleReactor extends Context.Service< | |
| 33 | + | ThreadAutoSettleReactor, | |
| 34 | + | ThreadAutoSettleReactorShape | |
| 35 | + | >()("t3/orchestration/Services/ThreadAutoSettleReactor") {} | |
The new service is split across Services/ThreadAutoSettleReactor.ts (tag + standalone ThreadAutoSettleReactorShape) and Layers/ThreadAutoSettleReactor.ts (construction + layer). Consider a single canonical module apps/server/src/orchestration/ThreadAutoSettleReactor.ts with the interface declared inline in the Context.Service call, and reference the inferred interface as ThreadAutoSettleReactor["Service"] (the ThreadAutoSettleReactorShape["sweepOnce"] / ["start"] / satisfies annotations in the layer file) instead of keeping a FooShape type.
Posted via Macroscope — Effect Service Conventions
Keeping the Services/Layers split: it matches every other reactor in this package (CheckpointReactor, ThreadDeletionReactor, ProviderCommandReactor all have a Services/ tag+Shape module and a Layers/ implementation). A one-off consolidation here would make this the odd one out.
Reversed my earlier dismissal — the check clarified the convention distinguishes single-implementation modules from abstract ports (the sibling reactors' Services/Layers split predates it). Fixed in c514c22cc: one canonical module at orchestration/ThreadAutoSettleReactor.ts, interface inline in Context.Service, no standalone Shape type, references via ThreadAutoSettleReactor["Service"].