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(issue-6770): guard legacy category keys

[._.]/ Adam Eivy5211ccd4efe1
diff --git a/client/src/components/pipeline/manuscript/ManuscriptCommentCard.test.jsx b/client/src/components/pipeline/manuscript/ManuscriptCommentCard.test.jsx
index cab135387a..46483944fa 100644
--- a/client/src/components/pipeline/manuscript/ManuscriptCommentCard.test.jsx
+++ b/client/src/components/pipeline/manuscript/ManuscriptCommentCard.test.jsx
@@ -185,6 +185,11 @@ describe('ManuscriptCommentCard finding categories (#6770)', () => {
other: 'Note',
});
});
+
+ it('falls back to a legacy category that matches an Object prototype key', () => {
+ render(<Badge comment={{ severity: 'low', category: 'constructor' }} />);
+ expect(screen.getByText('constructor')).toBeTruthy();
+ });
});
describe('ManuscriptCommentCard — accept toast offers Undo (#1609)', () => {
diff --git a/server/lib/editorial/findingCategories.js b/server/lib/editorial/findingCategories.js
index 79aca76513..1893a9e5d7 100644
--- a/server/lib/editorial/findingCategories.js
+++ b/server/lib/editorial/findingCategories.js
@@ -5,7 +5,7 @@
* dependency-free. Completeness-only categories remain here alongside the
* categories declared by built-in editorial checks.
*/
-export const FINDING_CATEGORY_LABELS = Object.freeze({
+export const FINDING_CATEGORY_LABELS = Object.freeze(Object.assign(Object.create(null), {
'missing-content': 'Missing content',
'arc-gap': 'Arc gap',
arc: 'Character arc',
@@ -28,4 +28,4 @@ export const FINDING_CATEGORY_LABELS = Object.freeze({
cliche: 'Cliché',
prose: 'Prose',
other: 'Note',
-});
+}));