feat(workspaces): define project runtime source authority

Route probe and user materialization through one projectRuntimeSource seam, where persisted Git source overrides the host-only convenience root and must belong to Git project data.

Lock default revision, explicit revision, and subdirectory semantics with real Docker acceptance. Enforce provider-probe internals structurally and document that the current Docker POC needs a locally built image because its default reference is unpublished.
This commit is contained in:
Mohamed Boudra
2026-08-12 20:53:05 +02:00
parent 527b252497
commit 33afa7283b
24 changed files with 750 additions and 74 deletions
+38 -1
View File
@@ -88,7 +88,7 @@ test("the AST guard rejects computed loading and dynamic host/internal bypasses"
"module-entrypoint",
"nonliteral-module-load",
"nonliteral-module-load",
"nonliteral-module-load",
"workspace-host-access",
"workspace-host-access",
"workspace-host-access",
"workspace-host-access",
@@ -96,6 +96,36 @@ test("the AST guard rejects computed loading and dynamic host/internal bypasses"
);
});
test("the AST guard rejects every statically resolvable provider probe internal import", async (t) => {
const root = await fixtureRoot(t);
await source(
root,
"packages/server/src/server/session/computed.ts",
'import { createService as direct } from "../provider-probe/internal/service.js";\n' +
'import { createService as alias } from "@getpaseo/server/provider-probe/internal/service.js";\n' +
'export { createService } from "../provider-probe/internal/service.js";\n' +
'const internal = "../provider-probe/" + "internal/service.js";\n' +
"const load = require;\n" +
'void require("../provider-probe/internal/service.js");\n' +
'void import("../provider-probe/" + "internal/service.js");\n' +
'void import(`../provider-probe/${"internal"}/service.js`);\n' +
"void import(internal);\n" +
"void load(internal);\n" +
"void direct; void alias;\n",
);
const violations = await findWorkspaceBoundaryViolations(root);
assert.equal(violations.length, 8);
assert.deepEqual(new Set(violations.map(({ rule }) => rule)), new Set(["module-entrypoint"]));
assert.deepEqual(
new Set(violations.map((violation) => violation.import)),
new Set([
"../provider-probe/internal/service.js",
"@getpaseo/server/provider-probe/internal/service.js",
]),
);
});
test("owned integrations, explicit legacy code, and fixture contract imports pass", async (t) => {
const root = await fixtureRoot(t);
await copyFile(path.join(repoRoot, ".oxlintrc.json"), path.join(root, ".oxlintrc.json"));
@@ -104,6 +134,13 @@ test("owned integrations, explicit legacy code, and fixture contract imports pas
"packages/server/src/server/workspace-runtime/index.ts",
'import { service } from "./internal/service.js"; void service;\n',
);
await source(
root,
"packages/server/src/server/provider-probe/index.ts",
'import { createService } from "./internal/service.js";\n' +
'export { createProbeStore } from "./internal/probe-store.js";\n' +
"void createService;\n",
);
await source(
root,
"packages/server/src/server/workspace-runtime/command/index.ts",