Skip to content

feat(story-author): fixes for script problems, line pacing, and a public contract check - #26

Merged
nichinichisou0609 merged 3 commits into
mainfrom
feat/story-author-fixes
Oct 14, 2026
Merged

nichinichisou0609 merged 3 commits into
mainfrom
feat/story-author-fixes

Conversation

@nichinichisou0609

Copy link
Copy Markdown
Contributor

The story author reports how to fix a script's problems and how each line is paced, and the package's public contracts are checked in CI.

  • Fixes for script problems. Every problem whose fix is known carries it as JSON Patch operations on the script: an unknown key is renamed to the nearest key of the format, an unknown name (stage, music, model, motion, expression, position, camera, cast member, language, font) is replaced by the nearest one, a repeated beat id takes the first free _<n>, and the later of two characters on one position moves to the nearest free position. --fix <file> on check and render writes the script with the fixes applied (later beats first) and checks the written script again.
  • Lines that overflow the talk window. render lays an overflowing line out again with TextMeshPro's word wrapping (the game's breaks, CJK line breaking rules included) and attaches a fix that breaks the text there and, where the window holds fewer lines, spreads it over beats of the same speaker after it.
  • Pacing. Each rendered frame has timing: the characters the typewriter types, the story seconds until the text is fully shown, and the hold auto mode adds from the base story's talk timings.
  • npm run contract:check. scripts/check-contracts.mjs checks that package.json (main, module, types, files, exports, sideEffects), each entry point's runtime exports, its type declarations and its row in the documents' entry points tables, the schemas ($schema, $id, keywords, validate-data and docs references), the ournotes.* format ids, the Markdown links and anchors, the story author's commands, options and problem codes, and the CI and release verification steps agree. CI and the release verification job run it after the build check.
  • Documentation. The story and UI entry points tables list every export (the check found 14 story exports and cameraProjection missing); docs/story-author.md describes fixes, --fix, timing and --timeout.

Validation: npm test (669 pass, 2 skipped, with new tests for the fixes, the wrap and split of a line, applying fixes and check --fix on the synthetic site), npm run typecheck, npm run lint, node scripts/build.mjs --check, npm run contract:check and npm pack --dry-run (278 files) pass locally on Node.js 22.

nichinichisou0609 and others added 3 commits October 14, 2026 19:16
A script's problems now say how to fix them, not only what is wrong, and
the renderer reports how long each line takes.

Every problem whose fix is known carries it as JSON Patch operations on
the script document: an unknown key is renamed to the nearest key of the
format (when the object does not hold that key already), an unknown name
is replaced by the nearest one the site has, a repeated beat id takes the
first free suffix, and two characters on one position put the later one
on the nearest free position. `--fix <file>` on `check` and `render`
writes the script with those fixes applied (later beats first, so the
beats a fix adds do not move the ones after it) and checks the written
script again, reporting which fixes went in and where the fixed script
stands.

A line that overflows the talk window is measured in the browser, laid
out again with TextMeshPro's word wrapping (the breaks the game's text
engine takes, CJK line breaking rules included), and comes with a fix
that breaks the text where the game breaks it and, where the window holds
fewer lines, spreads it over beats of the same speaker after it.

`render` frames also carry the line's pacing in story seconds: the
characters the typewriter types, the time until its text is fully shown,
and the hold auto mode adds from the base story's talk timings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The entry points table of docs/story.md now lists everything
`ournotes-player/story` exports: SimpleStorySession, parseStorySpeed,
the command registry (unregisteredCommands, StoryPlayerCore,
StoryCommandError), the story UI interface (checkStoryUI, StoryUILayer,
createStoryUILayers), STORY_LANGUAGES, storyLines, advViewport, the
control labels (STORY_STRINGS, storyStrings) and ADV_PLAYBACK_SPEEDS.
docs/api.md lists cameraProjection for `ournotes-player/ui`.

The story author's documentation names the --timeout option of the
picture commands, and its usage text names render's --columns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`npm run contract:check` (scripts/check-contracts.mjs) compares what
package.json, the modules, the type declarations, the schemas and the
documents say about the same things, and fails on any disagreement:

- package: main, module and types are the "." entry's, and every files
  entry, exports target and sideEffects pattern names files that exist
  inside `files`;
- entries: each entry point's runtime exports (its bundle's ES exports)
  are the values its .d.ts exports and the names its row of an entry
  points table in docs/ lists;
- schemas: each schema is draft 2020-12 with its raw URL as $id, uses
  only the keywords the validator implements, is loaded by
  validate-data and named in docs/;
- formats: the ournotes.* format ids of the code, types and schemas and
  those of the documents are the same;
- links: relative Markdown links and their #fragments resolve;
- story-author: the CLI's commands, options and problem codes are the
  ones its usage text and docs/story-author.md describe;
- workflows: the CI job and the release verification job run the same
  commands in the same order.

CI and the release verification job run it after the build check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nichinichisou0609
nichinichisou0609 merged commit e3fc3f7 into main Oct 14, 2026
4 checks passed
@nichinichisou0609
nichinichisou0609 deleted the feat/story-author-fixes branch October 14, 2026 11:33
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