feat(sync): enforce one-way yinduzhanxing import policy

This commit is contained in:
Jesse
2026-08-06 11:25:34 +08:00
parent 49da8f9169
commit 685ed00e2f
5 changed files with 664 additions and 0 deletions
@@ -0,0 +1,66 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://jyotisha.chat/contracts/yinduzhanxing-import-manifest.v1.schema.json",
"title": "Yinduzhanxing one-way import manifest",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version", "source_repository", "source_commit", "source_tree_hash",
"source_mode", "target_repository", "target_base_commit", "policy_version",
"generated_at", "mirror_files", "semantic_merge_files", "protected_rejections",
"tests_run", "privacy_scan", "operator_review_required"
],
"properties": {
"schema_version": {"const": 1},
"source_repository": {"type": "string", "minLength": 1},
"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"]},
"target_repository": {"type": "string", "minLength": 1},
"target_base_commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"policy_version": {"const": 2},
"generated_at": {"type": "string", "format": "date-time"},
"mirror_files": {"type": "array", "items": {"$ref": "#/$defs/file"}},
"semantic_merge_files": {"type": "array", "items": {"$ref": "#/$defs/semantic"}},
"protected_rejections": {"type": "array", "items": {"type": "string"}},
"tests_run": {"type": "array", "items": {"type": "string"}},
"privacy_scan": {
"type": "object",
"additionalProperties": false,
"required": ["status", "scanned_files", "rejections"],
"properties": {
"status": {"enum": ["pass", "rejected"]},
"scanned_files": {"type": "integer", "minimum": 0},
"rejections": {"type": "array", "items": {"type": "string"}}
}
},
"operator_review_required": {"type": "boolean"}
},
"$defs": {
"file": {
"type": "object",
"additionalProperties": false,
"required": ["source", "target", "status", "source_sha256", "target_sha256_before", "target_sha256_after", "license"],
"properties": {
"source": {"type": "string"}, "target": {"type": "string"},
"status": {"enum": ["new", "update", "unchanged", "applied"]},
"source_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"target_sha256_before": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
"target_sha256_after": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"license": {"type": "string"}
}
},
"semantic": {
"type": "object",
"additionalProperties": false,
"required": ["path", "status", "source_sha256", "target_sha256", "diff_summary"],
"properties": {
"path": {"type": "string"},
"status": {"enum": ["unchanged", "source_missing", "target_missing", "review_required"]},
"source_sha256": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
"target_sha256": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
"diff_summary": {"type": "string"}
}
}
}
}
@@ -0,0 +1,52 @@
{
"schema_version": 2,
"direction": "research_to_commercial_only",
"source_repository": "732642856/yinduzhanxing",
"target_repository": "root/Jyotisha",
"reverse_sync": "forbidden",
"modes": {
"mirror": [
{
"source": "SKILL.md",
"target": "references/upstream/yinduzhanxing/SKILL.md",
"license": "MIT"
}
],
"semantic_merge": [
"SKILL.md",
"AGENTS.md",
"references/strict-workflow-router.md",
"scripts/unified_consultation_orchestrator.py",
"scripts/report_orchestrator.py",
"scripts/jyotish_api_server.py"
],
"protected": [
"frontend/**",
"deploy/**",
".gitea/**",
".github/**",
"frontend/db/**",
"frontend/supabase/**",
"references/oracle/commercial_skill_truth_overlay.v1.json",
"**/.env",
"**/.env.*",
"**/*payment*",
"**/*billing*",
"**/*subscription*",
"**/*entitlement*",
"**/*admin*",
"**/*service_role*"
]
},
"privacy": {
"forbidden_extensions": [".pem", ".key", ".p12", ".pfx", ".dump", ".sql.gz", ".pdf"],
"forbidden_basenames": [".env", "cookies.txt", "id_rsa", "id_ed25519"],
"content_markers": ["-----BEGIN PRIVATE KEY-----", "SUPABASE_SERVICE_ROLE_KEY=", "VEDASTRO_API_KEY=", "OPENAI_API_KEY=", "DATABASE_URL=postgres"]
},
"notes": [
"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."
]
}