From 8cdda28c6fcbc277ce540a72caf69f964a29f5a7 Mon Sep 17 00:00:00 2001 From: 732642856 <732642856@qq.com> Date: Sun, 19 Jul 2026 23:04:46 +0800 Subject: [PATCH] test: sync deep fragment oss reuse gate --- ...ment_oss_reuse_gate_round2_2026_07_19.json | 190 ++++++++++++++++++ .../evidence_packet_index_2026_07_19.json | 10 +- ...est_deep_fragment_oss_reuse_gate_round2.py | 60 ++++++ 3 files changed, 259 insertions(+), 1 deletion(-) create mode 100644 references/oracle/deep_fragment_oss_reuse_gate_round2_2026_07_19.json create mode 100644 tests/test_deep_fragment_oss_reuse_gate_round2.py diff --git a/references/oracle/deep_fragment_oss_reuse_gate_round2_2026_07_19.json b/references/oracle/deep_fragment_oss_reuse_gate_round2_2026_07_19.json new file mode 100644 index 00000000..ee0f3b70 --- /dev/null +++ b/references/oracle/deep_fragment_oss_reuse_gate_round2_2026_07_19.json @@ -0,0 +1,190 @@ +{ + "scope": "deep_fragment_oss_reuse_gate_round2", + "created_at": "2026-07-19", + "status": "active_guardrail_ready", + "claim_status": "ready_contract", + "production_tuning_allowed": false, + "truth_matrix_allowed": false, + "scanned_roots": [ + "/Users/wuyongnaren/Documents", + "/Users/wuyongnaren/Downloads", + "/Users/wuyongnaren/Desktop", + "/tmp", + "/private/tmp", + "/Users/wuyongnaren/.workbuddy", + "/Users/wuyongnaren/WorkBuddy" + ], + "active_repositories": [ + { + "path": "/Users/wuyongnaren/Documents/印度占星", + "role": "research_main", + "action": "authoritative local research source" + }, + { + "path": "/tmp/jyotisha-commercial-readonly.adiUr0", + "role": "commercial_main", + "action": "target for mature astrology capability sync" + }, + { + "path": "/Users/wuyongnaren/.workbuddy/backups/jyotish-vedic-astrology-20260711-154109", + "role": "historical_backup", + "action": "read_only_do_not_bulk_copy" + }, + { + "path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing", + "role": "historical_workbuddy_checkout", + "action": "read_only_compare_only" + }, + { + "path": "/private/tmp/vedicastro_diliprk_flatlib_src_1784467988", + "role": "temporary_dependency_source", + "action": "dependency_identity_only_do_not_vendor" + } + ], + "local_fragments": [ + { + "path": "/tmp/jyotisha-commercial-readonly.adiUr0/hip_main.dat", + "classification": "untracked_commercial_non_task_file", + "action": "quarantine_do_not_stage_without_owner_confirmation" + }, + { + "path": "/Users/wuyongnaren/Desktop/印度占星修正版研究结论v3-高压基建后的反转兑现模型.md", + "classification": "personal_report_or_case_note", + "action": "do_not_ingest_without privacy/source review" + }, + { + "path": "/Users/wuyongnaren/Documents/ObsidianVault/05_文件仓库索引/电子书资料库/书目卡片", + "classification": "book_index_cards", + "action": "candidate_source_locator_only; no copyrighted text copy" + }, + { + "path": "/Users/wuyongnaren/Documents/印度占星/docs/research/antigravity_round24_open_source_jyotish_landscape_2026_06_25.md", + "classification": "prior_oss_landscape", + "action": "reuse_before_new_search" + }, + { + "path": "/Users/wuyongnaren/Documents/印度占星/docs/research/shadbala_av_normative_benchmark_plan_2026_07_19.md", + "classification": "shadbala_av_worked_example_plan", + "action": "reuse for component closure next steps" + } + ], + "oss_reuse_policy": [ + { + "project": "northtara/jyotishganit", + "license_boundary": "MIT", + "allowed_use": [ + "same-chart field observation", + "varga/panchanga/ashtakavarga/shadbala surface probe" + ], + "blocked_use": [ + "absolute truth without worked examples" + ] + }, + { + "project": "vedika-io/xalen-ephemeris", + "license_boundary": "Apache-2.0", + "allowed_use": [ + "formula isolation oracle", + "ephemeris/varga separation" + ], + "blocked_use": [ + "majority vote truth" + ] + }, + { + "project": "diliprk/VedicAstro + diliprk/flatlib@sidereal", + "license_boundary": "source/license must remain file-level checked", + "allowed_use": [ + "KP runtime raw/hash probe in isolated dependency path" + ], + "blocked_use": [ + "commercial runtime vendoring before license/dependency review" + ] + }, + { + "project": "naturalstupid/PyJHora", + "license_boundary": "AGPL-3.0", + "allowed_use": [ + "black-box external fixture/oracle only" + ], + "blocked_use": [ + "copy code", + "runtime dependency in commercial app" + ] + }, + { + "project": "VicharaVandana/jyotishyamitra", + "license_boundary": "MIT", + "allowed_use": [ + "independent package probe", + "field surface comparison" + ], + "blocked_use": [ + "truth promotion without worked examples" + ] + }, + { + "project": "dashaflow/rishi-ai-mcp local mirrors", + "license_boundary": "must verify before reuse", + "allowed_use": [ + "Muhurta/product workflow reference only" + ], + "blocked_use": [ + "copy implementation before license review" + ] + } + ], + "next_actions_ordered": [ + { + "priority": "P0", + "task": "Shadbala component closure", + "reuse_first": [ + "shadbala_same_unit_normalizer", + "jyotishganit_shadbala_surface_probe", + "xalen_shadbala_av_component_delta_report", + "VP Jain benchmark packet" + ], + "completion_gate": "component rows classified with same unit and source variant boundary" + }, + { + "priority": "P0", + "task": "KP cusp worked-example oracle queue", + "reuse_first": [ + "vedicastro_kp_cusp_batch_probe", + "KP public candidate queue", + "VedicAstro KP runtime raw" + ], + "completion_gate": "public input/settings/expected values/raw hash/replay comparison" + }, + { + "priority": "P1", + "task": "Muhurta factor scoring", + "reuse_first": [ + "muhurta_oss_factor_scoring_queue", + "local panchanga probes", + "DrikPanchang/MyPanchang public fixtures" + ], + "completion_gate": "factor weights and at least one public interval worked example per factor" + }, + { + "priority": "P1", + "task": "D1-D60 source naming/use closure", + "reuse_first": [ + "d1_d60_public_source_candidate_queue", + "jyotishganit varga surface", + "book index cards as locators only" + ], + "completion_gate": "source text citation without copying copyrighted content plus formula/usage boundary" + }, + { + "priority": "P2", + "task": "day-level holdout", + "reuse_first": [ + "public event datasets only for positive events", + "manual independent negative labels" + ], + "completion_gate": "20 positive and 80 explicit negative intervals reviewed by independent annotator" + } + ], + "boundary": "This packet completes the current pre-work sweep/OSS reuse guardrail only. It does not close numeric oracle, timing holdout, hosted identity, or worked-example blockers." +} diff --git a/references/oracle/evidence_packet_index_2026_07_19.json b/references/oracle/evidence_packet_index_2026_07_19.json index bd359528..26fc174c 100644 --- a/references/oracle/evidence_packet_index_2026_07_19.json +++ b/references/oracle/evidence_packet_index_2026_07_19.json @@ -5,7 +5,7 @@ "production_tuning_allowed": false, "boundary": "Index of current governance packets only. Raw oracle artifacts remain in references/oracle/artifacts and are not all duplicated here.", "summary": { - "packet_count": 62, + "packet_count": 63, "blocked_or_partial_count": 40, "human_review_required_count": 1 }, @@ -505,6 +505,14 @@ "claim_status": "partial", "consumer_policy": "research_to_commercial_contract_only", "claim_boundary": "Normalizes local/Xalen/jyotishganit/VP Jain Shadbala rows into Virupa/Rupa where available; classifications are arbitration queues, not absolute truth." + }, + { + "packet_id": "deep_fragment_oss_reuse_gate_round2", + "path": "references/oracle/deep_fragment_oss_reuse_gate_round2_2026_07_19.json", + "domain": "fragment_oss_reuse_governance", + "claim_status": "ready_contract", + "consumer_policy": "pre_work_required_before_sync", + "claim_boundary": "Current whole-machine fragment and OSS reuse guardrail is recorded; no numeric truth or production capability is upgraded by this packet." } ] } diff --git a/tests/test_deep_fragment_oss_reuse_gate_round2.py b/tests/test_deep_fragment_oss_reuse_gate_round2.py new file mode 100644 index 00000000..55acbafa --- /dev/null +++ b/tests/test_deep_fragment_oss_reuse_gate_round2.py @@ -0,0 +1,60 @@ +import json +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[1] +PACKET = ROOT / "references/oracle/deep_fragment_oss_reuse_gate_round2_2026_07_19.json" +INDEX = ROOT / "references/oracle/evidence_packet_index_2026_07_19.json" + + +def _packet(): + return json.loads(PACKET.read_text(encoding="utf-8")) + + +def test_deep_fragment_gate_records_current_machine_scope(): + data = _packet() + assert data["scope"] == "deep_fragment_oss_reuse_gate_round2" + assert data["claim_status"] == "ready_contract" + assert data["production_tuning_allowed"] is False + assert data["truth_matrix_allowed"] is False + assert "/Users/wuyongnaren/Documents" in data["scanned_roots"] + assert "/private/tmp" in data["scanned_roots"] + + +def test_deep_fragment_gate_keeps_dangerous_fragments_quarantined(): + data = _packet() + fragments = {row["path"]: row for row in data["local_fragments"]} + assert fragments["/tmp/jyotisha-commercial-readonly.adiUr0/hip_main.dat"]["action"].startswith("quarantine") + + repos = {row["path"]: row for row in data["active_repositories"]} + assert repos["/Users/wuyongnaren/.workbuddy/backups/jyotish-vedic-astrology-20260711-154109"]["action"] == "read_only_do_not_bulk_copy" + assert repos["/private/tmp/vedicastro_diliprk_flatlib_src_1784467988"]["action"] == "dependency_identity_only_do_not_vendor" + + +def test_deep_fragment_gate_reuses_oss_without_license_drift(): + data = _packet() + policies = {row["project"]: row for row in data["oss_reuse_policy"]} + assert policies["naturalstupid/PyJHora"]["license_boundary"] == "AGPL-3.0" + assert "copy code" in policies["naturalstupid/PyJHora"]["blocked_use"] + assert "same-chart field observation" in policies["northtara/jyotishganit"]["allowed_use"] + assert "KP runtime raw/hash probe in isolated dependency path" in policies[ + "diliprk/VedicAstro + diliprk/flatlib@sidereal" + ]["allowed_use"] + + +def test_deep_fragment_gate_orders_remaining_tasks_by_reusable_sources(): + data = _packet() + tasks = {row["task"]: row for row in data["next_actions_ordered"]} + assert tasks["Shadbala component closure"]["priority"] == "P0" + assert "shadbala_same_unit_normalizer" in tasks["Shadbala component closure"]["reuse_first"] + assert tasks["KP cusp worked-example oracle queue"]["priority"] == "P0" + assert "vedicastro_kp_cusp_batch_probe" in tasks["KP cusp worked-example oracle queue"]["reuse_first"] + assert tasks["day-level holdout"]["priority"] == "P2" + + +def test_deep_fragment_gate_is_registered_in_evidence_index(): + packets = { + row["packet_id"]: row + for row in json.loads(INDEX.read_text(encoding="utf-8"))["packets"] + } + assert packets["deep_fragment_oss_reuse_gate_round2"]["claim_status"] == "ready_contract"