Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: hash prompt-integrity bodies independent of the install's API origin (#3359)

[._.]/ Adam Eivya8d63b58615d
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index c137756bb3..2c0c175b69 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -160,6 +160,7 @@
- **[issue-3288] Video render submission is no longer a 717-line route handler — and a failed lookup mid-request stops orphaning your upload.** `POST /api/video-gen` did request validation, backend-pin resolution, model checks, durable staging for four upload kinds with rollback bookkeeping, IC-LoRA/keyframe/a2v validation, render-history lookups, LoRA normalization and chunk resolution inline, with twenty-plus throw sites sharing mutable cleanup state — so every new video-gen parameter meant editing the monolith and risking an unrelated validation branch. That whole region now lives in `services/videoGen/prepareParams.js`, mirroring what `imageGen` already did, and the route is a thin parse → prepare → enqueue → respond shell. Validation order and the exact cleanup-on-throw unwind are preserved verbatim, pinned by the existing route suite plus a new service suite. The extraction also closed a real leak (#3326): every *explicit* throw released the staged uploads, but a plain rejected `await` — a music-video project or track lookup, a render-history read, or the enqueue itself — bubbled straight past them, orphaning up to 100MB per request under `data/uploads` with no job to ever clean it up. One rollback guard now covers every rejection point at once and stays correct as new awaits are added, rethrowing the original error untouched.
- **[issue-3353] Client tests that type into a field and then submit no longer race the keystrokes.** A Stacker News save test failed on CI for a pull request whose entire diff was a dependency config file, and passed on the rerun. The cause is a shape that suite had in six places: `user.type` enters `20` as two separate events, and nothing between the last keystroke and the Save click asserted that the controlled input had actually reached `20` — so under load the click could send a payload built from the intermediate `2`, or from the post-clear empty string that `Number('')` turns into `0`. Waiting on the assertion cannot recover from that, because the call has already happened with the wrong argument and re-waiting never produces a second one. A shared `src/test/settledInput.js` helper now pins the settled input value between the keystrokes and whatever depends on them, and every instance of the shape now uses it — all six in the Stacker News suite plus ten more found by auditing the rest of the client tests, across the CoS agent card and reviewer picker, the sprite reference workflow, the media jobs queue, the duplicate-universe merge tab, and Media Collections. Two of those submitted with Enter typed as part of the same keystroke run, where a partially-typed `bad token!` would have been a *valid* username and quietly emitted; the Enter is now a separate press after the draft is pinned. One more asserted only the navigation that followed its submit, so a half-typed collection name could not have failed it — it now asserts the request it sent. The failure mode it replaces is an honest one — an input that never settles now fails saying so, rather than silently asserting against a half-typed value.
- **[issue-3358] An unreachable `gh` no longer looks like a quiet repo — and an agent can no longer report success having filed no PR.** Around thirty call sites ran `gh` and turned *any* failure into an empty result, so a firewalled or unauthenticated CLI was indistinguishable from a repo with nothing going on: the PR watcher saw no PRs, the branch reconciler classified every pushed branch as "needs a PR" (and would have had an agent open duplicates on top of the ones already open), the issue reconciler saw nothing to reconcile, and none of it logged a distinguishable error. Those reads now answer with three states instead of two — the forge said nothing, the forge said nothing *exists*, or we could not ask — and every forge-dependent scheduled job (`pr-watcher`, `branch-reconcile`, `issue-reconcile`, layered intelligence, self-diagnostics) probes `gh` first and skips the cycle with one clear line rather than executing against a forge it cannot read. Separately, a run whose task shape promised a pull request is now verified against the forge before it is recorded complete: an agent that commits, pushes over SSH (unaffected by an outbound block) and then fails to create the PR is recorded as needing attention with the branch named, not as "Completed successfully" — and "we could not confirm the PR" is kept distinct from "there is no PR", so a network outage is treated as environmental instead of denting the task type's measured success rate.
+- **[issue-3359] The prompt-integrity snapshot now pins prompt bytes instead of the machine that generated it.** `taskPromptDefaults.test.js` hashes every current and preserved-historical prompt body against a checked-in snapshot, because editing a preserved body silently strands every other install on a prompt it can no longer recognize as an upgradable default. Prompt bodies embed this install's API origin, so hashing normalized it away first — but only the *runtime* origin, while the historical bodies written before that interpolation existed hardcode `http://localhost:5555`. The snapshot therefore only reproduced on a machine whose own origin happened to equal that literal: set a custom host, or merely run the suite in a shell with `PORT` set (as every CoS agent does), and five untouched bodies hashed differently and the suite failed reporting drift that had not happened. Regenerating the snapshot there would have been the damaging fix — it blesses whatever edited a preserved body, which is the one thing this test exists to catch. Hashing now collapses the frozen legacy origin too, which reproduces the committed snapshot byte for byte on every install, and the shared hasher is what both the test and a new `scripts/regen-prompt-integrity-snapshot.js` use, so the regeneration path can no longer normalize differently from the assertion. The guard is also in the CI planner's always-run list now: it covers a cross-install contract nothing else covers, so no impact scope may scope it out.
## Three.js Models
diff --git a/docs/GITHUB_ACTIONS.md b/docs/GITHUB_ACTIONS.md
index eee015dcea..959de1a2d1 100644
--- a/docs/GITHUB_ACTIONS.md
+++ b/docs/GITHUB_ACTIONS.md
@@ -19,6 +19,12 @@ import-graph-aware `--changed` mode. The planner deliberately chooses full CI
for shared composition roots, test configuration, dependency manifests,
workflow changes, unknown artifacts, or wide diffs.
+A short always-run list (`ALWAYS_RUN_TESTS` in the planner) is added to every
+plan, so no impact scope can drop it — currently just
+`server/services/taskPromptDefaults.test.js`, which pins the cross-install
+prompt-upgrade contract nothing else in the suite covers. A documentation-only
+PR therefore still runs the server job with that one file selected.
+
The selected work is split across parallel jobs:
- **Server tests** — full, related, or explicit feature test files.
diff --git a/scripts/ci-test-plan.js b/scripts/ci-test-plan.js
index 3a12cd6103..65250a01b9 100644
--- a/scripts/ci-test-plan.js
+++ b/scripts/ci-test-plan.js
@@ -26,6 +26,19 @@ const FULL_TRIGGER_RULES = [
{ re: /^scripts\/run-ci-(?:lint|tests)\.js$/, reason: 'CI runner changed' },
];
+// Contract guards that run on EVERY plan, whatever the impact scope selects.
+// `taskPromptDefaults.test.js` pins the cross-install prompt-upgrade contract
+// (CLAUDE.md "Distribution model"): edit a preserved historical default and
+// other installs stop recognizing their stored prompt, so they are treated as
+// having customized it and stay on it forever. Nothing else in the suite
+// notices, and neither can a scoped run that happens not to select this file —
+// so it is never scoped out. The file runs in ~150ms and imports only prompt
+// data, which is cheap enough to pay on every PR including documentation-only
+// ones, where the alternative is reasoning per-scope about what can reach it.
+const ALWAYS_RUN_TESTS = [
+ 'server/services/taskPromptDefaults.test.js',
+];
+
const DB_RISK_RULES = [
/^server\/lib\/db(?:\/|\.|$)/i,
/^server\/scripts\/.*db/i,
@@ -151,6 +164,10 @@ const structuralTestsFor = (changedFiles, trackedSet) => {
const uniqueSorted = (values) => [...new Set(values)].sort();
+// Guarded by trackedSet like every other selector: an untracked path handed to
+// Vitest as an exact selector makes the run exit non-zero.
+const alwaysRunTests = (trackedSet) => ALWAYS_RUN_TESTS.filter((path) => trackedSet.has(path));
+
const skippedRunner = () => ({ mode: 'skip', files: [] });
/**
@@ -189,13 +206,15 @@ export function buildCiTestPlan(changedFiles, { trackedFiles = [], forceFull = f
return fullPlan(changed, `${fullTrigger.reason}: ${fullTrigger.path}`);
}
+ const alwaysRun = alwaysRunTests(trackedSet);
+
const relevant = changed.filter((path) => !isDocumentationOnly(path));
if (relevant.length === 0) {
return {
full: false,
reason: changed.length ? 'documentation-only change' : 'no changed files',
changedFiles: changed,
- server: skippedRunner(),
+ server: alwaysRun.length > 0 ? { mode: 'files', files: alwaysRun } : skippedRunner(),
client: skippedRunner(),
db: false,
lint: { mode: 'skip', files: [] },
@@ -230,6 +249,7 @@ export function buildCiTestPlan(changedFiles, { trackedFiles = [], forceFull = f
...directTests,
...sourceFiles.flatMap(siblingTestCandidates).filter((path) => trackedSet.has(path)),
...structuralTestsFor(changed, trackedSet),
+ ...alwaysRun,
];
for (const testFile of trackedFiles.filter(isTestFile)) {
diff --git a/scripts/ci-test-plan.test.js b/scripts/ci-test-plan.test.js
index 9ecb8e58ed..0c5916762b 100644
--- a/scripts/ci-test-plan.test.js
+++ b/scripts/ci-test-plan.test.js
@@ -12,6 +12,7 @@ const TRACKED = [
'server/services/sprites/atlas.test.js',
'server/services/sprites/atlasGrid.test.js',
'server/services/sprites/atlasLayout.test.js',
+ 'server/services/taskPromptDefaults.test.js',
'client/src/a11yConventions.test.js',
'client/src/hooks/mountedRefConventions.test.js',
'client/src/components/catalog/CatalogCard.jsx',
@@ -24,7 +25,7 @@ const TRACKED = [
];
describe('CI test impact planner', () => {
- it('skips all expensive jobs for documentation-only changes', () => {
+ it('skips all expensive jobs for documentation-only changes, keeping the always-run guards', () => {
const plan = buildCiTestPlan([
'.changelog/NEXT.md',
'docs/GITHUB_ACTIONS.md',
@@ -33,7 +34,7 @@ describe('CI test impact planner', () => {
expect(plan).toMatchObject({
full: false,
reason: 'documentation-only change',
- server: { mode: 'skip' },
+ server: { mode: 'files', files: ['server/services/taskPromptDefaults.test.js'] },
client: { mode: 'skip' },
db: false,
lint: { mode: 'skip' },
@@ -42,6 +43,38 @@ describe('CI test impact planner', () => {
});
});
+ // The prompt-integrity snapshot guards a cross-install upgrade contract that
+ // no other test covers, so no impact scope may drop it — including the scopes
+ // that otherwise skip the server runner entirely.
+ it('runs the prompt-integrity guard under every impact scope', () => {
+ const scopes = [
+ [], // no changed files
+ ['docs/GITHUB_ACTIONS.md'], // documentation-only
+ ['client/src/components/catalog/CatalogCard.jsx'], // client-only (server would skip)
+ ['server/services/auth.js'], // server related-mode
+ ['server/services/sprites/atlas.js'], // server files-mode
+ ];
+
+ for (const changed of scopes) {
+ const plan = buildCiTestPlan(changed, { trackedFiles: TRACKED });
+ expect(plan.server.mode, JSON.stringify(changed)).not.toBe('skip');
+ expect(plan.server.files, JSON.stringify(changed))
+ .toContain('server/services/taskPromptDefaults.test.js');
+ }
+
+ // A full plan runs everything, so it carries no explicit selector list.
+ const full = buildCiTestPlan(['.github/workflows/ci.yml'], { trackedFiles: TRACKED });
+ expect(full.server.mode).toBe('full');
+ });
+
+ it('omits an untracked always-run guard rather than handing Vitest a missing selector', () => {
+ const plan = buildCiTestPlan(['docs/GITHUB_ACTIONS.md'], {
+ trackedFiles: TRACKED.filter((path) => path !== 'server/services/taskPromptDefaults.test.js'),
+ });
+
+ expect(plan.server).toEqual({ mode: 'skip', files: [] });
+ });
+
it('forces the full suite when CI or shared test configuration changes', () => {
for (const path of [
'.github/workflows/ci.yml',
@@ -86,6 +119,7 @@ describe('CI test impact planner', () => {
'server/services/sprites/atlas.test.js',
'server/services/sprites/atlasGrid.test.js',
'server/services/sprites/atlasLayout.test.js',
+ 'server/services/taskPromptDefaults.test.js',
]);
expect(plan.client.files).toEqual([
'client/src/components/sprites/WalkWorkflow.test.jsx',
@@ -102,7 +136,7 @@ describe('CI test impact planner', () => {
expect(plan.full).toBe(false);
expect(plan.server).toEqual({
mode: 'related',
- files: ['server/services/auth.test.js'],
+ files: ['server/services/auth.test.js', 'server/services/taskPromptDefaults.test.js'],
});
expect(plan.client.mode).toBe('skip');
expect(plan.smoke).toBe(true);
@@ -159,7 +193,7 @@ describe('CI test impact planner', () => {
expect(plan.full).toBe(false);
expect(plan.server).toEqual({
mode: 'related',
- files: ['scripts/migrations/210-example.test.js'],
+ files: ['scripts/migrations/210-example.test.js', 'server/services/taskPromptDefaults.test.js'],
});
});
diff --git a/scripts/regen-prompt-integrity-snapshot.js b/scripts/regen-prompt-integrity-snapshot.js
new file mode 100644
index 0000000000..4021f1f84f
--- /dev/null
+++ b/scripts/regen-prompt-integrity-snapshot.js
@@ -0,0 +1,34 @@
+#!/usr/bin/env node
+/**
+ * Regenerate server/services/taskPromptDefaults/integrity.snapshot.json.
+ *
+ * Run this ONLY after an intentional prompt-default change that also bumped
+ * PROMPT_VERSIONS and appended the outgoing default to PREVIOUS_DEFAULT_PROMPTS
+ * (see CLAUDE.md "Distribution model"). Regenerating to silence a failing
+ * integrity test without those two steps blesses whatever edited a preserved
+ * historical body — which is precisely what the test exists to catch.
+ *
+ * node scripts/regen-prompt-integrity-snapshot.js
+ *
+ * Output is environment-independent (see integrityHash.js), so it produces the
+ * same bytes on every install.
+ */
+import { writeFileSync } from 'fs';
+import { fileURLToPath } from 'url';
+import { dirname, join } from 'path';
+
+import * as promptDefaults from '../server/services/taskPromptDefaults.js';
+import { buildPromptIntegritySnapshot } from '../server/services/taskPromptDefaults/integrityHash.js';
+
+const SNAPSHOT_PATH = join(
+ dirname(fileURLToPath(import.meta.url)),
+ '..',
+ 'server',
+ 'services',
+ 'taskPromptDefaults',
+ 'integrity.snapshot.json',
+);
+
+const snapshot = buildPromptIntegritySnapshot(promptDefaults);
+writeFileSync(SNAPSHOT_PATH, `${JSON.stringify(snapshot, null, 2)}\n`);
+console.log(`🔒 Regenerated prompt integrity snapshot (${Object.keys(snapshot.DEFAULT_TASK_PROMPTS).length} current, ${Object.keys(snapshot.PREVIOUS_DEFAULT_PROMPTS).length} historical prompt keys)`);
diff --git a/server/services/taskPromptDefaults.test.js b/server/services/taskPromptDefaults.test.js
index f34101d476..3c82876e61 100644
--- a/server/services/taskPromptDefaults.test.js
+++ b/server/services/taskPromptDefaults.test.js
@@ -1,5 +1,4 @@
-import { describe, it, expect } from 'vitest';
-import { createHash } from 'crypto';
+import { describe, it, expect, vi, afterEach } from 'vitest';
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { join, dirname } from 'path';
@@ -9,7 +8,7 @@ import {
REFERENCE_WATCH_AUDITED_VERSION,
PREVIOUS_DEFAULT_PROMPTS,
} from './taskPromptDefaults.js';
-import { PORTOS_API_URL } from '../lib/ports.js';
+import { hashPromptBody, buildPromptIntegritySnapshot } from './taskPromptDefaults/integrityHash.js';
// Hash snapshot of every exported prompt body and version. This pins the
// cross-install prompt-upgrade contract (see CLAUDE.md "Distribution model"):
@@ -18,39 +17,59 @@ import { PORTOS_API_URL } from '../lib/ports.js';
// where the rule is: bump PROMPT_VERSIONS, append the outgoing default to
// PREVIOUS_DEFAULT_PROMPTS, then regenerate the snapshot:
//
-// cd server && node --input-type=module -e "
-// import('./services/taskPromptDefaults.js').then(async (m) => {
-// const { PORTOS_API_URL } = await import('./lib/ports.js');
-// const { createHash } = await import('crypto');
-// const norm = (s) => s.split(PORTOS_API_URL).join('{{PORTOS_API_URL}}');
-// const md5 = (s) => createHash('md5').update(norm(s), 'utf8').digest('hex');
-// const out = {
-// DEFAULT_TASK_PROMPTS: Object.fromEntries(Object.entries(m.DEFAULT_TASK_PROMPTS).map(([k, v]) => [k, md5(v)])),
-// PROMPT_VERSIONS: m.PROMPT_VERSIONS,
-// REFERENCE_WATCH_AUDITED_VERSION: m.REFERENCE_WATCH_AUDITED_VERSION,
-// PREVIOUS_DEFAULT_PROMPTS: Object.fromEntries(Object.entries(m.PREVIOUS_DEFAULT_PROMPTS).map(([k, a]) => [k, a.map(md5)])),
-// };
-// (await import('fs')).writeFileSync('services/taskPromptDefaults/integrity.snapshot.json', JSON.stringify(out, null, 2) + '\n');
-// })"
+// node scripts/regen-prompt-integrity-snapshot.js
//
-// PORTOS_API_URL is interpolated into one prompt at module load and varies by
-// env (PORTOS_HOST/PORT), so it's normalized to a placeholder before hashing.
+// Prompt bodies embed the install's API origin, so hashing normalizes it to a
+// placeholder first — see taskPromptDefaults/integrityHash.js, which both this
+// test and that script share so they can't drift apart. Regenerating to silence
+// a failure without the version bump + preserved outgoing default blesses
+// whatever edited a preserved historical body, which is the failure mode this
+// test exists to catch.
const SNAPSHOT = JSON.parse(readFileSync(
join(dirname(fileURLToPath(import.meta.url)), 'taskPromptDefaults', 'integrity.snapshot.json'),
'utf8',
));
-const normalize = (s) => s.split(PORTOS_API_URL).join('{{PORTOS_API_URL}}');
-const md5 = (s) => createHash('md5').update(normalize(s), 'utf8').digest('hex');
-
describe('taskPromptDefaults integrity snapshot', () => {
+ afterEach(() => {
+ vi.unstubAllEnvs();
+ vi.resetModules();
+ });
+
it('DEFAULT_TASK_PROMPTS bodies match the snapshot hashes exactly', () => {
const actual = Object.fromEntries(
- Object.entries(DEFAULT_TASK_PROMPTS).map(([k, v]) => [k, md5(v)]),
+ Object.entries(DEFAULT_TASK_PROMPTS).map(([k, v]) => [k, hashPromptBody(v)]),
);
expect(actual).toEqual(SNAPSHOT.DEFAULT_TASK_PROMPTS);
});
+ // The snapshot pins prompt BYTES, not the machine that generated it. Hashing
+ // used to normalize only the runtime PORTOS_API_URL, so the historical bodies
+ // that hardcode the legacy `http://localhost:5555` origin only matched on an
+ // install whose own API origin happened to equal it. Anywhere else — a custom
+ // PORTOS_HOST, or merely a shell with PORT set, as inside a CoS agent — five
+ // untouched bodies hashed differently and this suite failed while nothing had
+ // drifted (issue #3359).
+ it('reproduces the snapshot on an install with a non-default API origin', async () => {
+ vi.resetModules();
+ // Cleared so the origin is derived from host/port rather than inherited
+ // from whatever the ambient environment sets — otherwise the assertion
+ // below depends on the machine running the suite, the very bug under test.
+ vi.stubEnv('PORTOS_API_URL', undefined);
+ vi.stubEnv('PORTOS_HOST', 'portos.example.test');
+ vi.stubEnv('PORT', '5558');
+
+ const [freshDefaults, { PORTOS_API_URL }] = await Promise.all([
+ import('./taskPromptDefaults.js'),
+ import('../lib/ports.js'),
+ ]);
+ // Guard the guard: if the stub stopped taking effect this test would pass
+ // vacuously by re-running the ambient-environment assertions above.
+ expect(PORTOS_API_URL).toBe('http://portos.example.test:5558');
+
+ expect(buildPromptIntegritySnapshot(freshDefaults, PORTOS_API_URL)).toEqual(SNAPSHOT);
+ });
+
it('PROMPT_VERSIONS matches the snapshot', () => {
expect(PROMPT_VERSIONS).toEqual(SNAPSHOT.PROMPT_VERSIONS);
});
@@ -61,7 +80,7 @@ describe('taskPromptDefaults integrity snapshot', () => {
it('PREVIOUS_DEFAULT_PROMPTS bodies match the snapshot hashes exactly', () => {
const actual = Object.fromEntries(
- Object.entries(PREVIOUS_DEFAULT_PROMPTS).map(([k, arr]) => [k, arr.map(md5)]),
+ Object.entries(PREVIOUS_DEFAULT_PROMPTS).map(([k, arr]) => [k, arr.map((p) => hashPromptBody(p))]),
);
expect(actual).toEqual(SNAPSHOT.PREVIOUS_DEFAULT_PROMPTS);
});
diff --git a/server/services/taskPromptDefaults/integrityHash.js b/server/services/taskPromptDefaults/integrityHash.js
new file mode 100644
index 0000000000..029cb421a2
--- /dev/null
+++ b/server/services/taskPromptDefaults/integrityHash.js
@@ -0,0 +1,65 @@
+/**
+ * Hashing for the prompt-default integrity snapshot.
+ *
+ * Shared by taskPromptDefaults.test.js (which asserts the snapshot) and
+ * scripts/regen-prompt-integrity-snapshot.js (which writes it), so the two can
+ * never disagree about how a prompt body is hashed.
+ *
+ * Deliberately NOT re-exported from ../taskPromptDefaults.js: that barrel is a
+ * pure data leaf, and this is tooling for the snapshot rather than prompt data.
+ */
+import { createHash } from 'crypto';
+import { PORTOS_API_URL } from '../../lib/ports.js';
+
+const API_URL_PLACEHOLDER = '{{PORTOS_API_URL}}';
+
+// Prompt bodies embed the install's API origin two different ways:
+//
+// 1. Current defaults interpolate PORTOS_API_URL at module load, so the body
+// text varies with PORTOS_API_URL / PORTOS_HOST / PORT.
+// 2. Preserved historical defaults (pre-genericization) hardcode
+// `http://localhost:5555` — the origin that WAS the default when they
+// shipped. Those bytes are frozen history and never change again, so the
+// literal is pinned here rather than derived from PORTS.API.
+//
+// Both collapse to the same placeholder so a body hashes identically on every
+// install. Normalizing only (1) made the snapshot reproducible solely on a
+// machine whose PORTOS_API_URL happened to equal the legacy origin: anywhere
+// else — a custom PORTOS_HOST, or simply a shell with PORT set, as inside a CoS
+// agent — the five bodies carrying the literal hashed differently and the
+// integrity test failed while nothing had actually drifted (issue #3359).
+const LEGACY_API_ORIGIN = 'http://localhost:5555';
+
+const replaceAll = (value, needle) => (
+ needle ? value.split(needle).join(API_URL_PLACEHOLDER) : value
+);
+
+export const normalizePromptForHash = (body, apiUrl = PORTOS_API_URL) => (
+ replaceAll(replaceAll(String(body), apiUrl), LEGACY_API_ORIGIN)
+);
+
+export const hashPromptBody = (body, apiUrl = PORTOS_API_URL) => createHash('md5')
+ .update(normalizePromptForHash(body, apiUrl), 'utf8')
+ .digest('hex');
+
+/**
+ * Build the full snapshot shape from the taskPromptDefaults exports. Key order
+ * matches the committed integrity.snapshot.json so a regeneration produces a
+ * clean diff.
+ */
+export const buildPromptIntegritySnapshot = ({
+ DEFAULT_TASK_PROMPTS,
+ PROMPT_VERSIONS,
+ REFERENCE_WATCH_AUDITED_VERSION,
+ PREVIOUS_DEFAULT_PROMPTS,
+}, apiUrl = PORTOS_API_URL) => ({
+ DEFAULT_TASK_PROMPTS: Object.fromEntries(
+ Object.entries(DEFAULT_TASK_PROMPTS).map(([key, body]) => [key, hashPromptBody(body, apiUrl)]),
+ ),
+ PROMPT_VERSIONS,
+ REFERENCE_WATCH_AUDITED_VERSION,
+ PREVIOUS_DEFAULT_PROMPTS: Object.fromEntries(
+ Object.entries(PREVIOUS_DEFAULT_PROMPTS)
+ .map(([key, bodies]) => [key, bodies.map((body) => hashPromptBody(body, apiUrl))]),
+ ),
+});