Skip to content

Commit 0861ff8

Browse files
committed
Address review: prettier, narrow fixture exclusion, fix stale imports
- Run prettier on the 7 files CI flagged. - Narrow the tests/fixtures/** typecheck exclusion so it no longer covers tests/fixtures/crash-run or tests/fixtures/plugins/implement-feature — both import real production modules by relative path and crash-run is spawned by tests/integration/crash-finalize.test.ts as a live exercise of that code. Excluding them would have recreated the gap this PR closes. List the remaining hermetic eval fixtures individually instead of a blanket glob. - Typechecking implement-feature surfaced exactly the kind of drift this PR targets: its relative imports were two directories short (stale), so CommandPlugin/WorkflowPlugin resolved to nothing. Fixed the path depth. The fixture isn't wired into any test today, so this was invisible until now.
1 parent e906dcd commit 0861ff8

9 files changed

Lines changed: 81 additions & 24 deletions

File tree

tests/fixtures/plugins/implement-feature/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { implementFeature } from "./workflows/implement-feature.js";
2-
import type { CommandPlugin } from "../../../src/tui/commands/registry.js";
3-
import type { WorkflowPlugin } from "../../../src/workflows/definition.js";
2+
import type { CommandPlugin } from "../../../../../src/tui/commands/registry.js";
3+
import type { WorkflowPlugin } from "../../../../../src/workflows/definition.js";
44

55
export const workflowPlugin: WorkflowPlugin = {
66
workflows: [implementFeature],

tests/fixtures/plugins/implement-feature/src/workflows/implement-feature.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Workflow } from "../../../../src/workflows/definition.js";
1+
import type { Workflow } from "../../../../../../src/workflows/definition.js";
22

33
export const implementFeature: Workflow = {
44
name: "implement-feature",

tests/unit/codex-session.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ describe("getValidCodexToken", () => {
122122
{ name: "p", createdAt: 0, tokens: { access: "old", refresh: "bad", expiresAt: 1_000 } },
123123
home,
124124
);
125-
globalThis.fetch = (async () => new Response("revoked", { status: 400 })) as unknown as typeof fetch;
125+
globalThis.fetch = (async () =>
126+
new Response("revoked", { status: 400 })) as unknown as typeof fetch;
126127
const err = await getValidCodexToken("p", 5_000, home).catch((e: unknown) => e);
127128
expect(err).toBeInstanceOf(CodexAuthError);
128129
expect((err as CodexAuthError).reason).toBe("refresh-failed");

tests/unit/resolve-inference-spec.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import type { InferenceSpec } from "../../src/agent/profile-types.js";
88

99
const baseSettings: Settings = {
1010
providers: {
11-
anthropic: { baseURL: "https://api.anthropic.com", models: ["claude-sonnet-4", "claude-haiku-4"] },
11+
anthropic: {
12+
baseURL: "https://api.anthropic.com",
13+
models: ["claude-sonnet-4", "claude-haiku-4"],
14+
},
1215
xai: { baseURL: "https://api.x.ai", models: ["grok-4"] },
1316
local: { baseURL: "http://localhost:11434", models: [] }, // empty models list = unrestricted
1417
},

tests/unit/subagent.test.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,9 @@ describe("createTaskTool profile resolution", () => {
742742
cwd: "/repo",
743743
getWorkdirBase: () => "/repo/.ctx",
744744
provider,
745-
settings: baseSettings as unknown as NonNullable<Parameters<typeof createTaskTool>[0]["settings"]>,
745+
settings: baseSettings as unknown as NonNullable<
746+
Parameters<typeof createTaskTool>[0]["settings"]
747+
>,
746748
profiles: [
747749
{
748750
id: "p",
@@ -779,7 +781,9 @@ describe("createTaskTool profile resolution", () => {
779781
cwd: "/repo",
780782
getWorkdirBase: () => "/repo/.ctx",
781783
provider,
782-
settings: baseSettings as unknown as NonNullable<Parameters<typeof createTaskTool>[0]["settings"]>,
784+
settings: baseSettings as unknown as NonNullable<
785+
Parameters<typeof createTaskTool>[0]["settings"]
786+
>,
783787
profiles: [
784788
{
785789
id: "p",
@@ -811,7 +815,9 @@ describe("createTaskTool profile resolution", () => {
811815
cwd: "/repo",
812816
getWorkdirBase: () => "/repo/.ctx",
813817
provider,
814-
settings: baseSettings as unknown as NonNullable<Parameters<typeof createTaskTool>[0]["settings"]>,
818+
settings: baseSettings as unknown as NonNullable<
819+
Parameters<typeof createTaskTool>[0]["settings"]
820+
>,
815821
profiles: [
816822
{
817823
id: "p",
@@ -852,7 +858,9 @@ describe("createTaskTool profile resolution", () => {
852858
cwd: "/repo",
853859
getWorkdirBase: () => "/repo/.ctx",
854860
provider: { ...provider, reasoningEffort: "high" },
855-
settings: baseSettings as unknown as NonNullable<Parameters<typeof createTaskTool>[0]["settings"]>,
861+
settings: baseSettings as unknown as NonNullable<
862+
Parameters<typeof createTaskTool>[0]["settings"]
863+
>,
856864
profiles: [
857865
{
858866
id: "p",
@@ -883,7 +891,9 @@ describe("createTaskTool profile resolution", () => {
883891
cwd: "/repo",
884892
getWorkdirBase: () => "/repo/.ctx",
885893
provider: { ...provider, reasoningEffort: "high" },
886-
settings: baseSettings as unknown as NonNullable<Parameters<typeof createTaskTool>[0]["settings"]>,
894+
settings: baseSettings as unknown as NonNullable<
895+
Parameters<typeof createTaskTool>[0]["settings"]
896+
>,
887897
profiles: [
888898
{
889899
id: "p",
@@ -912,7 +922,9 @@ describe("createTaskTool profile resolution", () => {
912922
cwd: "/repo",
913923
getWorkdirBase: () => "/repo/.ctx",
914924
provider: { ...provider, reasoningEffort: "low" },
915-
settings: baseSettings as unknown as NonNullable<Parameters<typeof createTaskTool>[0]["settings"]>,
925+
settings: baseSettings as unknown as NonNullable<
926+
Parameters<typeof createTaskTool>[0]["settings"]
927+
>,
916928
profiles: [
917929
{
918930
id: "orch",
@@ -947,7 +959,9 @@ describe("createTaskTool profile resolution", () => {
947959
cwd: "/repo",
948960
getWorkdirBase: () => "/repo/.ctx",
949961
provider,
950-
settings: baseSettings as unknown as NonNullable<Parameters<typeof createTaskTool>[0]["settings"]>,
962+
settings: baseSettings as unknown as NonNullable<
963+
Parameters<typeof createTaskTool>[0]["settings"]
964+
>,
951965
profiles: [{ id: "karen", systemPromptRole: "You are karen.", orchestrator: true }],
952966
run: async (params) => {
953967
received = params;

tests/unit/telemetry-product-events.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,7 @@ test("skill_used carries no skill name, so an employer-named skill cannot leak",
137137

138138
const tool = createUseSkillTool(cwd, [], telemetry);
139139
if (tool.kind !== "string") throw new Error(`expected string tool, got ${tool.kind}`);
140-
const result = await tool.handler(
141-
{ name: "acme-internal-deploy" },
142-
new AbortController().signal,
143-
);
140+
const result = await tool.handler({ name: "acme-internal-deploy" }, new AbortController().signal);
144141

145142
// Guard against the test passing because resolution failed: the event only
146143
// fires on a resolved skill, so a silent miss would trivially "not leak".

tests/unit/tui/agent-tools.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ mock.module("../../../src/agent/posix-tool-plugins.js", () => ({
7070
}));
7171

7272
const mockConnectMCPServer = mock(
73-
async (config: { name: string }, _options?: import("../../../src/mcp/client.js").MCPConnectOptions) => ({
73+
async (
74+
config: { name: string },
75+
_options?: import("../../../src/mcp/client.js").MCPConnectOptions,
76+
) => ({
7477
ok: false as const,
7578
serverName: config.name,
7679
error: "not connected",

tests/unit/workflows-director.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ test("the active step directive is injected into the inferred system prompt", as
101101
type: "message.received",
102102
message: {
103103
ref: { uid: 1, mailbox: "INBOX" },
104-
headers: { from: "user@test", to: ["agent@test"], date: "1970-01-01T00:00:00Z", messageId: "m1" },
104+
headers: {
105+
from: "user@test",
106+
to: ["agent@test"],
107+
date: "1970-01-01T00:00:00Z",
108+
messageId: "m1",
109+
},
105110
flags: [],
106111
signatureStatus: "missing",
107112
content: "go",

tsconfig.json

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,48 @@
1111
"@intx/types/*": ["./vendor/intx-types/src/*"]
1212
}
1313
},
14-
"include": ["src/**/*.ts", "packages/**/*.ts", "tests/**/*.ts", "evals/**/*.ts", "scripts/**/*.ts"],
14+
"include": [
15+
"src/**/*.ts",
16+
"packages/**/*.ts",
17+
"tests/**/*.ts",
18+
"evals/**/*.ts",
19+
"scripts/**/*.ts"
20+
],
1521
// Excluded: hermetic sandbox repos for the capability eval suite, not real
16-
// application code. They own their own package.json/tsconfig-free layout,
17-
// are copied into per-run workdirs rather than imported, and some
18-
// deliberately contain invalid syntax (e.g. tests/fixtures/broken-toolchain)
19-
// as fixture content for an eval case.
22+
// application code. They own their own package.json and are copied into
23+
// per-run eval workdirs rather than imported, and tests/fixtures/buggy-service
24+
// deliberately ships a bug as fixture content for an eval case.
25+
//
26+
// tests/fixtures/crash-run and tests/fixtures/plugins/implement-feature are
27+
// NOT listed here on purpose: they import real production modules by
28+
// relative path (src/index.ts, src/session/active-run.ts, src/session/state.ts,
29+
// src/tui/runner.ts, src/workflows/definition.ts, src/tui/commands/registry.ts)
30+
// and tests/integration/crash-finalize.test.ts spawns them as live exercises
31+
// of that code. Excluding them would recreate exactly the silent-drift gap
32+
// this config change exists to close.
2033
"exclude": [
21-
"tests/fixtures/**",
34+
"tests/fixtures/broken-toolchain/**",
35+
"tests/fixtures/buggy-service/**",
36+
"tests/fixtures/cart-service/**",
37+
"tests/fixtures/codex-sse/**",
38+
"tests/fixtures/demo-comparison/**",
39+
"tests/fixtures/env-config-build/**",
40+
"tests/fixtures/flaky-baseline/**",
41+
"tests/fixtures/flaky-cache/**",
42+
"tests/fixtures/inventory-service/**",
43+
"tests/fixtures/large-read/**",
44+
"tests/fixtures/marketplace/**",
45+
"tests/fixtures/multi-file-service/**",
46+
"tests/fixtures/multiline-edit/**",
47+
"tests/fixtures/plugins/exa/**",
48+
"tests/fixtures/plugins/example-agent/**",
49+
"tests/fixtures/plugins/example-commands/**",
50+
"tests/fixtures/plugins/example-tool/**",
51+
"tests/fixtures/rawmode-sigint/**",
52+
"tests/fixtures/report-pipeline/**",
53+
"tests/fixtures/skill-workspace/**",
54+
"tests/fixtures/slow-command/**",
55+
"tests/fixtures/web-note/**",
2256
"evals/capability/cases/**"
2357
]
2458
}

0 commit comments

Comments
 (0)