Skip to content

Commit 9445c37

Browse files
committed
Restore Emil critique layer from the CMO original at full fidelity
The design-eng overhaul had narrowed the prompt to a laws digest; port back every dropped section from the CMO source. Deviations are enumerated in the package header.
1 parent bf79cc0 commit 9445c37

3 files changed

Lines changed: 270 additions & 38 deletions

File tree

src/agent/directors/emil/package.test.ts

Lines changed: 74 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ describe("emilPackage", () => {
1414
test("systemPrompt identity is Emil / EmilDirector (package id stays emil)", () => {
1515
const p = emilPackage.systemPrompt;
1616
expect(p).toMatch(/EmilDirector \(Emil\)/);
17-
expect(p).toMatch(/design-eng laws lane only/i);
17+
expect(p).toMatch(/design-eng critique lane only/i);
1818
});
1919

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

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

40+
test("systemPrompt covers product decisions, not just code", () => {
41+
const p = emilPackage.systemPrompt;
42+
expect(p).toMatch(/product decisions/i);
43+
expect(p).toMatch(
44+
/critical eye that finds problems through principles and evidence/i,
45+
);
46+
});
47+
4048
test("systemPrompt has blinders-on / brief-scoped design-eng review", () => {
4149
const p = emilPackage.systemPrompt;
4250
expect(p).toMatch(/BLINDERS ON/i);
4351
expect(p).toMatch(/success_criteria/i);
4452
expect(p).toMatch(/Do not wander/i);
45-
expect(p).toMatch(/invent law violations from vibes/i);
53+
expect(p).toMatch(/invent law\s+violations from vibes/i);
4654
});
4755

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

64+
test("systemPrompt restores the Thinking & Reasoning laws (CL-7801)", () => {
65+
const p = emilPackage.systemPrompt;
66+
expect(p).toMatch(/Thinking & reasoning/i);
67+
expect(p).toMatch(/First Principles/);
68+
expect(p).toMatch(/Inversion/);
69+
expect(p).toMatch(/Map Is Not the Territory/);
70+
expect(p).toMatch(/Gilb's Law/);
71+
});
72+
73+
test("systemPrompt restores the Boy Scout Rule (CL-7801)", () => {
74+
expect(emilPackage.systemPrompt).toMatch(/Boy Scout Rule/);
75+
});
76+
77+
test("systemPrompt restores the reviewer capabilities incl. temp tests (CL-7801)", () => {
78+
const p = emilPackage.systemPrompt;
79+
expect(p).toMatch(/tmp\/critique-tests/);
80+
expect(p).toMatch(/Run existing test suites/i);
81+
expect(p).toMatch(/linter|type checker|static analysis/i);
82+
expect(p).toMatch(
83+
/If a test disproves your hypothesis, discard that finding/i,
84+
);
85+
});
86+
87+
test("systemPrompt restores the design-eng cross-reference checklist (CL-7801)", () => {
88+
const p = emilPackage.systemPrompt;
89+
expect(p).toMatch(/cross-reference/i);
90+
expect(p).toMatch(/missing will-change/i);
91+
expect(p).toMatch(/scale-on-press values/i);
92+
expect(p).toMatch(/hit area minimums/i);
93+
});
94+
95+
test("systemPrompt restores the full report format (CL-7801)", () => {
96+
const p = emilPackage.systemPrompt;
97+
expect(p).toMatch(/# Report format/i);
98+
expect(p).toMatch(/## Summary/);
99+
expect(p).toMatch(/## Findings/);
100+
expect(p).toMatch(/## Test results/);
101+
expect(p).toMatch(/Recommended tests for permanent inclusion/i);
102+
expect(p).toMatch(/## Observations/);
103+
expect(p).toMatch(/## Blockers/);
104+
expect(p).toMatch(/## Paths/);
105+
expect(p).toMatch(/Confidence.*VERIFIED \/ HIGH \/ MEDIUM/);
106+
});
107+
108+
test("systemPrompt restores guidelines and negative constraints (CL-7801)", () => {
109+
const p = emilPackage.systemPrompt;
110+
expect(p).toMatch(/Quality Over Quantity/i);
111+
expect(p).toMatch(/Cite the Law/i);
112+
expect(p).toMatch(/Evidence Required/i);
113+
expect(p).toMatch(/Severity Matters/i);
114+
expect(p).toMatch(/Don't Moralize/i);
115+
expect(p).toMatch(/Do not modify production code/i);
116+
expect(p).toMatch(/Do not commit changes/i);
117+
expect(p).toMatch(/Do not write permanent test files/i);
118+
});
119+
56120
test("systemPrompt has no tool-schema restatement or fake caps", () => {
57121
const p = emilPackage.systemPrompt;
58122
expect(p).not.toMatch(/parameters?:/i);
@@ -64,11 +128,7 @@ describe("emilPackage", () => {
64128
expect(p).not.toMatch(/Shell find\/rg/i);
65129
expect(p).not.toMatch(/Write tools are not mounted/i);
66130
expect(p).not.toMatch(/via run_shell/i);
67-
expect(p).not.toMatch(/not temp test files/i);
68-
expect(p).not.toMatch(/# Report shape/);
69-
expect(p).not.toMatch(/## Summary/);
70131
expect(p).not.toMatch(/Never spawn/);
71-
expect(p).not.toMatch(/Never commit/);
72132
});
73133

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

151+
test("description matches the CMO original (CL-7801)", () => {
152+
expect(emilPackage.description).toMatch(/Design engineering critique/i);
153+
expect(emilPackage.description).toMatch(/product decisions/i);
154+
expect(emilPackage.description).toMatch(/never fixes them/i);
155+
});
156+
91157
test("primaryIntent and outOfLane match emil lane", () => {
92158
expect(emilPackage.primaryIntent).toBe(
93159
"Design-engineering laws review; never fix product code",

0 commit comments

Comments
 (0)