


























@@ -1,7 +1,7 @@
11import fs from "node:fs";
22import os from "node:os";
33import path from "node:path";
4-import { describe, expect, it } from "vitest";
4+import { beforeAll, describe, expect, it } from "vitest";
55import {
66createFormattedPromptSnapshotFiles,
77deleteStalePromptSnapshotFiles,
@@ -38,10 +38,15 @@ function renderedPromptSection(content: string, heading: string, nextHeading: st
3838}
39394040describe("happy path prompt snapshots", () => {
41+let generatedSnapshots: Awaited<ReturnType<typeof createFormattedPromptSnapshotFiles>>;
42+43+beforeAll(async () => {
44+generatedSnapshots = await createFormattedPromptSnapshotFiles();
45+});
46+4147it("matches the committed Codex prompt snapshot artifacts", async () => {
42-const generated = await createFormattedPromptSnapshotFiles();
43-const expectedPaths = new Set(generated.map((file) => file.path));
44-for (const file of generated) {
48+const expectedPaths = new Set(generatedSnapshots.map((file) => file.path));
49+for (const file of generatedSnapshots) {
4550expect(fs.readFileSync(file.path, "utf8"), file.path).toBe(file.content);
4651}
4752const committed = fs
@@ -74,8 +79,10 @@ describe("happy path prompt snapshots", () => {
7479});
75807681it("renders the Codex model-bound prompt layers", async () => {
77-const generated = await createFormattedPromptSnapshotFiles();
78-const telegram = requireGeneratedSnapshot(generated, "telegram-direct-codex-message-tool.md");
82+const telegram = requireGeneratedSnapshot(
83+generatedSnapshots,
84+"telegram-direct-codex-message-tool.md",
85+);
79868087expect(telegram).toContain("## Reconstructed Model-Bound Prompt Layers");
8188expect(telegram).toContain("### System: Codex Model Instructions (gpt-5.5, pragmatic)");
@@ -95,10 +102,18 @@ describe("happy path prompt snapshots", () => {
95102});
9610397104it("keeps heartbeat guidance in heartbeat collaboration mode only", async () => {
98-const generated = await createFormattedPromptSnapshotFiles();
99-const direct = requireGeneratedSnapshot(generated, "telegram-direct-codex-message-tool.md");
100-const group = requireGeneratedSnapshot(generated, "discord-group-codex-message-tool.md");
101-const heartbeat = requireGeneratedSnapshot(generated, "telegram-heartbeat-codex-tool.md");
105+const direct = requireGeneratedSnapshot(
106+generatedSnapshots,
107+"telegram-direct-codex-message-tool.md",
108+);
109+const group = requireGeneratedSnapshot(
110+generatedSnapshots,
111+"discord-group-codex-message-tool.md",
112+);
113+const heartbeat = requireGeneratedSnapshot(
114+generatedSnapshots,
115+"telegram-heartbeat-codex-tool.md",
116+);
102117const heartbeatPhrase = "The purpose of heartbeats is to make you feel magical and proactive.";
103118104119expect(direct).toContain('"collaborationMode": {');
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。