Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion scripts/layering/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ function isDaemonServer(rel: string): boolean {
return rel.startsWith('src/daemon/') && !rel.startsWith('src/daemon/client/');
}

// sdk/ are the package's PUBLIC re-export barrels (§5.5 "sdk = re-export barrels
// only"). They legitimately re-export platform symbols as part of the public API,
// and are OFF the CLI cold path (not imported by bin.ts/cli), so exempting them
// from R3 does not regress cold-start — they sit above the internal DAG R3 governs.
function isSdkBarrel(rel: string): boolean {
return rel.startsWith('src/sdk/');
}

// ── Import extraction ───────────────────────────────────────────────────────

function scanDynamicImports(line: string, lineNo: number): ImportEdge[] {
Expand Down Expand Up @@ -180,7 +188,7 @@ function ruleCommandsFloor(ctx: EdgeContext): Violation | null {
// daemon server; everywhere else use a dynamic import() or a type-only import.
function rulePlatformsSeam(ctx: EdgeContext): Violation | null {
if (ctx.toTop !== 'platforms' || ctx.imp.dynamic || ctx.imp.typeOnly) return null;
if (isCoreInteractor(ctx.file) || isDaemonServer(ctx.file)) return null;
if (isCoreInteractor(ctx.file) || isDaemonServer(ctx.file) || isSdkBarrel(ctx.file)) return null;
return {
rule: 'R3 platforms-seam',
file: ctx.file,
Expand Down
Loading