Prepare branch for remote review; preserve documented validation gaps and protected historical packages. Co-Authored-By: Claude Code <noreply@anthropic.com>
13 KiB
TASK · 上游库主案例与本机路径残留清除(本仓,2026-09-19)
状态:待领取。只覆盖本仓
/workspace/Jyotisha。上游yinduzhanxing的清理由库主自己做,指令在UPSTREAM-INSTRUCTION-owner-case-purge-20260919.md,与本单互不依赖。 本任务书不转录任何出生日期、出生分钟、经纬度、本机用户名;检索键按符号定位到源文件行,执行方自己读。
0. 基线与交付
- 基线:
origin/staging=b05d2fa1(2026-09-19)。 - worktree
.worktrees/owner-case-purge-20260919,分支codex/owner-case-purge-20260919,验收后快进推staging。 - 改动落在
references/**、skills/**、tests/**、scripts/**、frontend/**,全在deploy/gated-paths.txt内,推 staging 会触发门禁并重新发布镜像。
1. 事故实证
本仓从上游镜像同步时把库主本人案例(案例 ID [库主案例标识已移除]_user_case / 别名 [私人案例引用已移除])和库主电脑的绝对路径一起带了进来。以库主标识(案例 ID、生日字符串、经纬度、出生秒级时间、别名、本机用户名)检索 origin/staging,命中 95 个文件。
检索键取法(不要写进任何提交):
git show origin/staging:tests/test_consultation_contract_golden.py | sed -n 44p # FORBIDDEN_PRIVACY_MARKERS 三个值
git show origin/staging:tests/test_truth_source_runtime_identity.py | sed -n 14p # 本机绝对路径前缀
- 无引用的 Skill 快照 33 个文件。
skills/jyotish-vedic-astrology/versions/{6.9.14,6.9.15,6.9.16}/三份快照共 3,467 个文件、71.6 MB。frontend/src/lib/skill-package-registry.ts:711-764与frontend/src/mastra/skill-binding.ts:16明写versions/快照不在加载路径上;仓内只有.gitignore:7-8与 CHANGELOG 历史提到它。 - 前端测试 13 个文件把库主生日当 fixture 日期。
frontend/tests/birth-time-journey-test-support.ts:25,34,156、birth-time-intake.test.ts:25,336、birth-time-dynamic-*.test.ts、birth-time-journey-*.test.ts、birth-time-journey-turn-persistence.test.mjs:185。坐标已换成上海,只剩日期。 - Python 测试 10 个。
tests/test_active_rectification_api.py:23,32-33,43,61,91,96,111用库主生日 + 出生分钟;test_active_rectification_events.py(7 处)、test_dynamic_rectification.py:123、test_dynamic_rectification_fact_priority.py:11、test_minute_rectification_feature_facts_v4.py:62、test_rectification_horary_observation.py:8、test_rectification_kp_cusp_observation.py:21用生日;test_deep_fragment_oss_reuse_gate_round2.py:20,30、test_truth_source_runtime_identity.py:14断言库主本机路径。 - 整机扫描台账 11 份 + 1 份 manifest。
references/oracle/下 2026-07 的deep_fragment_oss_reuse_gate_round2、event_judgment_fragment_rule_family_registry、fragment_second_pass_candidate_ledger、local_oss_reuse_sweep_kp_muhurta_av_compat、technique_fragment_inventory(无任何读者)、technique_promotion_audit_kp_gochara_muhurta、truth_source_runtime_identity、whole_machine_jyotish_fragment_scan、workbuddy_round{3,4}_candidate_ledger、workbuddy_round5_transfer_status,全部只被各自的合同测试读;scripts/technique_promotion_audit_kp_gochara_muhurta.py:21把库主本机备份路径当kp_reference。references/rangacharya_source_manifest.json含本机路径但有运行时读者scripts/rangacharya_readiness.py。 - 会话转录 2 份。
会话转录已按 2026-09-19 决策删除是库主本人校正会话的原文(含出生参数与生活事件),只被docs/tasks/TASK-rectification-convergence-20260830.md:199,407,457与PROGRESS-rectification-convergence-20260830.md:18-19引用。 - 上游镜像快照。
references/upstream/yinduzhanxing/SKILL.md(SKILL.md:13声明为只读研究快照,references/cross_project_contract/imports/*.json记录哈希)与references/upstream/test_birth_time_rectification_skill_contract.py含库主标识。 - 文档示例。
docs/superpowers/plans/2026-07-17-birth-date-picker.md:52,418用库主生日当示例;docs/research/whole_machine_fragment_sweep_2026_07_{14,16}.md与四份docs/superpowers/plans/2026-07-*.md含本机路径。 - 防线缺口。
tests/test_consultation_contract_golden.py:44已把库主生日与出生分钟列为FORBIDDEN_PRIVACY_MARKERS,但只检查咨询输出,不检查仓库文件;scripts/import_yinduzhanxing.py:36-53排除清单没有任何库主案例或整机扫描模式,下次同步会原样带回。
本仓 scripts/ 运行时没有上游那两个按库主生日分支的函数(_known_case_regression_hint / [私人案例引用已移除]),frontend/src/ 也无命中,不需要动运行时逻辑。
2. 根因
- 上游把库主本人盘当全链路 golden,本仓
import_yinduzhanxing.py只排除了支付 / 管理 / 密钥类路径,没有隐私排除项。 - 隐私守卫只放在咨询输出层,仓库文件层没有测试。
versions/快照在加载路径改造后没人删。
3. 决策记录
- 产品 2026-09-19 拍板:库主本人案例整体删除,不保留匿名化版本、不保留会话转录。这推翻
TASK-rectification-convergence-20260830.md:199把两份会话转录当研究资料归档的做法。 - 上游仓的清理不在本单,由库主按独立指令自己做;本仓不等上游。
- fixture 统一用虚构出生资料(日期、分钟、坐标均不得与任何真人一致),
frontend/tests/birth-time-journey-test-support.ts与tests/conftest.py各一份常量,其余测试引用常量,不再散落字面量。 references/upstream/yinduzhanxing/SKILL.md是带哈希的上游快照,不手改:等库主清完上游后用import_yinduzhanxing.py重新导入;在此之前它算已知残留,在 BLOCKED.md 记一条。
4. 硬红线
- 任务书、进度记录、Bug 历史、commit message、测试名、新常量名里不得出现库主的出生日期、出生分钟、经纬度、别名、本机用户名。
- 删文件就连带删或改测试,三栏说明「原值 / 新值 / 原因」;不得把断言改成「文件不存在」再留着文件。
- 只快进推
staging,不动main、workflow、DNS。 - 不顺手升级依赖、不修不在本单内的 warning。
frontend/src/app/page.tsx不增长;scripts/jyotish_api_server.py不增长。- 测试总数只能因本单列明的删除而减少,进度记录逐个列出被删测试名。
- 不得触碰
skills/jyotish-birth-time-rectification/versions/**。skills/skill-package-registry.json对这些目录逐个做 SHA-256 校验(frontend/src/lib/skill-package-registry.ts:289,582,781),历史校正会话按版本 + 哈希绑定,动一个字节就打不开旧会话。本单只删skills/jyotish-vedic-astrology/versions/,它不在注册表里,也不在运行时拷贝的四个入口(SKILL.md/references/scripts/assets,:623-628)之内。 - 要删的 11 份
references/oracle台账与 2 份会话转录,SKILL.md、skills/*/SKILL.md、mcp_server.py均未引用(已核),模型上下文不受影响;references/rangacharya_source_manifest.json只改路径字符串,rangacharya_readiness.py只判断文件是否可读,输出不变。
5. 任务分解
T1 删 skills/jyotish-vedic-astrology/versions/ 三份快照,.gitignore:7-8 两行随删。
验收:frontend/tests/skill-registry.test.ts、skill-binding.test.ts 通过;tsc / lint / npm test 与基线逐条一致;next build 后 / Static。
T2 fixture 常量化。
frontend/tests/birth-time-journey-test-support.ts 导出虚构 FIXTURE_BIRTH,13 个前端测试全部引用;tests/conftest.py 导出 FIXTURE_BIRTH_DATE / FIXTURE_BIRTH_TIME,8 个 Python 测试引用。test_active_rectification_api.py:32-33 的扫描区间断言按新常量重算,三栏说明。docs/superpowers/plans/2026-07-17-birth-date-picker.md:52,418 示例日期同步换。
验收:用第 1 节取到的检索键 git grep frontend/tests tests docs 为 0;两侧测试数量不低于基线。
T3 删整机扫描台账与会话转录。
- 删
references/oracle/上述 11 份及各自合同测试:tests/test_{deep_fragment_oss_reuse_gate_round2,fragment_migration_registries,fragment_second_pass_candidate_ledger,high_value_gap_registries,technique_promotion_audit_kp_gochara_muhurta,truth_source_runtime_identity,whole_machine_jyotish_fragment_scan,workbuddy_round3_candidate_ledger,workbuddy_round4_candidate_ledger,workbuddy_round4_formalization_registry,workbuddy_round4_usage_closure_queue,workbuddy_round5_transfer_status}.py;tests/test_skill_truth_overlay_application.py里读technique_promotion_audit_*的段落删除;scripts/technique_promotion_audit_kp_gochara_muhurta.py整个删除。 references/rangacharya_source_manifest.json与scripts/rangacharya_readiness.py里的本机路径改<home>占位,不删文件。- 已按原决策核实并删除两份指定私人会话转录(不在文档中重录其识别性文件名),以及
references/upstream/test_birth_time_rectification_skill_contract.py;TASK-rectification-convergence-20260830.md:199,407,457与PROGRESS-rectification-convergence-20260830.md:18-19改为「会话转录已按 2026-09-19 决策删除」。 docs/research/whole_machine_fragment_sweep_2026_07_{14,16}.md与docs/superpowers/plans/四份里的本机路径改<home>。 验收:本机用户名git grep -l在 HEAD 为 0(references/upstream/yinduzhanxing/SKILL.md除外,按 §3 记 BLOCKED);pytest 数量 = 基线 − 被删测试数。
T4 同步排除 + 仓库级隐私守卫。
scripts/import_yinduzhanxing.py使用独立的REQUIRED_PRIVACY_PATH_PATTERNS强制排除原决策指定的七类私人/扫描资料路径,mirror 源和目标及 semantic_merge 路径都检查。本任务书不再复制涉及私人标识的模式字面量,具体规则以该常量为准;方括号脱敏说明不得当作 glob。tests/test_import_yinduzhanxing.py按模式序号构造根目录/嵌套/大小写回归,不复制私人值。- 新增
tests/test_repo_privacy_markers.py:扫git ls-files(排除 pdf / wasm /vendor//references/open_source_sources/),模式来自test_consultation_contract_golden.py:44的FORBIDDEN_PRIVACY_MARKERS复用 + 内置HOME_PREFIX(用户主目录前缀)前缀 +tests/privacy_markers.local.txt(gitignore,可选),命中即失败;references/upstream/yinduzhanxing/SKILL.md在库主清完上游前列为显式豁免并注明到期条件。 验收:.venv/bin/python -m pytest tests/test_repo_privacy_markers.py tests/test_import_yinduzhanxing.py tests/test_consultation_contract_golden.py -q通过;快速门run_quality_gate.py --profile quick通过。
T5 记录。 docs/BUG_HISTORY.md 两条(§7)、BLOCKED.md 一条(上游快照豁免)、CHANGELOG.md 一行(无用户可感知行为变化,只记快照删除与隐私守卫)。
6. 让步顺序
- T2、T3、T4 不可让步。
- T1 若
next build或 skill 加载有任何回归,退回「只删三份快照里含库主标识的 33 个文件」,写进度记录。 - T2 若某 Python 测试换 fixture 后数值断言大面积变化,允许该测试标
skip并写 BLOCKED,不允许静默删断言。
7. BUG 编号起点
开工时核对 docs/BUG_HISTORY.md 最大号(写单时为 BUG-971),从 BUG-972 起:
- BUG-972:上游库主的出生资料、会话转录与本机路径经镜像同步进入本仓跟踪文件(T1~T3)。
- BUG-973:镜像同步无隐私排除项,
FORBIDDEN_PRIVACY_MARKERS只覆盖咨询输出不覆盖仓库文件(T4)。
8. 开工前置命令
cd /workspace/Jyotisha && git status -sb && git fetch origin --prune
git worktree add -b codex/owner-case-purge-20260919 .worktrees/owner-case-purge-20260919 origin/staging
cd .worktrees/owner-case-purge-20260919
.venv/bin/python -m pytest tests -q 2>&1 | tail -3 # 基线数量与失败清单
cd frontend && npm test 2>&1 | tail -5 && ./node_modules/.bin/tsc --noEmit && npm run lint && npm run build 2>&1 | grep -E "○ /$|First Load"
9. 验收口径
tsc 0 错;lint 0 error;npm test 失败清单与基线 b05d2fa1 逐条一致;next build / Static;首屏 gzip ±2%;pytest 数量 = 基线 − 已列明的删除数;快速门通过;三组检索(案例标识 / 生日与分钟 / 本机用户名)在 HEAD 为 0(仅上游快照豁免);推 staging 后 /api/health 的 deployment.gitCommit 等于该提交。进度记录 docs/tasks/PROGRESS-owner-case-purge-20260919.md。