feat(governance): pin selective upstream import contract

This commit is contained in:
Jesse_Chen
2026-08-15 12:13:09 +08:00
parent 0fd111d16b
commit 8abd248f49
11 changed files with 1053 additions and 51 deletions
@@ -13,9 +13,11 @@
"properties": {
"schema_version": {"const": 1},
"source_repository": {"type": "string", "minLength": 1},
"source_repository_url": {"type": "string", "pattern": "^https://github\\.com/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"},
"source_commit": {"type": "string", "pattern": "^(unknown|[0-9a-f]{40})$"},
"source_tree_hash": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"source_mode": {"enum": ["git", "snapshot"]},
"source_skill_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the research source root SKILL.md."},
"source_mode": {"enum": ["git", "archive", "snapshot"]},
"target_repository": {"type": "string", "minLength": 1},
"target_base_commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"policy_version": {"const": 2},
@@ -36,6 +38,15 @@
},
"operator_review_required": {"type": "boolean"}
},
"allOf": [
{
"if": {"properties": {"source_mode": {"enum": ["git", "archive"]}}},
"then": {
"required": ["source_repository_url", "source_skill_sha256"],
"properties": {"source_commit": {"pattern": "^[0-9a-f]{40}$"}}
}
}
],
"$defs": {
"file": {
"type": "object",
@@ -0,0 +1,80 @@
{
"generated_at": "2026-08-14T01:13:57Z",
"mirror_files": [
{
"license": "MIT",
"source": "SKILL.md",
"source_sha256": "ef453dd8dd4a9da72b56010ec33bb7dab57fd72333d8785cac0986d5456e17c5",
"status": "applied",
"target": "references/upstream/yinduzhanxing/SKILL.md",
"target_sha256_after": "ef453dd8dd4a9da72b56010ec33bb7dab57fd72333d8785cac0986d5456e17c5",
"target_sha256_before": "1be8beafbd5f4b6df7f95afec39e87033cd70ef6bf582fe7d9f1eb62fb5d00fb"
}
],
"operator_review_required": true,
"policy_version": 2,
"privacy_scan": {
"rejections": [],
"scanned_files": 1,
"status": "pass"
},
"protected_rejections": [],
"schema_version": 1,
"semantic_merge_files": [
{
"diff_summary": "manual semantic merge required: +42/-31 lines",
"path": "SKILL.md",
"source_sha256": "ef453dd8dd4a9da72b56010ec33bb7dab57fd72333d8785cac0986d5456e17c5",
"status": "review_required",
"target_sha256": "b0377ac7952f8a8d9433522c50837967939e5f91fbed5042467278520379da49"
},
{
"diff_summary": "manual semantic merge required: +65/-53 lines",
"path": "AGENTS.md",
"source_sha256": "a1ff71472c6312000b8aef3f099d5499c0b27d1fd4f61594ef06a56c48533dd2",
"status": "review_required",
"target_sha256": "d8cf104ff60e627ffaf75031237a37b022b54f7145cafdffb3eacdc634f998f9"
},
{
"diff_summary": "manual semantic merge required: +13/-1 lines",
"path": "references/strict-workflow-router.md",
"source_sha256": "afb83e0b1b290166cf7ecdcabcae8221d94b14138abc223e9cf57d27596f82d4",
"status": "review_required",
"target_sha256": "2dbab0179c6001c3c8b51e425af323f214e5e912afe7840821f6c38c3546c905"
},
{
"diff_summary": "manual semantic merge required: +207/-202 lines",
"path": "scripts/unified_consultation_orchestrator.py",
"source_sha256": "f48ad61455ee344ffc53cda225198511979eea05a4be2ac8ef16ea56f40a4d1a",
"status": "review_required",
"target_sha256": "da87697fb8d9bcafa98b2ba0cf091df38769f936a030b8095288f4c99a5dd928"
},
{
"diff_summary": "manual semantic merge required: +2/-11 lines",
"path": "scripts/report_orchestrator.py",
"source_sha256": "cd67d23cf9df68d200167ac25af8473bfabb1a344a5f0a1e1254de14ba426daf",
"status": "review_required",
"target_sha256": "5fbc2c8df6772597295ae80a5e68709a996ddb9b35724f0820f17f7cb028a201"
},
{
"diff_summary": "manual semantic merge required: +5082/-1638 lines",
"path": "scripts/jyotish_api_server.py",
"source_sha256": "d522d82a453645770df25b63f6ba77e75de4c694b9b6580a0d88b931a2988314",
"status": "review_required",
"target_sha256": "5c2f4de25547a98d16f6f8e84c129f525a1be6359c3a5f53fa6fd2a631411aee"
}
],
"source_commit": "5db72537741fcedaa7b5498502d4a31b0f9fc147",
"source_mode": "archive",
"source_repository": "732642856/yinduzhanxing",
"source_repository_url": "https://github.com/732642856/yinduzhanxing",
"source_skill_sha256": "ef453dd8dd4a9da72b56010ec33bb7dab57fd72333d8785cac0986d5456e17c5",
"source_tree_hash": "18e3122ef73c2776a950bfec128efeb09ac0524ec1d2179390260166b87ca814",
"target_base_commit": "0fd111d16b45796086a6c1d0945dbd3de6755d8a",
"target_repository": "root/Jyotisha",
"tests_run": [
"tests/test_import_yinduzhanxing.py",
"tests/test_report_orchestrator_reader_contract.py",
"tests/test_upstream_import_plan.py"
]
}
@@ -2,6 +2,7 @@
"schema_version": 2,
"direction": "research_to_commercial_only",
"source_repository": "732642856/yinduzhanxing",
"source_repository_url": "https://github.com/732642856/yinduzhanxing",
"target_repository": "root/Jyotisha",
"reverse_sync": "forbidden",
"modes": {
@@ -21,6 +22,9 @@
"scripts/jyotish_api_server.py"
],
"protected": [
"skills/jyotish-birth-time-rectification/**",
"skills/jyotish-vedic-astrology/**",
"SKILL.md",
"frontend/**",
"deploy/**",
".gitea/**",
@@ -47,6 +51,23 @@
"Only explicit mirror mappings may be copied byte-for-byte.",
"Semantic-merge paths are review inputs and are never overwritten by the importer.",
"Commercial product, identity, billing, database and deployment surfaces are protected.",
"There is no commercial-to-research mode or gate in schema v2."
]
"There is no commercial-to-research mode or gate in schema v2.",
"The only byte-for-byte mirror is upstream SKILL.md into references/upstream/yinduzhanxing/SKILL.md.",
"Commercial root and birth-time-rectification Skills are protected targets and may only be reviewed through separate semantic work.",
"The importer enforces the built-in minimum protected pattern set even when an alternate policy file is supplied.",
"Unbound non-Git snapshots are legacy records; new archive imports fail closed without commit and expected tree SHA-256.",
"A Git source must be a clean repository-root checkout whose origin matches source_repository; Git checkouts cannot be relabeled as archive sources.",
"Manifest generation requires a clean target repository root and is deterministic for fixed source, target base commit, policy and CLI identity inputs.",
"Manifest output must be JSON, cannot overlap the source tree, and may enter the target only through references/cross_project_contract/imports."
],
"source_modes": {
"git": "Use the exact clean repository-root HEAD commit. Explicit commit and expected tree pins, when used, must be supplied together and match.",
"archive": "Requires both an explicit 40-hex source commit and expected importer-compatible source-tree SHA-256; absence or mismatch is rejected.",
"snapshot": "Legacy manifest records only. The v2 importer does not emit new unbound snapshots."
},
"determinism": {
"tree_hash": "SHA-256 over sorted relative path, NUL, file SHA-256 bytes, NUL; .git is excluded and source symlinks are rejected.",
"generated_at": "Git source commit time for git mode; target base commit time for archive mode. Wall-clock time is forbidden.",
"json": "UTF-8, sorted keys, two-space indentation, trailing newline."
}
}
@@ -120,6 +120,7 @@ adapter available 解释为已完成 VedAstro、PyJHora/JHora 或 jyotishganit r
3. **阶段二**:意图识别 → 路由目标宫位(无明确意图→Level 2综合解盘)
4. **阶段二点五**:若 `full-reading` 或网页/API 返回 `ai_prompt_pack`,必须优先读取 `prompt_zh``evidence_snapshot``retrieval_plan` 作为 AI/RAG 主上下文;若没有该字段,再退回传统 JSON 摘要。
4.1 **VedAstro 官方优先级**:用户给出生信息后,网页、Skill、MCP 都必须默认走同一条数据优先级:`VedAstro official snapshot -> local supplemental modules -> local fallback only when official blocked`。用户不需要主动要求“调用 VedAstro”。若 `evidence_snapshot.vedastro_official_full_snapshot.status``ok/partial` 且官方 chart 可用,D1/分盘/官方返回的原始字段以 VedAstro 为主;本地引擎只做补充、交叉检查或官方 blocked 时 fallback。
4.1.1 **Formal Varga 官方证据审计**MCP `strict_workflow` 需要补充 VedAstro 官方形式分盘证据时,可显式传 `official_formal_varga_audit=True`;返回的 `vedastro_official_formal_varga_audit` 只能进入 Evidence Ledger / Technique Audit Table,作为 `evidence_only`,不得宣称本地 Varga 公式真值闭环、不得用官方响应静默覆盖本地算法、不得写入或展示任何 API key。
4. **阶段三**:静态分析10步(宫位→承诺→Yoga→Argala→逆行→NK→Shadbala→AV→Ketu→分盘)
5. **阶段四**:动态推运7步(Dasha→五系统Convergence→Transit→Double Transit→Jaimini→KP→Varshaphala
6. **阶段五**:应期输出(五层验证→时间窗口→Actionable Output+案例检索)
@@ -0,0 +1,233 @@
{
"schema_version": 1,
"source_repository": "732642856/yinduzhanxing",
"source_repository_url": "https://github.com/732642856/yinduzhanxing",
"source_commit": "5db72537741fcedaa7b5498502d4a31b0f9fc147",
"source_tree_sha256": "18e3122ef73c2776a950bfec128efeb09ac0524ec1d2179390260166b87ca814",
"boundary": "PR-0 records selective semantic decisions only. The importer mirrors only the pinned upstream root SKILL.md under references/upstream; none of these research scripts is copied into the commercial runtime by this PR.",
"entries": [
{
"source": "scripts/evidence_maturity.py",
"category": "evidence_assertion_contracts",
"action": "adapt",
"reason": "Reuse the explicit calculated/profile_validated/external_parity/predictively_validated vocabulary and visible partial/blocked states without treating a research receipt as commercial execution proof.",
"targets": [
"scripts/strict_evidence_service.py",
"scripts/high_rigor_closure_gate.py"
],
"tests": [
"tests/test_high_rigor_closure_gate.py",
"tests/test_upstream_import_plan.py"
]
},
{
"source": "scripts/assertion_policy.py",
"category": "evidence_assertion_contracts",
"action": "adapt",
"reason": "Adapt assertion-strength labels so blocked and parameter-sensitive claims remain explicit; server-owned evidence, state and scoring continue to decide what may be asserted.",
"targets": [
"scripts/rectification_policy.py",
"scripts/report_orchestrator.py"
],
"tests": [
"tests/test_rectification_technique_contract.py",
"tests/test_report_orchestrator_reader_contract.py",
"tests/test_upstream_import_plan.py"
]
},
{
"source": "scripts/evidence_labeled_reporting.py",
"category": "evidence_assertion_contracts",
"action": "adapt",
"reason": "Adapt evidence labels and limitation rendering while preserving the commercial reader contract and preventing computed_pending_validation material from being presented as externally verified truth.",
"targets": [
"scripts/report_builder.py",
"scripts/report_orchestrator.py"
],
"tests": [
"tests/test_report_orchestrator_reader_contract.py",
"tests/test_upstream_import_plan.py"
]
},
{
"source": "scripts/calculation_profile_contract.py",
"category": "calculation_contracts",
"action": "adapt",
"reason": "Adapt deterministic calculation-profile identity and privacy-safe hashing to the commercial producer instead of creating a second calculation chain or importing research dependency paths.",
"targets": [
"scripts/domain_calculation_service.py",
"scripts/rectification_three_engine_packet.py"
],
"tests": [
"tests/test_commercial_domain_calculation_contract.py",
"tests/test_rectification_three_engine_packet.py",
"tests/test_upstream_import_plan.py"
]
},
{
"source": "scripts/report_pack_contract.py",
"category": "report_domain_profile_contracts",
"action": "adapt",
"reason": "Adapt typed report-pack sections, provenance and limitations into the existing commercial report contract without replacing its routes, authorization or reader-facing conclusions.",
"targets": [
"scripts/personal_report_contract.py",
"scripts/report_orchestrator.py"
],
"tests": [
"tests/test_personal_report_contract.py",
"tests/test_report_orchestrator_reader_contract.py",
"tests/test_upstream_import_plan.py"
]
},
{
"source": "scripts/domain_profile_builder.py",
"category": "report_domain_profile_contracts",
"action": "adapt",
"reason": "Adapt domain-profile normalization behind the existing commercial domain service; migration, family and annual route selection remains owned by the commercial orchestrator.",
"targets": [
"scripts/domain_calculation_service.py",
"scripts/unified_consultation_orchestrator.py"
],
"tests": [
"tests/test_commercial_domain_calculation_contract.py",
"tests/test_unified_consultation_orchestrator.py",
"tests/test_upstream_import_plan.py"
]
},
{
"source": "scripts/unified_calculation_archive.py",
"category": "research_oracle_assets",
"action": "reference_only",
"reason": "Retain the research archive shape and PL9 observations as pinned reference evidence only. It must not replace the commercial calculation archive, satisfy required rectification layers, or become runtime truth.",
"targets": [
"scripts/high_rigor_closure_gate.py",
"scripts/unified_consultation_orchestrator.py"
],
"tests": [
"tests/test_high_rigor_closure_gate.py",
"tests/test_upstream_import_plan.py"
]
},
{
"source": "scripts/specialized_evidence_packets.py",
"category": "research_oracle_assets",
"action": "adapt",
"reason": "Adapt the raw Jaimini, KP and Tajika packet boundaries as evidence-only structures; each system keeps its own commercial validation gate and cannot vote itself into a deterministic outcome.",
"targets": [
"scripts/high_rigor_closure_gate.py",
"scripts/rectification_three_engine_packet.py"
],
"tests": [
"tests/test_high_rigor_closure_gate.py",
"tests/test_rectification_three_engine_packet.py",
"tests/test_upstream_import_plan.py"
]
},
{
"source": "scripts/timing_evidence_packets.py",
"category": "research_oracle_assets",
"action": "adapt",
"reason": "Adapt raw Dasha/transit packet labeling while retaining complete commercial candidate sensitivity and stability diagnostics; computed timing windows do not establish an event outcome or exact birth minute.",
"targets": [
"scripts/candidate_time_sensitivity_scan.py",
"scripts/high_rigor_closure_gate.py"
],
"tests": [
"tests/test_candidate_time_sensitivity_scan.py",
"tests/test_high_rigor_closure_gate.py",
"tests/test_upstream_import_plan.py"
]
}
],
"formal_varga_policy": {
"action": "reference_only",
"reason": "The upstream Formal Varga official-response audit may appear only as evidence_only in Evidence Ledger or Technique Audit output. It cannot claim local-formula parity, satisfy required layers, overwrite local calculations, or expose an API key.",
"targets": [
"references/upstream/yinduzhanxing/SKILL.md",
"scripts/high_rigor_closure_gate.py",
"scripts/report_orchestrator.py"
],
"tests": [
"tests/test_high_rigor_closure_gate.py",
"tests/test_report_orchestrator_reader_contract.py",
"tests/test_upstream_import_plan.py"
]
},
"rejected_regressions": [
{
"id": "fixed_event_domain_count_threshold",
"action": "reject",
"reason": "A fixed count of 3 events across 2 domains is not sufficient evidence for exact-minute confirmation and cannot bypass server-owned evidence completeness, state or scoring policy.",
"commercial_owner": "scripts/rectification_technique_contract.py",
"tests": [
"tests/test_rectification_technique_contract.py",
"tests/test_upstream_import_plan.py"
]
},
{
"id": "sparse_start_mid_end_rectification_scan",
"action": "reject",
"reason": "Sampling only range start, midpoint and end is not a complete sensitivity or stability gate; the commercial candidate scan and required diagnostic layers remain authoritative.",
"commercial_owner": "scripts/candidate_time_sensitivity_scan.py",
"tests": [
"tests/test_candidate_time_sensitivity_scan.py",
"tests/test_upstream_import_plan.py"
]
},
{
"id": "weaken_three_engine_gate",
"action": "reject",
"reason": "Research prose or a single official response cannot weaken the commercial three-engine evidence gate or convert blocked parity into executed truth.",
"commercial_owner": "scripts/rectification_three_engine_packet.py",
"tests": [
"tests/test_rectification_three_engine_packet.py",
"tests/test_upstream_import_plan.py"
]
},
{
"id": "weaken_required_layers",
"action": "reject",
"reason": "Missing required divisional, timing, strength or functional-benefic layers remain visible and blocked; upstream packets cannot silently satisfy them.",
"commercial_owner": "scripts/high_rigor_closure_gate.py",
"tests": [
"tests/test_high_rigor_closure_gate.py",
"tests/test_upstream_import_plan.py"
]
},
{
"id": "weaken_stability_gate",
"action": "reject",
"reason": "Candidate range or exact-minute claims must retain the commercial stability and sensitivity gates; narrative confidence is not stability evidence.",
"commercial_owner": "scripts/candidate_time_sensitivity_scan.py",
"tests": [
"tests/test_candidate_time_sensitivity_scan.py",
"tests/test_upstream_import_plan.py"
]
},
{
"id": "remove_commercial_routes",
"action": "reject",
"reason": "Existing migration, family and annual Web routes, their fallbacks and user-visible recovery remain commercial-runtime-owned and cannot be deleted or replaced by upstream routing.",
"commercial_owner": "scripts/unified_consultation_orchestrator.py",
"preserved_routes": [
"migration",
"family",
"annual"
],
"tests": [
"tests/test_unified_consultation_orchestrator.py",
"tests/test_upstream_import_plan.py"
]
}
],
"protected_surfaces": [
"SKILL.md",
"skills/jyotish-vedic-astrology/**",
"skills/jyotish-birth-time-rectification/**",
"frontend/**",
"deploy/**",
"authentication",
"billing",
"database"
]
}
@@ -1,11 +1,18 @@
{
"schema_version": 1,
"source_repository": "732642856/yinduzhanxing",
"source_commit": null,
"source_mode": "snapshot",
"source_tree_sha256": "9034e1967032d09c7fbae83fc2205f7e75e8ad482c5f9eba1bf309fe30aef5bb",
"skill_sha256": "1be8beafbd5f4b6df7f95afec39e87033cd70ef6bf582fe7d9f1eb62fb5d00fb",
"archive_file_count": 2901,
"archive_sha256": "07d6b71af311160c544433eb9d51beb5b0a5e4bd0afabd4a7d43d3edb573518d",
"boundary": "Archive content was verified byte-for-byte against all 2,901 non-.git files at the bound commit. Only root SKILL.md is mirrored; commercial and rectification Skills remain protected. skill_sha256 is retained as a legacy alias of source_skill_sha256.",
"import_policy_version": 2,
"imported_at": "2026-08-14T03:16:04Z",
"license": "MIT",
"imported_at": "2026-08-06T00:00:00Z",
"boundary": "The provided source had no usable Git metadata. This manifest does not claim parity with a GitHub commit."
"schema_version": 1,
"skill_sha256": "ef453dd8dd4a9da72b56010ec33bb7dab57fd72333d8785cac0986d5456e17c5",
"source_commit": "5db72537741fcedaa7b5498502d4a31b0f9fc147",
"source_committed_at": "2026-08-13T18:03:53Z",
"source_git_tree": "16935cb68a6fa1ef72661cfca4650a42c60e9b2c",
"source_mode": "archive",
"source_repository": "732642856/yinduzhanxing",
"source_repository_url": "https://github.com/732642856/yinduzhanxing",
"source_skill_sha256": "ef453dd8dd4a9da72b56010ec33bb7dab57fd72333d8785cac0986d5456e17c5",
"source_tree_sha256": "18e3122ef73c2776a950bfec128efeb09ac0524ec1d2179390260166b87ca814"
}