Skip to content

Commit 6fb74d4

Browse files
committed
perf: simplify tsgo test lanes
1 parent 9a94194 commit 6fb74d4

6 files changed

Lines changed: 44 additions & 25 deletions

File tree

‎AGENTS.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,13 @@
127127
- Node remains supported for running built output (`dist/*`) and production installs.
128128
- Mac packaging (dev): `scripts/package-mac-app.sh` defaults to current arch.
129129
- Type-check/build: `pnpm build`
130-
- TypeScript checks are split by architecture boundary:
130+
- TypeScript checks are split by architecture boundary, with four normal lanes:
131131
- `pnpm tsgo` / `pnpm tsgo:core`: core production roots (`src/`, `ui/`, `packages/`; no `extensions/` include roots).
132132
- `pnpm tsgo:core:test`: core colocated tests.
133-
- `pnpm tsgo:core:test:agents` / `pnpm tsgo:core:test:non-agents`: core test slices for isolating the heavy agent graph while debugging type-check performance.
134133
- `pnpm tsgo:extensions`: bundled extension production graph.
135134
- `pnpm tsgo:extensions:test`: bundled extension colocated tests.
136135
- `pnpm tsgo:all`: every TypeScript graph above; this is what `pnpm check` runs.
137-
- `pnpm tsgo:profile [core-test|core-test-agents|core-test-non-agents|extensions-test|--all]`: profile fresh graph cost into `.artifacts/tsgo-profile/`; if a core graph lists `extensions/<id>/`, treat that as boundary/perf debt from imports (usually plugin-sdk facades or shared helpers pulling extension sources).
136+
- `pnpm tsgo:profile [core-test|extensions-test|--all]`: profile fresh graph cost into `.artifacts/tsgo-profile/`. Diagnostic-only profile slices (`core-test-agents`, `core-test-non-agents`) exist for investigating agent graph cost; do not treat them as normal user-facing checks.
138137
- Narrow aliases remain for local loops: `pnpm tsgo:test:src`, `pnpm tsgo:test:ui`, `pnpm tsgo:test:packages`.
139138
- Do not add `tsc --noEmit`, `typecheck`, or `check:types` lanes for repo type checking. Use `tsgo` graphs. `tsc` is allowed only when emitting declaration/package-boundary compatibility artifacts that `tsgo` does not replace.
140139
- Boundary rule: core must not know extension implementation details. Extensions hook into core through manifests, registries, capabilities, and public `openclaw/plugin-sdk/*` contracts. If you find core production code naming a specific extension, or a core test that is really testing extension-owned behavior, call it out and prefer moving coverage/logic to the owning extension or a generic contract test.

‎package.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,8 +1474,6 @@
14741474
"tsgo:all": "pnpm tsgo:core && pnpm tsgo:core:test && pnpm tsgo:extensions && pnpm tsgo:extensions:test",
14751475
"tsgo:core": "node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo",
14761476
"tsgo:core:test": "node scripts/run-tsgo.mjs -p tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfo",
1477-
"tsgo:core:test:agents": "node scripts/run-tsgo.mjs -p tsconfig.core.test.agents.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test-agents.tsbuildinfo",
1478-
"tsgo:core:test:non-agents": "node scripts/run-tsgo.mjs -p tsconfig.core.test.non-agents.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test-non-agents.tsbuildinfo",
14791477
"tsgo:extensions": "node scripts/run-tsgo.mjs -p tsconfig.extensions.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions.tsbuildinfo",
14801478
"tsgo:extensions:test": "node scripts/run-tsgo.mjs -p tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfo",
14811479
"tsgo:prod": "pnpm tsgo:core && pnpm tsgo:extensions",

‎scripts/profile-tsgo.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ const GRAPH_DEFINITIONS = {
2424
},
2525
"core-test-agents": {
2626
config: "tsconfig.core.test.agents.json",
27-
description: "core agent colocated test graph",
27+
description: "diagnostic slice: core agent colocated tests",
2828
},
2929
"core-test-non-agents": {
3030
config: "tsconfig.core.test.non-agents.json",
31-
description: "core non-agent colocated test graph",
31+
description: "diagnostic slice: core tests excluding agent test roots",
3232
},
3333
extensions: {
3434
config: "tsconfig.extensions.json",

‎src/infra/outbound/channel-adapters.test.ts‎

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Container, Separator, TextDisplay } from "@buape/carbon";
21
import { beforeEach, describe, expect, it } from "vitest";
32
import type { ChannelPlugin } from "../../channels/plugins/types.js";
43
import { setActivePluginRegistry } from "../../plugins/runtime.js";
@@ -8,7 +7,17 @@ import {
87
} from "../../test-utils/channel-plugins.js";
98
import { getChannelMessageAdapter } from "./channel-adapters.js";
109

11-
class TestDiscordUiContainer extends Container {}
10+
class TestTextDisplay {
11+
constructor(readonly content: string) {}
12+
}
13+
14+
class TestSeparator {
15+
constructor(readonly options: { divider: boolean; spacing: string }) {}
16+
}
17+
18+
class TestDiscordUiContainer {
19+
constructor(readonly components: Array<TestTextDisplay | TestSeparator>) {}
20+
}
1221

1322
const discordCrossContextPlugin: Pick<
1423
ChannelPlugin,
@@ -18,12 +27,12 @@ const discordCrossContextPlugin: Pick<
1827
messaging: {
1928
buildCrossContextComponents: ({ originLabel, message, cfg, accountId }) => {
2029
const trimmed = message.trim();
21-
const components: Array<TextDisplay | Separator> = [];
30+
const components: Array<TestTextDisplay | TestSeparator> = [];
2231
if (trimmed) {
23-
components.push(new TextDisplay(message));
24-
components.push(new Separator({ divider: true, spacing: "small" }));
32+
components.push(new TestTextDisplay(message));
33+
components.push(new TestSeparator({ divider: true, spacing: "small" }));
2534
}
26-
components.push(new TextDisplay(`*From ${originLabel}*`));
35+
components.push(new TestTextDisplay(`*From ${originLabel}*`));
2736
void cfg;
2837
void accountId;
2938
return [new TestDiscordUiContainer(components)];
@@ -68,9 +77,9 @@ describe("getChannelMessageAdapter", () => {
6877
expect(components).toHaveLength(1);
6978
expect(container).toBeInstanceOf(TestDiscordUiContainer);
7079
expect(container?.components).toEqual([
71-
expect.any(TextDisplay),
72-
expect.any(Separator),
73-
expect.any(TextDisplay),
80+
expect.any(TestTextDisplay),
81+
expect.any(TestSeparator),
82+
expect.any(TestTextDisplay),
7483
]);
7584
});
7685

@@ -79,12 +88,16 @@ describe("getChannelMessageAdapter", () => {
7988
message: "Hello from chat",
8089
originLabel: "Telegram",
8190
accountId: "primary",
82-
expectedComponents: [expect.any(TextDisplay), expect.any(Separator), expect.any(TextDisplay)],
91+
expectedComponents: [
92+
expect.any(TestTextDisplay),
93+
expect.any(TestSeparator),
94+
expect.any(TestTextDisplay),
95+
],
8396
},
8497
{
8598
message: " ",
8699
originLabel: "Signal",
87-
expectedComponents: [expect.any(TextDisplay)],
100+
expectedComponents: [expect.any(TestTextDisplay)],
88101
},
89102
])(
90103
"builds cross-context components for %j",

‎src/infra/outbound/outbound-policy.test.ts‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Container, Separator, TextDisplay } from "@buape/carbon";
21
import { beforeAll, beforeEach, describe, expect, it } from "vitest";
32
import { vi } from "vitest";
43
import type { ChannelMessageActionName } from "../../channels/plugins/types.js";
@@ -9,7 +8,17 @@ let buildCrossContextDecoration: typeof import("./outbound-policy.js").buildCros
98
let enforceCrossContextPolicy: typeof import("./outbound-policy.js").enforceCrossContextPolicy;
109
let shouldApplyCrossContextMarker: typeof import("./outbound-policy.js").shouldApplyCrossContextMarker;
1110

12-
class TestDiscordUiContainer extends Container {}
11+
class TestTextDisplay {
12+
constructor(readonly content: string) {}
13+
}
14+
15+
class TestSeparator {
16+
constructor(readonly options: { divider: boolean; spacing: string }) {}
17+
}
18+
19+
class TestDiscordUiContainer {
20+
constructor(readonly components: Array<TestTextDisplay | TestSeparator>) {}
21+
}
1322

1423
const mocks = vi.hoisted(() => ({
1524
getChannelMessageAdapter: vi.fn((channel: string) =>
@@ -24,12 +33,12 @@ const mocks = vi.hoisted(() => ({
2433
message: string;
2534
}) => {
2635
const trimmed = message.trim();
27-
const components: Array<TextDisplay | Separator> = [];
36+
const components: Array<TestTextDisplay | TestSeparator> = [];
2837
if (trimmed) {
29-
components.push(new TextDisplay(message));
30-
components.push(new Separator({ divider: true, spacing: "small" }));
38+
components.push(new TestTextDisplay(message));
39+
components.push(new TestSeparator({ divider: true, spacing: "small" }));
3140
}
32-
components.push(new TextDisplay(`*From ${originLabel}*`));
41+
components.push(new TestTextDisplay(`*From ${originLabel}*`));
3342
return [new TestDiscordUiContainer(components)];
3443
},
3544
}

‎src/types/pi-coding-agent.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "@mariozechner/pi-coding-agent";
1+
export type OpenClawPiCodingAgentSkillSourceAugmentation = never;
22

33
declare module "@mariozechner/pi-coding-agent" {
44
interface Skill {

0 commit comments

Comments
 (0)