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 (claude): don't split a clock TIME in a beat-sheet slugline

[._.]/ Adam Eivycbfde59cabd3
diff --git a/server/lib/sceneExtractor.js b/server/lib/sceneExtractor.js
index 0483c8a6a7..45afa7f0f0 100644
--- a/server/lib/sceneExtractor.js
+++ b/server/lib/sceneExtractor.js
@@ -197,11 +197,13 @@ export function parseBeatSheetScenes(markdown) {
entry = sm[2].trim();
}
if (!entry) continue;
- // The first colon separates the slugline from the beats clause. Sluglines
- // (INT./EXT. LOCATION — TIME) don't normally carry a colon, so this is safe.
+ // A colon separates the slugline from the beats clause. Match the first
+ // colon NOT followed by a digit, so a clock TIME in the slugline
+ // (`INT. OFFICE — 3:00 PM: the meeting`) splits on the `PM:` separator
+ // rather than the `3:00` time — preserving the full slugline for matching.
let slugline = entry;
let summary = '';
- const colon = entry.indexOf(':');
+ const colon = entry.search(/:(?!\d)/);
if (colon >= 0) {
slugline = entry.slice(0, colon).trim();
summary = entry.slice(colon + 1).trim();
diff --git a/server/lib/sceneExtractor.test.js b/server/lib/sceneExtractor.test.js
index 5ebdc5e494..3e4be7e819 100644
--- a/server/lib/sceneExtractor.test.js
+++ b/server/lib/sceneExtractor.test.js
@@ -442,6 +442,21 @@ describe('parseBeatSheetScenes', () => {
{ number: 3, slugline: 'INT. LAB — NIGHT', summary: 'the experiment' },
]);
});
+
+ it('does not split a clock TIME in the slugline (splits on the beats-clause colon)', () => {
+ const md = '## Scenes\n1. Scene 1 — INT. OFFICE — 3:00 PM: the meeting';
+ expect(parseBeatSheetScenes(md)).toEqual([
+ { number: 1, slugline: 'INT. OFFICE — 3:00 PM', summary: 'the meeting' },
+ ]);
+ });
+
+ it('handles CRLF line endings', () => {
+ const md = '## Scenes\r\n1. Scene 1 — EXT. PIER — DAWN: the arrival\r\n2. Scene 2 — INT. HOLD — DAY: the search\r\n';
+ expect(parseBeatSheetScenes(md)).toEqual([
+ { number: 1, slugline: 'EXT. PIER — DAWN', summary: 'the arrival' },
+ { number: 2, slugline: 'INT. HOLD — DAY', summary: 'the search' },
+ ]);
+ });
});
describe('scenesFromBeatSheet', () => {