Skip to content

Commit e442c7a

Browse files
committed
refactor(contracts): name snapshot-producers as the iOS contract's registry source
The iOS contract imported the registry type through snapshot-model, which only re-exports it. It now imports from snapshot-producers, where the registry is declared, and R18's exemption and its comment name that module.
1 parent ecba420 commit e442c7a

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎packages/contracts/src/ios-snapshot.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
SnapshotQualityNote,
77
SnapshotKeyboardBandFact,
88
} from '@agent-device/kernel/snapshot';
9-
import type { SnapshotProducerRegistry } from './snapshot-model.ts';
9+
import type { SnapshotProducerRegistry } from './snapshot-producers.ts';
1010

1111
/** The producers whose trees arrive on the iOS (`xctest`) channel, from the producer registry. */
1212
export type IosSnapshotProducer = {

‎scripts/layering/contracts-implementation-policy.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ test('iOS snapshot contracts reject planning implementation and provider imports
131131
assert.deepEqual(
132132
messages(
133133
[
134-
"import type { SNAPSHOT_PRODUCERS } from './snapshot-model.ts';",
134+
"import type { SNAPSHOT_PRODUCERS } from './snapshot-producers.ts';",
135135
'export type IosProducer = keyof typeof SNAPSHOT_PRODUCERS;',
136136
].join('\n'),
137137
contract,
@@ -141,7 +141,7 @@ test('iOS snapshot contracts reject planning implementation and provider imports
141141
assert.match(
142142
messages(
143143
[
144-
"import { SNAPSHOT_PRODUCERS } from './snapshot-model.ts';",
144+
"import { SNAPSHOT_PRODUCERS } from './snapshot-producers.ts';",
145145
'export type IosProducer = keyof typeof SNAPSHOT_PRODUCERS;',
146146
].join('\n'),
147147
contract,

‎scripts/layering/contracts-implementation-policy.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ const FORBIDDEN_TIMER_CALLS = new Set([
2929
]);
3030
const IOS_SNAPSHOT_CONTRACT = 'packages/contracts/src/ios-snapshot.ts';
3131
/**
32-
* The iOS producer subsets derive from the producer registry in `snapshot-model.ts`. Every statement
33-
* in the iOS contract is type-only, so that import brings no behavior.
32+
* The iOS producer subsets derive from the producer registry declared in `snapshot-producers.ts`.
33+
* This exemption is safe only because every statement in the iOS contract stays type-only, which
34+
* the typed-vocabulary check above enforces, so the import brings no behavior.
3435
*/
35-
const IOS_SNAPSHOT_VOCABULARY_IMPORTS: ReadonlySet<string> = new Set(['./snapshot-model.ts']);
36+
const IOS_SNAPSHOT_VOCABULARY_IMPORTS: ReadonlySet<string> = new Set(['./snapshot-producers.ts']);
3637

3738
/** Contracts owns vocabulary. Host/process/timer mechanics belong in capture-kit or an adapter. */
3839
export function contractsImplementationAuthorityViolations(

0 commit comments

Comments
 (0)