You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Separate the public Machine, MachineTest, AtomMachine, and ClusterMachine contracts from their internal implementations. Enforce designated implementation seams and explicit public function signatures through the architecture check without changing the package API.
test("accepts Effect-shaped modules and ignores type-only back-edges",()=>{
44
44
constroot=makeProject({
45
45
"src/index.ts": 'export * as Machine from "./Machine.js"',
46
-
"src/Machine.ts": 'import * as Model from "./internal/machine/model.js"\nexport interface Machine {}\nexport const model = Model.value',
46
+
"src/Machine.ts": 'import * as internal from "./internal/machine/machine.js"\nimport type * as Model from "./internal/machine/model.js"\nexport interface Machine { readonly model: typeof Model.value }\nexport const make: () => Machine = internal.make',
47
+
"src/internal/machine/machine.ts": 'import type { Machine } from "../../Machine.js"\nexport const make = (): Machine => ({ model: 1 })',
47
48
"src/internal/machine/model.ts": 'import type { Machine } from "../../Machine.js"\nexport const value = 1',
48
49
"test/machine/Machine.test.ts": 'import { Machine } from "../../src/index.js"\nvoid Machine',
49
50
"test/internal/machine/model.test.ts": 'import { value } from "../../../src/internal/machine/model.js"\nvoid value'
50
51
})
51
52
assert.deepEqual(rules(root),[])
52
53
})
53
54
55
+
test("rejects public implementation bypasses and inferred internal signatures",()=>{
56
+
constroot=makeProject({
57
+
"src/Machine.ts": 'import * as internal from "./internal/machine/machine.js"\nimport { value } from "./internal/machine/model.js"\nexport const make = internal.make\nexport const model = value',
58
+
"src/internal/machine/machine.ts": "export const make = () => 1",
59
+
"src/internal/machine/model.ts": "export const value = 1"
0 commit comments