diff --git a/src/cli/architecture-boundaries.test.ts b/src/cli/architecture-boundaries.test.ts index 24fc75b..2cd5166 100644 --- a/src/cli/architecture-boundaries.test.ts +++ b/src/cli/architecture-boundaries.test.ts @@ -113,4 +113,19 @@ describe("Architecture Layering Boundaries", () => { expect(violations).toEqual([]); }); + + test("src/core/ must only contain whitelisted infrastructure modules", () => { + const allowedTopLevel = new Set([ + "README.core.md", + "auth", + "cache", + "config", + "db", + "errors.ts", + "http", + ]); + const entries = readdirSync(join(SRC_ROOT, "core")); + const unexpected = entries.filter((entry) => !allowedTopLevel.has(entry)); + expect(unexpected).toEqual([]); + }); }); diff --git a/src/cli/commands/openapi.ts b/src/cli/commands/openapi.ts index 827f5c4..1e8fc71 100644 --- a/src/cli/commands/openapi.ts +++ b/src/cli/commands/openapi.ts @@ -1,4 +1,4 @@ -import { getOpenApiSchema, listOpenApiPaths, type OpenApiType } from "../../core/embedded-openapi.js"; +import { getOpenApiSchema, listOpenApiPaths, type OpenApiType } from "../../packaging/embedded-openapi.js"; import { booleanOption, stringOption } from "../parser.js"; import { printJson, printKeyValue, printTable } from "../printer.js"; import type { CliParsedArgs, CliResult, CliRuntime } from "../types.js"; diff --git a/src/cli/commands/skill.ts b/src/cli/commands/skill.ts index 662c11f..953fca9 100644 --- a/src/cli/commands/skill.ts +++ b/src/cli/commands/skill.ts @@ -5,7 +5,7 @@ import { getDefaultGlobalSkillDir, getSkillContent, installSkillFiles, -} from "../../core/embedded-skill.js"; +} from "../../packaging/embedded-skill.js"; import { booleanOption, stringOption } from "../parser.js"; import { printJson, printKeyValue } from "../printer.js"; import { isDryRun, mutationPreview, requireMutationConfirmation } from "../mutation.js"; diff --git a/src/cli/commands/update.ts b/src/cli/commands/update.ts index 166d187..a283ac1 100644 --- a/src/cli/commands/update.ts +++ b/src/cli/commands/update.ts @@ -1,8 +1,8 @@ import { chmodSync, existsSync, mkdirSync, renameSync, rmSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs"; import { dirname, join } from "node:path"; import { spawnSync } from "node:child_process"; -import { isCompiledBinary, resolveAppRoot } from "../../core/runtime.js"; -import { syncGlobalSkillIfPresent } from "../../core/embedded-skill.js"; +import { isCompiledBinary, resolveAppRoot } from "../../packaging/runtime.js"; +import { syncGlobalSkillIfPresent } from "../../packaging/embedded-skill.js"; import { loadGlobalConfig } from "../../core/config/loader.js"; import { VERSION } from "../../version.js"; import { booleanOption, numberOption, stringOption } from "../parser.js"; diff --git a/src/http/routes.ts b/src/http/routes.ts index 858f584..e145f13 100644 --- a/src/http/routes.ts +++ b/src/http/routes.ts @@ -2,7 +2,7 @@ import type { IncomingMessage, ServerResponse } from "node:http"; import { URL } from "node:url"; import { runCli } from "../cli/runner.js"; import { loadCorpConfigs, loadGlobalConfig } from "../core/config/loader.js"; -import { getOpenApiSchema } from "../core/embedded-openapi.js"; +import { getOpenApiSchema } from "../packaging/embedded-openapi.js"; import { tokenizeCommand, normalizeCliArgs } from "../server.js"; import { VERSION } from "../version.js"; import { renderDocsHtml } from "./docs.js"; diff --git a/src/core/embedded-openapi.test.ts b/src/packaging/embedded-openapi.test.ts similarity index 100% rename from src/core/embedded-openapi.test.ts rename to src/packaging/embedded-openapi.test.ts diff --git a/src/core/embedded-openapi.ts b/src/packaging/embedded-openapi.ts similarity index 100% rename from src/core/embedded-openapi.ts rename to src/packaging/embedded-openapi.ts diff --git a/src/core/embedded-skill.test.ts b/src/packaging/embedded-skill.test.ts similarity index 100% rename from src/core/embedded-skill.test.ts rename to src/packaging/embedded-skill.test.ts diff --git a/src/core/embedded-skill.ts b/src/packaging/embedded-skill.ts similarity index 100% rename from src/core/embedded-skill.ts rename to src/packaging/embedded-skill.ts diff --git a/src/core/runtime.ts b/src/packaging/runtime.ts similarity index 100% rename from src/core/runtime.ts rename to src/packaging/runtime.ts