fix(e2e): restore project-collab P0 gate and collab mock seeding

PerishCode correctly blocked the follow-up that retagged the multi-client
convergence specs as P1 and dropped project-collab from the merge-gated UI P0
matrix: those two cases are the only browser coverage for live two-client
content/presence/unshare and authority-revocation convergence.

- Restore [P0] tags, the project-collab group/matrix/coverage entries, and the
  six-domain / four-domain shadow contracts (matches main).
- Teach collab-cluster unit mocks about addInitScript so the campaign-
  dismissal seed on independently created BrowserContexts does not break E2E
  Vitest.
This commit is contained in:
lefarcen
2026-08-06 19:25:12 +08:00
parent d5c71d58b3
commit 61de050324
7 changed files with 32 additions and 7 deletions
+13
View File
@@ -62,6 +62,17 @@ export const uiP0Groups = {
"ui/workspace-team-design-system-picker.test.ts",
],
},
// Split out of "project-workspace" (2026-08-04): the two multi-client collab
// specs alone accounted for ~10 of that group's ~26min single-worker wall
// time (workspace-multi-client-collab.test.ts spins up two isolated
// client/daemon runtimes per case). Keep this shard limited to the cluster-
// owned spec so it does not also boot the default worker runtime needed by
// ordinary UI files.
"project-collab": {
grep: String.raw`\[P0\]`,
workers: 1,
files: ["ui/workspace-multi-client-collab.test.ts"],
},
"project-runtime": {
grep: String.raw`\[P0\]`,
workers: 1,
@@ -80,6 +91,7 @@ export const uiP0CiMatrix = [
{ name: "entry-settings", shard: "entry-settings" },
{ name: "project-workspace", shard: "project-workspace" },
{ name: "project-workspace-editor", shard: "project-workspace-editor" },
{ name: "project-collab", shard: "project-collab" },
{ name: "project-runtime", shard: "project-runtime" },
{ name: "workspace-restoration", shard: "workspace-restoration" },
] as const satisfies readonly UiP0CiMatrixEntry[];
@@ -108,6 +120,7 @@ const uiP0CoverageFiles = [
"ui/settings-connectors-auth-recovery.test.ts",
"ui/settings-local-cli-codex-fallback.test.ts",
"ui/workspace-team-interactions.test.ts",
"ui/workspace-multi-client-collab.test.ts",
"ui/workspace-team-design-system-picker.test.ts",
"ui/workspace-keyboard-flows.test.ts",
] as const;
+3
View File
@@ -114,6 +114,9 @@ describe('createCollabCluster acquisition cleanup', () => {
expect(secondSpec.root).toContain(runtimeMocks.workspaceRoot);
expect(firstSpec.dataDir).toBe(join(firstSpec.root, 'scratch', 'data'));
expect(secondSpec.dataDir).toBe(join(secondSpec.root, 'scratch', 'data'));
// Isolated cluster contexts never pass through the suite fixture, so
// campaign dismissal must be seeded on each newContext result — and
// before newPage, so the init script is installed for the first load.
expect(firstContext.addInitScript).toHaveBeenCalledTimes(1);
expect(secondContext.addInitScript).toHaveBeenCalledTimes(1);
expect(firstContext.addInitScript.mock.invocationCallOrder[0]).toBeLessThan(
@@ -1220,6 +1220,7 @@ process.stdin.on("end", () => {
"entry-settings",
"project-workspace",
"project-workspace-editor",
"project-collab",
"project-runtime",
"workspace-restoration",
]);
@@ -1238,6 +1239,10 @@ process.stdin.on("end", () => {
"ui/workspace-team-design-system-picker.test.ts",
],
});
expect(uiP0Groups["project-collab"].files).toEqual([
"ui/workspace-multi-client-collab.test.ts",
]);
expect(uiP0Groups["project-collab"].workers).toBe(1);
expect(uiP0Groups["critical-extras"]).toEqual({
grep: "@merge-extra",
workers: 1,
+4 -3
View File
@@ -947,7 +947,7 @@ test("merge-queue threshold escalates medium-confidence files to the full radius
});
});
test("runtime-definition changes produce only a three-shard UI P0 shadow candidate", async () => {
test("runtime-definition changes produce only a four-domain UI P0 shadow candidate", async () => {
const { evaluateUiP0Shadow } = await import("../../../scripts/scopes.ts");
const decision = evaluateUiP0Shadow([
"apps/daemon/src/runtimes/defs/atomcode.ts",
@@ -958,7 +958,7 @@ test("runtime-definition changes produce only a three-shard UI P0 shadow candida
assert.equal(decision.capability, "daemon-runtime-definition");
assert.deepEqual(
decision.matrix.map((entry) => entry.name),
["entry-settings", "project-workspace", "project-runtime"],
["entry-settings", "project-workspace", "project-collab", "project-runtime"],
);
assert.deepEqual(decision.outsideCapabilityFiles, []);
});
@@ -979,6 +979,7 @@ test("runtime-definition shadow fails closed for mixed, unknown, empty, and unre
"entry-settings",
"project-workspace",
"project-workspace-editor",
"project-collab",
"project-runtime",
"workspace-restoration",
],
@@ -1031,7 +1032,7 @@ test("plan trace reports the runtime-definition UI P0 shadow without changing th
assert.equal(result.trace.uiP0Shadow.mode, "candidate");
assert.deepEqual(
result.trace.uiP0Shadow.matrix.map((entry) => entry.name),
["entry-settings", "project-workspace", "project-runtime"],
["entry-settings", "project-workspace", "project-collab", "project-runtime"],
);
});
+2 -2
View File
@@ -34,7 +34,7 @@ const MEMBER = {
test.describe.configure({ timeout: T.xlong * 5 });
test('[P1] two isolated clients converge live content, presence, and owner unshare', async ({
test('[P0] two isolated clients converge live content, presence, and owner unshare', async ({
browser,
}, testInfo) => {
const hubRoot = testInfo.outputPath('fake-collab-hub');
@@ -334,7 +334,7 @@ test('[P1] two isolated clients converge live content, presence, and owner unsha
}
});
test('[P1] two active clients converge when a member gains then loses admin access', async ({
test('[P0] two active clients converge when a member gains then loses admin access', async ({
browser,
}, testInfo) => {
const hubRoot = testInfo.outputPath('fake-role-change-hub');
+4 -2
View File
@@ -19,12 +19,14 @@ const fullMatrixNames = [
"entry-settings",
"project-workspace",
"project-workspace-editor",
"project-collab",
"project-runtime",
"workspace-restoration",
] as const;
const candidateMatrixNames = [
"entry-settings",
"project-workspace",
"project-collab",
"project-runtime",
] as const;
@@ -39,7 +41,7 @@ function sameValues(actual: readonly string[], expected: readonly string[]): boo
export function uiP0ShadowContractErrors(): string[] {
const errors: string[] = [];
if (!sameValues(matrixNames(uiP0CiMatrix), fullMatrixNames)) {
errors.push("the applied UI P0 matrix is no longer the guarded full five-shard matrix");
errors.push("the applied UI P0 matrix is no longer the guarded full six-domain matrix");
}
const sourceSample = `${DAEMON_RUNTIME_DEFINITION_PREFIXES[0]}example.ts`;
@@ -50,7 +52,7 @@ export function uiP0ShadowContractErrors(): string[] {
candidate.capability !== "daemon-runtime-definition" ||
!sameValues(matrixNames(candidate.matrix), candidateMatrixNames)
) {
errors.push("the runtime-definition shadow no longer resolves to the guarded three-shard candidate");
errors.push("the runtime-definition shadow no longer resolves to the guarded four-domain candidate");
}
for (const outsideFile of [
+1
View File
@@ -74,6 +74,7 @@ export const DAEMON_RUNTIME_DEFINITION_EXACT = [
const DAEMON_RUNTIME_DEFINITION_MATRIX_NAMES = [
"entry-settings",
"project-workspace",
"project-collab",
"project-runtime",
] as const;