Skip to content

Commit 7e556ce

Browse files
Merge pull request #999 from corbitsdev/cl-7800-restore-emil-cmo-copymessaging-layer-at-full-fidelity
Restore Emil critique layer from the CMO original at full fidelity
2 parents 0d5c14c + 987264a commit 7e556ce

2 files changed

Lines changed: 232 additions & 36 deletions

File tree

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

Lines changed: 78 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,66 @@ 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 defers to the scaffold envelope and carries report content as Findings sub-bullets (CL-7801)", () => {
96+
const p = emilPackage.systemPrompt;
97+
expect(p).toMatch(/# Report\n/);
98+
expect(p).toMatch(/scaffold owns its shape/i);
99+
expect(p).not.toMatch(/# Report format/);
100+
expect(p).not.toMatch(/## Summary/);
101+
expect(p).not.toMatch(/## Findings/);
102+
expect(p).not.toMatch(/## Test results/);
103+
expect(p).not.toMatch(/## Observations/);
104+
expect(p).not.toMatch(/## Blockers/);
105+
expect(p).not.toMatch(/## Paths/);
106+
expect(p).toMatch(/Recommended tests for permanent inclusion/i);
107+
expect(p).toMatch(/confidence.*VERIFIED \/ HIGH \/ MEDIUM/i);
108+
expect(p).toMatch(/severity.*Critical.*Major.*Minor/i);
109+
expect(p).toMatch(/Observations: patterns across findings/);
110+
});
111+
112+
test("systemPrompt restores guidelines and negative constraints (CL-7801)", () => {
113+
const p = emilPackage.systemPrompt;
114+
expect(p).toMatch(/Quality Over Quantity/i);
115+
expect(p).toMatch(/Cite the Law/i);
116+
expect(p).toMatch(/Evidence Required/i);
117+
expect(p).toMatch(/Severity Matters/i);
118+
expect(p).toMatch(/Don't Moralize/i);
119+
expect(p).toMatch(/Do not modify production code/i);
120+
expect(p).toMatch(/Do not commit changes/i);
121+
expect(p).toMatch(/Do not write permanent test files/i);
122+
});
123+
56124
test("systemPrompt has no tool-schema restatement or fake caps", () => {
57125
const p = emilPackage.systemPrompt;
58126
expect(p).not.toMatch(/parameters?:/i);
@@ -64,11 +132,7 @@ describe("emilPackage", () => {
64132
expect(p).not.toMatch(/Shell find\/rg/i);
65133
expect(p).not.toMatch(/Write tools are not mounted/i);
66134
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/);
70135
expect(p).not.toMatch(/Never spawn/);
71-
expect(p).not.toMatch(/Never commit/);
72136
});
73137

74138
test("spawn.maySpawn is false", () => {
@@ -89,6 +153,12 @@ describe("emilPackage", () => {
89153
expect(emilPackage.modelRole).toBe("review");
90154
});
91155

156+
test("description matches the CMO original (CL-7801)", () => {
157+
expect(emilPackage.description).toMatch(/Design engineering critique/i);
158+
expect(emilPackage.description).toMatch(/product decisions/i);
159+
expect(emilPackage.description).toMatch(/never fixes them/i);
160+
});
161+
92162
test("primaryIntent and outOfLane match emil lane", () => {
93163
expect(emilPackage.primaryIntent).toBe(
94164
"Design-engineering laws review; never fix product code",

0 commit comments

Comments
 (0)