Skip to content

Fix: bare page-range scope returns empty; restore MCP byte-for-byte parity#1

Open
newjordan wants to merge 2 commits into
wassermanproductions:masterfrom
newjordan:fix/export-scope-and-mcp-parity
Open

Fix: bare page-range scope returns empty; restore MCP byte-for-byte parity#1
newjordan wants to merge 2 commits into
wassermanproductions:masterfrom
newjordan:fix/export-scope-and-mcp-parity

Conversation

@newjordan

Copy link
Copy Markdown

Two small correctness fixes (export scope + MCP parity)

Two independent, low-risk fixes surfaced while working in the export code. Each is its own commit.

fix(export) — a bare page number in "pages" scope matched zero scenes

In the export scope bar, choosing "Page range…" and typing a single page with no dash — e.g. 7 — matched zero scenes and silently produced an empty export. parseRangeSet stored the bare number in its set, but the pages branch of exportScenes() queried it with an empty key (r.has('', scenePageStart(i))), so the set was never consulted and no range existed to match.

Fixed by passing the computed page number as the match key (r.has(p, p)), so a bare page matches via the set and page ranges still match via ranges. Fixed identically in the app and the MCP so the two stay in parity; this also fixes the same bug in the MCP's list_scenes / get_shot_list / export_prompt_pack under scope:"pages". Scene-number scope is untouched.

fix(mcp) — restore byte-for-byte parity with the app's prompt packs

The MCP server documents that its packs reproduce the app "byte-for-byte", but two templates had drifted:

  • Video / storyboard packs: when a PROP BIBLE is present, the app emits a blank line before ## SHOTS TO GENERATE / ## FRAMES TO GENERATE; the MCP ran the heading straight onto the prop rows.
  • Script Companion: the app has a blank line between the style-guide slot and ### Bibles; the MCP omitted it (affecting every companion export).

Matched the app exactly. Verified by rendering both sides for the same project and diffing to zero bytes (companion, video-with-prop-bible, and image-with-prop-bible all now identical).

Not fixed here (found, not touched)

An adversarial pass over the parser/exporter turned up several more unrelated bugs I intentionally left out of this focused PR — e.g. the FDX title-page reader rejecting real titles that start with a metadata word (Draft Day, Byzantium), an all-caps action line between two non-blank lines being mis-detected as a character cue, and a combined INT/EXT. heading voiding a PDF's layout-derived page numbers. Happy to open those separately with repro cases.


🤖 Generated with Claude Code

https://claude.ai/code/session_01A2NtcuBy6SQmKaBQtgvkog

newjordan and others added 2 commits July 20, 2026 11:12
In the export scope bar (and the MCP's scope selectors), choosing "Page
range…" and entering a single page with no dash — e.g. `7` — matched ZERO
scenes and silently produced an empty export. parseRangeSet stored the bare
number in its `set`, but the pages branch of exportScenes() queried it with
an empty numStr (`r.has('', scenePageStart(i))`), so the set was never
consulted and no range existed to match.

Pass the computed page number as the match key (`r.has(p, p)`), so a bare
page matches via the set and page ranges still match via `ranges`. Fixed
identically in the app (src/index.html) and the MCP server so the two stay
in parity. Scene-number scope is untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A2NtcuBy6SQmKaBQtgvkog
The MCP server documents that its packs reproduce the desktop app's output
"byte-for-byte", but two templates had drifted:

- Video and storyboard packs: when a PROP BIBLE is present, the app emits a
  blank line before `## SHOTS TO GENERATE` / `## FRAMES TO GENERATE`; the MCP
  ran the heading straight onto the prop rows.
- Script Companion: the app has a blank line between the style-guide slot and
  `### Bibles`; the MCP omitted it (affecting every companion export).

Match the app exactly. Verified by rendering both sides for the same project
and diffing to zero bytes (companion, video-with-prop-bible, image-with-prop-
bible all now identical).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A2NtcuBy6SQmKaBQtgvkog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant