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

address review (codex): reject unknown run checkIds; namespace editorial in root barrel

[._.]/ Adam Eivyec246584dcc0
diff --git a/server/lib/index.js b/server/lib/index.js
index 2cfc04b588..8e71e96936 100644
--- a/server/lib/index.js
+++ b/server/lib/index.js
@@ -44,6 +44,10 @@ export * from './comicScriptParser.js';
export * from './composeStyledPrompt.js';
export * from './creativeDirectorPresets.js';
export * from './creativeDirectorPrompts.js';
+// Namespaced: the editorial-check registry (#1284) lives in the editorial/
+// subdir with its own barrel — surface it under `editorial.*` so the root
+// discovery surface reaches EDITORIAL_CHECKS + the lookup helpers.
+export * as editorial from './editorial/index.js';
export * from './sceneExtractor.js';
export * from './scenePrompt.js';
export * from './seasonStructure.js';
diff --git a/server/routes/pipeline/editorial.js b/server/routes/pipeline/editorial.js
index 6920fb4372..e50a41b713 100644
--- a/server/routes/pipeline/editorial.js
+++ b/server/routes/pipeline/editorial.js
@@ -113,6 +113,14 @@ router.patch('/editorial/checks/:id', asyncHandler(async (req, res) => {
// Run all enabled checks (or a named subset) for a series — progress via SSE.
router.post('/series/:id/editorial/checks/run', asyncHandler(async (req, res) => {
const body = validateRequest(editorialChecksRunSchema, req.body ?? {});
+ // Reject unknown check ids up front — otherwise a typo'd subset is silently
+ // filtered to a zero-check run that reports success (PATCH 404s unknown ids too).
+ if (body.checkIds?.length) {
+ const unknown = body.checkIds.filter((id) => !getCheck(id));
+ if (unknown.length) {
+ throw new ServerError(`Unknown editorial check(s): ${unknown.join(', ')}`, { status: 400 });
+ }
+ }
await seriesSvc.getSeries(req.params.id).catch((err) => { throw mapServiceError(err); });
const result = checkRunner.startEditorialChecksRun(req.params.id, {
checkIds: body.checkIds,
diff --git a/server/routes/pipeline/editorial.test.js b/server/routes/pipeline/editorial.test.js
index 4155d29510..12cec15170 100644
--- a/server/routes/pipeline/editorial.test.js
+++ b/server/routes/pipeline/editorial.test.js
@@ -104,4 +104,12 @@ describe('POST /api/pipeline/series/:id/editorial/checks/run', () => {
expect(res.status).toBe(404);
expect(startEditorialChecksRun).not.toHaveBeenCalled();
});
+
+ it('400s an unknown requested check id instead of running zero checks', async () => {
+ const res = await request(app)
+ .post('/api/pipeline/series/s1/editorial/checks/run')
+ .send({ checkIds: ['prose.info-dumpng'] }); // typo
+ expect(res.status).toBe(400);
+ expect(startEditorialChecksRun).not.toHaveBeenCalled();
+ });
});