refactor: 抽出 models.py + 加合成 demo persona example#29
Merged
Conversation
core.py 1556 行的 model 層(2 type alias + 6 Pydantic model + _Candidate + ConstructCard warnings filter)抽到新檔 snapshot/models.py。core.py 以 re-export 保持所有既有 import 路徑(from ...snapshot.core import SnapshotBundle 等)完全不變。core.py 1556 → 1453 行。 純搬移、零行為改變。models.py 不 import core.py(無循環依賴)。 驗證: pytest 327 passed(= baseline)+ ruff clean。 Constraint: 23★ public repo,Facade 保 ~25 處 build_snapshot_bundle caller 不破 Directive: models.py 為依賴底層,只能被 import 不可 import core(單向) Rejected: 一次拆完 core.py(models/review/renderers/generator)| 風險集中, 改逐刀驗證;本刀只動 model 層 Not-tested: 無(純結構搬移,既有測試全綠即覆蓋) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
clone 者最大的障礙是「看不到我會拿到什麼」(examples/ 原本空的,export 又需要 populated DB)。新增: - scripts/seed_demo.py:用 18 個合成雙語錨點(虛構人物,非真人)建臨時 DB,跑真實 export pipeline 產出 archive。PRINCIPLE+≥3 question_ids → triangulated core truths(demo 有 5 個) - examples/sample-maker/:真 pipeline 產出的 11 檔 persona archive(8 維 markdown + START_HERE + index + manifest.json),雙語展示 CJK 路徑 - examples/README.md:明確標示 synthetic + 怎麼重生 - README「8 週後你會拿到什麼」加 examples 指引 North star: 讓 VirtualMe 成熟到值得 reference/clone — example output 是 比拆 God file 更高槓桿的 clone-worthiness 訊號。 Constraint: example 必須是真 pipeline 產出,不可手編(才代表真實輸出) Directive: 人物 generic 不影射真人 + 清楚標 synthetic Not-tested: seed script 無單元測試(產出已人工檢視;export pipeline 既有測試覆蓋) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
摘要
兩個 commit,朝北極星「值得被 reference / clone」推進:
4df09a3refactor(snapshot):抽出models.pyGod-file 拆分 Phase 1a(Facade 模式)。
core.py1556 → 1453 行,資料模型獨立成models.py,對外介面不變。4e0d16cfeat(examples):加合成 demo persona解掉最大的 clone 障礙 ——
examples/原本空的,cloner 看不到「跑完 8 週會拿到什麼」。做法是走真 export pipeline 產出(非手編):
scripts/seed_demo.py→ 18 個合成雙語錨點(虛構人物sample-maker,generic 不影射真人)→ 真export_markdown→examples/sample-maker/(11 檔)。成品含雙語渲染 + provenance 可追溯 + Core Truths(triangulated)vs Emerging Patterns 分層。README 也加了「先看成品」指引。
去識別化
anchor_content_pii_scrubbed: truesample-maker),無真實姓名 / email / 聯絡資訊待 eyeball
examples/sample-maker/SOUL.md等門面檔的 GitHub 實際渲染(list item 的-+ blockquote 結構)🤖 Generated with Claude Code