@aria-cli/types 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -1
- package/dist-cjs/.tsbuildinfo +0 -1
- package/dist-cjs/errors.d.ts +0 -29
- package/dist-cjs/errors.js +0 -51
- package/dist-cjs/errors.js.map +0 -1
- package/dist-cjs/index.d.ts +0 -11
- package/dist-cjs/index.js +0 -29
- package/dist-cjs/index.js.map +0 -1
- package/dist-cjs/logger.d.ts +0 -54
- package/dist-cjs/logger.js +0 -166
- package/dist-cjs/logger.js.map +0 -1
- package/dist-cjs/memoria.d.ts +0 -428
- package/dist-cjs/memoria.js +0 -11
- package/dist-cjs/memoria.js.map +0 -1
- package/dist-cjs/models.d.ts +0 -322
- package/dist-cjs/models.js +0 -21
- package/dist-cjs/models.js.map +0 -1
- package/dist-cjs/native-tools.d.ts +0 -57
- package/dist-cjs/native-tools.js +0 -33
- package/dist-cjs/native-tools.js.map +0 -1
- package/dist-cjs/package.json +0 -3
- package/dist-cjs/relaunch.d.ts +0 -22
- package/dist-cjs/relaunch.js +0 -67
- package/dist-cjs/relaunch.js.map +0 -1
- package/dist-cjs/src/errors.d.ts +0 -29
- package/dist-cjs/src/errors.js +0 -51
- package/dist-cjs/src/errors.js.map +0 -1
- package/dist-cjs/src/index.d.ts +0 -10
- package/dist-cjs/src/index.js +0 -28
- package/dist-cjs/src/index.js.map +0 -1
- package/dist-cjs/src/logger.d.ts +0 -22
- package/dist-cjs/src/logger.js +0 -85
- package/dist-cjs/src/logger.js.map +0 -1
- package/dist-cjs/src/memoria.d.ts +0 -418
- package/dist-cjs/src/memoria.js +0 -11
- package/dist-cjs/src/memoria.js.map +0 -1
- package/dist-cjs/src/models.d.ts +0 -322
- package/dist-cjs/src/models.js +0 -21
- package/dist-cjs/src/models.js.map +0 -1
- package/dist-cjs/src/native-tools.d.ts +0 -57
- package/dist-cjs/src/native-tools.js +0 -33
- package/dist-cjs/src/native-tools.js.map +0 -1
- package/dist-cjs/src/relaunch.d.ts +0 -22
- package/dist-cjs/src/relaunch.js +0 -61
- package/dist-cjs/src/relaunch.js.map +0 -1
- package/dist-cjs/src/tool-outputs.d.ts +0 -37
- package/dist-cjs/src/tool-outputs.js +0 -5
- package/dist-cjs/src/tool-outputs.js.map +0 -1
- package/dist-cjs/stall-phase.d.ts +0 -2
- package/dist-cjs/stall-phase.js +0 -18
- package/dist-cjs/stall-phase.js.map +0 -1
- package/dist-cjs/tests/logger.test.d.ts +0 -1
- package/dist-cjs/tests/logger.test.js +0 -65
- package/dist-cjs/tests/logger.test.js.map +0 -1
- package/dist-cjs/tool-outputs.d.ts +0 -37
- package/dist-cjs/tool-outputs.js +0 -5
- package/dist-cjs/tool-outputs.js.map +0 -1
- package/dist-cjs/vitest.config.d.ts +0 -2
- package/dist-cjs/vitest.config.js +0 -19
- package/dist-cjs/vitest.config.js.map +0 -1
- package/src/errors.ts +0 -50
- package/src/index.ts +0 -17
- package/src/logger.ts +0 -169
- package/src/memoria.ts +0 -437
- package/src/models.ts +0 -356
- package/src/native-tools.ts +0 -73
- package/src/relaunch.ts +0 -67
- package/src/stall-phase.ts +0 -20
- package/src/tool-outputs.ts +0 -42
- package/tests/guards/types-test-lane-manifest.contract.test.ts +0 -42
- package/tests/logger.test.ts +0 -102
- package/tests/memoria-vitest-isolation.contract.test.ts +0 -108
- package/tests/test-lane-manifest.ts +0 -177
- package/tests/vitest-project-runner.contract.test.ts +0 -309
- package/tests/vitest-runner-capacity.contract.test.ts +0 -142
- package/tests/vitest-shared-pool.contract.test.ts +0 -79
- package/tsconfig.cjs.json +0 -15
- package/tsconfig.json +0 -12
- package/vitest.config.ts +0 -17
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
async function importRunner() {
|
|
4
|
-
vi.resetModules();
|
|
5
|
-
return import(new URL("../../../scripts/run-vitest-projects.mjs", import.meta.url).href);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
afterEach(() => {
|
|
9
|
-
vi.restoreAllMocks();
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
describe("vitest runner host capacity contract", () => {
|
|
13
|
-
it("waits for host capacity before starting another shard", async () => {
|
|
14
|
-
const { waitForVitestCapacity } = await importRunner();
|
|
15
|
-
const snapshots = [
|
|
16
|
-
{
|
|
17
|
-
cpuCount: 14,
|
|
18
|
-
load1: 128,
|
|
19
|
-
freeMemoryBytes: 256 * 1024 * 1024,
|
|
20
|
-
activeVitestProcesses: 9,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
cpuCount: 14,
|
|
24
|
-
load1: 6,
|
|
25
|
-
freeMemoryBytes: 4 * 1024 * 1024 * 1024,
|
|
26
|
-
activeVitestProcesses: 1,
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
const sleep = vi.fn(async () => {});
|
|
30
|
-
|
|
31
|
-
await waitForVitestCapacity({
|
|
32
|
-
pollMs: 1234,
|
|
33
|
-
readHostSnapshot: async () => snapshots.shift() ?? snapshots.at(-1)!,
|
|
34
|
-
sleep,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
expect(sleep).toHaveBeenCalledTimes(1);
|
|
38
|
-
expect(sleep).toHaveBeenCalledWith(1234);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it("starts immediately when host capacity is already available", async () => {
|
|
42
|
-
const { waitForVitestCapacity } = await importRunner();
|
|
43
|
-
const sleep = vi.fn(async () => {});
|
|
44
|
-
|
|
45
|
-
await waitForVitestCapacity({
|
|
46
|
-
readHostSnapshot: async () => ({
|
|
47
|
-
cpuCount: 14,
|
|
48
|
-
load1: 4,
|
|
49
|
-
freeMemoryBytes: 4 * 1024 * 1024 * 1024,
|
|
50
|
-
activeVitestProcesses: 1,
|
|
51
|
-
}),
|
|
52
|
-
sleep,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
expect(sleep).not.toHaveBeenCalled();
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it("does not block solely on unrelated host load once vitest concurrency and memory are healthy", async () => {
|
|
59
|
-
const { waitForVitestCapacity } = await importRunner();
|
|
60
|
-
const sleep = vi.fn(async () => {});
|
|
61
|
-
|
|
62
|
-
await waitForVitestCapacity({
|
|
63
|
-
readHostSnapshot: async () => ({
|
|
64
|
-
cpuCount: 14,
|
|
65
|
-
load1: 140,
|
|
66
|
-
freeMemoryBytes: 4 * 1024 * 1024 * 1024,
|
|
67
|
-
activeVitestProcesses: 1,
|
|
68
|
-
}),
|
|
69
|
-
sleep,
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
expect(sleep).not.toHaveBeenCalled();
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it("ignores unrelated worktree vitest processes when counting local shard pressure", async () => {
|
|
76
|
-
const { countActiveVitestProcesses } = await importRunner();
|
|
77
|
-
const repoRoot = "/Users/hole/aria/.worktrees/current";
|
|
78
|
-
const otherRoot = "/Users/hole/aria/.worktrees/other";
|
|
79
|
-
const processTable = [
|
|
80
|
-
`100 node ${repoRoot}/scripts/run-vitest-projects.mjs --passWithNoTests`,
|
|
81
|
-
`101 node ${repoRoot}/node_modules/.bin/../.pnpm/vitest@4.0.18/node_modules/vitest/vitest.mjs run packages/types/tests/logger.test.ts`,
|
|
82
|
-
`102 node ${otherRoot}/scripts/run-vitest-projects.mjs --passWithNoTests`,
|
|
83
|
-
`103 node ${otherRoot}/node_modules/.bin/../.pnpm/vitest@4.0.18/node_modules/vitest/vitest.mjs run packages/server/tests/real-peer-continuity-rotation-e2e.test.ts`,
|
|
84
|
-
`104 node ${otherRoot}/scripts/bootstrap-worktree.mjs`,
|
|
85
|
-
"105 node /opt/homebrew/bin/pnpm exec vitest run packages/server/tests/guards/network-runtime-blackbox-runner.contract.test.ts",
|
|
86
|
-
].join("\n");
|
|
87
|
-
|
|
88
|
-
expect(countActiveVitestProcesses(processTable, 100, repoRoot)).toBe(1);
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it("does not block solely on unrelated external vitest process counts once memory is healthy", async () => {
|
|
92
|
-
const { waitForVitestCapacity } = await importRunner();
|
|
93
|
-
const snapshots = [
|
|
94
|
-
{
|
|
95
|
-
cpuCount: 14,
|
|
96
|
-
load1: 4,
|
|
97
|
-
freeMemoryBytes: 4 * 1024 * 1024 * 1024,
|
|
98
|
-
activeVitestProcesses: 99,
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
cpuCount: 14,
|
|
102
|
-
load1: 4,
|
|
103
|
-
freeMemoryBytes: 4 * 1024 * 1024 * 1024,
|
|
104
|
-
activeVitestProcesses: 1,
|
|
105
|
-
},
|
|
106
|
-
];
|
|
107
|
-
const sleep = vi.fn(async () => {});
|
|
108
|
-
|
|
109
|
-
await waitForVitestCapacity({
|
|
110
|
-
readHostSnapshot: async () => snapshots.shift() ?? snapshots.at(-1)!,
|
|
111
|
-
sleep,
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
expect(sleep).not.toHaveBeenCalled();
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it("fails closed with diagnostics when free memory never recovers", async () => {
|
|
118
|
-
const { waitForVitestCapacity } = await importRunner();
|
|
119
|
-
let elapsedMs = 0;
|
|
120
|
-
const sleep = vi.fn(async (ms) => {
|
|
121
|
-
elapsedMs += ms;
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
await expect(
|
|
125
|
-
waitForVitestCapacity({
|
|
126
|
-
pollMs: 1_000,
|
|
127
|
-
timeoutMs: 2_500,
|
|
128
|
-
now: () => elapsedMs,
|
|
129
|
-
readHostSnapshot: async () => ({
|
|
130
|
-
cpuCount: 14,
|
|
131
|
-
load1: 64,
|
|
132
|
-
freeMemoryBytes: 128 * 1024 * 1024,
|
|
133
|
-
activeVitestProcesses: 9,
|
|
134
|
-
}),
|
|
135
|
-
sleep,
|
|
136
|
-
}),
|
|
137
|
-
).rejects.toThrow(/host capacity unavailable after 2500ms/);
|
|
138
|
-
|
|
139
|
-
expect(sleep).toHaveBeenCalledTimes(3);
|
|
140
|
-
expect(sleep).toHaveBeenNthCalledWith(1, 1_000);
|
|
141
|
-
});
|
|
142
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
const ORIGINAL_CI = process.env.CI;
|
|
4
|
-
const ORIGINAL_CONCURRENT = process.env.VITEST_CONCURRENT_PROCESSES;
|
|
5
|
-
const ORIGINAL_MAX_WORKERS = process.env.VITEST_MAX_WORKERS;
|
|
6
|
-
|
|
7
|
-
async function importFresh<T>(specifier: string): Promise<T> {
|
|
8
|
-
vi.resetModules();
|
|
9
|
-
return import(new URL(specifier, import.meta.url).href) as Promise<T>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
afterEach(() => {
|
|
13
|
-
vi.resetModules();
|
|
14
|
-
if (ORIGINAL_CI === undefined) {
|
|
15
|
-
delete process.env.CI;
|
|
16
|
-
} else {
|
|
17
|
-
process.env.CI = ORIGINAL_CI;
|
|
18
|
-
}
|
|
19
|
-
if (ORIGINAL_CONCURRENT === undefined) {
|
|
20
|
-
delete process.env.VITEST_CONCURRENT_PROCESSES;
|
|
21
|
-
} else {
|
|
22
|
-
process.env.VITEST_CONCURRENT_PROCESSES = ORIGINAL_CONCURRENT;
|
|
23
|
-
}
|
|
24
|
-
if (ORIGINAL_MAX_WORKERS === undefined) {
|
|
25
|
-
delete process.env.VITEST_MAX_WORKERS;
|
|
26
|
-
} else {
|
|
27
|
-
process.env.VITEST_MAX_WORKERS = ORIGINAL_MAX_WORKERS;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
describe("vitest shared pool config", () => {
|
|
32
|
-
it("treats CommonJS build outputs as infrastructure, not runnable source tests", async () => {
|
|
33
|
-
const { getExcludes } = await importFresh<typeof import("../../../vitest.shared.ts")>(
|
|
34
|
-
"../../../vitest.shared.ts",
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
expect(getExcludes()).toContain("**/dist-cjs/**");
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it("uses the root projects-mode concurrency budget when package configs load sharedPoolConfig", async () => {
|
|
41
|
-
delete process.env.VITEST_MAX_WORKERS;
|
|
42
|
-
process.env.VITEST_CONCURRENT_PROCESSES = "11";
|
|
43
|
-
|
|
44
|
-
const { getMaxWorkers, sharedPoolConfig } = await importFresh<
|
|
45
|
-
typeof import("../../../vitest.shared.ts")
|
|
46
|
-
>("../../../vitest.shared.ts");
|
|
47
|
-
|
|
48
|
-
expect(sharedPoolConfig.maxWorkers).toBe(getMaxWorkers(11));
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it("root vitest config publishes its project-count budget before package configs resolve", async () => {
|
|
52
|
-
delete process.env.VITEST_CONCURRENT_PROCESSES;
|
|
53
|
-
process.env.CI = "1";
|
|
54
|
-
|
|
55
|
-
await importFresh<typeof import("../../../vitest.config.ts")>("../../../vitest.config.ts");
|
|
56
|
-
|
|
57
|
-
expect(process.env.VITEST_CONCURRENT_PROCESSES).toBe("11");
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it("root vitest config serializes workspace projects instead of running all packages in parallel", async () => {
|
|
61
|
-
process.env.CI = "1";
|
|
62
|
-
|
|
63
|
-
const { default: rootConfig } = await importFresh<typeof import("../../../vitest.config.ts")>(
|
|
64
|
-
"../../../vitest.config.ts",
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
const projects = rootConfig.test?.projects ?? [];
|
|
68
|
-
expect(projects).toHaveLength(11);
|
|
69
|
-
|
|
70
|
-
const inlineProjects = projects.filter(
|
|
71
|
-
(project): project is Exclude<(typeof projects)[number], string> =>
|
|
72
|
-
typeof project !== "string",
|
|
73
|
-
);
|
|
74
|
-
expect(inlineProjects).toHaveLength(11);
|
|
75
|
-
expect(inlineProjects.map((project) => project.test?.sequence?.groupOrder)).toEqual([
|
|
76
|
-
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
|
77
|
-
]);
|
|
78
|
-
});
|
|
79
|
-
});
|
package/tsconfig.cjs.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"composite": true,
|
|
5
|
-
"module": "CommonJS",
|
|
6
|
-
"moduleResolution": "Node",
|
|
7
|
-
"outDir": "./dist-cjs",
|
|
8
|
-
"rootDir": "./src",
|
|
9
|
-
"declaration": true,
|
|
10
|
-
"declarationMap": false,
|
|
11
|
-
"tsBuildInfoFile": "./dist-cjs/.tsbuildinfo"
|
|
12
|
-
},
|
|
13
|
-
"include": ["src/**/*"],
|
|
14
|
-
"exclude": ["node_modules", "dist", "dist-cjs", "tests", "**/*.test.ts", "**/*.test.tsx"]
|
|
15
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"composite": true,
|
|
5
|
-
"outDir": "./dist",
|
|
6
|
-
"tsBuildInfoFile": "./dist/.tsbuildinfo",
|
|
7
|
-
"rootDir": "./src",
|
|
8
|
-
"types": ["node"]
|
|
9
|
-
},
|
|
10
|
-
"include": ["src/**/*"],
|
|
11
|
-
"exclude": ["node_modules", "dist", "tests", "**/*.test.ts", "**/*.test.tsx"]
|
|
12
|
-
}
|
package/vitest.config.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vitest/config";
|
|
2
|
-
import { getExcludes, sharedPoolConfig } from "../../vitest.shared.ts";
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
test: {
|
|
6
|
-
...sharedPoolConfig,
|
|
7
|
-
globals: true,
|
|
8
|
-
exclude: getExcludes(),
|
|
9
|
-
coverage: {
|
|
10
|
-
provider: "v8",
|
|
11
|
-
reporter: ["text", "json", "html"],
|
|
12
|
-
reportOnFailure: true,
|
|
13
|
-
include: ["src/**"],
|
|
14
|
-
exclude: ["**/__tests__/**", "**/*.test.ts"],
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
});
|