Skip to content
Open
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
82 changes: 74 additions & 8 deletions src/agent/directors/emil/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ describe("emilPackage", () => {
test("systemPrompt identity is Emil / EmilDirector (package id stays emil)", () => {
const p = emilPackage.systemPrompt;
expect(p).toMatch(/EmilDirector \(Emil\)/);
expect(p).toMatch(/design-eng laws lane only/i);
expect(p).toMatch(/design-eng critique lane only/i);
});

test("systemPrompt states PRIMARY INTENT", () => {
expect(emilPackage.systemPrompt).toMatch(/PRIMARY INTENT/i);
expect(emilPackage.systemPrompt).toContain("route to builder");
});

test("systemPrompt is design-eng laws review, never-fix", () => {
test("systemPrompt is design-eng critique, never-fix", () => {
const p = emilPackage.systemPrompt;
expect(p).toMatch(/design-engineering laws review/i);
expect(p).toMatch(/design-engineering critique/i);
expect(p).toMatch(/never fix/i);
expect(p).toMatch(/cite at least one per finding/i);
expect(p).toMatch(/Design-engineering craft/i);
Expand All @@ -37,12 +37,20 @@ describe("emilPackage", () => {
expect(p).not.toMatch(/route to critique\b/);
});

test("systemPrompt covers product decisions, not just code", () => {
const p = emilPackage.systemPrompt;
expect(p).toMatch(/product decisions/i);
expect(p).toMatch(
/critical eye that finds problems through principles and evidence/i,
);
});

test("systemPrompt has blinders-on / brief-scoped design-eng review", () => {
const p = emilPackage.systemPrompt;
expect(p).toMatch(/BLINDERS ON/i);
expect(p).toMatch(/success_criteria/i);
expect(p).toMatch(/Do not wander/i);
expect(p).toMatch(/invent law violations from vibes/i);
expect(p).toMatch(/invent law\s+violations from vibes/i);
});

test("systemPrompt keeps classic software laws as secondary lenses", () => {
Expand All @@ -53,6 +61,62 @@ describe("emilPackage", () => {
expect(p).toMatch(/No implementation prescriptions/i);
});

test("systemPrompt restores the Thinking & Reasoning laws (CL-7801)", () => {
const p = emilPackage.systemPrompt;
expect(p).toMatch(/Thinking & reasoning/i);
expect(p).toMatch(/First Principles/);
expect(p).toMatch(/Inversion/);
expect(p).toMatch(/Map Is Not the Territory/);
expect(p).toMatch(/Gilb's Law/);
});

test("systemPrompt restores the Boy Scout Rule (CL-7801)", () => {
expect(emilPackage.systemPrompt).toMatch(/Boy Scout Rule/);
});

test("systemPrompt restores the reviewer capabilities incl. temp tests (CL-7801)", () => {
const p = emilPackage.systemPrompt;
expect(p).toMatch(/tmp\/critique-tests/);
expect(p).toMatch(/Run existing test suites/i);
expect(p).toMatch(/linter|type checker|static analysis/i);
expect(p).toMatch(
/If a test disproves your hypothesis, discard that finding/i,
);
});

test("systemPrompt restores the design-eng cross-reference checklist (CL-7801)", () => {
const p = emilPackage.systemPrompt;
expect(p).toMatch(/cross-reference/i);
expect(p).toMatch(/missing will-change/i);
expect(p).toMatch(/scale-on-press values/i);
expect(p).toMatch(/hit area minimums/i);
});

test("systemPrompt restores the full report format (CL-7801)", () => {
const p = emilPackage.systemPrompt;
expect(p).toMatch(/# Report format/i);
expect(p).toMatch(/## Summary/);
expect(p).toMatch(/## Findings/);
expect(p).toMatch(/## Test results/);
expect(p).toMatch(/Recommended tests for permanent inclusion/i);
expect(p).toMatch(/## Observations/);
expect(p).toMatch(/## Blockers/);
expect(p).toMatch(/## Paths/);
expect(p).toMatch(/Confidence.*VERIFIED \/ HIGH \/ MEDIUM/);
});

test("systemPrompt restores guidelines and negative constraints (CL-7801)", () => {
const p = emilPackage.systemPrompt;
expect(p).toMatch(/Quality Over Quantity/i);
expect(p).toMatch(/Cite the Law/i);
expect(p).toMatch(/Evidence Required/i);
expect(p).toMatch(/Severity Matters/i);
expect(p).toMatch(/Don't Moralize/i);
expect(p).toMatch(/Do not modify production code/i);
expect(p).toMatch(/Do not commit changes/i);
expect(p).toMatch(/Do not write permanent test files/i);
});

test("systemPrompt has no tool-schema restatement or fake caps", () => {
const p = emilPackage.systemPrompt;
expect(p).not.toMatch(/parameters?:/i);
Expand All @@ -64,11 +128,7 @@ describe("emilPackage", () => {
expect(p).not.toMatch(/Shell find\/rg/i);
expect(p).not.toMatch(/Write tools are not mounted/i);
expect(p).not.toMatch(/via run_shell/i);
expect(p).not.toMatch(/not temp test files/i);
expect(p).not.toMatch(/# Report shape/);
expect(p).not.toMatch(/## Summary/);
expect(p).not.toMatch(/Never spawn/);
expect(p).not.toMatch(/Never commit/);
});

test("spawn.maySpawn is false", () => {
Expand All @@ -88,6 +148,12 @@ describe("emilPackage", () => {
expect(emilPackage.modelRole).toBe("review");
});

test("description matches the CMO original (CL-7801)", () => {
expect(emilPackage.description).toMatch(/Design engineering critique/i);
expect(emilPackage.description).toMatch(/product decisions/i);
expect(emilPackage.description).toMatch(/never fixes them/i);
});

test("primaryIntent and outOfLane match emil lane", () => {
expect(emilPackage.primaryIntent).toBe(
"Design-engineering laws review; never fix product code",
Expand Down
Loading
Loading