Files
AgentCompany/tests/unit/prompt-manager-classification.test.ts
T
ZacharyZhang-NY b772e1c758 Build the current workspace snapshot on native CI runners
This branch snapshots the in-progress desktop workspace so GitHub-hosted Windows and Linux runners can package the same source tree that already passes local verification on macOS.

Constraint: Local Apple Silicon Docker/Wine packaging crashes before Windows artifacts are produced
Rejected: Publish from the incomplete base repo state | remote typecheck failed because current source additions were missing
Confidence: medium
Scope-risk: broad
Directive: Treat this branch as a build snapshot only; do not merge it without reviewing the unrelated workspace changes it contains
Tested: local typecheck, lint, workspace typecheck, unit tests, integration tests, e2e smoke, macOS signed release upload
Not-tested: Native Windows/Linux artifacts before this CI run
2026-04-04 03:28:14 -04:00

81 lines
2.4 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { buildSystemPrompt } from "../../src/main/prompt-builder";
import type { PromptContext } from "../../src/main/prompt-builder/index";
function buildCtx(overrides: Partial<PromptContext> = {}): PromptContext {
return {
agent: {
id: "agent-1",
companyId: "company-1",
name: "CTO",
role: "CTO",
title: "Chief Technology Officer",
department: "engineering",
status: "active",
reportsTo: "ceo-1",
connectorId: "codex_local",
workspaceId: null,
model: null,
capabilities: "Lead engineering",
budgetMonthlyUsd: 200,
spentMonthlyUsd: 0,
metadataJson: "{}",
heartbeatEnabled: true,
heartbeatIntervalSec: 120,
lastHeartbeatAt: null,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
apiUrl: "http://127.0.0.1:3210",
apiKey: "token",
runId: "run-1",
task: null,
companyName: "Prompt Co",
companyDescription: "Tests leadership prompt classification",
goals: [],
projects: [],
directReports: [],
chainOfCommand: [{
id: "ceo-1",
companyId: "company-1",
name: "CEO",
role: "CEO",
title: "Chief Executive Officer",
department: "executive",
status: "active",
reportsTo: null,
connectorId: "codex_local",
workspaceId: null,
model: null,
capabilities: "Lead the company",
budgetMonthlyUsd: 250,
spentMonthlyUsd: 0,
metadataJson: "{}",
heartbeatEnabled: true,
heartbeatIntervalSec: 120,
lastHeartbeatAt: null,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
}],
assignedTasks: [],
allAgents: [],
pendingApprovals: [],
tasksAwaitingReview: [],
wakeReason: null,
allTasks: [],
recentComments: [],
socialAccounts: [],
...overrides,
};
}
describe("buildSystemPrompt leadership classification", () => {
it("treats first-layer executive leaders as managers even before they have direct reports", () => {
const prompt = buildSystemPrompt(buildCtx());
expect(prompt).toContain("Operating Instructions (Manager)");
expect(prompt).toContain("New hires for your team should report to you by default");
expect(prompt).not.toContain("Operating Instructions (Individual Contributor)");
});
});