Add principles doc and a delivery gate (npm run verify) - #3
Merged
Merged
Conversation
- docs/principles.md: the six principles behind the template (one time source, frames as pure functions, enter/breathe/exit, looks as clothing, one canvas for every format, nothing derived is hand-edited) and how deliverable / repeatable / stable maps onto this repo - tools/verify.mjs: types -> source consistency -> every scene renders at start/mid/end in every format -> two renders are byte-identical; --quick skips rendering. publish runs it before rendering (--no-verify to skip) - tests/test_sync.py: script.json <-> timings.json <-> audio <-> scene registry stay in step - CLAUDE.md, README and skills point at the principles and the gate Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hf6CivwFE1rx9Hf8pbNvaS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为什么
「往原理去理解,随后一通百通;可交付、可重复、稳定输出,才是 AI 赋能的前提。」这句话之前没有落到具体的东西上,这个 PR 用一份文档和一道检查把它落地。
改了什么
docs/principles.md:原理文档tools/verify.mjs(npm run verify):交付前的检查依次检查四项,任何一项不通过就停下:
--quick只跑前两项,不渲染。tools/publish.mjs在渲染前会自动跑一遍,不通过就停,不会白渲染几十分钟;需要跳过时用--no-verify。tests/test_sync.py检查
tts/script.json、src/timings.json、音频文件、src/scenes/index.ts场景登记表四者一致:场景、顺序、章节标题、cue 都要对上,每场都要登记。CI 里会跑。文档
CLAUDE.md写入了这条原则,规定verify不过就不算完成。new-scene、review、new-style-pack、publish)都改成以verify为准。验证
npm run verify:四项全部通过,用时约 40 秒。--quick也跑通了。Math.random(),第 4 项报错;之后已恢复,s02 不在这次的改动里。npx tsc --noEmit和 15 项 pytest 都通过。场景代码、风格包和渲染结果都没有改动。
🤖 Generated with Claude Code
https://claude.ai/code/session_01Hf6CivwFE1rx9Hf8pbNvaS
Generated by Claude Code