diff --git a/docs/CURRENT-STATE.md b/docs/CURRENT-STATE.md index 12f0ba3d8..7a6a56a88 100644 --- a/docs/CURRENT-STATE.md +++ b/docs/CURRENT-STATE.md @@ -1641,8 +1641,8 @@ rules own presentation overrides and Nepal map fallback without changing saved shots or content. Scene-document validation and legacy migration now have separate owners. Invalid imports preserve the current project; unreadable saved projects are protected from fallback writes. Version 7 adds Scenes' optional Stories -metadata (accepted only in version 7 documents) and reads prior project files with -zero pitch, low camera heights, scope and detection edits preserved. See [the document contract](SCENE-DOCUMENT.md); +metadata (accepted from version 6, which early Stories builds wrote) and reads +prior project files, including version 6 drafts, with zero pitch, low camera heights, scope and detection edits preserved. See [the document contract](SCENE-DOCUMENT.md); see [Director](DIRECTOR.md) for camera, pack, action and sharing support. Search framing and annotations request semantic map features from an explicit source. The Overpass adapter owns bounded queries, member/tag decoding and request deadlines; callers retain candidate ranking, outline caching, deferred retries and scene placement. Empty, unavailable, transient and throttled outcomes remain distinct; a data reply is refused only for its `remark`, never for text in element tags. Traffic sources return road records and installation sources return mapped records with freshness/saturation metadata, so their layers no longer decode upstream elements. ALPR already normalizes its records in the source. Traffic uses OpenFreeMap roads with optional matched TomTom congestion; ALPR uses an hourly OpenStreetMap extract. Keyless installations use military-area tiles. Detailed feature queries require operator-configured Overpass. diff --git a/docs/SCENE-DOCUMENT.md b/docs/SCENE-DOCUMENT.md index 061560319..6d4077d95 100644 --- a/docs/SCENE-DOCUMENT.md +++ b/docs/SCENE-DOCUMENT.md @@ -1,7 +1,8 @@ # Scene document format Authoring exports a UTF-8 JSON project. Version 7 records Stories metadata. -Versions 1 through 6 and unversioned legacy files migrate on import. Existing shots keep their +Versions 1 through 6 and unversioned legacy files migrate on import, including +version 6 projects written by early Stories builds. Existing shots keep their camera behavior. Unknown versions or unsupported fields are rejected with a field path before the current project, selection or saved bytes change. @@ -33,9 +34,9 @@ Each scene requires a `shots` array; optional fields are `id`, `title`, `releaseLayerIds`, `appliedShotPacks` and version-4 `anchors`. A pack marker has `id`, optional numeric `version` and `shotBindings` (original shot title to saved shot ID). These markers retain the editor's existing pack-update and rename behavior. -From version 7, scenes may include `stories` (true when saved to Stories), -`storyThumb` (a JPEG or PNG data URL of at most 300,000 characters) and -`storyTags` (up to five supported topic keys). +From version 6 (written by early Stories builds), scenes may include `stories` +(true when saved to Stories), `storyThumb` (a JPEG or PNG data URL of at most +300,000 characters) and `storyTags` (up to five supported topic keys). Shots accept `id`, `title`, `durationSec`, `holdSec`, `camera`, `visual`, `layers`, `sourcePackId`, `sourcePackVersion` and version-4 `move`. Scene IDs are unique within the project; diff --git a/src/director/document.js b/src/director/document.js index 1adda48e6..2ab0e6ec3 100644 --- a/src/director/document.js +++ b/src/director/document.js @@ -97,7 +97,8 @@ export function validateSceneDocument(project) { 'shots', ...(version >= 4 ? ['anchors'] : []), ...(version >= 5 ? ['dataPacks'] : []), - ...(version >= 7 ? ['stories', 'storyThumb', 'storyTags'] : []), + // Early Stories builds wrote these in version 6 projects. + ...(version >= 6 ? ['stories', 'storyThumb', 'storyTags'] : []), ]); uniqueId(scene, path, sceneIds); optional(scene, 'title', path, (v, p) => string(v, p, 4096)); diff --git a/src/scenes/director.test.mjs b/src/scenes/director.test.mjs index cf0770873..f742db981 100644 --- a/src/scenes/director.test.mjs +++ b/src/scenes/director.test.mjs @@ -2788,7 +2788,8 @@ test('story thumbnail and tags survive a reload and an export/import round trip' try { first.director.setSceneStoryThumb('scene-1', THUMB); first.director.setSceneStoryTags('scene-1', ['Storms']); - saved = JSON.stringify(savedProject()); + // Draft builds wrote the same optional Stories fields in version 6. + saved = JSON.stringify({ ...savedProject(), version: 6 }); } finally { first.restore(); } @@ -2818,19 +2819,20 @@ test('story thumbnail and tags survive a reload and an export/import round trip' } }); -test('Stories fields are refused before document version 7, like other new fields', () => { +test('Stories fields are refused before document version 6, like other new fields', () => { for (const [field, value] of [ ['stories', true], ['storyThumb', THUMB], ['storyTags', ['Storms']], ]) { - const project = { ...structuredClone(PROJECT_FIXTURE), version: 6 }; + const project = { ...structuredClone(PROJECT_FIXTURE), version: 5 }; project.scenes[0][field] = value; assert.throws( () => validateSceneDocument(project), new RegExp(`scenes\\[0\\]\\.${field}`), field, ); + validateSceneDocument({ ...project, version: 6 }); validateSceneDocument({ ...project, version: 7 }); } });