@oh-story/dsh 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/lib/client.js +7 -3
- package/lib/client.js.map +2 -2
- package/lib/drama/manifest.json +212 -142
- package/lib/drama/skills/short-drama/SKILL.md +14 -2
- package/lib/drama/skills/short-drama/assets/project-template/short-drama.json +3 -0
- package/lib/drama/skills/short-drama/references/creator-documents.md +3 -0
- package/lib/drama/skills/short-drama/references/knowhow-index.md +15 -0
- package/lib/drama/skills/short-drama/scripts/project_tool.py +131 -0
- package/lib/drama/skills/short-drama-assets/SKILL.md +2 -1
- package/lib/drama/skills/short-drama-assets/references/asset-review-checklist.md +2 -0
- package/lib/drama/skills/short-drama-assets/references/era-anchors.md +37 -0
- package/lib/drama/skills/short-drama-assets/references/stage-contract.md +2 -0
- package/lib/drama/skills/short-drama-develop/SKILL.md +10 -4
- package/lib/drama/skills/short-drama-develop/assets/adaptation-map.example.jsonl +1 -1
- package/lib/drama/skills/short-drama-develop/assets/creative-brief.md +8 -0
- package/lib/drama/skills/short-drama-develop/references/adaptation-craft.md +80 -13
- package/lib/drama/skills/short-drama-develop/references/episode-design.md +95 -12
- package/lib/drama/skills/short-drama-develop/references/genre-and-hook-playbook.md +9 -5
- package/lib/drama/skills/short-drama-develop/references/genre-cards//345/244/215/344/273/207/346/211/223/350/204/270.md +1 -1
- package/lib/drama/skills/short-drama-develop/references/genre-cards//347/263/273/347/273/237/346/265/201.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//351/200/206/350/242/255.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//351/207/215/347/224/237/347/251/277/350/266/212.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards.md +10 -7
- package/lib/drama/skills/short-drama-develop/references/premise-devices.md +15 -9
- package/lib/drama/skills/short-drama-develop/references/serial-character-and-memory.md +3 -2
- package/lib/drama/skills/short-drama-develop/references/stage-contract.md +14 -7
- package/lib/drama/skills/short-drama-develop/references/story-craft.md +7 -3
- package/lib/drama/skills/short-drama-edit/SKILL.md +43 -20
- package/lib/drama/skills/short-drama-edit/assets/remotion/README.md +49 -13
- package/lib/drama/skills/short-drama-edit/assets/remotion/package.json +4 -2
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/Overlay.tsx +31 -0
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/Root.tsx +5 -5
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/Subtitles.tsx +68 -69
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/font.ts +39 -29
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/rules.mjs +188 -0
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/schema.ts +26 -13
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/Card.tsx +72 -0
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/CornerChip.tsx +39 -0
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/ScreenText.tsx +36 -0
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/SystemPanel.tsx +44 -0
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/TaskPanel.tsx +100 -0
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/chrome.tsx +197 -0
- package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/tokens.ts +62 -0
- package/lib/drama/skills/short-drama-edit/assets/remotion/tsconfig.json +1 -0
- package/lib/drama/skills/short-drama-edit/assets//345/211/252/350/276/221/345/215/225.md +4 -2
- package/lib/drama/skills/short-drama-edit/references/cut-craft.md +3 -1
- package/lib/drama/skills/short-drama-edit/references/delivery-verify.md +6 -2
- package/lib/drama/skills/short-drama-edit/references/generated-footage.md +12 -6
- package/lib/drama/skills/short-drama-edit/references/sound-and-subtitles.md +13 -8
- package/lib/drama/skills/short-drama-edit/references/stage-contract.md +2 -0
- package/lib/drama/skills/short-drama-edit/scripts/edit_tool.py +1153 -121
- package/lib/drama/skills/short-drama-edit/scripts/selftest.py +49 -9
- package/lib/drama/skills/short-drama-novel-analyze/SKILL.md +3 -3
- package/lib/drama/skills/short-drama-novel-analyze/assets/episode-candidate.example.jsonl +2 -2
- package/lib/drama/skills/short-drama-novel-analyze/references/adaptation-triage.md +8 -4
- package/lib/drama/skills/short-drama-novel-analyze/references/adaptation-value.md +10 -3
- package/lib/drama/skills/short-drama-novel-analyze/references/aggregation-and-entities.md +25 -1
- package/lib/drama/skills/short-drama-novel-analyze/references/stage-contract.md +1 -0
- package/lib/drama/skills/short-drama-review/SKILL.md +2 -2
- package/lib/drama/skills/short-drama-review/references/review-method.md +6 -1
- package/lib/drama/skills/short-drama-review/references/rubric-assets-prompts.md +11 -0
- package/lib/drama/skills/short-drama-review/references/rubric-story-script.md +77 -3
- package/lib/drama/skills/short-drama-review/references/rubric-visual-motion.md +15 -0
- package/lib/drama/skills/short-drama-review/references/stage-contract.md +3 -0
- package/lib/drama/skills/short-drama-storyboard/SKILL.md +13 -5
- package/lib/drama/skills/short-drama-storyboard/references/blocking-playbooks.md +1 -1
- package/lib/drama/skills/short-drama-storyboard/references/production-shot-grammar.md +2 -2
- package/lib/drama/skills/short-drama-storyboard/references/shot-craft.md +82 -14
- package/lib/drama/skills/short-drama-storyboard/references/stage-contract.md +4 -2
- package/lib/drama/skills/short-drama-video-prompts/SKILL.md +5 -3
- package/lib/drama/skills/short-drama-video-prompts/references/camera-audio-continuity.md +12 -0
- package/lib/drama/skills/short-drama-video-prompts/references/delivery-profile.md +4 -5
- package/lib/drama/skills/short-drama-video-prompts/references/generability.md +4 -2
- package/lib/drama/skills/short-drama-video-prompts/references/minimax-h3.md +40 -1
- package/lib/drama/skills/short-drama-video-prompts/references/motion-recipe.md +20 -14
- package/lib/drama/skills/short-drama-video-prompts/references/performance-action-timing.md +1 -1
- package/lib/drama/skills/short-drama-video-prompts/references/production-prompt-grammar.md +8 -7
- package/lib/drama/skills/short-drama-video-prompts/references/review-and-fixtures.md +1 -1
- package/lib/drama/skills/short-drama-video-prompts/references/stage-contract.md +1 -0
- package/lib/drama/skills/short-drama-video-prompts/references/target-model-profile.md +8 -1
- package/lib/drama/skills/short-drama-video-prompts/references/wan-3.0.md +103 -0
- package/lib/drama/skills/short-drama-video-prompts/scripts/motion_timing_check.py +8 -7
- package/lib/drama/skills/short-drama-write/SKILL.md +8 -3
- package/lib/drama/skills/short-drama-write/references/dialogue-craft.md +1 -1
- package/lib/drama/skills/short-drama-write/references/script-craft.md +56 -3
- package/lib/drama/skills/short-drama-write/references/stage-contract.md +4 -0
- package/lib/drama/skills/short-drama-write/scripts/duration_estimate.py +48 -2
- package/lib/index.js +71 -21
- package/lib/index.js.map +3 -3
- package/lib/oh-story/manifest.json +545 -310
- package/lib/oh-story/roles/chapter-extractor.md +11 -11
- package/lib/oh-story/roles/character-designer.md +1 -2
- package/lib/oh-story/roles/consistency-checker.md +11 -9
- package/lib/oh-story/roles/narrative-writer.md +24 -25
- package/lib/oh-story/roles/story-architect.md +9 -61
- package/lib/oh-story/roles/story-explorer.md +20 -125
- package/lib/oh-story/roles/story-researcher.md +0 -1
- package/lib/oh-story/skills/story/SKILL.md +6 -6
- package/lib/oh-story/skills/story/VERSION +1 -1
- package/lib/oh-story/skills/story/references/author-memory-maintenance.md +75 -0
- package/lib/oh-story/skills/story/references/author-memory.md +40 -118
- package/lib/oh-story/skills/story/scripts/author_memory_commit.py +3 -3
- package/lib/oh-story/skills/story-deslop/SKILL.md +24 -25
- package/lib/oh-story/skills/story-deslop/references/agent-calls.md +5 -0
- package/lib/oh-story/skills/story-deslop/references/anti-ai-writing.md +1 -1
- package/lib/oh-story/skills/story-deslop/references/author-memory-maintenance.md +75 -0
- package/lib/oh-story/skills/story-deslop/references/author-memory.md +40 -118
- package/lib/oh-story/skills/story-deslop/references/banned-words.md +2 -2
- package/lib/oh-story/skills/story-deslop/references/deslop-gates.md +21 -4
- package/lib/oh-story/skills/story-deslop/references/style-resolution.md +4 -4
- package/lib/oh-story/skills/story-deslop/scripts/author_memory_commit.py +3 -3
- package/lib/oh-story/skills/story-deslop/scripts/check-ai-patterns.js +155 -8
- package/lib/oh-story/skills/story-import/SKILL.md +63 -579
- package/lib/oh-story/skills/story-import/references/deep-analysis.md +47 -0
- package/lib/oh-story/skills/story-import/references/format-and-structure.md +1 -1
- package/lib/oh-story/skills/story-import/references/import-report.md +64 -0
- package/lib/oh-story/skills/story-import/references/import-special-cases.md +34 -0
- package/lib/oh-story/skills/story-import/references/import-tracking.md +95 -0
- package/lib/oh-story/skills/story-import/references/length-routing.md +1 -1
- package/lib/oh-story/skills/story-import/references/outline-reverse-rules.md +79 -0
- package/lib/oh-story/skills/story-import/references/outline-reverse.md +24 -0
- package/lib/oh-story/skills/story-import/references/structure-mapping-long.md +95 -91
- package/lib/oh-story/skills/story-import/references/structure-mapping-short.md +24 -12
- package/lib/oh-story/skills/story-import/references/tracking-initialization.md +1 -1
- package/lib/oh-story/skills/story-import/references/tracking-transaction.md +11 -9
- package/lib/oh-story/skills/story-import/scripts/build_outline_brief.py +332 -0
- package/lib/oh-story/skills/story-import/scripts/check-outline-contract.js +101 -14
- package/lib/oh-story/skills/story-import/scripts/tracking_commit.py +278 -23
- package/lib/oh-story/skills/story-import/scripts/wordcount_core.py +179 -23
- package/lib/oh-story/skills/story-long-analyze/SKILL.md +28 -50
- package/lib/oh-story/skills/story-long-analyze/references/author-facing.md +12 -5
- package/lib/oh-story/skills/story-long-analyze/references/deconstruction-notes.md +1 -1
- package/lib/oh-story/skills/story-long-analyze/references/final-checks.md +19 -0
- package/lib/oh-story/skills/story-long-analyze/references/index-rebuild.md +11 -0
- package/lib/oh-story/skills/story-long-analyze/references/pipeline-ops.md +21 -55
- package/lib/oh-story/skills/story-long-analyze/references/stage1-golden-chapters.md +128 -0
- package/lib/oh-story/skills/story-long-analyze/references/stage2-extraction.md +229 -0
- package/lib/oh-story/skills/story-long-analyze/references/stage3-plot-rhythm.md +480 -0
- package/lib/oh-story/skills/story-long-analyze/references/stage4-characters-settings.md +195 -0
- package/lib/oh-story/skills/story-long-analyze/references/stage5-report.md +33 -0
- package/lib/oh-story/skills/story-long-analyze/references/style-profile-generator.md +17 -0
- package/lib/oh-story/skills/story-long-analyze/references/style-profile-protocol.md +1 -1
- package/lib/oh-story/skills/story-long-analyze/references/synthesis-inputs.md +39 -0
- package/lib/oh-story/skills/story-long-analyze/scripts/manage_analysis_run.py +47 -8
- package/lib/oh-story/skills/story-long-scan/SKILL.md +41 -193
- package/lib/oh-story/skills/story-long-scan/references/platform-ciweimao.md +19 -0
- package/lib/oh-story/skills/story-long-scan/references/platform-fanqie.md +45 -0
- package/lib/oh-story/skills/story-long-scan/references/platform-jjwxc.md +28 -0
- package/lib/oh-story/skills/story-long-scan/references/platform-qidian.md +35 -0
- package/lib/oh-story/skills/story-long-scan/references/platform-qimao.md +27 -0
- package/lib/oh-story/skills/story-long-scan/references/topic-decision.md +6 -2
- package/lib/oh-story/skills/story-long-write/SKILL.md +32 -73
- package/lib/oh-story/skills/story-long-write/references/agent-calls.md +47 -0
- package/lib/oh-story/skills/story-long-write/references/anti-ai-writing.md +1 -1
- package/lib/oh-story/skills/story-long-write/references/artifact-protocols.md +18 -201
- package/lib/oh-story/skills/story-long-write/references/author-memory-maintenance.md +75 -0
- package/lib/oh-story/skills/story-long-write/references/author-memory.md +40 -118
- package/lib/oh-story/skills/story-long-write/references/banned-words.md +2 -2
- package/lib/oh-story/skills/story-long-write/references/benchmark-recall.md +6 -10
- package/lib/oh-story/skills/story-long-write/references/character-relations.md +49 -1
- package/lib/oh-story/skills/story-long-write/references/deslop-gates.md +171 -0
- package/lib/oh-story/skills/story-long-write/references/emotion-on-page.md +116 -0
- package/lib/oh-story/skills/story-long-write/references/emotional-arc-design.md +1 -114
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards.md +1 -1
- package/lib/oh-story/skills/story-long-write/references/long-chapter-quality.md +3 -2
- package/lib/oh-story/skills/story-long-write/references/long-format.md +0 -8
- package/lib/oh-story/skills/story-long-write/references/long-genre-catalog.md +1 -1
- package/lib/oh-story/skills/story-long-write/references/long-genre-mechanics.md +3 -3
- package/lib/oh-story/skills/story-long-write/references/opening-design.md +2 -2
- package/lib/oh-story/skills/story-long-write/references/outline-conflict.md +4 -4
- package/lib/oh-story/skills/story-long-write/references/outline-methods.md +7 -7
- package/lib/oh-story/skills/story-long-write/references/outline-rhythm.md +3 -3
- package/lib/oh-story/skills/story-long-write/references/outline-structure-theory.md +14 -69
- package/lib/oh-story/skills/story-long-write/references/plot-frameworks.md +1 -1
- package/lib/oh-story/skills/story-long-write/references/plot-special-topics.md +2 -2
- package/lib/oh-story/skills/story-long-write/references/project-files.md +10 -6
- package/lib/oh-story/skills/story-long-write/references/reader-contract-and-progression.md +1 -1
- package/lib/oh-story/skills/story-long-write/references/reference-index.md +4 -4
- package/lib/oh-story/skills/story-long-write/references/stop-and-fix.md +9 -0
- package/lib/oh-story/skills/story-long-write/references/style-combat-face.md +1 -58
- package/lib/oh-story/skills/story-long-write/references/style-genre-modules.md +1 -1
- package/lib/oh-story/skills/story-long-write/references/style-resolution.md +4 -4
- package/lib/oh-story/skills/story-long-write/references/tracking-initialization.md +1 -1
- package/lib/oh-story/skills/story-long-write/references/tracking-transaction.md +11 -9
- package/lib/oh-story/skills/story-long-write/references/workflow-chapter.md +33 -44
- package/lib/oh-story/skills/story-long-write/references/workflow-daily.md +18 -51
- package/lib/oh-story/skills/story-long-write/references/workflow-outline.md +157 -0
- package/lib/oh-story/skills/story-long-write/references/workflow-revision.md +53 -67
- package/lib/oh-story/skills/story-long-write/references/workflow-setup.md +112 -251
- package/lib/oh-story/skills/story-long-write/references/workflow-volume.md +142 -0
- package/lib/oh-story/skills/story-long-write/references/writer-prompt-fallback.md +5 -3
- package/lib/oh-story/skills/story-long-write/references/writing-craft.md +18 -56
- package/lib/oh-story/skills/story-long-write/scripts/author_memory_commit.py +3 -3
- package/lib/oh-story/skills/story-long-write/scripts/build_architect_brief.py +260 -0
- package/lib/oh-story/skills/story-long-write/scripts/build_writer_prompt.py +96 -16
- package/lib/oh-story/skills/story-long-write/scripts/check-ai-patterns.js +155 -8
- package/lib/oh-story/skills/story-long-write/scripts/check-outline-contract.js +101 -14
- package/lib/oh-story/skills/story-long-write/scripts/check-outline-copy.js +7 -2
- package/lib/oh-story/skills/story-long-write/scripts/outline_view.py +2 -1
- package/lib/oh-story/skills/story-long-write/scripts/storyctl.py +250 -50
- package/lib/oh-story/skills/story-long-write/scripts/tracking_commit.py +278 -23
- package/lib/oh-story/skills/story-long-write/scripts/wordcount_core.py +179 -23
- package/lib/oh-story/skills/story-review/SKILL.md +19 -273
- package/lib/oh-story/skills/story-review/references/agent-prompts.md +184 -0
- package/lib/oh-story/skills/story-review/references/anti-ai-writing.md +1 -1
- package/lib/oh-story/skills/story-review/references/author-memory-maintenance.md +75 -0
- package/lib/oh-story/skills/story-review/references/author-memory.md +40 -118
- package/lib/oh-story/skills/story-review/references/banned-words.md +2 -2
- package/lib/oh-story/skills/story-review/references/batch-review.md +19 -0
- package/lib/oh-story/skills/story-review/references/character-relations.md +49 -1
- package/lib/oh-story/skills/story-review/references/review-quality.md +2 -1
- package/lib/oh-story/skills/story-review/references/review-tracking.md +10 -0
- package/lib/oh-story/skills/story-review/references/solo.md +52 -0
- package/lib/oh-story/skills/story-review/references/style-resolution.md +4 -4
- package/lib/oh-story/skills/story-review/references/tracking-initialization.md +1 -1
- package/lib/oh-story/skills/story-review/references/tracking-transaction.md +11 -9
- package/lib/oh-story/skills/story-review/scripts/author_memory_commit.py +3 -3
- package/lib/oh-story/skills/story-review/scripts/check-ai-patterns.js +155 -8
- package/lib/oh-story/skills/story-review/scripts/tracking_commit.py +278 -23
- package/lib/oh-story/skills/story-review/scripts/wordcount_core.py +179 -23
- package/lib/oh-story/skills/story-setup/SKILL.md +69 -458
- package/lib/oh-story/skills/story-setup/references/agent-references/agent-quality.md +4 -4
- package/lib/oh-story/skills/story-setup/references/agent-references/anti-ai-writing.md +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/banned-words.md +2 -2
- package/lib/oh-story/skills/story-setup/references/agent-references/benchmark-style-load.md +107 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/character-relations.md +49 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/deslop-gates.md +21 -4
- package/lib/oh-story/skills/story-setup/references/agent-references/emotion-on-page.md +116 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/emotional-arc-design.md +1 -114
- package/lib/oh-story/skills/story-setup/references/agent-references/format-and-structure.md +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards.md +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/long-genre-catalog.md +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/long-genre-mechanics.md +3 -3
- package/lib/oh-story/skills/story-setup/references/agent-references/long-quality.md +7 -5
- package/lib/oh-story/skills/story-setup/references/agent-references/opening-design.md +2 -2
- package/lib/oh-story/skills/story-setup/references/agent-references/outline-conflict.md +4 -4
- package/lib/oh-story/skills/story-setup/references/agent-references/outline-methods.md +7 -7
- package/lib/oh-story/skills/story-setup/references/agent-references/outline-rhythm.md +3 -3
- package/lib/oh-story/skills/story-setup/references/agent-references/short-emotional-methods.md +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/short-genre-formulas.md +0 -15
- package/lib/oh-story/skills/story-setup/references/agent-references/short-reversal.md +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/style-combat-face.md +1 -58
- package/lib/oh-story/skills/story-setup/references/agent-references/style-genre-modules.md +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/style-resolution.md +4 -4
- package/lib/oh-story/skills/story-setup/references/agent-references/writing-craft.md +18 -56
- package/lib/oh-story/skills/story-setup/references/diagnostics.md +3 -3
- package/lib/oh-story/skills/story-short-analyze/SKILL.md +37 -110
- package/lib/oh-story/skills/story-short-analyze/references/analysis-character-relations.md +1 -1
- package/lib/oh-story/skills/story-short-analyze/references/analysis-method.md +42 -0
- package/lib/oh-story/skills/story-short-analyze/references/optional-modules.md +97 -0
- package/lib/oh-story/skills/story-short-analyze/references/output-contract.md +9 -47
- package/lib/oh-story/skills/story-short-analyze/references/quality-checklist.md +80 -0
- package/lib/oh-story/skills/story-short-analyze/references/source-story-quality.md +4 -4
- package/lib/oh-story/skills/story-short-analyze/references/stage2-3-structure-emotion.md +308 -0
- package/lib/oh-story/skills/story-short-analyze/references/{material-decomposition.md → stage4-6-reversal-summary.md} +303 -374
- package/lib/oh-story/skills/story-short-scan/SKILL.md +30 -64
- package/lib/oh-story/skills/story-short-scan/references/manual-rank-input.md +36 -0
- package/lib/oh-story/skills/story-short-scan/references/platform-dianzhong.md +24 -0
- package/lib/oh-story/skills/story-short-scan/references/platform-heiyan.md +21 -0
- package/lib/oh-story/skills/story-short-scan/references/topic-match.md +38 -0
- package/lib/oh-story/skills/story-short-write/SKILL.md +23 -34
- package/lib/oh-story/skills/story-short-write/references/agent-calls.md +13 -0
- package/lib/oh-story/skills/story-short-write/references/author-memory-maintenance.md +75 -0
- package/lib/oh-story/skills/story-short-write/references/author-memory.md +40 -118
- package/lib/oh-story/skills/story-short-write/references/banned-words.md +2 -2
- package/lib/oh-story/skills/story-short-write/references/benchmark-recall.md +1 -21
- package/lib/oh-story/skills/story-short-write/references/emotional-methods.md +1 -1
- package/lib/oh-story/skills/story-short-write/references/genre-writing-formulas.md +0 -15
- package/lib/oh-story/skills/story-short-write/references/output-contract.md +9 -47
- package/lib/oh-story/skills/story-short-write/references/reference-index.md +17 -49
- package/lib/oh-story/skills/story-short-write/references/scene-craft.md +40 -0
- package/lib/oh-story/skills/story-short-write/references/short-craft.md +7 -43
- package/lib/oh-story/skills/story-short-write/references/short-format.md +3 -3
- package/lib/oh-story/skills/story-short-write/references/short-prose-quality.md +2 -1
- package/lib/oh-story/skills/story-short-write/references/short-reversal.md +1 -1
- package/lib/oh-story/skills/story-short-write/references/style-resolution.md +4 -4
- package/lib/oh-story/skills/story-short-write/references/submission-craft.md +1 -1
- package/lib/oh-story/skills/story-short-write/references/villain-and-reveal.md +5 -10
- package/lib/oh-story/skills/story-short-write/references/workflow-design.md +19 -12
- package/lib/oh-story/skills/story-short-write/references/workflow-draft.md +22 -32
- package/lib/oh-story/skills/story-short-write/references/workflow-revision.md +84 -17
- package/lib/oh-story/skills/story-short-write/references/writing-workflow.md +7 -119
- package/lib/oh-story/skills/story-short-write/scripts/author_memory_commit.py +3 -3
- package/lib/oh-story/skills/story-short-write/scripts/check-ai-patterns.js +155 -8
- package/lib/oh-story/skills/story-short-write/scripts/check-outline-copy.js +7 -2
- package/lib/types/client/video-studio.d.ts.map +1 -1
- package/lib/types/native-hooks.d.ts +2 -2
- package/lib/types/native-hooks.d.ts.map +1 -1
- package/lib/types/role-tool.d.ts.map +1 -1
- package/lib/types/skill-provider.d.ts.map +1 -1
- package/lib/types/video-project.d.ts.map +1 -1
- package/lib/types/workspace-route.d.ts.map +1 -1
- package/lib/video-recap/CHANGELOG.md +60 -1
- package/lib/video-recap/README.en.md +348 -137
- package/lib/video-recap/README.md +340 -136
- package/lib/video-recap/manifest.json +406 -251
- package/lib/video-recap/skills/video-assemble/SKILL.md +30 -15
- package/lib/video-recap/skills/video-assemble/references/audio-modes.md +63 -0
- package/lib/video-recap/skills/video-assemble/references/explicit-audio-mix.md +75 -0
- package/lib/video-recap/skills/video-assemble/references/foreground-compose.md +118 -0
- package/lib/video-recap/skills/video-assemble/references/narration-adoption.md +103 -0
- package/lib/video-recap/skills/video-assemble/references/packaging.md +45 -0
- package/lib/video-recap/skills/video-assemble/references/pair-media.md +74 -0
- package/lib/video-recap/skills/video-assemble/references/source-score.md +147 -0
- package/lib/video-recap/skills/video-assemble/references/subtitle-track.md +202 -0
- package/lib/video-recap/skills/video-assemble/scripts/adoption/__init__.py +1 -0
- package/lib/video-recap/skills/video-assemble/scripts/adoption/audio_mix_binding.py +279 -0
- package/lib/video-recap/skills/video-assemble/scripts/adoption/frozen_audio.py +187 -0
- package/lib/video-recap/skills/video-assemble/scripts/adoption/narration_binding.py +323 -0
- package/lib/video-recap/skills/video-assemble/scripts/adoption/strict_inputs.py +109 -0
- package/lib/video-recap/skills/video-assemble/scripts/adoption/strict_publish.py +130 -0
- package/lib/video-recap/skills/video-assemble/scripts/artifacts.py +10 -46
- package/lib/video-recap/skills/video-assemble/scripts/assemble.py +378 -119
- package/lib/video-recap/skills/video-assemble/scripts/assemble_constants.py +29 -12
- package/lib/video-recap/skills/video-assemble/scripts/assembly_contract.py +95 -44
- package/lib/video-recap/skills/video-assemble/scripts/assembly_settings.py +75 -32
- package/lib/video-recap/skills/video-assemble/scripts/audio_mix.py +11 -11
- package/lib/video-recap/skills/video-assemble/scripts/compose_foreground.py +293 -0
- package/lib/video-recap/skills/video-assemble/scripts/export_jianying.py +71 -78
- package/lib/video-recap/skills/video-assemble/scripts/jianying/__init__.py +1 -0
- package/lib/video-recap/skills/video-assemble/scripts/{jianying_builders.py → jianying/builders.py} +39 -67
- package/lib/video-recap/skills/video-assemble/scripts/{jianying_model.py → jianying/model.py} +3 -11
- package/lib/video-recap/skills/video-assemble/scripts/{jianying_optional.py → jianying/optional.py} +1 -1
- package/lib/video-recap/skills/video-assemble/scripts/jianying/schema.py +53 -0
- package/lib/video-recap/skills/video-assemble/scripts/{jianying_templates.py → jianying/templates.py} +1 -1
- package/lib/video-recap/skills/video-assemble/scripts/{jianying_timeline_contract.py → jianying/timeline_contract.py} +34 -13
- package/lib/video-recap/skills/video-assemble/scripts/{jianying_writer.py → jianying/writer.py} +7 -17
- package/lib/video-recap/skills/video-assemble/scripts/lib.py +37 -4
- package/lib/video-recap/skills/video-assemble/scripts/media.py +12 -21
- package/lib/video-recap/skills/video-assemble/scripts/narration_audio.py +64 -34
- package/lib/video-recap/skills/video-assemble/scripts/packaging.py +122 -0
- package/lib/video-recap/skills/video-assemble/scripts/pair_media.py +216 -0
- package/lib/video-recap/skills/video-assemble/scripts/render_preflight.py +1 -3
- package/lib/video-recap/skills/video-assemble/scripts/source_score.py +469 -0
- package/lib/video-recap/skills/video-assemble/scripts/source_subtitles.py +25 -9
- package/lib/video-recap/skills/video-assemble/scripts/subtitles/__init__.py +1 -0
- package/lib/video-recap/skills/video-assemble/scripts/{subtitle_core.py → subtitles/core.py} +13 -6
- package/lib/video-recap/skills/video-assemble/scripts/{subtitle_render.py → subtitles/render.py} +5 -4
- package/lib/video-recap/skills/video-assemble/scripts/subtitles/track.py +324 -0
- package/lib/video-recap/skills/video-assemble/scripts/subtitles/track_binding.py +200 -0
- package/lib/video-recap/skills/video-assemble/scripts/timeline.py +30 -46
- package/lib/video-recap/skills/video-assemble/scripts/timeline_emit.py +91 -7
- package/lib/video-recap/skills/video-assemble/scripts/visual_render.py +22 -8
- package/lib/video-recap/skills/video-cut/SKILL.md +34 -16
- package/lib/video-recap/skills/video-cut/references/shot-review.md +50 -0
- package/lib/video-recap/skills/video-cut/scripts/cut.py +2 -28
- package/lib/video-recap/skills/video-cut/scripts/cut_cli.py +58 -62
- package/lib/video-recap/skills/video-cut/scripts/cut_contract.py +21 -106
- package/lib/video-recap/skills/video-cut/scripts/cut_render.py +14 -9
- package/lib/video-recap/skills/video-cut/scripts/lib.py +39 -0
- package/lib/video-recap/skills/video-cut/scripts/narration_mapping.py +2 -155
- package/lib/video-recap/skills/video-cut/scripts/narrative_selection.py +244 -0
- package/lib/video-recap/skills/video-cut/scripts/shot_review.py +357 -0
- package/lib/video-recap/skills/video-recap/SKILL.md +86 -42
- package/lib/video-recap/skills/video-recap/references/audio-routing.md +126 -0
- package/lib/video-recap/skills/video-recap/references/config-playbook.md +12 -8
- package/lib/video-recap/skills/video-recap/references/data-schema.md +44 -33
- package/lib/video-recap/skills/video-recap/references/resource-library.md +151 -0
- package/lib/video-recap/skills/video-recap/references/shift-left-qc-schema.md +1 -1
- package/lib/video-recap/skills/video-recap/scripts/doctor.py +123 -30
- package/lib/video-recap/skills/video-recap/scripts/final_qc.py +22 -75
- package/lib/video-recap/skills/video-recap/scripts/lib.py +3 -3
- package/lib/video-recap/skills/video-recap/scripts/library.py +509 -0
- package/lib/video-recap/skills/video-recap/scripts/materials.py +63 -91
- package/lib/video-recap/skills/video-recap/scripts/mimo_qc.py +8 -70
- package/lib/video-recap/skills/video-recap/scripts/project_binding.py +286 -0
- package/lib/video-recap/skills/video-recap/scripts/qc/__init__.py +1 -0
- package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_client.py → qc/mimo_client.py} +1 -1
- package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_evidence.py → qc/mimo_evidence.py} +33 -66
- package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_observations.py → qc/mimo_observations.py} +3 -11
- package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_payload.py → qc/mimo_payload.py} +4 -7
- package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_report.py → qc/mimo_report.py} +17 -28
- package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_runner.py → qc/mimo_runner.py} +2 -2
- package/lib/video-recap/skills/video-recap/scripts/qc_contract.py +0 -19
- package/lib/video-recap/skills/video-recap/scripts/recap_cli.py +119 -50
- package/lib/video-recap/skills/video-recap/scripts/recap_inspect.py +32 -114
- package/lib/video-recap/skills/video-recap/scripts/recap_review.py +9 -23
- package/lib/video-recap/skills/video-recap/scripts/recap_runner.py +387 -334
- package/lib/video-recap/skills/video-recap/scripts/recap_runtime.py +23 -23
- package/lib/video-recap/skills/video-recap/scripts/recap_source.py +278 -0
- package/lib/video-recap/skills/video-recap/scripts/recap_stage_qc.py +25 -12
- package/lib/video-recap/skills/video-recap/scripts/recap_timeline.py +59 -52
- package/lib/video-recap/skills/video-recap/scripts/resource_lock.py +162 -0
- package/lib/video-recap/skills/video-script/SKILL.md +16 -13
- package/lib/video-recap/skills/video-script/references/creative-editing-playbook.md +9 -5
- package/lib/video-recap/skills/video-script/references/promotional-copy.md +68 -0
- package/lib/video-recap/skills/video-script/references/research-guide.md +1 -1
- package/lib/video-recap/skills/video-script/scripts/evidence_bundle.py +24 -76
- package/lib/video-recap/skills/video-script/scripts/lib.py +10 -87
- package/lib/video-recap/skills/video-script/scripts/narration_lint.py +63 -39
- package/lib/video-recap/skills/video-script/scripts/review.py +0 -2
- package/lib/video-recap/skills/video-script/scripts/review_grounding.py +35 -59
- package/lib/video-recap/skills/video-script/scripts/review_response.py +66 -128
- package/lib/video-recap/skills/video-script/scripts/review_runner.py +12 -20
- package/lib/video-recap/skills/video-script/scripts/speech_ownership.py +4 -4
- package/lib/video-recap/skills/video-script/scripts/validate.py +53 -42
- package/lib/video-recap/skills/video-understanding/SKILL.md +6 -4
- package/lib/video-recap/skills/video-understanding/references/data-schema.md +50 -156
- package/lib/video-recap/skills/video-understanding/references/research-guide.md +4 -4
- package/lib/video-recap/skills/video-understanding/scripts/asr.py +85 -65
- package/lib/video-recap/skills/video-understanding/scripts/asr_timing_evidence.py +270 -0
- package/lib/video-recap/skills/video-understanding/scripts/brief.py +2 -5
- package/lib/video-recap/skills/video-understanding/scripts/briefing/__init__.py +1 -0
- package/lib/video-recap/skills/video-understanding/scripts/{agent_brief.py → briefing/builder.py} +38 -35
- package/lib/video-recap/skills/{video-script/scripts/brief_context.py → video-understanding/scripts/briefing/context.py} +4 -35
- package/lib/video-recap/skills/{video-script/scripts/brief_inputs.py → video-understanding/scripts/briefing/inputs.py} +9 -31
- package/lib/video-recap/skills/video-understanding/scripts/{brief_timeline.py → briefing/timeline.py} +5 -6
- package/lib/video-recap/skills/video-understanding/scripts/consolidate.py +65 -116
- package/lib/video-recap/skills/video-understanding/scripts/detect.py +31 -40
- package/lib/video-recap/skills/video-understanding/scripts/lib.py +30 -86
- package/lib/video-recap/skills/video-understanding/scripts/narration_lint.py +63 -39
- package/lib/video-recap/skills/video-understanding/scripts/speech_ownership.py +4 -4
- package/lib/video-recap/skills/video-understanding/scripts/storyboard.py +17 -79
- package/lib/video-recap/skills/video-understanding/scripts/understanding_brief.py +14 -40
- package/lib/video-recap/skills/video-understanding/scripts/understanding_cache.py +64 -46
- package/lib/video-recap/skills/video-understanding/scripts/understanding_runner.py +31 -11
- package/lib/video-recap/skills/video-understanding/scripts/understanding_storyboard.py +19 -14
- package/lib/video-recap/skills/video-understanding/scripts/vlm.py +80 -108
- package/lib/video-recap/skills/video-voiceover/SKILL.md +29 -19
- package/lib/video-recap/skills/video-voiceover/references/index-tts.md +31 -0
- package/lib/video-recap/skills/video-voiceover/scripts/approved_text_policy.py +123 -0
- package/lib/video-recap/skills/video-voiceover/scripts/dub.py +51 -59
- package/lib/video-recap/skills/video-voiceover/scripts/lib.py +8 -44
- package/lib/video-recap/skills/video-voiceover/scripts/providers/__init__.py +1 -0
- package/lib/video-recap/skills/video-voiceover/scripts/providers/index_tts.py +184 -0
- package/lib/video-recap/skills/video-voiceover/scripts/voiceover.py +212 -134
- package/package.json +1 -1
- package/lib/oh-story/skills/story-long-analyze/references/material-decomposition.md +0 -538
- package/lib/oh-story/skills/story-long-analyze/references/output-templates.md +0 -603
- package/lib/oh-story/skills/story-long-scan/references/scan-output-format.md +0 -207
- package/lib/oh-story/skills/story-short-analyze/references/output-templates.md +0 -561
- package/lib/video-recap/skills/video-assemble/scripts/jianying_schema.py +0 -98
- package/lib/video-recap/skills/video-recap/references/creative-editing-playbook.md +0 -225
- package/lib/video-recap/skills/video-recap/references/research-guide.md +0 -74
- package/lib/video-recap/skills/video-recap/references/timeline-and-jianying.md +0 -250
- package/lib/video-recap/skills/video-script/scripts/agent_brief.py +0 -399
- package/lib/video-recap/skills/video-script/scripts/brief_timeline.py +0 -327
- package/lib/video-recap/skills/video-script/scripts/narration.py +0 -12
- package/lib/video-recap/skills/video-understanding/scripts/brief_context.py +0 -348
- package/lib/video-recap/skills/video-understanding/scripts/brief_inputs.py +0 -290
- /package/lib/video-recap/skills/video-assemble/scripts/{jianying_tracks.py → jianying/tracks.py} +0 -0
- /package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_contract.py → qc/mimo_contract.py} +0 -0
- /package/lib/video-recap/skills/video-voiceover/scripts/{fish_audio.py → providers/fish_audio.py} +0 -0
|
@@ -15,7 +15,6 @@ written into scenes/ASR/VLM/summary JSON.
|
|
|
15
15
|
"""
|
|
16
16
|
from __future__ import annotations
|
|
17
17
|
|
|
18
|
-
import hashlib
|
|
19
18
|
import json
|
|
20
19
|
import os
|
|
21
20
|
import re
|
|
@@ -68,75 +67,47 @@ def utc_now_iso() -> str:
|
|
|
68
67
|
return datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z")
|
|
69
68
|
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
def _file_identity(path):
|
|
75
|
-
"""(device, inode, size, mtime_ns) — changes whenever the bytes could have changed."""
|
|
70
|
+
def file_identity(path: str | Path) -> dict:
|
|
71
|
+
"""``{size, mtime_ns}`` of a file: the identity recap records and compares for a source
|
|
72
|
+
video or adopted artifact. A file rewritten in place gets a new mtime_ns."""
|
|
76
73
|
st = os.stat(os.fspath(path))
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
def file_fingerprint(path: str | Path, chunk_size: int = 1024 * 1024) -> str:
|
|
81
|
-
"""Return a full-content fingerprint for cache-correct identity checks.
|
|
82
|
-
|
|
83
|
-
The digest covers CONTENT only — never the path or mtime — so a copied video or
|
|
84
|
-
artifact is still recognised as the same asset, while any byte change invalidates
|
|
85
|
-
the cache even if timestamps, size, head, or tail bytes are misleading.
|
|
86
|
-
|
|
87
|
-
Identity metadata is used ONLY to memoize within a single process. One understanding
|
|
88
|
-
run fingerprints the same source video 8-10 times and the whole extracted frame set
|
|
89
|
-
2-3 times; on a 40-minute video at fps=1 that is gigabytes of redundant reads before
|
|
90
|
-
any real work starts. A file rewritten in place gets a new (size, mtime_ns) and is
|
|
91
|
-
re-hashed, so the memo can never serve a stale digest.
|
|
92
|
-
"""
|
|
93
|
-
key = _file_identity(path)
|
|
94
|
-
memoized = _FILE_FINGERPRINT_MEMO.get(key)
|
|
95
|
-
if memoized is not None:
|
|
96
|
-
return memoized
|
|
97
|
-
h = hashlib.sha256()
|
|
98
|
-
with open(os.fspath(path), "rb") as f:
|
|
99
|
-
for chunk in iter(lambda: f.read(chunk_size), b""):
|
|
100
|
-
h.update(chunk)
|
|
101
|
-
digest = h.hexdigest()
|
|
102
|
-
_FILE_FINGERPRINT_MEMO[key] = digest
|
|
103
|
-
return digest
|
|
74
|
+
return {"size": st.st_size, "mtime_ns": st.st_mtime_ns}
|
|
104
75
|
|
|
105
76
|
|
|
106
|
-
def
|
|
107
|
-
|
|
77
|
+
def _slug(text: str, max_len: int = 48) -> str:
|
|
78
|
+
raw = Path(text).stem.lower()
|
|
79
|
+
raw = re.sub(r"[^a-z0-9\u4e00-\u9fff._-]+", "-", raw).strip("-._")
|
|
80
|
+
return (raw or "material")[:max_len].strip("-._") or "material"
|
|
108
81
|
|
|
109
82
|
|
|
110
|
-
def
|
|
111
|
-
|
|
83
|
+
def _id_stem(source_path: str | Path, max_len: int = 32) -> str:
|
|
84
|
+
raw = re.sub(r"[^a-z0-9]+", "-", Path(source_path).stem.lower()).strip("-")
|
|
85
|
+
return (raw or "source")[:max_len].strip("-") or "source"
|
|
112
86
|
|
|
113
87
|
|
|
114
|
-
def
|
|
115
|
-
|
|
88
|
+
def source_id_for(source_path: str | Path) -> str:
|
|
89
|
+
"""``src_<stem>_<size>``: readable, stable across runs, and distinct for a different cut
|
|
90
|
+
of the same title (the size changes)."""
|
|
91
|
+
return f"src_{_id_stem(source_path)}_{os.stat(os.fspath(source_path)).st_size}"
|
|
116
92
|
|
|
117
93
|
|
|
118
94
|
def assign_source_ids(sources: list[dict]) -> list[dict]:
|
|
119
95
|
"""Assign deterministic source_id values to manifest source records.
|
|
120
96
|
|
|
121
|
-
Base id is ``
|
|
122
|
-
|
|
123
|
-
``_<pathhash6>`` suffixes. Input order does not affect the id for unique
|
|
124
|
-
fingerprints, and duplicate suffixes are derived from resolved path text.
|
|
97
|
+
Base id is ``source_id_for(source_path)``. When two records in one project share a
|
|
98
|
+
base id, the first keeps it and later ones get ``_2``, ``_3``… suffixes in input order.
|
|
125
99
|
"""
|
|
126
|
-
|
|
100
|
+
used: set[str] = set()
|
|
127
101
|
assigned = []
|
|
128
102
|
for raw in sources:
|
|
129
103
|
item = dict(raw)
|
|
130
|
-
fp = item["source_video_fingerprint"]
|
|
131
|
-
base = source_id_from_fingerprint(fp)
|
|
132
104
|
path = str(Path(item["source_path"]).resolve())
|
|
133
|
-
|
|
105
|
+
base = source_id_for(path)
|
|
134
106
|
sid = base
|
|
135
|
-
|
|
136
|
-
sid = f"{base}_{hashlib.sha256(path.encode('utf-8')).hexdigest()[:6]}"
|
|
137
|
-
# Avoid accidental path-hash collisions within one manifest.
|
|
107
|
+
suffix = 2
|
|
138
108
|
while sid in used:
|
|
139
|
-
sid = f"{base}_{
|
|
109
|
+
sid = f"{base}_{suffix}"
|
|
110
|
+
suffix += 1
|
|
140
111
|
used.add(sid)
|
|
141
112
|
item["source_id"] = sid
|
|
142
113
|
item["source_path"] = path
|
|
@@ -144,14 +115,8 @@ def assign_source_ids(sources: list[dict]) -> list[dict]:
|
|
|
144
115
|
return assigned
|
|
145
116
|
|
|
146
117
|
|
|
147
|
-
def
|
|
148
|
-
|
|
149
|
-
raw = re.sub(r"[^a-z0-9\u4e00-\u9fff._-]+", "-", raw).strip("-._")
|
|
150
|
-
return (raw or "material")[:max_len].strip("-._") or "material"
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
def material_id_for(source_path: str | Path, source_fingerprint: str) -> str:
|
|
154
|
-
return f"{_slug(str(source_path))}-{source_fingerprint[:12]}"
|
|
118
|
+
def material_id_for(source_path: str | Path, source_identity: dict) -> str:
|
|
119
|
+
return f"{_slug(str(source_path))}-{source_identity['size']}"
|
|
155
120
|
|
|
156
121
|
|
|
157
122
|
def material_dir(library_dir: str | Path, material_id: str) -> Path:
|
|
@@ -199,13 +164,12 @@ def summarize_work_dir(work_dir: str | Path, *, source_name: str = "") -> dict:
|
|
|
199
164
|
tags = []
|
|
200
165
|
index_path = work / "understanding_index.json"
|
|
201
166
|
if index_path.exists():
|
|
167
|
+
# consolidate.py writes {characters, relationships, plot_points, entities,
|
|
168
|
+
# research_glossary} and no prose summary. The list ITEMS are MiMo output that
|
|
169
|
+
# consolidate only list-checks, so their shape is still tolerated here.
|
|
202
170
|
index = load_json(index_path)
|
|
203
|
-
for key in ("
|
|
204
|
-
|
|
205
|
-
summary = _redact_text(str(index[key]))[:600]
|
|
206
|
-
break
|
|
207
|
-
for key in ("characters", "entities", "keywords", "tags"):
|
|
208
|
-
for item in index.get(key, [])[:12]:
|
|
171
|
+
for key in ("characters", "entities"):
|
|
172
|
+
for item in index[key][:12]:
|
|
209
173
|
text = item.get("name", "") if isinstance(item, dict) else item
|
|
210
174
|
tags.append(_redact_text(str(text))[:80])
|
|
211
175
|
for name, label in (("scenes.json", "scenes"), ("asr_result.json", "asr")):
|
|
@@ -229,8 +193,8 @@ def write_material_md(path: Path, metadata: dict, summary: str, tags: list[str])
|
|
|
229
193
|
|
|
230
194
|
- material_id: `{metadata['material_id']}`
|
|
231
195
|
- source: `{metadata['source_path']}`
|
|
232
|
-
-
|
|
233
|
-
-
|
|
196
|
+
- source_identity: `{json.dumps(metadata['source_video_identity'], sort_keys=True)}`
|
|
197
|
+
- settings: `{json.dumps(metadata['settings'], ensure_ascii=False, sort_keys=True)}`
|
|
234
198
|
- updated_at: `{metadata['updated_at']}`
|
|
235
199
|
- tags: {tags_text}
|
|
236
200
|
|
|
@@ -254,9 +218,12 @@ def _read_material_metadata(path: Path) -> dict | None:
|
|
|
254
218
|
def _material_cache_entry(path: Path) -> dict | None:
|
|
255
219
|
data = _read_material_metadata(path)
|
|
256
220
|
if not data or not all(data.get(key) for key in (
|
|
257
|
-
"
|
|
221
|
+
"source_path", "updated_at", "material_id",
|
|
258
222
|
)) or not isinstance(data.get("artifacts"), list):
|
|
259
223
|
return None
|
|
224
|
+
if not isinstance(data.get("source_video_identity"), dict) \
|
|
225
|
+
or not isinstance(data.get("settings"), dict):
|
|
226
|
+
return None
|
|
260
227
|
return data
|
|
261
228
|
|
|
262
229
|
|
|
@@ -264,8 +231,8 @@ def save_material(
|
|
|
264
231
|
library_dir: str | Path,
|
|
265
232
|
work_dir: str | Path,
|
|
266
233
|
source_path: str | Path,
|
|
267
|
-
|
|
268
|
-
|
|
234
|
+
source_identity: dict,
|
|
235
|
+
settings: dict,
|
|
269
236
|
*,
|
|
270
237
|
duration: float | None = None,
|
|
271
238
|
source_id: str | None = None,
|
|
@@ -274,7 +241,7 @@ def save_material(
|
|
|
274
241
|
) -> dict:
|
|
275
242
|
"""Persist small reusable analysis artifacts into the filesystem library."""
|
|
276
243
|
lib = Path(library_dir)
|
|
277
|
-
mid = material_id or material_id_for(source_path,
|
|
244
|
+
mid = material_id or material_id_for(source_path, source_identity)
|
|
278
245
|
dest = material_dir(lib, mid)
|
|
279
246
|
artifacts_dir = dest / "artifacts"
|
|
280
247
|
artifacts_dir.mkdir(parents=True, exist_ok=True)
|
|
@@ -291,7 +258,7 @@ def save_material(
|
|
|
291
258
|
for src in sources:
|
|
292
259
|
dst = artifacts_dir / src.name
|
|
293
260
|
copy_artifact_redacted(src, dst)
|
|
294
|
-
copied.append({"name": src.name, "path": f"artifacts/{src.name}", "
|
|
261
|
+
copied.append({"name": src.name, "path": f"artifacts/{src.name}", "bytes": dst.stat().st_size})
|
|
295
262
|
|
|
296
263
|
meta_path = dest / "material.json"
|
|
297
264
|
previous = _read_material_metadata(meta_path)
|
|
@@ -306,9 +273,9 @@ def save_material(
|
|
|
306
273
|
"source_id": source_id,
|
|
307
274
|
"source_name": source_path.name,
|
|
308
275
|
"source_path": str(source_path),
|
|
309
|
-
"
|
|
276
|
+
"source_video_identity": dict(source_identity),
|
|
310
277
|
"duration": duration,
|
|
311
|
-
"
|
|
278
|
+
"settings": dict(settings),
|
|
312
279
|
"artifacts": copied,
|
|
313
280
|
"created_at": created_at,
|
|
314
281
|
"updated_at": now,
|
|
@@ -322,8 +289,7 @@ def save_material(
|
|
|
322
289
|
"material_id": mid,
|
|
323
290
|
"source_name": metadata["source_name"],
|
|
324
291
|
"source_path": metadata["source_path"],
|
|
325
|
-
"
|
|
326
|
-
"settings_fingerprint": settings_fp,
|
|
292
|
+
"source_video_identity": dict(source_identity),
|
|
327
293
|
"summary": summary_info["summary"],
|
|
328
294
|
"tags": summary_info["tags"],
|
|
329
295
|
"material_dir": str(dest),
|
|
@@ -335,14 +301,22 @@ def save_material(
|
|
|
335
301
|
return metadata
|
|
336
302
|
|
|
337
303
|
|
|
338
|
-
def
|
|
304
|
+
def find_material_by_source(
|
|
305
|
+
library_dir: str | Path, source_path: str | Path, source_identity: dict
|
|
306
|
+
) -> dict | None:
|
|
307
|
+
"""The newest material saved for this exact source file (resolved path + identity)."""
|
|
339
308
|
root = Path(library_dir) / "materials"
|
|
340
309
|
if not root.exists():
|
|
341
310
|
return None
|
|
311
|
+
resolved = str(Path(source_path).resolve())
|
|
342
312
|
candidates = []
|
|
343
313
|
for meta_path in root.glob("*/material.json"):
|
|
344
314
|
data = _material_cache_entry(meta_path)
|
|
345
|
-
if
|
|
315
|
+
if (
|
|
316
|
+
data is not None
|
|
317
|
+
and data["source_path"] == resolved
|
|
318
|
+
and data["source_video_identity"] == source_identity
|
|
319
|
+
):
|
|
346
320
|
data["material_dir"] = str(meta_path.parent)
|
|
347
321
|
candidates.append(data)
|
|
348
322
|
if not candidates:
|
|
@@ -357,13 +331,14 @@ def restore_material(
|
|
|
357
331
|
library_dir: str | Path,
|
|
358
332
|
work_dir: str | Path,
|
|
359
333
|
*,
|
|
360
|
-
|
|
361
|
-
|
|
334
|
+
source_path: str | Path,
|
|
335
|
+
source_identity: dict,
|
|
336
|
+
settings: dict,
|
|
362
337
|
material_id: str | None = None,
|
|
363
338
|
overwrite: bool = True,
|
|
364
339
|
prune_stale_allowed: bool = True,
|
|
365
340
|
) -> dict:
|
|
366
|
-
"""Restore allowed artifacts when
|
|
341
|
+
"""Restore allowed artifacts when source path, identity and settings all match.
|
|
367
342
|
|
|
368
343
|
Returns a status dict and never partially restores on mismatch.
|
|
369
344
|
|
|
@@ -382,13 +357,14 @@ def restore_material(
|
|
|
382
357
|
return {"restored": False, "reason": "material missing or invalid"}
|
|
383
358
|
meta["material_dir"] = str(meta_path.parent)
|
|
384
359
|
else:
|
|
385
|
-
meta =
|
|
360
|
+
meta = find_material_by_source(lib, source_path, source_identity)
|
|
386
361
|
if meta is None:
|
|
387
362
|
return {"restored": False, "reason": "material not found"}
|
|
388
|
-
if meta["
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
363
|
+
if meta["source_path"] != str(Path(source_path).resolve()) \
|
|
364
|
+
or meta["source_video_identity"] != source_identity:
|
|
365
|
+
return {"restored": False, "reason": "source identity mismatch", "material_id": meta["material_id"]}
|
|
366
|
+
if meta["settings"] != settings:
|
|
367
|
+
return {"restored": False, "reason": "settings mismatch", "material_id": meta["material_id"]}
|
|
392
368
|
|
|
393
369
|
src_dir = Path(meta["material_dir"]) / "artifacts"
|
|
394
370
|
if not src_dir.exists():
|
|
@@ -397,11 +373,7 @@ def restore_material(
|
|
|
397
373
|
dest.mkdir(parents=True, exist_ok=True)
|
|
398
374
|
with tempfile.TemporaryDirectory(prefix=".material_restore_", dir=str(dest)) as tmp_name:
|
|
399
375
|
tmp = Path(tmp_name)
|
|
400
|
-
staged = [
|
|
401
|
-
artifact["name"]
|
|
402
|
-
for artifact in meta["artifacts"]
|
|
403
|
-
if isinstance(artifact, dict) and artifact.get("name") in ALLOWED_ARTIFACTS
|
|
404
|
-
]
|
|
376
|
+
staged = [artifact["name"] for artifact in meta["artifacts"]] # save_material's own list
|
|
405
377
|
if not staged or any(not (src_dir / name).is_file() for name in staged):
|
|
406
378
|
return {"restored": False, "reason": "material artifacts missing", "material_id": meta["material_id"]}
|
|
407
379
|
for name in staged:
|
|
@@ -1,77 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""Public API and CLI entrypoint for advisory MiMo multimodal QC."""
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from mimo_qc_client import mimo_qc_api_call
|
|
10
|
-
from mimo_qc_contract import DEFAULT_STAGE
|
|
4
|
+
import qc.mimo_runner as mimo_qc_runner
|
|
5
|
+
from qc.mimo_evidence import collect_evidence, safe_mimo_config
|
|
6
|
+
from qc.mimo_observations import normalize_observations
|
|
7
|
+
from qc.mimo_payload import build_payload
|
|
8
|
+
from qc.mimo_client import mimo_qc_api_call
|
|
11
9
|
|
|
12
|
-
sample_video_frames = mimo_qc_report.sample_video_frames
|
|
13
|
-
write_report = mimo_qc_report.write_report
|
|
14
10
|
clear_report = mimo_qc_runner.clear_report
|
|
15
11
|
|
|
16
12
|
|
|
17
|
-
def
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
stage=DEFAULT_STAGE,
|
|
21
|
-
fixture=None,
|
|
22
|
-
dry_run=False,
|
|
23
|
-
judge=None,
|
|
24
|
-
config=None,
|
|
25
|
-
final_output=None,
|
|
26
|
-
live=False,
|
|
27
|
-
refresh=False,
|
|
28
|
-
frame_sampler=None,
|
|
29
|
-
existing=None,
|
|
30
|
-
):
|
|
31
|
-
return mimo_qc_report.build_report(
|
|
32
|
-
work_dir,
|
|
33
|
-
stage=stage,
|
|
34
|
-
fixture=fixture,
|
|
35
|
-
dry_run=dry_run,
|
|
36
|
-
judge=judge,
|
|
37
|
-
config=config,
|
|
38
|
-
final_output=final_output,
|
|
39
|
-
live=live,
|
|
40
|
-
refresh=refresh,
|
|
41
|
-
frame_sampler=frame_sampler,
|
|
42
|
-
existing=existing,
|
|
43
|
-
api_call=mimo_qc_api_call,
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def run(
|
|
48
|
-
work_dir,
|
|
49
|
-
*,
|
|
50
|
-
stage=DEFAULT_STAGE,
|
|
51
|
-
fixture=None,
|
|
52
|
-
dry_run=False,
|
|
53
|
-
judge=None,
|
|
54
|
-
config=None,
|
|
55
|
-
final_output=None,
|
|
56
|
-
output=None,
|
|
57
|
-
live=False,
|
|
58
|
-
refresh=False,
|
|
59
|
-
frame_sampler=None,
|
|
60
|
-
):
|
|
61
|
-
return mimo_qc_runner.run(
|
|
62
|
-
work_dir,
|
|
63
|
-
stage=stage,
|
|
64
|
-
fixture=fixture,
|
|
65
|
-
dry_run=dry_run,
|
|
66
|
-
judge=judge,
|
|
67
|
-
config=config,
|
|
68
|
-
final_output=final_output,
|
|
69
|
-
output=output,
|
|
70
|
-
live=live,
|
|
71
|
-
refresh=refresh,
|
|
72
|
-
frame_sampler=frame_sampler,
|
|
73
|
-
api_call=mimo_qc_api_call,
|
|
74
|
-
)
|
|
13
|
+
def run(work_dir, **kwargs):
|
|
14
|
+
"""mimo_qc_runner.run with the real MiMo transport bound at call time."""
|
|
15
|
+
return mimo_qc_runner.run(work_dir, api_call=mimo_qc_api_call, **kwargs)
|
|
75
16
|
|
|
76
17
|
|
|
77
18
|
def main(argv=None):
|
|
@@ -79,16 +20,13 @@ def main(argv=None):
|
|
|
79
20
|
|
|
80
21
|
__all__ = [
|
|
81
22
|
"build_payload",
|
|
82
|
-
"build_report",
|
|
83
23
|
"clear_report",
|
|
84
24
|
"collect_evidence",
|
|
85
25
|
"main",
|
|
86
26
|
"mimo_qc_api_call",
|
|
87
27
|
"normalize_observations",
|
|
88
28
|
"run",
|
|
89
|
-
"sample_video_frames",
|
|
90
29
|
"safe_mimo_config",
|
|
91
|
-
"write_report",
|
|
92
30
|
]
|
|
93
31
|
|
|
94
32
|
if __name__ == "__main__":
|