Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion test/unit/agent-sdk-driver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ describe("createAgentSdkCodingAgentDriver", () => {
});

it("enumerates tracked and untracked worktree changes with git", async () => {
// Real subprocess spawns (init, 2x config, add, commit, plus the driver's own diff enumeration) --
// legitimately more wall-clock latency than the default 15s test timeout reliably covers under
// concurrent CI shard/system load (observed timing out under heavy parallel contention with no logic
// failure; passes in well under 1s in isolation). An explicit timeout says so instead of relying on
// ambient headroom.
const dir = await mkdtemp(join(tmpdir(), "gittensory-agent-sdk-"));
try {
await execFileAsync("git", ["init"], { cwd: dir });
Expand All @@ -114,7 +119,7 @@ describe("createAgentSdkCodingAgentDriver", () => {
} finally {
await rm(dir, { recursive: true, force: true });
}
});
}, 30000);

it("derives changed files from the worktree after untracked mutating tools", async () => {
const driver = driverWith({
Expand Down
6 changes: 5 additions & 1 deletion test/unit/ai-summaries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,16 @@ describe("optional deterministic-summary rewrite layer", () => {
});

it("routes every forbidden public term through the canonical sanitizer and falls back when AI is unsafe", async () => {
// Iterates every entry in FORBIDDEN_PUBLIC_COMMENT_WORDS (40+ words) as its own real round trip through
// rewriteSignalBundleWithAi -- legitimately more work than the default 15s test timeout reliably covers
// under load (observed timing out under concurrent CI shard contention, not a logic failure: every
// assertion that DID run passed). An explicit timeout says so instead of relying on ambient headroom.
for (const word of FORBIDDEN_PUBLIC_COMMENT_WORDS) {
const run = vi.fn(async () => ({ response: `Looks great, includes ${word} detail.` }));
const result = await rewriteSignalBundleWithAi(publicEnv({}, run), rewriteReq());
expect(result, `forbidden word: ${word}`).toMatchObject({ status: "unsafe", text: DETERMINISTIC_BODY });
}
});
}, 30000);

it("rejects reward, ranking, scoreability, and reviewability variants in public AI rewrites", async () => {
const unsafeOutputs = [
Expand Down
6 changes: 5 additions & 1 deletion test/unit/upstream-ruleset.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,10 @@ describe("upstream ruleset drift tracking", () => {
expect(calls.find((call) => call.method === "POST")?.body?.assignees).toEqual(["alice", "bob"]); // trimmed, empty segment dropped
});

// 29 distinct real-D1-backed scenarios run sequentially in this one test -- legitimately more work than
// the default 15s test timeout reliably covers under concurrent CI shard/system load (observed timing out
// under heavy parallel contention with no assertion failure). An explicit timeout says so instead of
// relying on ambient headroom.
it("handles edge cases while filing upstream drift issues", async () => {
const defaultRepoEnv = createTestEnv({ GITTENSORY_AUTO_FILE_DRIFT_ISSUES: "1", GITTENSORY_DRIFT_ISSUE_TOKEN: "token", GITTENSORY_DRIFT_ISSUE_REPO: "" });
await upsertUpstreamDriftReport(defaultRepoEnv, driftReport("source-fingerprint", { severity: "medium", affectedAreas: [] }));
Expand Down Expand Up @@ -1225,7 +1229,7 @@ describe("upstream ruleset drift tracking", () => {
const disabledEnv = createTestEnv();
delete (disabledEnv as Partial<Env>).GITTENSORY_AUTO_FILE_DRIFT_ISSUES;
await expect(fileUpstreamDriftIssues(disabledEnv)).resolves.toMatchObject({ status: "disabled" });
});
}, 45000);

it("finds the existing drift issue on page 2 when the repo has more than 100 open signals issues", async () => {
const env = createTestEnv({ GITTENSORY_AUTO_FILE_DRIFT_ISSUES: "true", GITTENSORY_DRIFT_ISSUE_TOKEN: "token" });
Expand Down