@oh-story/dsh 0.1.0
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/LICENSE +21 -0
- package/README.md +38 -0
- package/cordis.patch.yml +3 -0
- package/lib/client.js +1201 -0
- package/lib/client.js.map +7 -0
- package/lib/drama/LICENSE.upstream +21 -0
- package/lib/drama/manifest.json +1012 -0
- package/lib/drama/skills/short-drama/SKILL.md +153 -0
- package/lib/drama/skills/short-drama/agents/openai.yaml +4 -0
- package/lib/drama/skills/short-drama/assets/creator-decision.example.jsonl +4 -0
- package/lib/drama/skills/short-drama/assets/production-observation.example.jsonl +2 -0
- package/lib/drama/skills/short-drama/assets/project-template/short-drama.json +36 -0
- package/lib/drama/skills/short-drama/assets/reference-observation.example.jsonl +2 -0
- package/lib/drama/skills/short-drama/references/audience-reveal.md +74 -0
- package/lib/drama/skills/short-drama/references/contract-and-ownership.md +94 -0
- package/lib/drama/skills/short-drama/references/creator-workflow.md +82 -0
- package/lib/drama/skills/short-drama/references/form-cards/Q/347/211/210/350/241/250/350/276/276.md +73 -0
- package/lib/drama/skills/short-drama/references/form-cards//344/272/214/347/273/264/345/212/250/346/200/201/346/274/253.md +74 -0
- package/lib/drama/skills/short-drama/references/form-cards//345/233/275/346/274/253/344/272/214/346/254/241/345/205/203.md +79 -0
- package/lib/drama/skills/short-drama/references/form-cards//345/256/236/346/213/215.md +75 -0
- package/lib/drama/skills/short-drama/references/form-cards//346/260/264/345/242/250/347/254/224/350/247/246.md +85 -0
- package/lib/drama/skills/short-drama/references/form-cards//351/243/216/346/240/274/345/214/226/344/270/211/347/273/264.md +72 -0
- package/lib/drama/skills/short-drama/references/knowhow-index.md +80 -0
- package/lib/drama/skills/short-drama/references/lifecycle-commands.md +130 -0
- package/lib/drama/skills/short-drama/references/look-development.md +52 -0
- package/lib/drama/skills/short-drama/references/pickup-and-alternate.md +58 -0
- package/lib/drama/skills/short-drama/references/production-form-profiles.md +126 -0
- package/lib/drama/skills/short-drama/references/reference-roles.md +142 -0
- package/lib/drama/skills/short-drama/references/runtime-preflight.md +27 -0
- package/lib/drama/skills/short-drama/scripts/project_tool.py +1963 -0
- package/lib/drama/skills/short-drama/scripts/selftest.py +287 -0
- package/lib/drama/skills/short-drama-assets/SKILL.md +187 -0
- package/lib/drama/skills/short-drama-assets/agents/openai.yaml +4 -0
- package/lib/drama/skills/short-drama-assets/assets/character-look.example.jsonl +3 -0
- package/lib/drama/skills/short-drama-assets/assets/continuity.example.jsonl +4 -0
- package/lib/drama/skills/short-drama-assets/assets/decisions.example.jsonl +5 -0
- package/lib/drama/skills/short-drama-assets/assets/location-view.example.jsonl +3 -0
- package/lib/drama/skills/short-drama-assets/assets/occurrences.example.jsonl +5 -0
- package/lib/drama/skills/short-drama-assets/assets/prop-state.example.jsonl +3 -0
- package/lib/drama/skills/short-drama-assets/examples/minimal/characters.jsonl +2 -0
- package/lib/drama/skills/short-drama-assets/examples/minimal/looks.jsonl +2 -0
- package/lib/drama/skills/short-drama-assets/references/asset-review-checklist.md +89 -0
- package/lib/drama/skills/short-drama-assets/references/character-and-look.md +164 -0
- package/lib/drama/skills/short-drama-assets/references/continuity-delta.md +123 -0
- package/lib/drama/skills/short-drama-assets/references/identity-vs-variant.md +146 -0
- package/lib/drama/skills/short-drama-assets/references/location-and-view.md +84 -0
- package/lib/drama/skills/short-drama-assets/references/occurrence-extraction.md +111 -0
- package/lib/drama/skills/short-drama-assets/references/prop-and-state.md +107 -0
- package/lib/drama/skills/short-drama-assets/references/stage-contract.md +136 -0
- package/lib/drama/skills/short-drama-assets/references/voice-direction.md +171 -0
- package/lib/drama/skills/short-drama-assets/scripts/asset_check.py +267 -0
- package/lib/drama/skills/short-drama-assets/scripts/selftest.py +89 -0
- package/lib/drama/skills/short-drama-develop/SKILL.md +157 -0
- package/lib/drama/skills/short-drama-develop/agents/openai.yaml +4 -0
- package/lib/drama/skills/short-drama-develop/assets/adaptation-map.example.jsonl +1 -0
- package/lib/drama/skills/short-drama-develop/assets/creative-brief.md +120 -0
- package/lib/drama/skills/short-drama-develop/assets/episode-map.jsonl +1 -0
- package/lib/drama/skills/short-drama-develop/assets/story-engine.md +181 -0
- package/lib/drama/skills/short-drama-develop/references/adaptation-craft.md +219 -0
- package/lib/drama/skills/short-drama-develop/references/creative-reference-intake.md +57 -0
- package/lib/drama/skills/short-drama-develop/references/director-brief-craft.md +113 -0
- package/lib/drama/skills/short-drama-develop/references/episode-design.md +509 -0
- package/lib/drama/skills/short-drama-develop/references/genre-and-hook-playbook.md +240 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//344/272/262/345/255/220/351/232/220/347/247/230.md +112 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//344/273/231/344/276/240/344/277/256/347/234/237.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//345/212/250/344/275/234/344/273/273/345/212/241.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//345/217/244/350/243/205/346/235/203/350/260/213.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//345/244/215/344/273/207/346/211/223/350/204/270.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//345/256/266/345/272/255/345/205/263/347/263/273.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//346/202/254/347/226/221/350/247/204/345/210/231.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//347/224/237/346/264/273/346/265/201.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//347/240/264/351/225/234/351/207/215/345/234/206.md +109 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//350/201/214/345/234/272/345/226/234/345/211/247.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//350/261/252/351/227/250/345/251/232/346/201/213.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards//350/272/253/344/273/275/351/224/231/344/275/215.md +51 -0
- package/lib/drama/skills/short-drama-develop/references/genre-cards.md +92 -0
- package/lib/drama/skills/short-drama-develop/references/mechanism-loop.md +282 -0
- package/lib/drama/skills/short-drama-develop/references/multi-episode-intake.md +128 -0
- package/lib/drama/skills/short-drama-develop/references/premise-devices.md +211 -0
- package/lib/drama/skills/short-drama-develop/references/reveal-reversal-payoff.md +99 -0
- package/lib/drama/skills/short-drama-develop/references/serial-character-and-memory.md +293 -0
- package/lib/drama/skills/short-drama-develop/references/stage-contract.md +88 -0
- package/lib/drama/skills/short-drama-develop/references/story-craft.md +359 -0
- package/lib/drama/skills/short-drama-develop/scripts/episode_intake.py +699 -0
- package/lib/drama/skills/short-drama-develop/scripts/selftest.py +47 -0
- package/lib/drama/skills/short-drama-image-prompts/SKILL.md +181 -0
- package/lib/drama/skills/short-drama-image-prompts/agents/openai.yaml +4 -0
- package/lib/drama/skills/short-drama-image-prompts/assets/image-prompt-spec.jsonl.md +187 -0
- package/lib/drama/skills/short-drama-image-prompts/assets/image-prompts.md +37 -0
- package/lib/drama/skills/short-drama-image-prompts/assets/lookdev-frame-spec.jsonl.md +128 -0
- package/lib/drama/skills/short-drama-image-prompts/assets/lookdev-prompts.md +31 -0
- package/lib/drama/skills/short-drama-image-prompts/examples/minimal-image-prompt-specs.jsonl +2 -0
- package/lib/drama/skills/short-drama-image-prompts/references/character-and-look.md +154 -0
- package/lib/drama/skills/short-drama-image-prompts/references/common-recipe.md +231 -0
- package/lib/drama/skills/short-drama-image-prompts/references/edit-and-revision.md +122 -0
- package/lib/drama/skills/short-drama-image-prompts/references/location-plate.md +152 -0
- package/lib/drama/skills/short-drama-image-prompts/references/look-and-state-variant.md +96 -0
- package/lib/drama/skills/short-drama-image-prompts/references/lookdev-frame.md +38 -0
- package/lib/drama/skills/short-drama-image-prompts/references/production-sheet-recipes.md +177 -0
- package/lib/drama/skills/short-drama-image-prompts/references/prop-plate.md +140 -0
- package/lib/drama/skills/short-drama-image-prompts/references/review-and-fixtures.md +92 -0
- package/lib/drama/skills/short-drama-image-prompts/references/stage-contract.md +89 -0
- package/lib/drama/skills/short-drama-image-prompts/scripts/image_prompt_check.py +443 -0
- package/lib/drama/skills/short-drama-image-prompts/scripts/selftest.py +93 -0
- package/lib/drama/skills/short-drama-novel-analyze/SKILL.md +245 -0
- package/lib/drama/skills/short-drama-novel-analyze/agents/openai.yaml +4 -0
- package/lib/drama/skills/short-drama-novel-analyze/assets/episode-candidate.example.jsonl +3 -0
- package/lib/drama/skills/short-drama-novel-analyze/references/adaptation-triage.md +116 -0
- package/lib/drama/skills/short-drama-novel-analyze/references/adaptation-value.md +124 -0
- package/lib/drama/skills/short-drama-novel-analyze/references/aggregation-and-entities.md +155 -0
- package/lib/drama/skills/short-drama-novel-analyze/references/chapter-extraction.md +141 -0
- package/lib/drama/skills/short-drama-novel-analyze/references/stage-contract.md +67 -0
- package/lib/drama/skills/short-drama-novel-analyze/scripts/novel_index.py +651 -0
- package/lib/drama/skills/short-drama-novel-analyze/scripts/selftest.py +51 -0
- package/lib/drama/skills/short-drama-produce/SKILL.md +103 -0
- package/lib/drama/skills/short-drama-produce/agents/openai.yaml +4 -0
- package/lib/drama/skills/short-drama-produce/references/adapter-contract.md +140 -0
- package/lib/drama/skills/short-drama-produce/references/providers/gpt-image-2.md +24 -0
- package/lib/drama/skills/short-drama-produce/references/providers/minimax-music.md +25 -0
- package/lib/drama/skills/short-drama-produce/references/providers/seedance.md +40 -0
- package/lib/drama/skills/short-drama-produce/scripts/fixture_adapter.py +60 -0
- package/lib/drama/skills/short-drama-produce/scripts/production_tool.py +1635 -0
- package/lib/drama/skills/short-drama-produce/scripts/provider_adapters.py +964 -0
- package/lib/drama/skills/short-drama-produce/scripts/selftest.py +134 -0
- package/lib/drama/skills/short-drama-review/SKILL.md +178 -0
- package/lib/drama/skills/short-drama-review/agents/openai.yaml +4 -0
- package/lib/drama/skills/short-drama-review/assets/finding-template.jsonl +2 -0
- package/lib/drama/skills/short-drama-review/assets/supersession-decision.example.json +42 -0
- package/lib/drama/skills/short-drama-review/assets/verdict-template.json +32 -0
- package/lib/drama/skills/short-drama-review/examples/minimal-findings.jsonl +2 -0
- package/lib/drama/skills/short-drama-review/examples/minimal-verdict.json +34 -0
- package/lib/drama/skills/short-drama-review/references/anti-template-repair.md +114 -0
- package/lib/drama/skills/short-drama-review/references/production-quality-gates.md +270 -0
- package/lib/drama/skills/short-drama-review/references/project-calibration.md +85 -0
- package/lib/drama/skills/short-drama-review/references/review-method.md +82 -0
- package/lib/drama/skills/short-drama-review/references/rubric-assets-prompts.md +115 -0
- package/lib/drama/skills/short-drama-review/references/rubric-source-analysis.md +108 -0
- package/lib/drama/skills/short-drama-review/references/rubric-story-script.md +164 -0
- package/lib/drama/skills/short-drama-review/references/rubric-visual-motion.md +166 -0
- package/lib/drama/skills/short-drama-review/references/stage-contract.md +87 -0
- package/lib/drama/skills/short-drama-review/scripts/review_check.py +325 -0
- package/lib/drama/skills/short-drama-review/scripts/selftest.py +87 -0
- package/lib/drama/skills/short-drama-storyboard/SKILL.md +264 -0
- package/lib/drama/skills/short-drama-storyboard/agents/openai.yaml +4 -0
- package/lib/drama/skills/short-drama-storyboard/assets/coverage-audition.example.jsonl +2 -0
- package/lib/drama/skills/short-drama-storyboard/assets/coverage-template.json +49 -0
- package/lib/drama/skills/short-drama-storyboard/assets/keyframe-prompts.md +32 -0
- package/lib/drama/skills/short-drama-storyboard/assets/keyframe-template.jsonl +2 -0
- package/lib/drama/skills/short-drama-storyboard/assets/revision-lineage.fragment.json +12 -0
- package/lib/drama/skills/short-drama-storyboard/assets/scene-visual-plan.example.jsonl +2 -0
- package/lib/drama/skills/short-drama-storyboard/assets/shot-template.jsonl +2 -0
- package/lib/drama/skills/short-drama-storyboard/references/blocking-playbooks.md +241 -0
- package/lib/drama/skills/short-drama-storyboard/references/coverage-audition.md +39 -0
- package/lib/drama/skills/short-drama-storyboard/references/keyframe-craft.md +169 -0
- package/lib/drama/skills/short-drama-storyboard/references/production-shot-grammar.md +264 -0
- package/lib/drama/skills/short-drama-storyboard/references/review-and-fixtures.md +70 -0
- package/lib/drama/skills/short-drama-storyboard/references/scene-visual-plan.md +39 -0
- package/lib/drama/skills/short-drama-storyboard/references/screenplay-to-keyframe-example.md +157 -0
- package/lib/drama/skills/short-drama-storyboard/references/shot-craft.md +192 -0
- package/lib/drama/skills/short-drama-storyboard/references/shot-revision-identity.md +29 -0
- package/lib/drama/skills/short-drama-storyboard/references/stage-contract.md +110 -0
- package/lib/drama/skills/short-drama-storyboard/scripts/selftest.py +191 -0
- package/lib/drama/skills/short-drama-storyboard/scripts/storyboard_check.py +824 -0
- package/lib/drama/skills/short-drama-video-prompts/SKILL.md +245 -0
- package/lib/drama/skills/short-drama-video-prompts/agents/openai.yaml +4 -0
- package/lib/drama/skills/short-drama-video-prompts/assets/coverage-scope.fragment.json +21 -0
- package/lib/drama/skills/short-drama-video-prompts/assets/delivery-container.jsonl.md +101 -0
- package/lib/drama/skills/short-drama-video-prompts/assets/motion-spec.jsonl.md +212 -0
- package/lib/drama/skills/short-drama-video-prompts/assets/motion-terminal.example.jsonl +2 -0
- package/lib/drama/skills/short-drama-video-prompts/assets/music-spec.jsonl.md +31 -0
- package/lib/drama/skills/short-drama-video-prompts/assets/performance.fragment.json +38 -0
- package/lib/drama/skills/short-drama-video-prompts/assets/video-prompts.md +46 -0
- package/lib/drama/skills/short-drama-video-prompts/examples/minimal-music-specs.jsonl +2 -0
- package/lib/drama/skills/short-drama-video-prompts/references/camera-audio-continuity.md +240 -0
- package/lib/drama/skills/short-drama-video-prompts/references/delivery-profile.md +255 -0
- package/lib/drama/skills/short-drama-video-prompts/references/generability.md +93 -0
- package/lib/drama/skills/short-drama-video-prompts/references/motion-recipe.md +304 -0
- package/lib/drama/skills/short-drama-video-prompts/references/performance-action-timing.md +191 -0
- package/lib/drama/skills/short-drama-video-prompts/references/production-prompt-grammar.md +312 -0
- package/lib/drama/skills/short-drama-video-prompts/references/review-and-fixtures.md +168 -0
- package/lib/drama/skills/short-drama-video-prompts/references/stage-contract.md +110 -0
- package/lib/drama/skills/short-drama-video-prompts/scripts/container_check.py +329 -0
- package/lib/drama/skills/short-drama-video-prompts/scripts/motion_timing_check.py +450 -0
- package/lib/drama/skills/short-drama-video-prompts/scripts/music_spec_check.py +327 -0
- package/lib/drama/skills/short-drama-video-prompts/scripts/selftest.py +82 -0
- package/lib/drama/skills/short-drama-write/SKILL.md +284 -0
- package/lib/drama/skills/short-drama-write/agents/openai.yaml +4 -0
- package/lib/drama/skills/short-drama-write/assets/beats.jsonl +2 -0
- package/lib/drama/skills/short-drama-write/assets/episode-card-standalone.json +120 -0
- package/lib/drama/skills/short-drama-write/assets/episode-card.json +55 -0
- package/lib/drama/skills/short-drama-write/assets/screenplay.md +36 -0
- package/lib/drama/skills/short-drama-write/assets/voice-record-sheet.jsonl.md +89 -0
- package/lib/drama/skills/short-drama-write/references/dialogue-craft.md +519 -0
- package/lib/drama/skills/short-drama-write/references/production-format-dialect.md +273 -0
- package/lib/drama/skills/short-drama-write/references/scene-handoff-capsule.md +51 -0
- package/lib/drama/skills/short-drama-write/references/scene-sound-dramaturgy.md +43 -0
- package/lib/drama/skills/short-drama-write/references/screenplay-format.md +260 -0
- package/lib/drama/skills/short-drama-write/references/script-craft.md +558 -0
- package/lib/drama/skills/short-drama-write/references/stage-contract.md +94 -0
- package/lib/drama/skills/short-drama-write/references/substitutable-realization.md +107 -0
- package/lib/drama/skills/short-drama-write/scripts/duration_estimate.py +309 -0
- package/lib/drama/skills/short-drama-write/scripts/screenplay_index.py +1091 -0
- package/lib/drama/skills/short-drama-write/scripts/selftest.py +229 -0
- package/lib/drama/skills/short-drama-write/scripts/voice_sheet_check.py +416 -0
- package/lib/index.js +756 -0
- package/lib/index.js.map +7 -0
- package/lib/oh-story/LICENSE.upstream +21 -0
- package/lib/oh-story/manifest.json +1351 -0
- package/lib/oh-story/roles/chapter-extractor.md +314 -0
- package/lib/oh-story/roles/character-designer.md +169 -0
- package/lib/oh-story/roles/consistency-checker.md +190 -0
- package/lib/oh-story/roles/narrative-writer.md +294 -0
- package/lib/oh-story/roles/story-architect.md +195 -0
- package/lib/oh-story/roles/story-explorer.md +364 -0
- package/lib/oh-story/roles/story-researcher.md +304 -0
- package/lib/oh-story/skills/browser-cdp/SKILL.md +175 -0
- package/lib/oh-story/skills/story/SKILL.md +116 -0
- package/lib/oh-story/skills/story/VERSION +1 -0
- package/lib/oh-story/skills/story-cover/SKILL.md +327 -0
- package/lib/oh-story/skills/story-cover/references/cover-styles.md +210 -0
- package/lib/oh-story/skills/story-deslop/SKILL.md +445 -0
- package/lib/oh-story/skills/story-deslop/references/anti-ai-writing.md +582 -0
- package/lib/oh-story/skills/story-deslop/references/banned-words.md +147 -0
- package/lib/oh-story/skills/story-deslop/scripts/check-ai-patterns.js +1371 -0
- package/lib/oh-story/skills/story-deslop/scripts/check-degeneration.js +330 -0
- package/lib/oh-story/skills/story-deslop/scripts/check-outline-copy.js +241 -0
- package/lib/oh-story/skills/story-deslop/scripts/normalize-punctuation.js +410 -0
- package/lib/oh-story/skills/story-import/SKILL.md +634 -0
- package/lib/oh-story/skills/story-import/references/character-state-reverse.md +82 -0
- package/lib/oh-story/skills/story-import/references/format-and-structure.md +169 -0
- package/lib/oh-story/skills/story-import/references/length-routing.md +134 -0
- package/lib/oh-story/skills/story-import/references/state-tracking.md +108 -0
- package/lib/oh-story/skills/story-import/references/structure-mapping-long.md +442 -0
- package/lib/oh-story/skills/story-import/references/structure-mapping-short.md +175 -0
- package/lib/oh-story/skills/story-import/references/tracking-transaction.md +161 -0
- package/lib/oh-story/skills/story-import/scripts/tracking_commit.py +1139 -0
- package/lib/oh-story/skills/story-long-analyze/SKILL.md +329 -0
- package/lib/oh-story/skills/story-long-analyze/references/deconstruction-notes.md +270 -0
- package/lib/oh-story/skills/story-long-analyze/references/material-decomposition.md +530 -0
- package/lib/oh-story/skills/story-long-analyze/references/output-templates.md +559 -0
- package/lib/oh-story/skills/story-long-analyze/references/pipeline-ops.md +80 -0
- package/lib/oh-story/skills/story-long-analyze/references/style-profile-generator.md +149 -0
- package/lib/oh-story/skills/story-long-analyze/references/style-profile-protocol.md +133 -0
- package/lib/oh-story/skills/story-long-scan/SKILL.md +342 -0
- package/lib/oh-story/skills/story-long-scan/references/genre-trends.md +197 -0
- package/lib/oh-story/skills/story-long-scan/references/publishing-guide.md +114 -0
- package/lib/oh-story/skills/story-long-scan/references/reader-profiling.md +105 -0
- package/lib/oh-story/skills/story-long-scan/references/scan-output-format.md +207 -0
- package/lib/oh-story/skills/story-long-scan/references/topic-decision.md +78 -0
- package/lib/oh-story/skills/story-long-write/SKILL.md +327 -0
- package/lib/oh-story/skills/story-long-write/references/anti-ai-writing.md +582 -0
- package/lib/oh-story/skills/story-long-write/references/artifact-protocols.md +302 -0
- package/lib/oh-story/skills/story-long-write/references/banned-words.md +147 -0
- package/lib/oh-story/skills/story-long-write/references/character-basics.md +445 -0
- package/lib/oh-story/skills/story-long-write/references/character-design-methods.md +428 -0
- package/lib/oh-story/skills/story-long-write/references/character-relations.md +385 -0
- package/lib/oh-story/skills/story-long-write/references/commercial-core-methods.md +502 -0
- package/lib/oh-story/skills/story-long-write/references/cross-book-recall.md +62 -0
- package/lib/oh-story/skills/story-long-write/references/dialogue-mastery.md +282 -0
- package/lib/oh-story/skills/story-long-write/references/emotional-arc-design.md +426 -0
- package/lib/oh-story/skills/story-long-write/references/emotional-methods.md +209 -0
- package/lib/oh-story/skills/story-long-write/references/female-audience-writing.md +188 -0
- package/lib/oh-story/skills/story-long-write/references/format-and-structure.md +169 -0
- package/lib/oh-story/skills/story-long-write/references/genre-catalog.md +480 -0
- package/lib/oh-story/skills/story-long-write/references/genre-core-mechanics.md +415 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//344/270/234/346/226/271/344/273/231/344/276/240.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//344/274/240/347/273/237/347/216/204/345/271/273.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//345/216/206/345/217/262/345/217/244/344/273/243.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//345/216/206/345/217/262/350/204/221/346/264/236.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//345/217/214/347/224/267/344/270/273.md +53 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//345/217/244/350/250/200/350/204/221/346/264/236.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//345/217/244/351/243/216/344/270/226/346/203/205.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//345/245/263/351/242/221/346/202/254/347/226/221.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//345/245/263/351/242/221/347/247/215/347/224/260.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//345/256/253/346/226/227/345/256/205/346/226/227.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//345/271/264/344/273/243.md +53 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//345/277/253/347/251/277.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//346/202/254/347/226/221/347/201/265/345/274/202.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//346/202/254/347/226/221/350/204/221/346/264/236.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//346/210/230/347/245/236/350/265/230/345/251/277.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//346/212/227/346/210/230/350/260/215/346/210/230.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//346/230/237/345/205/211/347/222/200/347/222/250.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//346/260/221/345/233/275/350/250/200/346/203/205.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//346/270/270/346/210/217/344/275/223/350/202/262.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//347/216/204/345/271/273/350/204/221/346/264/236.md +53 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//347/216/204/345/271/273/350/250/200/346/203/205.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//347/216/260/350/250/200/350/204/221/346/264/236.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//347/247/221/345/271/273/346/234/253/344/270/226.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//350/201/214/345/234/272/345/251/232/346/201/213.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//350/245/277/346/226/271/345/245/207/345/271/273.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//350/261/252/351/227/250/346/200/273/350/243/201.md +53 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/344/277/256/347/234/237.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/346/227/245/345/270/270.md +53 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/347/247/215/347/224/260.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/350/204/221/346/264/236.md +53 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/351/253/230/346/255/246.md +53 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards//351/235/222/346/230/245/347/224/234/345/256/240.md +51 -0
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards.md +91 -0
- package/lib/oh-story/skills/story-long-write/references/genre-readers.md +235 -0
- package/lib/oh-story/skills/story-long-write/references/genre-writing-formulas.md +444 -0
- package/lib/oh-story/skills/story-long-write/references/hooks-chapter.md +225 -0
- package/lib/oh-story/skills/story-long-write/references/hooks-paragraph.md +146 -0
- package/lib/oh-story/skills/story-long-write/references/hooks-suspense.md +352 -0
- package/lib/oh-story/skills/story-long-write/references/opening-design.md +349 -0
- package/lib/oh-story/skills/story-long-write/references/outline-conflict.md +457 -0
- package/lib/oh-story/skills/story-long-write/references/outline-methods.md +287 -0
- package/lib/oh-story/skills/story-long-write/references/outline-rhythm.md +389 -0
- package/lib/oh-story/skills/story-long-write/references/outline-structure-theory.md +326 -0
- package/lib/oh-story/skills/story-long-write/references/plot-core-methods.md +522 -0
- package/lib/oh-story/skills/story-long-write/references/plot-emotion-system.md +354 -0
- package/lib/oh-story/skills/story-long-write/references/plot-frameworks.md +711 -0
- package/lib/oh-story/skills/story-long-write/references/plot-special-topics.md +622 -0
- package/lib/oh-story/skills/story-long-write/references/quality-checklist.md +184 -0
- package/lib/oh-story/skills/story-long-write/references/reader-contract-and-progression.md +109 -0
- package/lib/oh-story/skills/story-long-write/references/reversal-toolkit.md +349 -0
- package/lib/oh-story/skills/story-long-write/references/state-tracking.md +108 -0
- package/lib/oh-story/skills/story-long-write/references/style-combat-face.md +409 -0
- package/lib/oh-story/skills/story-long-write/references/style-craft.md +347 -0
- package/lib/oh-story/skills/story-long-write/references/style-genre-modules.md +510 -0
- package/lib/oh-story/skills/story-long-write/references/tracking-transaction.md +161 -0
- package/lib/oh-story/skills/story-long-write/references/workflow-chapter.md +140 -0
- package/lib/oh-story/skills/story-long-write/references/workflow-daily.md +171 -0
- package/lib/oh-story/skills/story-long-write/references/workflow-revision.md +99 -0
- package/lib/oh-story/skills/story-long-write/references/workflow-setup.md +284 -0
- package/lib/oh-story/skills/story-long-write/references/writing-craft.md +421 -0
- package/lib/oh-story/skills/story-long-write/scripts/check-ai-patterns.js +1371 -0
- package/lib/oh-story/skills/story-long-write/scripts/check-degeneration.js +330 -0
- package/lib/oh-story/skills/story-long-write/scripts/check-outline-copy.js +241 -0
- package/lib/oh-story/skills/story-long-write/scripts/normalize-punctuation.js +410 -0
- package/lib/oh-story/skills/story-long-write/scripts/tracking_commit.py +1139 -0
- package/lib/oh-story/skills/story-review/SKILL.md +483 -0
- package/lib/oh-story/skills/story-review/references/anti-ai-writing.md +582 -0
- package/lib/oh-story/skills/story-review/references/banned-words.md +147 -0
- package/lib/oh-story/skills/story-review/references/character-relations.md +385 -0
- package/lib/oh-story/skills/story-review/references/dialogue-mastery.md +282 -0
- package/lib/oh-story/skills/story-review/references/plot-core-methods.md +522 -0
- package/lib/oh-story/skills/story-review/references/quality-checklist.md +250 -0
- package/lib/oh-story/skills/story-review/references/quality-rubric.md +55 -0
- package/lib/oh-story/skills/story-review/references/rubrics/fanqie.md +18 -0
- package/lib/oh-story/skills/story-review/references/rubrics/qidian.md +19 -0
- package/lib/oh-story/skills/story-review/references/rubrics/zhihu.md +20 -0
- package/lib/oh-story/skills/story-review/references/tracking-transaction.md +161 -0
- package/lib/oh-story/skills/story-review/scripts/check-ai-patterns.js +1371 -0
- package/lib/oh-story/skills/story-review/scripts/check-degeneration.js +330 -0
- package/lib/oh-story/skills/story-review/scripts/normalize-punctuation.js +410 -0
- package/lib/oh-story/skills/story-review/scripts/tracking_commit.py +1139 -0
- package/lib/oh-story/skills/story-setup/SKILL.md +495 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/anti-ai-writing.md +582 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/banned-words.md +147 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/character-basics.md +445 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/character-design-methods.md +428 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/character-relations.md +385 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/dialogue-mastery.md +282 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/emotional-arc-design.md +426 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/emotional-methods.md +179 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/format-and-structure.md +169 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-catalog.md +480 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-core-mechanics.md +415 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//344/270/234/346/226/271/344/273/231/344/276/240.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//344/274/240/347/273/237/347/216/204/345/271/273.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//345/216/206/345/217/262/345/217/244/344/273/243.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//345/216/206/345/217/262/350/204/221/346/264/236.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//345/217/214/347/224/267/344/270/273.md +53 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//345/217/244/350/250/200/350/204/221/346/264/236.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//345/217/244/351/243/216/344/270/226/346/203/205.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//345/245/263/351/242/221/346/202/254/347/226/221.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//345/245/263/351/242/221/347/247/215/347/224/260.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//345/256/253/346/226/227/345/256/205/346/226/227.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//345/271/264/344/273/243.md +53 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//345/277/253/347/251/277.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//346/202/254/347/226/221/347/201/265/345/274/202.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//346/202/254/347/226/221/350/204/221/346/264/236.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//346/210/230/347/245/236/350/265/230/345/251/277.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//346/212/227/346/210/230/350/260/215/346/210/230.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//346/230/237/345/205/211/347/222/200/347/222/250.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//346/260/221/345/233/275/350/250/200/346/203/205.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//346/270/270/346/210/217/344/275/223/350/202/262.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//347/216/204/345/271/273/350/204/221/346/264/236.md +53 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//347/216/204/345/271/273/350/250/200/346/203/205.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//347/216/260/350/250/200/350/204/221/346/264/236.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//347/247/221/345/271/273/346/234/253/344/270/226.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//350/201/214/345/234/272/345/251/232/346/201/213.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//350/245/277/346/226/271/345/245/207/345/271/273.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//350/261/252/351/227/250/346/200/273/350/243/201.md +53 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/344/277/256/347/234/237.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/346/227/245/345/270/270.md +53 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/347/247/215/347/224/260.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/350/204/221/346/264/236.md +53 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/351/253/230/346/255/246.md +53 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards//351/235/222/346/230/245/347/224/234/345/256/240.md +51 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards.md +91 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-readers.md +235 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-writing-formulas.md +444 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/hooks-chapter.md +225 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/hooks-suspense.md +352 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/opening-design.md +349 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/outline-conflict.md +457 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/outline-methods.md +287 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/outline-rhythm.md +389 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/plot-core-methods.md +522 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/quality-checklist.md +247 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/reversal-toolkit.md +349 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/style-combat-face.md +409 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/style-genre-modules.md +510 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/writing-craft.md +421 -0
- package/lib/oh-story/skills/story-short-analyze/SKILL.md +278 -0
- package/lib/oh-story/skills/story-short-analyze/references/anti-ai-writing.md +582 -0
- package/lib/oh-story/skills/story-short-analyze/references/banned-words.md +147 -0
- package/lib/oh-story/skills/story-short-analyze/references/character-basics.md +453 -0
- package/lib/oh-story/skills/story-short-analyze/references/character-design-methods.md +438 -0
- package/lib/oh-story/skills/story-short-analyze/references/character-relations.md +395 -0
- package/lib/oh-story/skills/story-short-analyze/references/deconstruction-examples.md +79 -0
- package/lib/oh-story/skills/story-short-analyze/references/genre-catalog.md +490 -0
- package/lib/oh-story/skills/story-short-analyze/references/genre-core-mechanics.md +425 -0
- package/lib/oh-story/skills/story-short-analyze/references/genre-readers.md +245 -0
- package/lib/oh-story/skills/story-short-analyze/references/genre-writing-formulas.md +453 -0
- package/lib/oh-story/skills/story-short-analyze/references/genre-writing-techniques.md +475 -0
- package/lib/oh-story/skills/story-short-analyze/references/hooks-chapter.md +225 -0
- package/lib/oh-story/skills/story-short-analyze/references/hooks-paragraph.md +146 -0
- package/lib/oh-story/skills/story-short-analyze/references/hooks-suspense.md +352 -0
- package/lib/oh-story/skills/story-short-analyze/references/material-decomposition.md +685 -0
- package/lib/oh-story/skills/story-short-analyze/references/output-contract.md +165 -0
- package/lib/oh-story/skills/story-short-analyze/references/output-templates.md +561 -0
- package/lib/oh-story/skills/story-short-analyze/references/quality-checklist.md +242 -0
- package/lib/oh-story/skills/story-short-analyze/references/real-market-data.md +90 -0
- package/lib/oh-story/skills/story-short-analyze/references/zhihu-style.md +54 -0
- package/lib/oh-story/skills/story-short-scan/SKILL.md +212 -0
- package/lib/oh-story/skills/story-short-scan/references/real-market-data.md +90 -0
- package/lib/oh-story/skills/story-short-write/SKILL.md +433 -0
- package/lib/oh-story/skills/story-short-write/references/banned-words.md +147 -0
- package/lib/oh-story/skills/story-short-write/references/cross-book-recall.md +62 -0
- package/lib/oh-story/skills/story-short-write/references/dialogue-mastery.md +282 -0
- package/lib/oh-story/skills/story-short-write/references/emotional-methods.md +179 -0
- package/lib/oh-story/skills/story-short-write/references/genre-styles//344/270/226/346/203/205/346/211/223/350/204/270.md +159 -0
- package/lib/oh-story/skills/story-short-write/references/genre-styles//345/217/214/347/224/267/344/270/273.md +156 -0
- package/lib/oh-story/skills/story-short-write/references/genre-styles//345/244/215/344/273/207/346/211/223/350/204/270.md +163 -0
- package/lib/oh-story/skills/story-short-write/references/genre-styles//345/256/205/346/226/227/345/256/253/346/226/227.md +167 -0
- package/lib/oh-story/skills/story-short-write/references/genre-styles//346/200/273/350/243/201/350/261/252/351/227/250.md +178 -0
- package/lib/oh-story/skills/story-short-write/references/genre-styles//346/202/254/347/226/221.md +166 -0
- package/lib/oh-story/skills/story-short-write/references/genre-styles//346/260/221/344/277/227/346/200/252/350/260/210.md +159 -0
- package/lib/oh-story/skills/story-short-write/references/genre-styles//346/262/231/351/233/225/350/204/221/346/264/236.md +151 -0
- package/lib/oh-story/skills/story-short-write/references/genre-styles//347/224/234/345/256/240.md +153 -0
- package/lib/oh-story/skills/story-short-write/references/genre-styles//350/277/275/345/246/273/347/201/253/350/221/254/345/234/272.md +210 -0
- package/lib/oh-story/skills/story-short-write/references/genre-writing-formulas.md +444 -0
- package/lib/oh-story/skills/story-short-write/references/genre-writing-techniques.md +488 -0
- package/lib/oh-story/skills/story-short-write/references/hooks-chapter.md +225 -0
- package/lib/oh-story/skills/story-short-write/references/hooks-paragraph.md +146 -0
- package/lib/oh-story/skills/story-short-write/references/hooks-suspense.md +352 -0
- package/lib/oh-story/skills/story-short-write/references/output-contract.md +165 -0
- package/lib/oh-story/skills/story-short-write/references/quality-checklist.md +222 -0
- package/lib/oh-story/skills/story-short-write/references/reversal-toolkit.md +349 -0
- package/lib/oh-story/skills/story-short-write/references/short-craft.md +185 -0
- package/lib/oh-story/skills/story-short-write/references/short-deslop.md +133 -0
- package/lib/oh-story/skills/story-short-write/references/short-format.md +167 -0
- package/lib/oh-story/skills/story-short-write/references/submission-craft.md +35 -0
- package/lib/oh-story/skills/story-short-write/references/villain-and-reveal.md +158 -0
- package/lib/oh-story/skills/story-short-write/references/writing-workflow.md +153 -0
- package/lib/oh-story/skills/story-short-write/scripts/check-ai-patterns.js +1371 -0
- package/lib/oh-story/skills/story-short-write/scripts/check-degeneration.js +330 -0
- package/lib/oh-story/skills/story-short-write/scripts/check-outline-copy.js +241 -0
- package/lib/oh-story/skills/story-short-write/scripts/normalize-punctuation.js +410 -0
- package/lib/types/client/file-activity.d.ts +30 -0
- package/lib/types/client/file-activity.d.ts.map +1 -0
- package/lib/types/client/file-tree.d.ts +20 -0
- package/lib/types/client/file-tree.d.ts.map +1 -0
- package/lib/types/client/index.d.ts +12 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/jsonl-preview.d.ts +15 -0
- package/lib/types/client/jsonl-preview.d.ts.map +1 -0
- package/lib/types/client/markdown-preview.d.ts +38 -0
- package/lib/types/client/markdown-preview.d.ts.map +1 -0
- package/lib/types/index.d.ts +25 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/native-hooks.d.ts +16 -0
- package/lib/types/native-hooks.d.ts.map +1 -0
- package/lib/types/role-provider.d.ts +6 -0
- package/lib/types/role-provider.d.ts.map +1 -0
- package/lib/types/role-tool.d.ts +10 -0
- package/lib/types/role-tool.d.ts.map +1 -0
- package/lib/types/skill-provider.d.ts +15 -0
- package/lib/types/skill-provider.d.ts.map +1 -0
- package/lib/types/workspace-request-trust.d.ts +13 -0
- package/lib/types/workspace-request-trust.d.ts.map +1 -0
- package/lib/types/workspace-route.d.ts +10 -0
- package/lib/types/workspace-route.d.ts.map +1 -0
- package/lib/types/workspace-security.d.ts +9 -0
- package/lib/types/workspace-security.d.ts.map +1 -0
- package/package.json +107 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Validate provider-neutral, timeline-level short-drama music specs."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import json
|
|
8
|
+
import math
|
|
9
|
+
import re
|
|
10
|
+
import sys
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from typing import Any, NamedTuple
|
|
13
|
+
|
|
14
|
+
MINIMUM_PYTHON = (3, 9)
|
|
15
|
+
if sys.version_info < MINIMUM_PYTHON:
|
|
16
|
+
raise SystemExit("music_spec_check.py requires Python 3.9 or newer")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# ---------------------------------------------------------------------------
|
|
20
|
+
# REFERENCE RESOLVER
|
|
21
|
+
#
|
|
22
|
+
# Each skill carries its own copy of this block. A skill must stay runnable
|
|
23
|
+
# after copying only its own directory, so the suite has no shared library and
|
|
24
|
+
# this file imports nothing from outside its own skill.
|
|
25
|
+
# ---------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
SOURCES_RECORD_TYPE = "sources"
|
|
28
|
+
SOURCES_SCHEMA_VERSION = "1.0.0"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ResolvedRef(NamedTuple):
|
|
32
|
+
"""An upstream reference with its snapshot resolved, whichever form it used."""
|
|
33
|
+
|
|
34
|
+
owner: str
|
|
35
|
+
artifact: str
|
|
36
|
+
record_id: str | None
|
|
37
|
+
field: str | None
|
|
38
|
+
authority: str | None
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class RefFinding(NamedTuple):
|
|
42
|
+
"""A structural defect in a reference object."""
|
|
43
|
+
|
|
44
|
+
code: str
|
|
45
|
+
location: str
|
|
46
|
+
detail: str
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def load_sources(document: Any) -> dict[str, dict[str, Any]]:
|
|
50
|
+
"""Return the ``sources`` declaration of a parsed file, or ``{}`` if absent.
|
|
51
|
+
|
|
52
|
+
Accepts a parsed ``.json`` document (a dict) or the parsed record list of a
|
|
53
|
+
``.jsonl`` file, whose declaration lives on the first record.
|
|
54
|
+
"""
|
|
55
|
+
if isinstance(document, list):
|
|
56
|
+
document = document[0] if document else None
|
|
57
|
+
if not isinstance(document, dict):
|
|
58
|
+
return {}
|
|
59
|
+
declared = document.get("sources")
|
|
60
|
+
if not isinstance(declared, dict):
|
|
61
|
+
return {}
|
|
62
|
+
return {key: value for key, value in declared.items() if isinstance(value, dict)}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def resolve_ref(
|
|
66
|
+
ref: Any, sources: dict[str, dict[str, Any]], location: str
|
|
67
|
+
) -> tuple[ResolvedRef | None, RefFinding | None]:
|
|
68
|
+
"""Resolve a reference object written in either the compact or expanded form."""
|
|
69
|
+
if not isinstance(ref, dict):
|
|
70
|
+
return None, RefFinding("REF_IS_NOT_AN_OBJECT", location, f"got {type(ref).__name__}")
|
|
71
|
+
src = ref.get("src")
|
|
72
|
+
if isinstance(src, str):
|
|
73
|
+
entry = sources.get(src)
|
|
74
|
+
if entry is None:
|
|
75
|
+
return None, RefFinding(
|
|
76
|
+
"REF_SRC_IS_NOT_DECLARED", location, f"src {src!r} has no sources entry"
|
|
77
|
+
)
|
|
78
|
+
owner, artifact = entry.get("owner"), entry.get("artifact")
|
|
79
|
+
if not (isinstance(owner, str) and isinstance(artifact, str)):
|
|
80
|
+
return None, RefFinding(
|
|
81
|
+
"SOURCE_ENTRY_IS_INCOMPLETE",
|
|
82
|
+
location,
|
|
83
|
+
f"sources[{src!r}] needs owner/artifact",
|
|
84
|
+
)
|
|
85
|
+
elif all(isinstance(ref.get(key), str) for key in ("owner", "artifact")):
|
|
86
|
+
owner, artifact = ref["owner"], ref["artifact"]
|
|
87
|
+
else:
|
|
88
|
+
return None, RefFinding(
|
|
89
|
+
"REF_HAS_NO_UPSTREAM_BINDING", location, "needs src, or owner+artifact"
|
|
90
|
+
)
|
|
91
|
+
optional = {
|
|
92
|
+
key: ref[key]
|
|
93
|
+
for key in ("record_id", "field", "authority")
|
|
94
|
+
if isinstance(ref.get(key), str)
|
|
95
|
+
}
|
|
96
|
+
return (
|
|
97
|
+
ResolvedRef(
|
|
98
|
+
owner,
|
|
99
|
+
artifact,
|
|
100
|
+
optional.get("record_id"),
|
|
101
|
+
optional.get("field"),
|
|
102
|
+
optional.get("authority"),
|
|
103
|
+
),
|
|
104
|
+
None,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# ---------------------------------------------------------------------------
|
|
109
|
+
# END REFERENCE RESOLVER
|
|
110
|
+
# ---------------------------------------------------------------------------
|
|
111
|
+
|
|
112
|
+
SKILL_ROOT = Path(__file__).resolve().parents[1]
|
|
113
|
+
HASH_RE = re.compile(r"[0-9a-f]{64}")
|
|
114
|
+
VENDOR_FIELDS = {
|
|
115
|
+
"provider",
|
|
116
|
+
"model",
|
|
117
|
+
"endpoint",
|
|
118
|
+
"api_key",
|
|
119
|
+
"task_id",
|
|
120
|
+
"remote_id",
|
|
121
|
+
"callback_url",
|
|
122
|
+
}
|
|
123
|
+
TOP_LEVEL_FIELDS = {
|
|
124
|
+
"music_id",
|
|
125
|
+
"scope",
|
|
126
|
+
"source_refs",
|
|
127
|
+
"narrative_function",
|
|
128
|
+
"prompt",
|
|
129
|
+
"mode",
|
|
130
|
+
"lyrics",
|
|
131
|
+
"mix_intent",
|
|
132
|
+
"status",
|
|
133
|
+
}
|
|
134
|
+
SCOPE_FIELDS = {"episode_id", "start_seconds", "end_seconds"}
|
|
135
|
+
REFERENCE_FIELDS = {"src", "owner", "artifact", "record_id", "field", "authority"}
|
|
136
|
+
SOURCES_HEADER_FIELDS = {"record_type", "schema_version", "sources"}
|
|
137
|
+
SOURCE_ENTRY_FIELDS = {"owner", "artifact"}
|
|
138
|
+
MIX_FIELDS = {"entry", "exit", "duck_under_dialogue", "loop"}
|
|
139
|
+
MUSIC_ID_RE = re.compile(r"[A-Za-z0-9][A-Za-z0-9._-]{0,79}")
|
|
140
|
+
EPISODE_ID_RE = re.compile(r"EP(?:[0-9]{3}|[1-9][0-9]{3,})")
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class ValidationError(ValueError):
|
|
144
|
+
"""A music spec cannot be handed to production safely."""
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def resolve_input(value: str | Path) -> Path:
|
|
148
|
+
path = Path(value).expanduser()
|
|
149
|
+
if path.exists() or path.is_absolute():
|
|
150
|
+
return path
|
|
151
|
+
return SKILL_ROOT / path
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def load_jsonl(value: str | Path) -> list[dict[str, Any]]:
|
|
155
|
+
path = resolve_input(value)
|
|
156
|
+
records: list[dict[str, Any]] = []
|
|
157
|
+
for number, line in enumerate(path.read_text(encoding="utf-8").splitlines(), 1):
|
|
158
|
+
if not line.strip():
|
|
159
|
+
continue
|
|
160
|
+
try:
|
|
161
|
+
record = json.loads(line)
|
|
162
|
+
except json.JSONDecodeError as exc:
|
|
163
|
+
raise ValidationError(f"{path}:{number}: invalid JSON") from exc
|
|
164
|
+
if not isinstance(record, dict):
|
|
165
|
+
raise ValidationError(f"{path}:{number}: each record must be an object")
|
|
166
|
+
records.append(record)
|
|
167
|
+
if not records:
|
|
168
|
+
raise ValidationError(f"{path}: no music specs")
|
|
169
|
+
return records
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def _text(value: object, label: str, *, maximum: int = 10_000) -> str:
|
|
173
|
+
if not isinstance(value, str) or not value.strip() or len(value) > maximum:
|
|
174
|
+
raise ValidationError(f"{label} must be non-empty text up to {maximum} characters")
|
|
175
|
+
return value
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def _number(value: object, label: str) -> float:
|
|
179
|
+
if isinstance(value, bool) or not isinstance(value, (int, float)):
|
|
180
|
+
raise ValidationError(f"{label} must be a number")
|
|
181
|
+
number = float(value)
|
|
182
|
+
if not math.isfinite(number):
|
|
183
|
+
raise ValidationError(f"{label} must be finite")
|
|
184
|
+
return number
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def _exact_fields(value: dict[str, Any], allowed: set[str], label: str) -> None:
|
|
188
|
+
unknown = sorted(set(value) - allowed)
|
|
189
|
+
if unknown:
|
|
190
|
+
raise ValidationError(f"{label} has unsupported fields: {', '.join(unknown)}")
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def _reject_vendor_fields(value: object, label: str) -> None:
|
|
194
|
+
if isinstance(value, dict):
|
|
195
|
+
leaked = sorted(str(key) for key in value if str(key).casefold() in VENDOR_FIELDS)
|
|
196
|
+
if leaked:
|
|
197
|
+
raise ValidationError(f"{label}: provider execution fields are forbidden: {', '.join(leaked)}")
|
|
198
|
+
for key, child in value.items():
|
|
199
|
+
_reject_vendor_fields(child, f"{label}.{key}")
|
|
200
|
+
elif isinstance(value, list):
|
|
201
|
+
for index, child in enumerate(value):
|
|
202
|
+
_reject_vendor_fields(child, f"{label}[{index}]")
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def _validate_ref(value: object, label: str, sources: dict[str, dict[str, Any]]) -> None:
|
|
206
|
+
if not isinstance(value, dict):
|
|
207
|
+
raise ValidationError(f"{label} must be a reference object")
|
|
208
|
+
_exact_fields(value, REFERENCE_FIELDS, label)
|
|
209
|
+
resolved, finding = resolve_ref(value, sources, label)
|
|
210
|
+
if finding is not None:
|
|
211
|
+
raise ValidationError(f"{finding.location}: {finding.code}: {finding.detail}")
|
|
212
|
+
if resolved is None:
|
|
213
|
+
raise ValidationError(f"{label} could not be resolved")
|
|
214
|
+
for key, text in (
|
|
215
|
+
("owner", resolved.owner),
|
|
216
|
+
("artifact", resolved.artifact),
|
|
217
|
+
):
|
|
218
|
+
_text(text, f"{label}.{key}")
|
|
219
|
+
if not isinstance(value.get("record_id") or value.get("field"), str):
|
|
220
|
+
raise ValidationError(f"{label} needs record_id or field")
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def split_sources_header(
|
|
224
|
+
records: list[dict[str, Any]],
|
|
225
|
+
) -> tuple[dict[str, dict[str, Any]], list[dict[str, Any]]]:
|
|
226
|
+
"""Split a leading ``sources`` header off the file's own records.
|
|
227
|
+
|
|
228
|
+
The header declares each upstream snapshot once, so a reference only names
|
|
229
|
+
the snapshot key and the record it points at.
|
|
230
|
+
"""
|
|
231
|
+
if not records or records[0].get("record_type") != SOURCES_RECORD_TYPE:
|
|
232
|
+
return {}, list(records)
|
|
233
|
+
header, *specs = records
|
|
234
|
+
_exact_fields(header, SOURCES_HEADER_FIELDS, "sources header")
|
|
235
|
+
if header.get("schema_version") != SOURCES_SCHEMA_VERSION:
|
|
236
|
+
raise ValidationError(f"sources header schema_version must be {SOURCES_SCHEMA_VERSION}")
|
|
237
|
+
declared = header.get("sources")
|
|
238
|
+
if not isinstance(declared, dict) or not declared:
|
|
239
|
+
raise ValidationError("sources header must declare at least one source")
|
|
240
|
+
for key, entry in declared.items():
|
|
241
|
+
label = f"sources[{key!r}]"
|
|
242
|
+
if not isinstance(entry, dict):
|
|
243
|
+
raise ValidationError(f"{label} must be an object")
|
|
244
|
+
_exact_fields(entry, SOURCE_ENTRY_FIELDS, label)
|
|
245
|
+
for field in sorted(SOURCE_ENTRY_FIELDS):
|
|
246
|
+
_text(entry.get(field), f"{label}.{field}")
|
|
247
|
+
return load_sources(header), specs
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
def validate_records(records: list[dict[str, Any]]) -> dict[str, Any]:
|
|
251
|
+
sources, specs = split_sources_header(records)
|
|
252
|
+
if not specs:
|
|
253
|
+
raise ValidationError("no music specs")
|
|
254
|
+
identifiers: set[str] = set()
|
|
255
|
+
for index, record in enumerate(specs, 1):
|
|
256
|
+
label = f"music[{index}]"
|
|
257
|
+
_reject_vendor_fields(record, label)
|
|
258
|
+
_exact_fields(record, TOP_LEVEL_FIELDS, label)
|
|
259
|
+
music_id = _text(record.get("music_id"), f"{label}.music_id", maximum=80)
|
|
260
|
+
if MUSIC_ID_RE.fullmatch(music_id) is None:
|
|
261
|
+
raise ValidationError(f"{label}.music_id must be a portable identifier")
|
|
262
|
+
if music_id in identifiers:
|
|
263
|
+
raise ValidationError(f"duplicate music_id: {music_id}")
|
|
264
|
+
identifiers.add(music_id)
|
|
265
|
+
|
|
266
|
+
scope = record.get("scope")
|
|
267
|
+
if not isinstance(scope, dict):
|
|
268
|
+
raise ValidationError(f"{label}.scope must be an object")
|
|
269
|
+
_exact_fields(scope, SCOPE_FIELDS, f"{label}.scope")
|
|
270
|
+
episode_id = _text(
|
|
271
|
+
scope.get("episode_id"), f"{label}.scope.episode_id", maximum=40
|
|
272
|
+
)
|
|
273
|
+
if EPISODE_ID_RE.fullmatch(episode_id) is None:
|
|
274
|
+
raise ValidationError(f"{label}.scope.episode_id is invalid")
|
|
275
|
+
start = _number(scope.get("start_seconds"), f"{label}.scope.start_seconds")
|
|
276
|
+
end = _number(scope.get("end_seconds"), f"{label}.scope.end_seconds")
|
|
277
|
+
if start < 0 or end <= start:
|
|
278
|
+
raise ValidationError(f"{label}.scope must have 0 <= start < end")
|
|
279
|
+
|
|
280
|
+
refs = record.get("source_refs")
|
|
281
|
+
if not isinstance(refs, list) or not refs:
|
|
282
|
+
raise ValidationError(f"{label}.source_refs must be a non-empty list")
|
|
283
|
+
for ref_index, ref in enumerate(refs, 1):
|
|
284
|
+
_validate_ref(ref, f"{label}.source_refs[{ref_index}]", sources)
|
|
285
|
+
|
|
286
|
+
_text(record.get("narrative_function"), f"{label}.narrative_function")
|
|
287
|
+
_text(record.get("prompt"), f"{label}.prompt", maximum=2_000)
|
|
288
|
+
mode = record.get("mode")
|
|
289
|
+
if mode not in {"instrumental", "song"}:
|
|
290
|
+
raise ValidationError(f"{label}.mode must be instrumental or song")
|
|
291
|
+
lyrics = record.get("lyrics")
|
|
292
|
+
if mode == "instrumental" and lyrics not in {None, ""}:
|
|
293
|
+
raise ValidationError(f"{label}: instrumental music must not carry lyrics")
|
|
294
|
+
if mode == "song":
|
|
295
|
+
_text(lyrics, f"{label}.lyrics", maximum=3_500)
|
|
296
|
+
|
|
297
|
+
mix = record.get("mix_intent")
|
|
298
|
+
if not isinstance(mix, dict):
|
|
299
|
+
raise ValidationError(f"{label}.mix_intent must be an object")
|
|
300
|
+
_exact_fields(mix, MIX_FIELDS, f"{label}.mix_intent")
|
|
301
|
+
if not isinstance(mix.get("duck_under_dialogue"), bool):
|
|
302
|
+
raise ValidationError(f"{label}.mix_intent.duck_under_dialogue must be boolean")
|
|
303
|
+
if not isinstance(mix.get("loop"), bool):
|
|
304
|
+
raise ValidationError(f"{label}.mix_intent.loop must be boolean")
|
|
305
|
+
_text(mix.get("entry"), f"{label}.mix_intent.entry")
|
|
306
|
+
_text(mix.get("exit"), f"{label}.mix_intent.exit")
|
|
307
|
+
if record.get("status") not in {"candidate", "accepted", "revise"}:
|
|
308
|
+
raise ValidationError(f"{label}.status must be candidate, accepted, or revise")
|
|
309
|
+
|
|
310
|
+
return {"status": "valid", "music_specs": len(specs)}
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
def main(argv: list[str] | None = None) -> int:
|
|
314
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
315
|
+
parser.add_argument("specs")
|
|
316
|
+
args = parser.parse_args(argv)
|
|
317
|
+
try:
|
|
318
|
+
result = validate_records(load_jsonl(args.specs))
|
|
319
|
+
except (OSError, UnicodeError, ValidationError) as exc:
|
|
320
|
+
print(str(exc), file=sys.stderr)
|
|
321
|
+
return 2
|
|
322
|
+
print(json.dumps(result, ensure_ascii=False, sort_keys=True))
|
|
323
|
+
return 0
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
if __name__ == "__main__":
|
|
327
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Offline self-test for standalone video and music prompt tooling."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import copy
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
from music_spec_check import SKILL_ROOT, ValidationError, load_jsonl, validate_records
|
|
10
|
+
|
|
11
|
+
MINIMUM_PYTHON = (3, 9)
|
|
12
|
+
if sys.version_info < MINIMUM_PYTHON:
|
|
13
|
+
raise SystemExit("selftest.py requires Python 3.9 or newer")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def require(condition: bool, message: str) -> None:
|
|
17
|
+
if not condition:
|
|
18
|
+
raise AssertionError(message)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def fail(records: list[dict], marker: str) -> None:
|
|
22
|
+
try:
|
|
23
|
+
validate_records(records)
|
|
24
|
+
except ValidationError as exc:
|
|
25
|
+
require(marker in str(exc), f"expected {marker!r}, got {exc!s}")
|
|
26
|
+
else:
|
|
27
|
+
raise AssertionError(f"expected failure containing {marker!r}")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def main() -> int:
|
|
31
|
+
records = load_jsonl(SKILL_ROOT / "examples/minimal-music-specs.jsonl")
|
|
32
|
+
require(validate_records(records)["music_specs"] == 1, "valid fixture count")
|
|
33
|
+
header, spec = records[0], records[1]
|
|
34
|
+
require(spec["source_refs"][0]["src"] == "screenplay", "fixture uses a source key")
|
|
35
|
+
|
|
36
|
+
# A file that was written before sources declarations existed still carries
|
|
37
|
+
# the snapshot on every reference, and still validates.
|
|
38
|
+
expanded = copy.deepcopy(spec)
|
|
39
|
+
expanded["source_refs"] = [
|
|
40
|
+
{**header["sources"]["screenplay"], "record_id": "EP001-SC001"}
|
|
41
|
+
]
|
|
42
|
+
require(validate_records([expanded])["music_specs"] == 1, "inline snapshot accepted")
|
|
43
|
+
|
|
44
|
+
undeclared = copy.deepcopy(spec)
|
|
45
|
+
undeclared["source_refs"] = [{"src": "screenplai", "record_id": "EP001-SC001"}]
|
|
46
|
+
fail([header, undeclared], "REF_SRC_IS_NOT_DECLARED")
|
|
47
|
+
|
|
48
|
+
unbound = copy.deepcopy(spec)
|
|
49
|
+
unbound["source_refs"] = [{"record_id": "EP001-SC001"}]
|
|
50
|
+
fail([header, unbound], "REF_HAS_NO_UPSTREAM_BINDING")
|
|
51
|
+
|
|
52
|
+
duplicate = [header, spec, copy.deepcopy(spec)]
|
|
53
|
+
fail(duplicate, "duplicate music_id")
|
|
54
|
+
|
|
55
|
+
leaked = [header, copy.deepcopy(spec)]
|
|
56
|
+
leaked[1]["model"] = "example"
|
|
57
|
+
fail(leaked, "provider execution fields")
|
|
58
|
+
|
|
59
|
+
song_without_lyrics = [header, copy.deepcopy(spec)]
|
|
60
|
+
song_without_lyrics[1]["mode"] = "song"
|
|
61
|
+
fail(song_without_lyrics, "lyrics")
|
|
62
|
+
|
|
63
|
+
invalid_scope = [header, copy.deepcopy(spec)]
|
|
64
|
+
invalid_scope[1]["scope"]["end_seconds"] = 0
|
|
65
|
+
fail(invalid_scope, "0 <= start < end")
|
|
66
|
+
|
|
67
|
+
unsupported = [header, copy.deepcopy(spec)]
|
|
68
|
+
unsupported[1]["token"] = "not provider-neutral"
|
|
69
|
+
fail(unsupported, "unsupported fields")
|
|
70
|
+
|
|
71
|
+
# A source entry now names an upstream artifact and nothing else; a stray
|
|
72
|
+
# byte digest is an unsupported field rather than a malformed hash.
|
|
73
|
+
stale_source = [copy.deepcopy(header), spec]
|
|
74
|
+
stale_source[0]["sources"]["screenplay"]["hash"] = "not-a-sha256"
|
|
75
|
+
fail(stale_source, "unsupported fields")
|
|
76
|
+
|
|
77
|
+
print("10 self-tests passed")
|
|
78
|
+
return 0
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
if __name__ == "__main__":
|
|
82
|
+
raise SystemExit(main())
|