Apply owner-case-purge fix2 P0/F3 corrections. Co-Authored-By: Claude Code <noreply@anthropic.com>
12 KiB
给 yinduzhanxing 库主的清理指令(2026-09-19)
这份文件是交给上游仓
yinduzhanxing(GitHub732642856/yinduzhanxing)库主的独立指令,可整段贴给他的 coding agent。它不属于本仓任务书,本仓的对应工作在TASK-owner-case-purge-20260919.md。 全文不转录任何出生日期、出生分钟、经纬度、本机用户名;检索键一律指到源文件行,执行时自己读。
你要做什么
把仓库里你本人的出生案例(案例 ID pl9_1993_user_case / 别名 yn-1993 / 紫微别名文件族 ziwei_*wenmo*)、另一位真实用户的三份报告、以及你电脑上的绝对路径从仓库 HEAD 里清干净,并顺手清掉一批零信息损失的冗余文件。基线 main = a6f47abd(2026-09-03)。在新分支 cleanup/owner-case-purge 上做,做完自己看 diff 再合。
第一步:先取检索键(不要写进任何提交)
cd <repo> && git checkout -b cleanup/owner-case-purge a6f47abd
sed -n 26,31p scripts/panchanga_api_bridge.py # 默认 birth / lat / lon / SUBJECT 四个值
sed -n 10p tests/test_birth_time_rectification_skill_contract.py # 本机绝对路径前缀
把这几个值放进 tests/privacy_markers.local.txt(一行一个正则),并把该文件加进 .gitignore。后面所有「为 0」的验收都用它:
git grep -lEf tests/privacy_markers.local.txt -- . ':!*.pdf' ':!*.wasm' ':!references/open_source_sources' | wc -l
开工时这个数是 94(案例标识)+ 511(本机路径),做完必须是 0。
第二步:运行时去特判(这是 Bug,不只是隐私)
scripts/active_rectification_questions.py:176-209_known_case_regression_hint:用出生日期字符串判断来访者是不是你,是就返回你的target_minute。任何和你同一天生日的用户都会拿到你的答案。 删函数、删:468的调用和返回字段。scripts/jyotish_engine.py:2130-2160_load_1993_candidate_segment_table:按年月日命中就加载references/oracle/1993_birth_time_candidate_segment_table_2026_08_23.json。删函数,删:2072-2086的candidate_segment_table/candidate_segment_reference两键,删scripts/jyotish_api_server.py:14047-14049的读取(该文件受tests/test_api_server_growth_contract.py行数冻结,只减不增)。scripts/classical_astrology.py:100-102三个DEFAULT_CLASSICAL_ZR_*常量与:3665起的build_classical_zr_1993_event_feedback_template_packet及调用方,一并删。scripts/panchanga_api_bridge.py:26-31、scripts/vedastro_rest_bridge.py:19-20默认参数改成公开名人(AstroDatabank AA 级,例如乔布斯,资料已在references/real_case_calibration/replay_manifest.json),SUBJECT改成该名人 ID。
验收:git grep -nE "1993|known_user_case|candidate_segment_table" scripts/ 为 0;python3 -m pytest tests/test_active_rectification_questions.py tests/test_active_rectification_api.py tests/test_classical_astrology.py -q fail=0。
第三步:删案例文件
git ls-files | grep -iE "1993|wenmo|1993_user" # 36 个,全删
分布:docs/research 9、references/oracle 8、references/real_case_calibration 9(含 astrolog_parity/ 5)、scripts 6(capture_1993_*.py ×2、pl9_1993_case_contract.py、qizheng_1993_replay_packet.py、vedastro_1993_difference_attribution_ledger.py、ziwei_wenmo_parser.py)、tests 4(同名测试)。
根目录三份未跟踪的另一位真实用户报告(git status --short 里 3 个 ??,文件名含「个人印度占星报告」)直接删,.gitignore 加 *个人印度占星报告*.md。
SKILL.md:13,125,561 三处「yn-1993 本盘」措辞删掉;progress.md:3474-3480,3588 四段整段删(含你本机 .codex/attachments/... 路径和完整出生参数)。
第四步:26 个测试三分
git grep -lEf tests/privacy_markers.local.txt -- tests
- 直接断言你的案例存在的 13 个:随文件删除,或只删
case_1993那段断言。例:tests/test_narayana_dense_observed_profile_matrix.py:22、test_narayana_pl9_multi_case_promotion_gate.py:24、test_narayana_dasha.py:140、test_classical_astrology.py:1242、test_qizheng_practical_rule_pack.py:61、test_ziwei_personal_report.py:125、test_startrack_full_report_opt_in.py:16、test_startrack_language_bridge_adapter.py:1399、test_vimshottari_first_balance_fix_ledger.py:23、test_xhs_minitool_bundle.py:113、test_vedastro_rest_bridge.py:35、test_chara_narayana_variant_profiles.py:32。 - 把你的生日当通用 fixture 的 13 个:换成第二步选定的公开名人,或一份虚构常量(放
tests/conftest.py)。例:test_local_case_fill_checklist.py:11、test_local_flexible_time_case_template.py:11、test_active_rectification_api.py:22、test_active_rectification_result_summary.py:125、test_birth_time_rectification_skill_contract.py:218。 tests/test_frontend_productization.py:381那条「前端源码不含你生日」的守卫保留。
每条改动记「原值 / 新值 / 原因」。不许为了绿而把断言改成「文件不存在」再留着文件。
第五步:清本机绝对路径(511 个文件、122,274 处)
六个文件占绝大多数,全是整机扫描产物,直接删:
docs/research/character_level_external_manifest_latest.json(42 MB,109,306 处,仓库最大单文件)与character_level_inventory_manifest_latest.json,连同其余docs/research/character_level_*_latest.*(共 12 个);scripts/build_legacy_vocabulary_cleanup_queue.py:27-28读它们的两处改为「不存在即跳过」。references/real_case_calibration/classical_{zr,horary,electional}_{reviewer_freeze,domain_validation}_scoring_manifest_*.json(6 × 2.9 MB)及其合同测试断言。
其余:
tests/test_birth_time_rectification_skill_contract.py:10删 fallback 行(CI 上永远不可解析)。docs/rfc/**6 处绝对内链改相对路径(integration_plan.md:7-8、test_strategy.md:7-9、schema.md:5)。- 剩下的逐文件判断:整机扫描清单删,研究文档里的路径改
<home>。
验收:git grep -c "/Users/" -- . ':!references/open_source_sources' | wc -l 为 0。
第六步:仓库级隐私守卫(防复发)
新增 tests/test_repo_privacy_markers.py:读 tests/privacy_markers.local.txt(gitignore 的)里的模式,扫 git ls-files(排除 pdf / wasm / open_source_sources),命中即失败;文件不存在时 skip 并打印提示。/Users/ 前缀作为内置模式始终检查。
第七步:冗余清理(零信息损失,已逐条 md5 / diff 核实)
| # | 动作 | 验收 |
|---|---|---|
| 1 | 删 references/analysis-natal-full-part1..7-*.md(7 个 md5 全同,正文只剩匿名化墓碑)、references/analysis-full-reading-v1.8-review.md ≡ -v4.0.md |
无引用 |
| 2 | 删 references/oracle/cases/ 里 8 个 md5 全同、内容全 null 的桩;tests/test_oracle_benchmark_inventory.py:46-47 对应断言删 |
测试通过 |
| 3 | references/real_case_calibration/*.json 16 组 md5 全同、37 个冗余:每组留最新日期,读旧名的脚本/测试改指向 |
md5sum references/real_case_calibration/*.json | awk '{print $1}' | sort | uniq -d 为空 |
| 4 | 删 docs/research/{tajika_annual_closure_status,tajika_annual_benchmark_dashboard,public_benchmark_dashboard,oracle_closure_master_dashboard}_latest.md(docs/benchmark/ 是代码读的真源) |
无引用 |
| 5 | 110 个 docs/research/antigravity_round{28,29,30}_* + antigravity_sidecar_work_order_round* 移到 docs/archive/research_2026_06/(round 1–27 已于 2026-08-07 归档,这批漏了),更新该目录 README 计数 |
ls docs/research | grep -c antigravity 为 0 |
| 6 | 删 AGENTS.original.md(是 AGENTS.md 旧版子集)、REPO_LAYOUT.md(指向不存在的 docs/research/archive/、scratch/local/),仍成立的规则并入 AGENTS.md |
— |
| 7 | CHANGELOG.md:3→29 从 v6.9.14 直接跳到 v6.1.12:把 CHANGELOG_v6.2_to_v6.9.md 插进去再删小文件 |
grep -c "^## v6\.[2-9]\." CHANGELOG.md ≥ 10 |
| 8 | benchmark/validation-einstein-2026-06-04.md 移 docs/benchmark/,删 benchmark/;scripts/interpretation_source_inventory_gate.py:267 去掉 "benchmark/" 特判;docs/planning/ 唯一文件并入 docs/roadmap/ |
测试通过 |
| 9 | 死链:SKILL.md 3 个 docs/research/*_2026_06_26.md + 4 个 verified-celebrity-cases-*.md(真实文件带 -part2/3/4-);mcp_server.py 3 个 docs/research/local_drafts/**;references/quick-reference-guide.md 5 个;README.md 2 个 scripts/*plugin*.py。目标不存在的删引用行,命名代差的改真实名 |
新增 tests/test_doc_links_resolve.py 扫这四个文件 |
| 10 | skills/jyotish-engine-modules/scripts/ 5 个 .py 是 scripts/ 的拷贝,special_lagnas.py、vimsopaka_calculator.py 已漂移(findings.md:246 记过一次同因事故);连同自述「历史方案」的 skills/jyotish-full-reading-integration/ 和只做 cp 的 tests/test_skill_truth_sync_scripts.py 一起删 |
cmp 无漂移对 |
第八步:另一条分支
codex/add-birth-time-rectification-skill 分支上有两个 main 没有的文件:docs/research/rectification_process_v2_guardrails_2026_09_04.md(18 件生活事件复盘)和 tests/test_rectification_ayanamsa_calibration_baseline.py(以你的出生分钟为中心的 15 分钟扫描基线)。要么删分支,要么把这两个文件从分支上删掉再合。
验收清单
python3 -m pytest tests/ -q # 失败清单与开工基线逐条比对,0 新红
python3 -m pytest tests/test_repo_privacy_markers.py -q
git grep -lEf tests/privacy_markers.local.txt -- . ':!*.pdf' ':!*.wasm' ':!references/open_source_sources' | wc -l # 0
git grep -l "/Users/" -- . ':!references/open_source_sources' | wc -l # 0
git diff --stat a6f47abd | tail -1
你自己决定、本指令不动的
| 项 | 体量 | 问题 |
|---|---|---|
| git 历史 | — | 以上只清 HEAD,历史提交里仍有你的资料;要彻底清用 git filter-repo,会改写所有 SHA,镜像方要重新对齐 |
Science of Light I/II.pdf |
32 MB,占 .git 约 1/4 |
版权书整本入 MIT 仓;建议 untrack + 本地路径,tests/test_book_admission_audit.py:30-50 改为容忍缺失 |
| 七政四余 / 紫微 / 大六壬 | 约 650 个文件(references 215、tests 182、scripts 180、docs 73) | 不是印度占星,有活测试,建议拆独立仓 |
docs/superpowers/(82)、progress.md(690 KB)/ findings.md / task_plan.md |
— | 外部规划工具输出与会话日志,无代码引用,建议移 docs/archive/ |
chara_narayana_*(25)、raman_muhurta_*(22)、qizheng_remainder_*(23) |
70 | 同题日期链,需人判断留哪几份 |
13 份 references/verified-celebrity-cases-* + celebrity-cases.md + consultation-case-library.md + case-study-collection-*.md + indastro-case-studies.md |
— | 三代命名的同一名人库;真源是 tests/celebrity_cases.json(16 人)、tests/indastro_cases.json(11 人),建议合成一份 references/famous-case-library.md 索引 |
COVERAGE_AUDIT_REPORT.md |
— | v6.1.12 时代快照仍被 SKILL.md:707 链接,重生成或摘链 |
顺带说明
仓里没有一个「校正流水线从宽窗找回真实出生时间」的成功案例:五名人「验证案例」是已知时间反推吻合度;乔布斯 / 奥巴马 / 戴安娜内部试点从未打分(blocked_until_human_labels,可盲测案例数 0);10 名人日级 holdout 真跑了,Top-1 与 Top-3 都是 0%;你本人那次是以答案为中心的 15 分钟扫描,且真值本身是推算值。references/birth-time-rectification-cases.md 那 95% 吻合度不能当校正命中率引用。