Files
detect-policy-conflict-gs/scripts/main.py
taojianmin cd71f49709 v1.0.1: 制度文件冲突检测与合规审查 - 初版骨架
基于匠厂 skill-template 主仓 v1.0.108 派生的业务技能。

核心业务:
- 起草人在 OA 上传新制度送审稿时,自动比对校内现行制度库(约 300+ 份)
- 条款级冲突检测 + 程序合规性体检 + 疑似重复发文检测
- 在 Word 侧栏生成批注清单,一键跳转冲突原文

输出形态:
- 制度送审稿表状态更新(可送审 → 审查中 → 已通过 / 冲突中 / 驳回)
- 冲突条款清单 + HTML 审查报告 + 可选 PDF 导出

预期提效:制度出台后因"与 XX 文件冲突"而被要求暂停/修订的事件减少至零起。

业务行生命周期:可送审 → 审查中 → 已通过 / 冲突中 / 驳回 / 已跳过

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-14 12:19:05 +08:00

92 lines
2.4 KiB
Python

#!/usr/bin/env python3
"""制度文件冲突检测与合规审查 - CLI 入口(占位骨架)"""
import sys
from pathlib import Path
# 占位:开发者后续接入 jiangchang_skill_core
# from jiangchang_skill_core import ...
BASE_DIR = Path(__file__).resolve().parent.parent
def health():
"""运行检查(占位)。"""
print(f"detect-policy-conflict-gs health check (placeholder)")
print(f"base_dir: {BASE_DIR}")
return 0
def version():
"""查看版本(占位)。"""
print("detect-policy-conflict-gs v1.0.1")
return 0
def config_path():
"""查看配置位置(占位)。"""
print(f"{BASE_DIR / '.env'}")
return 0
def init_db():
"""初始化数据库(占位)。"""
print("init-db: 后续由开发者按 references/SCHEMA.md 实现")
return 0
def audit_policy_draft(draft_id: str):
"""审查送审稿(占位)。"""
print(f"audit-policy-draft: {draft_id} (待开发者实现)")
return 0
def recheck_conflict_clause(clause_id: str):
"""重新比对冲突条款(占位)。"""
print(f"recheck-conflict-clause: {clause_id} (待开发者实现)")
return 0
def export_review_report(draft_id: str, fmt: str = "pdf"):
"""导出审查报告(占位)。"""
print(f"export-review-report: {draft_id} format={fmt} (待开发者实现)")
return 0
def mark_policy_status(draft_id: str, target_status: str):
"""标记送审稿状态(占位)。"""
print(f"mark-policy-status: {draft_id} -> {target_status} (待开发者实现)")
return 0
def rescan_pending_drafts():
"""定时扫描存量送审稿(占位)。"""
print("rescan-pending-drafts (待开发者实现)")
return 0
COMMANDS = {
"health": health,
"version": version,
"config-path": config_path,
"init-db": init_db,
"audit-policy-draft": audit_policy_draft,
"recheck-conflict-clause": recheck_conflict_clause,
"export-review-report": export_review_report,
"mark-policy-status": mark_policy_status,
"rescan-pending-drafts": rescan_pending_drafts,
}
def main(argv=None):
argv = argv or sys.argv[1:]
if not argv or argv[0] not in COMMANDS:
print("Usage: python scripts/main.py <command>")
print("Commands:", ", ".join(COMMANDS.keys()))
return 1
return COMMANDS[argv[0]](*argv[1:])
if __name__ == "__main__":
sys.exit(main())