From 6eea3f8261b29c9419e65e8f38e87b078fdcc8ea Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 1 May 2026 20:53:00 +0800 Subject: [PATCH] docs: localize phase 13 legal materials --- .../README.md | 42 ++-- .../clause-library/README.md | 13 +- .../clause-library/common/README.md | 4 +- .../clause-library/labor-service/README.md | 4 +- .../clause-library/nda/README.md | 4 +- .../clause-library/purchase/README.md | 4 +- .../clause-library/service/README.md | 4 +- .../clause-library/software-saas/README.md | 4 +- .../technology-development/README.md | 4 +- .../contract-templates/README.md | 13 +- .../labor-service/README.md | 4 +- .../contract-templates/nda/README.md | 4 +- .../contract-templates/purchase/README.md | 4 +- .../contract-templates/service/README.md | 4 +- .../software-saas/README.md | 4 +- .../technology-development/README.md | 4 +- .../evidence/README.md | 10 +- .../field-dictionary.md | 68 +++--- .../governance-rules.md | 73 +++---- .../inventories/README.md | 13 +- .../inventories/legal-source-inventory.csv | 40 ++-- .../legal-sources/README.md | 13 +- .../legal-sources/civil-code/README.md | 4 +- .../company-commercial/README.md | 4 +- .../legal-sources/data-privacy/README.md | 4 +- .../intellectual-property/README.md | 4 +- .../judicial-interpretations/README.md | 4 +- .../legal-sources/labor-employment/README.md | 4 +- .../procurement-tendering/README.md | 4 +- .../qa-samples/README.md | 11 +- .../qa-samples/generation/README.md | 4 +- .../qa-samples/kb-qa/README.md | 4 +- .../qa-samples/review/README.md | 4 +- ...¾‹知识库与合同模板库建设闭环方案-2026-05-01.md | 44 ++-- ...“与合同模板库建设闭环第一批执行记录-2026-05-01.md | 8 +- scripts/run-legal-knowledge-library-gate.ps1 | 194 ++++++++++++------ 36 files changed, 370 insertions(+), 264 deletions(-) diff --git a/project-docs/phase13-legal-knowledge-template-library/README.md b/project-docs/phase13-legal-knowledge-template-library/README.md index cce9d5db..4d12dc79 100644 --- a/project-docs/phase13-legal-knowledge-template-library/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/README.md @@ -1,28 +1,28 @@ -# Phase 13 Legal Knowledge And Template Library +# 阶段 13 法律知识库与合同模板库资料包 -This package is the production pilot data foundation for the AI Contract Platform legal knowledge base and contract template library. +本目录是 AI 合同平台法律知识库和合同模板库的生产试点资料底座。资料范围限定为中国大陆企业民商事合同场景,所有审核规则、知识卡、标准条款和合同模板都必须以中国现行法律、司法解释、部门规章或官方规则为依据。 -Current scope: +当前资料范围: -1. Mainland China enterprise civil and commercial contract scenarios. -2. Official legal source inventory. -3. Legal knowledge card schema. -4. Contract review risk rule schema. -5. Standard clause library schema. -6. Contract template schema. -7. Golden sample schema for review, generation, and KB Q&A. -8. Expert review register schema. +1. 中国大陆企业民商事合同场景。 +2. 官方法源清单。 +3. 法律知识卡字段规范。 +4. 合同审核风险规则字段规范。 +5. 标准条款库字段规范。 +6. 合同模板库字段规范。 +7. 合同审核、合同生成和知识库问答黄金样本字段规范。 +8. 法律专家和业务负责人复核登记规范。 -Important rules: +重要规则: -1. Do not store real customer contracts, personal information, secrets, Webhook URLs, or administrator passwords in this package. -2. Third-party articles may only be clues. They cannot be final legal authority. -3. A source can become production-ready only after official source detail, validity, and legal reviewer fields are completed. -4. Generated contracts and review findings must cite source IDs instead of unsupported model memory. -5. This package supports legal and business review. It does not replace advice from qualified legal professionals. +1. 不得在本资料包中保存真实客户合同、个人信息、密钥、网络回调地址或管理员密码。 +2. 第三方文章、公众号、博客、模型回答只能作为线索,不能作为最终法律依据。 +3. 法源只有补齐官方来源、有效状态、适用范围和法务复核记录后,才允许进入生产试点。 +4. 合同生成结果和审核结果必须引用法源编号、知识卡编号、条款编号或规则编号,不能依赖无依据的模型记忆。 +5. 本资料包用于支持法律和业务复核,不替代执业律师或企业法务的专业意见。 -Status: +当前状态: -- Phase 13.0 schema baseline: in progress. -- Phase 13.1 official source inventory: in progress. -- Production publishing: blocked until legal/business review is complete. +1. 阶段 13.0 资料结构和字段规范已建立。 +2. 阶段 13.1 第一批官方法源采集任务已建立。 +3. 生产发布仍需等待法务复核和业务复核完成。 diff --git a/project-docs/phase13-legal-knowledge-template-library/clause-library/README.md b/project-docs/phase13-legal-knowledge-template-library/clause-library/README.md index b7a4e11f..0048ea6c 100644 --- a/project-docs/phase13-legal-knowledge-template-library/clause-library/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/clause-library/README.md @@ -1,3 +1,12 @@ -# Clause Library +# 标准条款库 -Standard clauses will be added after legal source and review rule baselines are approved. Every clause must be listed in `inventories/clause-library-inventory.csv`. +本目录用于保存中国大陆合同场景下的标准条款。所有条款必须引用已登记的中国官方法源,并经过法务或业务复核。 + +条款进入平台前必须登记到 `inventories/clause-library-inventory.csv`。 + +条款要求: + +1. 使用中文正文。 +2. 明确适用合同类型、适用条件和排除条件。 +3. 标明对应法源、审核规则和风险提示。 +4. 不得引用境外法律条款或国外模板条款作为默认文本。 diff --git a/project-docs/phase13-legal-knowledge-template-library/clause-library/common/README.md b/project-docs/phase13-legal-knowledge-template-library/clause-library/common/README.md index 087b0830..605c7460 100644 --- a/project-docs/phase13-legal-knowledge-template-library/clause-library/common/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/clause-library/common/README.md @@ -1,3 +1,3 @@ -# Common Clauses +# 通用条款 -Scope: definitions, payment, delivery, acceptance, breach, termination, force majeure, notice, governing law, and dispute resolution. +范围:定义、付款、交付、验收、违约、解除、不可抗力、通知、法律适用和争议解决等中国合同通用条款。 diff --git a/project-docs/phase13-legal-knowledge-template-library/clause-library/labor-service/README.md b/project-docs/phase13-legal-knowledge-template-library/clause-library/labor-service/README.md index 085e582c..b3a80594 100644 --- a/project-docs/phase13-legal-knowledge-template-library/clause-library/labor-service/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/clause-library/labor-service/README.md @@ -1,3 +1,3 @@ -# Labor And Service Clauses +# 劳动与劳务相关条款 -Scope: labor service boundary, work scope, fee, confidentiality, compliance, and employment-risk warnings. +范围:劳动关系与劳务关系边界、工作内容、费用或报酬、保密、合规义务和用工风险提示等条款。 diff --git a/project-docs/phase13-legal-knowledge-template-library/clause-library/nda/README.md b/project-docs/phase13-legal-knowledge-template-library/clause-library/nda/README.md index ac3ec739..3e1de761 100644 --- a/project-docs/phase13-legal-knowledge-template-library/clause-library/nda/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/clause-library/nda/README.md @@ -1,3 +1,3 @@ -# NDA Clauses +# 保密协议条款 -Scope: confidential information, exclusions, confidentiality term, use restrictions, breach, and return/destruction. +范围:保密信息定义、例外信息、保密期限、使用限制、违约责任、资料返还或销毁等保密协议条款。 diff --git a/project-docs/phase13-legal-knowledge-template-library/clause-library/purchase/README.md b/project-docs/phase13-legal-knowledge-template-library/clause-library/purchase/README.md index 7f0a8dec..c4cbe218 100644 --- a/project-docs/phase13-legal-knowledge-template-library/clause-library/purchase/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/clause-library/purchase/README.md @@ -1,3 +1,3 @@ -# Purchase Clauses +# 采购合同条款 -Scope: purchase order, delivery, quality acceptance, payment, warranty, and return/replacement clauses. +范围:采购订单、交付、质量验收、付款、质保、退换货、违约责任和争议解决等采购合同条款。 diff --git a/project-docs/phase13-legal-knowledge-template-library/clause-library/service/README.md b/project-docs/phase13-legal-knowledge-template-library/clause-library/service/README.md index 50983546..e42b9b78 100644 --- a/project-docs/phase13-legal-knowledge-template-library/clause-library/service/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/clause-library/service/README.md @@ -1,3 +1,3 @@ -# Service Clauses +# 服务合同条款 -Scope: service scope, milestones, acceptance, service level, payment, and breach clauses. +范围:服务范围、里程碑、验收标准、服务质量、服务费用、违约责任和解除终止等服务合同条款。 diff --git a/project-docs/phase13-legal-knowledge-template-library/clause-library/software-saas/README.md b/project-docs/phase13-legal-knowledge-template-library/clause-library/software-saas/README.md index 883883cf..20d69f28 100644 --- a/project-docs/phase13-legal-knowledge-template-library/clause-library/software-saas/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/clause-library/software-saas/README.md @@ -1,3 +1,3 @@ -# Software And SaaS Clauses +# 软件与软件即服务条款 -Scope: software license, SaaS service level, data processing, cybersecurity, account management, and service suspension. +范围:软件许可、软件即服务等级、数据处理、网络安全、账号管理、服务暂停、服务终止和数据返还等条款。 diff --git a/project-docs/phase13-legal-knowledge-template-library/clause-library/technology-development/README.md b/project-docs/phase13-legal-knowledge-template-library/clause-library/technology-development/README.md index fed041c2..e36a1f1a 100644 --- a/project-docs/phase13-legal-knowledge-template-library/clause-library/technology-development/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/clause-library/technology-development/README.md @@ -1,3 +1,3 @@ -# Technology Development Clauses +# 技术开发合同条款 -Scope: deliverables, milestones, technical成果, acceptance, IP ownership, confidentiality, and maintenance. +范围:交付物、开发里程碑、技术成果、验收标准、知识产权归属、保密义务、维护支持和违约责任等条款。 diff --git a/project-docs/phase13-legal-knowledge-template-library/contract-templates/README.md b/project-docs/phase13-legal-knowledge-template-library/contract-templates/README.md index 463af9a2..7e56d1bc 100644 --- a/project-docs/phase13-legal-knowledge-template-library/contract-templates/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/contract-templates/README.md @@ -1,3 +1,12 @@ -# Contract Templates +# 合同模板库 -Production templates will be added after clause library and variable schema review. Every template must be listed in `inventories/contract-template-inventory.csv`. +本目录用于保存生产试点可用的中文合同模板。所有模板必须适用于中国大陆企业民商事合同场景,并绑定中国官方法源、标准条款、变量结构说明、审核规则和生成验收样本。 + +模板进入平台前必须登记到 `inventories/contract-template-inventory.csv`。 + +模板要求: + +1. 模板正文必须为中文。 +2. 变量名、提示语、默认值、必填校验说明必须为中文。 +3. 模板条款必须来自本阶段标准条款库或经过法务复核。 +4. 不得使用国外合同模板作为默认模板。 diff --git a/project-docs/phase13-legal-knowledge-template-library/contract-templates/labor-service/README.md b/project-docs/phase13-legal-knowledge-template-library/contract-templates/labor-service/README.md index e8a64e7f..de70b7c1 100644 --- a/project-docs/phase13-legal-knowledge-template-library/contract-templates/labor-service/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/contract-templates/labor-service/README.md @@ -1,3 +1,3 @@ -# Labor And Service Templates +# 劳动与劳务相关协议模板 -Planned first-batch template: labor/service-related agreement. +第一批计划模板:中文劳动或劳务相关协议。模板必须明确劳动关系与劳务关系边界,并提示用工合规风险。 diff --git a/project-docs/phase13-legal-knowledge-template-library/contract-templates/nda/README.md b/project-docs/phase13-legal-knowledge-template-library/contract-templates/nda/README.md index 6dc28ab3..b944b16f 100644 --- a/project-docs/phase13-legal-knowledge-template-library/contract-templates/nda/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/contract-templates/nda/README.md @@ -1,3 +1,3 @@ -# NDA Templates +# 保密协议模板 -Planned first-batch template: non-disclosure agreement. +第一批计划模板:中文保密协议。模板应覆盖保密信息、保密义务、例外情形、保密期限、违约责任、资料返还或销毁。 diff --git a/project-docs/phase13-legal-knowledge-template-library/contract-templates/purchase/README.md b/project-docs/phase13-legal-knowledge-template-library/contract-templates/purchase/README.md index 4a40f652..49649995 100644 --- a/project-docs/phase13-legal-knowledge-template-library/contract-templates/purchase/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/contract-templates/purchase/README.md @@ -1,3 +1,3 @@ -# Purchase Contract Templates +# 采购合同模板 -Planned first-batch template: purchase contract. +第一批计划模板:中文采购合同。模板应覆盖采购标的、数量、价格、交付、验收、付款、质保、违约责任和争议解决。 diff --git a/project-docs/phase13-legal-knowledge-template-library/contract-templates/service/README.md b/project-docs/phase13-legal-knowledge-template-library/contract-templates/service/README.md index ccf254ad..df05bc0b 100644 --- a/project-docs/phase13-legal-knowledge-template-library/contract-templates/service/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/contract-templates/service/README.md @@ -1,3 +1,3 @@ -# Service Contract Templates +# 服务合同模板 -Planned first-batch template: service contract. +第一批计划模板:中文服务合同。模板应覆盖服务范围、服务期限、服务标准、验收、付款、保密、违约责任和解除终止。 diff --git a/project-docs/phase13-legal-knowledge-template-library/contract-templates/software-saas/README.md b/project-docs/phase13-legal-knowledge-template-library/contract-templates/software-saas/README.md index 9aa105f9..a6c2db4b 100644 --- a/project-docs/phase13-legal-knowledge-template-library/contract-templates/software-saas/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/contract-templates/software-saas/README.md @@ -1,3 +1,3 @@ -# Software And SaaS Templates +# 软件与软件即服务合同模板 -Planned first-batch template: software/SaaS service contract. +第一批计划模板:中文软件或软件即服务合同。模板应覆盖服务内容、账号权限、服务等级、数据处理、网络安全、费用、服务暂停和终止。 diff --git a/project-docs/phase13-legal-knowledge-template-library/contract-templates/technology-development/README.md b/project-docs/phase13-legal-knowledge-template-library/contract-templates/technology-development/README.md index 948685a1..86de211b 100644 --- a/project-docs/phase13-legal-knowledge-template-library/contract-templates/technology-development/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/contract-templates/technology-development/README.md @@ -1,3 +1,3 @@ -# Technology Development Templates +# 技术开发合同模板 -Planned first-batch template: technology development contract. +第一批计划模板:中文技术开发合同。模板应覆盖开发目标、技术要求、里程碑、交付物、验收、知识产权归属、保密和违约责任。 diff --git a/project-docs/phase13-legal-knowledge-template-library/evidence/README.md b/project-docs/phase13-legal-knowledge-template-library/evidence/README.md index 618f7809..bd6b8673 100644 --- a/project-docs/phase13-legal-knowledge-template-library/evidence/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/evidence/README.md @@ -1,3 +1,9 @@ -# Evidence +# 证据目录 -This folder stores Phase 13 gate outputs, legal review evidence, import dry-run evidence, and production pilot publication evidence. +本目录用于保存阶段 13 的自动化门禁结果、法务复核证据、导入演练证据和生产试点发布证据。 + +证据要求: + +1. 证据文件不得包含真实客户合同、个人信息、密钥、网络回调地址或管理员密码。 +2. 法务复核证据必须能追溯到资料编号和复核人。 +3. 导入和发布证据必须能说明资料是否进入知识库、条款库、模板库或黄金样本集。 diff --git a/project-docs/phase13-legal-knowledge-template-library/field-dictionary.md b/project-docs/phase13-legal-knowledge-template-library/field-dictionary.md index e1dac35a..e15b61f2 100644 --- a/project-docs/phase13-legal-knowledge-template-library/field-dictionary.md +++ b/project-docs/phase13-legal-knowledge-template-library/field-dictionary.md @@ -1,41 +1,45 @@ -# Phase 13 Field Dictionary +# 阶段 13 字段字典 -## Common Fields +## 通用字段 -| Field | Meaning | +| 字段 | 含义 | |---|---| -| status | Lifecycle status: DRAFT, LEGAL_REVIEW, BUSINESS_REVIEW, APPROVED, PUBLISHED, DEPRECATED | -| owner | Asset owner responsible for maintenance | -| legal_reviewer | Legal reviewer; pending values cannot be published | -| business_reviewer | Business reviewer; pending values cannot be published | -| source_ids | Semicolon-separated legal source IDs | -| review_required | true when legal or business review is required before pilot import | -| production_ready | true only after review and gate pass | +| status | 资料生命周期状态:DRAFT、LEGAL_REVIEW、BUSINESS_REVIEW、APPROVED、PUBLISHED、DEPRECATED | +| owner | 资料维护负责人 | +| legal_reviewer | 法务复核人;未填写或待复核时不得发布 | +| business_reviewer | 业务复核人;未填写或待复核时不得发布 | +| source_ids | 关联的官方法源编号,多个编号用分号分隔 | +| review_required | 是否需要法务或业务复核后才能进入试点导入 | +| production_ready | 是否已具备生产试点导入条件 | -## Legal Source Fields +## 法源字段 -| Field | Meaning | +| 字段 | 含义 | |---|---| -| source_id | Unique legal source ID | -| title | Source title | -| source_type | law, judicial_interpretation, administrative_regulation, departmental_rule, official_guidance | -| issuer | Issuing authority | -| official_domain | Official source domain | -| source_url | Official portal or detail URL | -| retrieval_hint | How to retrieve the source from official portal | -| effective_date | Effective date or VERIFY_REQUIRED | -| validity_status | EFFECTIVE, DEPRECATED, SUPERSEDED, VERIFY_REQUIRED | -| contract_scope | Contract scenarios covered | -| knowledge_domain | Phase 13 domain folder | +| source_id | 唯一法源编号 | +| title | 法源名称 | +| source_type | 法源类型,例如法律、司法解释、行政法规、部门规章、官方指引 | +| issuer | 发布机关 | +| official_domain | 官方来源域名 | +| source_url | 官方入口或官方详情页地址 | +| retrieval_hint | 在官方入口中检索该法源的方法 | +| effective_date | 施行日期;未确认时填写 VERIFY_REQUIRED | +| validity_status | 有效状态:EFFECTIVE、DEPRECATED、SUPERSEDED、VERIFY_REQUIRED | +| contract_scope | 适用的合同场景 | +| knowledge_domain | 阶段 13 资料域目录 | -## Template Fields +## 合同模板字段 -| Field | Meaning | +| 字段 | 含义 | |---|---| -| template_id | Unique template ID | -| template_name | User-facing template name | -| contract_type | Contract type | -| variable_schema_path | Schema file path for variables | -| clause_ids | Bound standard clause IDs | -| generation_sample_ids | Bound generation sample IDs | -| review_rule_ids | Bound review rules | +| template_id | 唯一模板编号 | +| template_name | 面向用户展示的模板名称 | +| contract_type | 合同类型 | +| variable_schema_path | 模板变量结构说明文件路径 | +| clause_ids | 绑定的标准条款编号 | +| generation_sample_ids | 绑定的合同生成黄金样本编号 | +| review_rule_ids | 绑定的合同审核规则编号 | + +## 使用说明 + +字段名保留英文是为了让自动化门禁和后续导入脚本稳定识别;字段内容、业务说明、法源说明、条款说明和模板正文必须使用中文,并且必须以中国大陆现行法律资料为依据。 diff --git a/project-docs/phase13-legal-knowledge-template-library/governance-rules.md b/project-docs/phase13-legal-knowledge-template-library/governance-rules.md index 34eafdc4..e9d7b028 100644 --- a/project-docs/phase13-legal-knowledge-template-library/governance-rules.md +++ b/project-docs/phase13-legal-knowledge-template-library/governance-rules.md @@ -1,49 +1,52 @@ -# Phase 13 Governance Rules +# 阶段 13 资料治理规则 -## Scope +## 适用范围 -Default jurisdiction is mainland China. Default business scope is enterprise civil and commercial contracts. +默认法域为中国大陆。默认业务范围为企业民商事合同,包括采购合同、服务合同、保密协议、软件或软件即服务合同、技术开发合同、劳动或劳务相关协议。 -## Allowed Statuses +本资料包不得混入外国法律、境外判例、境外合同模板或未经确认适用中国大陆场景的外部条款。 -| Status | Meaning | +## 允许状态 + +| 状态 | 含义 | |---|---| -| DRAFT | Created but not reviewed | -| LEGAL_REVIEW | Waiting for legal professional review | -| BUSINESS_REVIEW | Waiting for business owner review | -| APPROVED | Reviewed and can enter pilot import | -| PUBLISHED | Imported into pilot or production environment | -| DEPRECATED | Superseded or no longer valid | +| DRAFT | 已创建但尚未复核 | +| LEGAL_REVIEW | 等待法务或法律专业人员复核 | +| BUSINESS_REVIEW | 等待业务负责人复核 | +| APPROVED | 已复核,可进入试点导入 | +| PUBLISHED | 已导入试点或生产环境 | +| DEPRECATED | 已被替代、失效或不再使用 | -## ID Prefixes +## 编号前缀 -| Prefix | Asset | +| 前缀 | 资料类型 | |---|---| -| LAW | Official legal source | -| KC | Legal knowledge card | -| RULE | Contract review risk rule | -| CLAUSE | Standard clause | -| TPL | Contract template | -| REVIEW-SAMPLE | Review golden sample | -| GEN-SAMPLE | Generation golden sample | -| KBQA-SAMPLE | KB Q&A golden sample | -| EXPERT | Expert review record | +| LAW | 官方法源 | +| KC | 法律知识卡 | +| RULE | 合同审核风险规则 | +| CLAUSE | 标准条款 | +| TPL | 合同模板 | +| REVIEW-SAMPLE | 合同审核黄金样本 | +| GEN-SAMPLE | 合同生成黄金样本 | +| KBQA-SAMPLE | 知识库问答黄金样本 | +| EXPERT | 专家复核记录 | -## Production Readiness +## 生产就绪条件 -An asset is not production-ready unless: +资料必须同时满足以下条件,才允许进入生产试点: -1. Source IDs are traceable to official domains. -2. Validity status is verified. -3. Legal reviewer is recorded for legal assets. -4. Business reviewer is recorded for business templates or clauses. -5. Regression or acceptance sample is recorded. +1. 法源编号可以追溯到官方域名。 +2. 法源有效状态已经确认。 +3. 法律类资料已记录法务复核人。 +4. 模板或条款类资料已记录业务复核人。 +5. 已绑定回归样本或验收样本。 -## Refusal Boundary +## 拒答和人工复核边界 -The platform must refuse or ask for human review when: +平台在以下情况下必须拒答、提示不确定,或要求人工复核: -1. The requested contract type is outside the approved template scope. -2. The legal source is missing or not verified. -3. The answer would require legal judgment beyond the knowledge card. -4. A high-risk clause has no approved fallback wording. +1. 用户请求的合同类型超出已批准模板范围。 +2. 法源缺失、未确认有效,或未通过法务复核。 +3. 问题需要超出知识卡边界的法律判断。 +4. 高风险条款没有已批准的替代文本。 +5. 合同内容涉及真实客户敏感信息、个人信息、商业秘密或跨境法律适用问题。 diff --git a/project-docs/phase13-legal-knowledge-template-library/inventories/README.md b/project-docs/phase13-legal-knowledge-template-library/inventories/README.md index 30c0558a..70d2be4d 100644 --- a/project-docs/phase13-legal-knowledge-template-library/inventories/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/inventories/README.md @@ -1,9 +1,10 @@ -# Phase 13 Inventories +# 阶段 13 清单目录 -Inventories are the only approved entry point for Phase 13 assets. Every legal source, knowledge card, rule, clause, template, sample, and review record must be listed here before it can be imported into the platform. +本目录是阶段 13 资料进入平台的唯一登记入口。任何法源、法律知识卡、审核规则、标准条款、合同模板、黄金样本和专家复核记录,都必须先登记到对应清单,再允许进入导入、索引、审核或生成流程。 -First-batch rule: +第一批规则: -1. `legal-source-inventory.csv` may contain official source collection targets with `VERIFY_REQUIRED`. -2. No asset may be marked `PUBLISHED` until legal/business review is complete. -3. Header-only inventories are allowed during Phase 13.0, but they must pass schema checks. +1. `legal-source-inventory.csv` 可以登记待复核的官方法源采集任务,并使用 `VERIFY_REQUIRED` 标记待确认信息。 +2. 法务或业务复核完成前,任何资料都不得标记为 `PUBLISHED`。 +3. 阶段 13.0 允许存在只有表头的清单,但必须通过字段结构门禁。 +4. 清单内容必须使用中文业务描述;字段名和状态枚举保留英文,是为了让自动化脚本稳定识别。 diff --git a/project-docs/phase13-legal-knowledge-template-library/inventories/legal-source-inventory.csv b/project-docs/phase13-legal-knowledge-template-library/inventories/legal-source-inventory.csv index 20046a10..09e9ba86 100644 --- a/project-docs/phase13-legal-knowledge-template-library/inventories/legal-source-inventory.csv +++ b/project-docs/phase13-legal-knowledge-template-library/inventories/legal-source-inventory.csv @@ -1,21 +1,21 @@ source_id,title,source_type,issuer,official_domain,source_url,retrieval_hint,effective_date,validity_status,contract_scope,knowledge_domain,review_required,status,owner,legal_reviewer,collection_date,notes -LAW-CIVIL-001,中华人民共和国民法典,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国民法典,2021-01-01,VERIFY_REQUIRED,合同通用;合同编;civil liability,civil-code,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,第一批核心法源;需补充官方详情页和条款索引 -LAW-CONTRACT-001,最高人民法院关于适用中华人民共和国民法典合同编通则若干问题的解释,judicial_interpretation,最高人民法院,www.court.gov.cn,https://www.court.gov.cn/,最高人民法院官网检索:民法典 合同编 通则 解释,VERIFY_REQUIRED,VERIFY_REQUIRED,合同通用;合同成立;效力;履行,judicial-interpretations,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,需法务确认法释编号和施行日期 -LAW-COMPANY-001,中华人民共和国公司法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国公司法,VERIFY_REQUIRED,VERIFY_REQUIRED,主体资格;授权代表;公司治理,company-commercial,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于主体资格和授权审核 -LAW-LABOR-001,中华人民共和国劳动合同法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国劳动合同法,VERIFY_REQUIRED,VERIFY_REQUIRED,劳动合同;劳务边界,labor-employment,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于劳动与劳务模板边界 -LAW-LABOR-002,中华人民共和国劳动法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国劳动法,VERIFY_REQUIRED,VERIFY_REQUIRED,劳动用工;劳动保护,labor-employment,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于劳动相关合同风险识别 -LAW-TENDER-001,中华人民共和国招标投标法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国招标投标法,VERIFY_REQUIRED,VERIFY_REQUIRED,采购;招投标,procurement-tendering,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于采购合同合规边界 -LAW-PROCUREMENT-001,中华人民共和国政府采购法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国政府采购法,VERIFY_REQUIRED,VERIFY_REQUIRED,政府采购;采购流程,procurement-tendering,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于政府采购场景提示 -LAW-DATA-001,中华人民共和国个人信息保护法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国个人信息保护法,VERIFY_REQUIRED,VERIFY_REQUIRED,个人信息;数据处理;隐私,data-privacy,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于数据处理和隐私条款 -LAW-DATA-002,中华人民共和国数据安全法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国数据安全法,VERIFY_REQUIRED,VERIFY_REQUIRED,数据安全;数据处理,data-privacy,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于数据安全条款和审核 -LAW-DATA-003,中华人民共和国网络安全法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国网络安全法,VERIFY_REQUIRED,VERIFY_REQUIRED,网络服务;SaaS;数据安全,data-privacy,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于软件和SaaS合同条款 -LAW-IP-001,中华人民共和国著作权法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国著作权法,VERIFY_REQUIRED,VERIFY_REQUIRED,知识产权;软件著作权,intellectual-property,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于软件服务和技术开发模板 -LAW-IP-002,中华人民共和国专利法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国专利法,VERIFY_REQUIRED,VERIFY_REQUIRED,知识产权;技术成果,intellectual-property,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于技术开发成果归属 -LAW-IP-003,中华人民共和国商标法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国商标法,VERIFY_REQUIRED,VERIFY_REQUIRED,品牌授权;商标使用,intellectual-property,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于品牌和商标授权条款 -LAW-COMMERCIAL-001,中华人民共和国反不正当竞争法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国反不正当竞争法,VERIFY_REQUIRED,VERIFY_REQUIRED,商业秘密;竞争限制,company-commercial,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于保密和竞争相关条款 -LAW-ARBITRATION-001,中华人民共和国仲裁法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国仲裁法,VERIFY_REQUIRED,VERIFY_REQUIRED,争议解决;仲裁,company-commercial,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于争议解决条款 -LAW-CIVIL-PROCEDURE-001,中华人民共和国民事诉讼法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国民事诉讼法,VERIFY_REQUIRED,VERIFY_REQUIRED,争议解决;管辖,company-commercial,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于管辖和诉讼条款 -LAW-E-SIGN-001,中华人民共和国电子签名法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国电子签名法,VERIFY_REQUIRED,VERIFY_REQUIRED,电子签约;电子数据,company-commercial,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于电子合同签署场景 -LAW-E-COMMERCE-001,中华人民共和国电子商务法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国电子商务法,VERIFY_REQUIRED,VERIFY_REQUIRED,SaaS;平台服务;线上交易,company-commercial,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于线上服务合同边界 -LAW-MARKET-001,中华人民共和国消费者权益保护法,law,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国消费者权益保护法,VERIFY_REQUIRED,VERIFY_REQUIRED,服务合同;消费者场景,company-commercial,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,用于B2C服务合同提示 -LAW-TECH-001,最高人民法院关于审理技术合同纠纷案件适用法律若干问题的解释,judicial_interpretation,最高人民法院,www.court.gov.cn,https://www.court.gov.cn/,最高人民法院官网检索:技术合同纠纷 司法解释,VERIFY_REQUIRED,VERIFY_REQUIRED,技术开发;技术服务,judicial-interpretations,true,LEGAL_REVIEW,legal-ops,pending,2026-05-01,需法务确认现行有效版本 +LAW-CIVIL-001,中华人民共和国民法典,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国民法典,2021-01-01,VERIFY_REQUIRED,合同通用;合同编;民事责任,civil-code,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,第一批核心法源;需补充官方详情页和条款索引 +LAW-CONTRACT-001,最高人民法院关于适用中华人民共和国民法典合同编通则若干问题的解释,司法解释,最高人民法院,www.court.gov.cn,https://www.court.gov.cn/,最高人民法院官网检索:民法典 合同编 通则 解释,VERIFY_REQUIRED,VERIFY_REQUIRED,合同通用;合同成立;效力;履行,judicial-interpretations,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,需法务确认法释编号和施行日期 +LAW-COMPANY-001,中华人民共和国公司法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国公司法,VERIFY_REQUIRED,VERIFY_REQUIRED,主体资格;授权代表;公司治理,company-commercial,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于主体资格和授权审核 +LAW-LABOR-001,中华人民共和国劳动合同法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国劳动合同法,VERIFY_REQUIRED,VERIFY_REQUIRED,劳动合同;劳务边界,labor-employment,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于劳动与劳务模板边界 +LAW-LABOR-002,中华人民共和国劳动法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国劳动法,VERIFY_REQUIRED,VERIFY_REQUIRED,劳动用工;劳动保护,labor-employment,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于劳动相关合同风险识别 +LAW-TENDER-001,中华人民共和国招标投标法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国招标投标法,VERIFY_REQUIRED,VERIFY_REQUIRED,采购;招投标,procurement-tendering,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于采购合同合规边界 +LAW-PROCUREMENT-001,中华人民共和国政府采购法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国政府采购法,VERIFY_REQUIRED,VERIFY_REQUIRED,政府采购;采购流程,procurement-tendering,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于政府采购场景提示 +LAW-DATA-001,中华人民共和国个人信息保护法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国个人信息保护法,VERIFY_REQUIRED,VERIFY_REQUIRED,个人信息;数据处理;隐私,data-privacy,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于数据处理和隐私条款 +LAW-DATA-002,中华人民共和国数据安全法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国数据安全法,VERIFY_REQUIRED,VERIFY_REQUIRED,数据安全;数据处理,data-privacy,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于数据安全条款和审核 +LAW-DATA-003,中华人民共和国网络安全法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国网络安全法,VERIFY_REQUIRED,VERIFY_REQUIRED,网络服务;软件即服务;数据安全,data-privacy,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于软件和软件即服务合同条款 +LAW-IP-001,中华人民共和国著作权法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国著作权法,VERIFY_REQUIRED,VERIFY_REQUIRED,知识产权;软件著作权,intellectual-property,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于软件服务和技术开发模板 +LAW-IP-002,中华人民共和国专利法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国专利法,VERIFY_REQUIRED,VERIFY_REQUIRED,知识产权;技术成果,intellectual-property,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于技术开发成果归属 +LAW-IP-003,中华人民共和国商标法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国商标法,VERIFY_REQUIRED,VERIFY_REQUIRED,品牌授权;商标使用,intellectual-property,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于品牌和商标授权条款 +LAW-COMMERCIAL-001,中华人民共和国反不正当竞争法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国反不正当竞争法,VERIFY_REQUIRED,VERIFY_REQUIRED,商业秘密;竞争限制,company-commercial,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于保密和竞争相关条款 +LAW-ARBITRATION-001,中华人民共和国仲裁法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国仲裁法,VERIFY_REQUIRED,VERIFY_REQUIRED,争议解决;仲裁,company-commercial,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于争议解决条款 +LAW-CIVIL-PROCEDURE-001,中华人民共和国民事诉讼法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国民事诉讼法,VERIFY_REQUIRED,VERIFY_REQUIRED,争议解决;管辖,company-commercial,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于管辖和诉讼条款 +LAW-E-SIGN-001,中华人民共和国电子签名法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国电子签名法,VERIFY_REQUIRED,VERIFY_REQUIRED,电子签约;电子数据,company-commercial,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于电子合同签署场景 +LAW-E-COMMERCE-001,中华人民共和国电子商务法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国电子商务法,VERIFY_REQUIRED,VERIFY_REQUIRED,软件即服务;平台服务;线上交易,company-commercial,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于线上服务合同边界 +LAW-MARKET-001,中华人民共和国消费者权益保护法,法律,全国人民代表大会,flk.npc.gov.cn,https://flk.npc.gov.cn/,国家法律法规数据库检索:中华人民共和国消费者权益保护法,VERIFY_REQUIRED,VERIFY_REQUIRED,服务合同;消费者场景,company-commercial,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,用于面向消费者服务合同提示 +LAW-TECH-001,最高人民法院关于审理技术合同纠纷案件适用法律若干问题的解释,司法解释,最高人民法院,www.court.gov.cn,https://www.court.gov.cn/,最高人民法院官网检索:技术合同纠纷 司法解释,VERIFY_REQUIRED,VERIFY_REQUIRED,技术开发;技术服务,judicial-interpretations,true,LEGAL_REVIEW,法律资料运营,待法务复核,2026-05-01,需法务确认现行有效版本 diff --git a/project-docs/phase13-legal-knowledge-template-library/legal-sources/README.md b/project-docs/phase13-legal-knowledge-template-library/legal-sources/README.md index 23ffbe10..27b0d6ea 100644 --- a/project-docs/phase13-legal-knowledge-template-library/legal-sources/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/legal-sources/README.md @@ -1,9 +1,14 @@ -# Legal Sources +# 法源资料目录 -This folder stores official legal source extraction notes after the source has been confirmed from an approved official domain. +本目录用于保存中国大陆官方法源的结构化提取说明。法源必须来自阶段 13 方案允许的官方渠道,例如国家法律法规数据库、中国人大网、最高人民法院、中国政府网及相关部委官网。 -Current first-batch inventory lives in: +第一批法源清单位于: `../inventories/legal-source-inventory.csv` -No raw copied full law text should be stored here unless copyright and source policy are confirmed. Prefer structured references, article ranges, official URLs, and extraction notes. +资料保存要求: + +1. 优先保存官方链接、条款范围、适用场景、提取说明和复核记录。 +2. 未确认版权和官方转载规则前,不直接复制整部法律全文。 +3. 不使用境外法律、境外判例或国外合同模板作为中国合同审核和生成依据。 +4. 法源未确认有效状态前,只能用于采集和复核,不能进入生产索引。 diff --git a/project-docs/phase13-legal-knowledge-template-library/legal-sources/civil-code/README.md b/project-docs/phase13-legal-knowledge-template-library/legal-sources/civil-code/README.md index ef9fac99..63890988 100644 --- a/project-docs/phase13-legal-knowledge-template-library/legal-sources/civil-code/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/legal-sources/civil-code/README.md @@ -1,3 +1,3 @@ -# Civil Code Sources +# 民法典法源 -Scope: Civil Code general provisions, contract formation, validity, performance, breach, termination, and liability. +范围:民法典总则、合同成立、合同效力、合同履行、违约责任、合同解除和民事责任等中国合同通用依据。 diff --git a/project-docs/phase13-legal-knowledge-template-library/legal-sources/company-commercial/README.md b/project-docs/phase13-legal-knowledge-template-library/legal-sources/company-commercial/README.md index 0783decf..2b100c01 100644 --- a/project-docs/phase13-legal-knowledge-template-library/legal-sources/company-commercial/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/legal-sources/company-commercial/README.md @@ -1,3 +1,3 @@ -# Company And Commercial Sources +# 公司与商事法源 -Scope: company authority, commercial operations, dispute resolution, arbitration, electronic signatures, and competition-related contract risks. +范围:公司主体资格、授权代表、商事交易、争议解决、仲裁、电子签名、电子商务和商业秘密保护等中国商事合同风险依据。 diff --git a/project-docs/phase13-legal-knowledge-template-library/legal-sources/data-privacy/README.md b/project-docs/phase13-legal-knowledge-template-library/legal-sources/data-privacy/README.md index 99e80214..dc0bf0d3 100644 --- a/project-docs/phase13-legal-knowledge-template-library/legal-sources/data-privacy/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/legal-sources/data-privacy/README.md @@ -1,3 +1,3 @@ -# Data And Privacy Sources +# 数据与个人信息保护法源 -Scope: personal information protection, data security, cybersecurity, data processing, and SaaS data clauses. +范围:个人信息保护、数据安全、网络安全、数据处理、软件服务和软件即服务中的数据条款依据。 diff --git a/project-docs/phase13-legal-knowledge-template-library/legal-sources/intellectual-property/README.md b/project-docs/phase13-legal-knowledge-template-library/legal-sources/intellectual-property/README.md index f01e53dc..0e256657 100644 --- a/project-docs/phase13-legal-knowledge-template-library/legal-sources/intellectual-property/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/legal-sources/intellectual-property/README.md @@ -1,3 +1,3 @@ -# Intellectual Property Sources +# 知识产权法源 -Scope: copyright, patent, trademark, technical成果, software deliverables, licensing, and ownership clauses. +范围:著作权、专利、商标、技术成果、软件交付物、许可使用、权属归属和侵权责任等中国知识产权合同依据。 diff --git a/project-docs/phase13-legal-knowledge-template-library/legal-sources/judicial-interpretations/README.md b/project-docs/phase13-legal-knowledge-template-library/legal-sources/judicial-interpretations/README.md index 0f2a01a2..48f69ad2 100644 --- a/project-docs/phase13-legal-knowledge-template-library/legal-sources/judicial-interpretations/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/legal-sources/judicial-interpretations/README.md @@ -1,3 +1,3 @@ -# Judicial Interpretation Sources +# 司法解释法源 -Scope: Supreme People's Court interpretations and official judicial guidance for contract disputes. +范围:最高人民法院发布的合同纠纷相关司法解释、司法文件和官方裁判规则说明。未确认现行有效前,不得进入生产知识库。 diff --git a/project-docs/phase13-legal-knowledge-template-library/legal-sources/labor-employment/README.md b/project-docs/phase13-legal-knowledge-template-library/legal-sources/labor-employment/README.md index bf1b142c..5ca185a7 100644 --- a/project-docs/phase13-legal-knowledge-template-library/legal-sources/labor-employment/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/legal-sources/labor-employment/README.md @@ -1,3 +1,3 @@ -# Labor And Employment Sources +# 劳动与用工法源 -Scope: labor contract, labor service boundary, employment compliance, and worker protection. +范围:劳动合同、劳务关系边界、用工合规、劳动保护、劳动报酬和解除终止等中国劳动用工相关依据。 diff --git a/project-docs/phase13-legal-knowledge-template-library/legal-sources/procurement-tendering/README.md b/project-docs/phase13-legal-knowledge-template-library/legal-sources/procurement-tendering/README.md index 0a92ffa2..3733ea69 100644 --- a/project-docs/phase13-legal-knowledge-template-library/legal-sources/procurement-tendering/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/legal-sources/procurement-tendering/README.md @@ -1,3 +1,3 @@ -# Procurement And Tendering Sources +# 采购与招投标法源 -Scope: procurement, bidding, tendering, government procurement, and purchase contract compliance. +范围:采购、招标、投标、政府采购、采购流程合规和采购合同风险依据。 diff --git a/project-docs/phase13-legal-knowledge-template-library/qa-samples/README.md b/project-docs/phase13-legal-knowledge-template-library/qa-samples/README.md index 1e4d0bfb..c3de8511 100644 --- a/project-docs/phase13-legal-knowledge-template-library/qa-samples/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/qa-samples/README.md @@ -1,3 +1,10 @@ -# QA Samples +# 黄金样本目录 -Golden samples are used by review quality, generation quality, and KB Q&A gates. Sample inventories live in `../inventories/`. +本目录用于保存合同审核、合同生成和知识库问答的中文黄金样本。 + +黄金样本要求: + +1. 样本必须使用中文。 +2. 样本不得包含真实客户合同全文或未脱敏敏感信息。 +3. 每个样本必须绑定预期依据、预期风险等级或预期拒答边界。 +4. 样本清单位于 `../inventories/`。 diff --git a/project-docs/phase13-legal-knowledge-template-library/qa-samples/generation/README.md b/project-docs/phase13-legal-knowledge-template-library/qa-samples/generation/README.md index 6ef622fd..ce7ffc79 100644 --- a/project-docs/phase13-legal-knowledge-template-library/qa-samples/generation/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/qa-samples/generation/README.md @@ -1,3 +1,3 @@ -# Generation Samples +# 合同生成样本 -Generation samples will be added after first-batch templates are drafted. +合同生成样本将在第一批中文合同模板完成后补充。样本必须包含中文变量、预期合同文本和生成后审核要求。 diff --git a/project-docs/phase13-legal-knowledge-template-library/qa-samples/kb-qa/README.md b/project-docs/phase13-legal-knowledge-template-library/qa-samples/kb-qa/README.md index 19336e0f..5ae27a7c 100644 --- a/project-docs/phase13-legal-knowledge-template-library/qa-samples/kb-qa/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/qa-samples/kb-qa/README.md @@ -1,3 +1,3 @@ -# KB QA Samples +# 知识库问答样本 -KB Q&A samples will validate source citation, refusal boundary, and human-review prompts. +知识库问答样本用于验证中文回答、法源引用、拒答边界和人工复核提示。依据不足时必须提示不确定或要求人工复核。 diff --git a/project-docs/phase13-legal-knowledge-template-library/qa-samples/review/README.md b/project-docs/phase13-legal-knowledge-template-library/qa-samples/review/README.md index 117f51a0..a085ef12 100644 --- a/project-docs/phase13-legal-knowledge-template-library/qa-samples/review/README.md +++ b/project-docs/phase13-legal-knowledge-template-library/qa-samples/review/README.md @@ -1,3 +1,3 @@ -# Review Samples +# 合同审核样本 -Review samples will be added after review risk rules are drafted. +合同审核样本将在审核风险规则完成后补充。样本必须为中文,并绑定预期风险点、法源依据和修改建议。 diff --git a/project-docs/阶段13-法律知识库与合同模板库建设闭环方案-2026-05-01.md b/project-docs/阶段13-法律知识库与合同模板库建设闭环方案-2026-05-01.md index d2d7d58b..288e81af 100644 --- a/project-docs/阶段13-法律知识库与合同模板库建设闭环方案-2026-05-01.md +++ b/project-docs/阶段13-法律知识库与合同模板库建设闭环方案-2026-05-01.md @@ -10,8 +10,8 @@ 2. 所有法律依据必须记录来源、发布机关、条款号、施行日期、有效状态、采集日期和复核人。 3. 官方法源优先,第三方文章、公众号、博客、模型回答不得作为最终依据。 4. 法律条文、司法解释、监管规则进入知识库前必须拆成结构化知识卡、风险规则和条款适用说明。 -5. 合同模板必须绑定变量 schema、必填项、默认值、条款来源、审核规则和生成验收样本。 -6. 不把真实客户合同、真实个人信息、密钥、Webhook、管理员密码写入资料包。 +5. 合同模板必须绑定变量结构说明、必填项、默认值、条款来源、审核规则和生成验收样本。 +6. 不把真实客户合同、真实个人信息、密钥、网络回调地址、管理员密码写入资料包。 7. 平台输出必须标注依据来源;无法确定依据时必须提示“不确定”或要求人工复核。 8. 生产使用前必须经过法律专业人员或业务负责人复核,本资料库不替代执业律师意见。 @@ -84,13 +84,13 @@ project-docs/phase13-legal-knowledge-template-library/ | 子阶段 | 主题 | 核心目标 | 主要产物 | 退出门禁 | |---|---|---|---|---| -| 13.0 | 治理口径与资料 schema | 先定义资料如何进入平台 | 目录结构、字段字典、法源白名单、复核流程 | schema 齐套、敏感信息规则明确 | +| 13.0 | 治理口径与资料字段结构 | 先定义资料如何进入平台 | 目录结构、字段字典、法源白名单、复核流程 | 字段结构齐套、敏感信息规则明确 | | 13.1 | 法源资料采集 | 建立权威法律依据底座 | 法源清单、法规版本、条款引用索引 | 官方来源可追溯、有效状态明确 | | 13.2 | 法律知识卡建设 | 把法律条文转为可检索知识 | 知识卡、适用场景、问答提示 | 每张卡有来源、条款号和适用边界 | | 13.3 | 合同审核规则库 | 让审核结果有法源和规则依据 | 风险类型、识别规则、修改建议、严重等级 | 每条规则绑定法律依据和回归样本 | | 13.4 | 标准条款库 | 让生成内容可控、可替换、可解释 | 标准条款、替代条款、禁用条款、适用条件 | 条款有来源、适用条件和风险提示 | -| 13.5 | 合同模板库 | 建立生产可用模板 | 模板正文、变量 schema、默认值、生成规则 | 模板可预览、可生成、可下载、可审核 | -| 13.6 | 黄金样本与评测集 | 验证审核和生成质量 | 审核样本、生成样本、KB 问答样本 | 样本覆盖主要风险和模板类型 | +| 13.5 | 合同模板库 | 建立生产可用模板 | 模板正文、变量结构说明、默认值、生成规则 | 模板可预览、可生成、可下载、可审核 | +| 13.6 | 黄金样本与评测集 | 验证审核和生成质量 | 审核样本、生成样本、知识库问答样本 | 样本覆盖主要风险和模板类型 | | 13.7 | 入库与自动化门禁 | 资料包从文档变成系统可用资产 | 导入脚本、门禁脚本、报告 | 入库、索引、问答、审核、生成均可复跑 | | 13.8 | 生产试点发布 | 把资料包部署到试点环境 | 发布记录、索引记录、业务验收记录 | 试点用户能基于资料完成真实业务场景 | | 13.9 | 持续更新与失效治理 | 避免知识过期 | 月度复核、失效规则、变更记录 | 过期资料可发现、可下线、可回归 | @@ -99,7 +99,7 @@ project-docs/phase13-legal-knowledge-template-library/ ## 五、分阶段任务 -### 13.0 治理口径与资料 schema +### 13.0 治理口径与资料字段结构 任务: @@ -128,7 +128,7 @@ project-docs/phase13-legal-knowledge-template-library/ 1. 采集民法典合同编及总则中与合同成立、效力、履行、违约、解除相关条款。 2. 采集最高人民法院民法典合同编通则司法解释。 3. 采集买卖、建设工程、技术合同、劳动用工、知识产权、数据安全、个人信息保护等高频业务相关依据。 -4. 记录每条法源的官方 URL、发布机关、施行日期、有效状态、引用范围。 +4. 记录每条法源的官方地址、发布机关、施行日期、有效状态、引用范围。 5. 对失效、修订、替代关系进行标注。 产物: @@ -149,7 +149,7 @@ project-docs/phase13-legal-knowledge-template-library/ 1. 将法源拆成面向平台检索的知识卡。 2. 每张知识卡包含:法律问题、适用场景、条款摘要、原文引用范围、风险提示、不可适用场景。 -3. 建立 KB 问答提示:什么问题可以回答,什么问题必须拒答或提示人工复核。 +3. 建立知识库问答提示:什么问题可以回答,什么问题必须拒答或提示人工复核。 4. 建立引用格式,确保回答能回溯到法源和条款号。 5. 建立知识卡版本和失效检查规则。 @@ -157,13 +157,13 @@ project-docs/phase13-legal-knowledge-template-library/ 1. `legal-knowledge-card-inventory.csv` 2. `qa-samples/kb-qa/*` -3. KB 问答验收样本。 +3. 知识库问答验收样本。 门禁: 1. 知识卡不得只有法条全文,必须有适用场景和边界。 2. 每张知识卡至少绑定一个官方法源 ID。 -3. KB 问答样本必须验证来源引用和拒答边界。 +3. 知识库问答样本必须验证来源引用和拒答边界。 ### 13.3 合同审核规则库 @@ -192,7 +192,7 @@ project-docs/phase13-legal-knowledge-template-library/ 任务: 1. 建立通用条款:定义、合同目的、履行、付款、交付、验收、违约、解除、不可抗力、通知、争议解决。 -2. 建立专项条款:采购、服务、保密、软件/SaaS、技术开发、劳动/劳务、知识产权、数据处理。 +2. 建立专项条款:采购、服务、保密、软件与软件即服务、技术开发、劳动/劳务、知识产权、数据处理。 3. 为每条条款定义适用条件、替代版本、禁用条件、风险提示和来源依据。 4. 建立条款之间的依赖关系,例如保密条款需要期限、例外、违约责任。 5. 建立条款质量复核流程。 @@ -213,8 +213,8 @@ project-docs/phase13-legal-knowledge-template-library/ 任务: -1. 建立第一批生产模板:采购合同、服务合同、保密协议、软件/SaaS 服务合同、技术开发合同、劳动/劳务相关协议。 -2. 为每个模板建立变量 schema、必填字段、默认值、枚举值、校验规则。 +1. 建立第一批生产模板:采购合同、服务合同、保密协议、软件与软件即服务合同、技术开发合同、劳动/劳务相关协议。 +2. 为每个模板建立变量结构说明、必填字段、默认值、枚举值、校验规则。 3. 将模板章节与标准条款库绑定。 4. 建立模板生成前、生成中、生成后审核流程。 5. 建立模板版本、启停、适用范围和负责人。 @@ -223,7 +223,7 @@ project-docs/phase13-legal-knowledge-template-library/ 1. `contract-template-inventory.csv` 2. `contract-templates/*` -3. 模板变量 schema。 +3. 模板变量结构说明。 4. 模板验收样本。 门禁: @@ -239,7 +239,7 @@ project-docs/phase13-legal-knowledge-template-library/ 1. 建立审核黄金样本,覆盖高频风险和边界场景。 2. 建立生成黄金样本,覆盖每个模板的变量组合。 -3. 建立 KB 问答黄金样本,覆盖可答、拒答、需要人工复核三类。 +3. 建立知识库问答黄金样本,覆盖可答、拒答、需要人工复核三类。 4. 标注期望输出、期望依据、期望风险等级。 5. 与阶段 9 质量门禁衔接,形成可重复评测。 @@ -253,7 +253,7 @@ project-docs/phase13-legal-knowledge-template-library/ 1. 每个模板至少有 3 个生成样本。 2. 每个高频风险类型至少有 2 个审核样本。 -3. KB 问答必须验证引用来源和拒答边界。 +3. 知识库问答必须验证引用来源和拒答边界。 ### 13.7 入库与自动化门禁 @@ -261,9 +261,9 @@ project-docs/phase13-legal-knowledge-template-library/ 1. 实现 `scripts/run-legal-knowledge-library-gate.ps1`。 2. 检查目录结构、CSV 字段、法源 URL、状态、负责人、复核字段。 -3. 检查模板变量 schema、必填项、默认值和生成样本。 +3. 检查模板变量结构说明、必填项、默认值和生成样本。 4. 检查风险规则是否绑定法源和样本。 -5. 检查资料包是否包含密钥、真实密码、Webhook、未脱敏合同原文。 +5. 检查资料包是否包含密钥、真实密码、网络回调地址、未脱敏合同原文。 6. 生成资料包验收报告。 产物: @@ -336,7 +336,7 @@ project-docs/phase13-legal-knowledge-template-library/ 1. 采购合同。 2. 服务合同。 3. 保密协议。 -4. 软件/SaaS 服务合同。 +4. 软件与软件即服务合同。 5. 技术开发合同。 6. 劳动/劳务相关协议。 @@ -375,7 +375,7 @@ project-docs/phase13-legal-knowledge-template-library/ 1. 法源资料来自官方渠道,且可追溯到条款号和有效状态。 2. 合同审核风险规则有依据、有样本、有修改建议、有严重等级。 3. 标准条款库有适用条件、替代版本和风险提示。 -4. 合同模板具备变量 schema、必填校验、生成样本和审核回归。 +4. 合同模板具备变量结构说明、必填校验、生成样本和审核回归。 5. 知识库问答能引用来源,并能在依据不足时拒答或提示人工复核。 6. 资料包可通过自动化门禁检查。 7. 生产或试点环境完成至少一轮导入、索引、问答、审核、生成、下载闭环。 @@ -388,7 +388,7 @@ project-docs/phase13-legal-knowledge-template-library/ 下一步最合适进入阶段 13.0 和 13.1: 1. 创建 `project-docs/phase13-legal-knowledge-template-library/` 目录。 -2. 创建第一批 inventories CSV。 +2. 创建第一批清单 CSV。 3. 创建法源采集字段字典和资料状态规则。 4. 建立第一批官方法源清单。 5. 实现 `scripts/run-legal-knowledge-library-gate.ps1` 的第一版,只做结构、字段、法源白名单和敏感信息门禁。 @@ -396,4 +396,4 @@ project-docs/phase13-legal-knowledge-template-library/ 阶段 13 当前状态:`IN_PROGRESS`。 -当前第一批执行结果:`13.0` 和 `13.1` 已完成工程化底座,资料包、清单 schema、第一批 `20` 条官方法源采集任务和 `scripts/run-legal-knowledge-library-gate.ps1` 已落地。门禁状态为 `PASS_WITH_LEGAL_REVIEW_REQUIRED`,所有法源在法务复核前不得作为生产确定性依据。 +当前第一批执行结果:`13.0` 和 `13.1` 已完成工程化底座,资料包、清单字段结构、第一批 `20` 条官方法源采集任务和 `scripts/run-legal-knowledge-library-gate.ps1` 已落地。门禁状态为 `PASS_WITH_LEGAL_REVIEW_REQUIRED`,所有法源在法务复核前不得作为生产确定性依据。 diff --git a/project-docs/阶段13-法律知识库与合同模板库建设闭环第一批执行记录-2026-05-01.md b/project-docs/阶段13-法律知识库与合同模板库建设闭环第一批执行记录-2026-05-01.md index e52e36aa..8081e7ee 100644 --- a/project-docs/阶段13-法律知识库与合同模板库建设闭环第一批执行记录-2026-05-01.md +++ b/project-docs/阶段13-法律知识库与合同模板库建设闭环第一批执行记录-2026-05-01.md @@ -2,9 +2,9 @@ ## 一、阶段结论 -阶段 13 第一批已完成 `13.0 治理口径与资料 schema` 和 `13.1 法源资料采集` 的工程化底座,当前状态为 `PASS_WITH_LEGAL_REVIEW_REQUIRED`。 +阶段 13 第一批已完成 `13.0 治理口径与资料字段结构` 和 `13.1 法源资料采集` 的工程化底座,当前状态为 `PASS_WITH_LEGAL_REVIEW_REQUIRED`。 -本批次不是最终生产发布,而是把法律知识库与合同模板库从“想法”落成可校验的资料包结构、清单 schema、第一批官方法源采集任务和自动化门禁。所有法源均标记为 `LEGAL_REVIEW` 和 `VERIFY_REQUIRED`,在法务复核完成前不得作为生产确定性依据。 +本批次不是最终生产发布,而是把法律知识库与合同模板库从“想法”落成可校验的资料包结构、清单字段结构、第一批官方法源采集任务和自动化门禁。所有法源均标记为 `LEGAL_REVIEW` 和 `VERIFY_REQUIRED`,在法务复核完成前不得作为生产确定性依据。 ## 二、本批次交付 @@ -83,7 +83,7 @@ PHASE13_LEGAL_KNOWLEDGE_LIBRARY_GATE_PASS_WITH_LEGAL_REVIEW_REQUIRED D:\ai-contr | 法源采集任务 | 20 | | 官方白名单域名 | 10 | | 知识域覆盖 | 7 | -| Inventory 文件 | 9 | +| 清单文件 | 9 | | 必需失败项 | 0 | | 法务复核待办 | 20 | @@ -95,7 +95,7 @@ PHASE13_LEGAL_KNOWLEDGE_LIBRARY_GATE_PASS_WITH_LEGAL_REVIEW_REQUIRED D:\ai-contr |---|---|---| | 法源详情页确认 | LEGAL_REVIEW | 当前 `source_url` 记录官方入口,后续需补充或确认官方详情页 | | 生效日期与有效状态 | VERIFY_REQUIRED | 不在未复核状态下写死可能变化或可能误记的生效信息 | -| 法律专家复核 | PENDING | `legal_reviewer` 当前为 `pending` | +| 法律专家复核 | 待复核 | `legal_reviewer` 当前为 `待法务复核` | | 生产发布 | BLOCKED_BY_REVIEW | 复核完成前不得进入生产索引或作为确定性依据 | ## 六、下一步 diff --git a/scripts/run-legal-knowledge-library-gate.ps1 b/scripts/run-legal-knowledge-library-gate.ps1 index efbc2296..2f5e1d9a 100644 --- a/scripts/run-legal-knowledge-library-gate.ps1 +++ b/scripts/run-legal-knowledge-library-gate.ps1 @@ -1,4 +1,4 @@ -param( +param( [string]$ArtifactRoot = "", [string]$LibraryRoot = "", [int]$MinLegalSources = 20, @@ -70,6 +70,62 @@ function Add-Check { }) | Out-Null } +function Convert-GateStatusText { + param([string]$Status) + switch ($Status) { + "PASS" { return "通过" } + "WARN" { return "通过但有警告" } + "FAIL" { return "未通过" } + "PASS_WITH_LEGAL_REVIEW_REQUIRED" { return "通过但仍需法务复核" } + default { return $Status } + } +} + +function Convert-AlertSeverityText { + param([string]$Severity) + switch ($Severity) { + "critical" { return "严重" } + "review_required" { return "需法务复核" } + "warning" { return "警告" } + "none" { return "无" } + default { return $Severity } + } +} + +function Convert-CheckStatusText { + param([string]$Status) + switch ($Status) { + "pass" { return "通过" } + "fail" { return "失败" } + "warn" { return "警告" } + "skip" { return "跳过" } + "blocked" { return "阻塞" } + default { return $Status } + } +} + +function Convert-BoolText { + param([bool]$Value) + if ($Value) { + return "是" + } + return "否" +} + +function Convert-KnowledgeDomainText { + param([string]$Domain) + switch ($Domain) { + "civil-code" { return "民法典与合同通用" } + "judicial-interpretations" { return "司法解释" } + "company-commercial" { return "公司与商事" } + "labor-employment" { return "劳动与用工" } + "data-privacy" { return "数据与个人信息保护" } + "intellectual-property" { return "知识产权" } + "procurement-tendering" { return "采购与招投标" } + default { return $Domain } + } +} + function Save-Json { param([string]$Path, [object]$Value) $Value | ConvertTo-Json -Depth 20 | Set-Content -Encoding UTF8 -Path $Path @@ -139,7 +195,7 @@ function Add-RequiredFileCheck { ) $path = Join-Path $repoRoot $RelativePath if (-not (Test-Path -LiteralPath $path -PathType Leaf)) { - Add-Check -Key $Key -Label $Label -Status "fail" -Detail "Missing file: $RelativePath" -Meta @{ path = $path } + Add-Check -Key $Key -Label $Label -Status "fail" -Detail "缺少文件:$RelativePath" -Meta @{ path = $path } $inventoryReport.Add([pscustomobject][ordered]@{ key = $Key label = $Label @@ -165,9 +221,9 @@ function Add-RequiredFileCheck { }) | Out-Null if ($schema.ok) { - Add-Check -Key $Key -Label $Label -Status "pass" -Detail "Schema OK, rows=$($rows.Count)" -Meta @{ path = $path } + Add-Check -Key $Key -Label $Label -Status "pass" -Detail "字段结构通过,行数=$($rows.Count)" -Meta @{ path = $path } } else { - Add-Check -Key $Key -Label $Label -Status "fail" -Detail "Missing columns: $($schema.missing -join ',')" -Meta @{ path = $path; missing = $schema.missing } + Add-Check -Key $Key -Label $Label -Status "fail" -Detail "缺少字段:$($schema.missing -join ',')" -Meta @{ path = $path; missing = $schema.missing } } return $rows } @@ -191,9 +247,9 @@ function Test-SecretLeak { } if (-not (Test-Path "$HOME\.Codex\skills\gstack\bin")) { - Add-Check -Key "gstack" -Label "gstack preflight" -Status "fail" -Detail "gstack is missing" + Add-Check -Key "gstack" -Label "gstack 前置检查" -Status "fail" -Detail "gstack 缺失" } else { - Add-Check -Key "gstack" -Label "gstack preflight" -Status "pass" -Detail "GSTACK_OK" + Add-Check -Key "gstack" -Label "gstack 前置检查" -Status "pass" -Detail "GSTACK_OK" } $branch = (git -C $repoRoot rev-parse --abbrev-ref HEAD).Trim() @@ -203,21 +259,21 @@ $gitStatus = git -C $repoRoot status --short ($gitStatus -join [Environment]::NewLine) | Set-Content -Encoding UTF8 -Path $gitStatusPath if ($remoteUrl -match "192\.168\.3\.90") { - Add-Check -Key "origin_remote" -Label "origin remote" -Status "pass" -Detail "origin points to 192.168.3.90" -Meta @{ branch = $branch; commit = $commit; remote = $remoteUrl } + Add-Check -Key "origin_remote" -Label "origin 远端仓库" -Status "pass" -Detail "origin 指向 192.168.3.90" -Meta @{ branch = $branch; commit = $commit; remote = $remoteUrl } } else { - Add-Check -Key "origin_remote" -Label "origin remote" -Status "fail" -Detail "origin does not point to 192.168.3.90" -Meta @{ branch = $branch; commit = $commit; remote = $remoteUrl } + Add-Check -Key "origin_remote" -Label "origin 远端仓库" -Status "fail" -Detail "origin 未指向 192.168.3.90" -Meta @{ branch = $branch; commit = $commit; remote = $remoteUrl } } if ($gitStatus) { - Add-Check -Key "working_tree" -Label "working tree" -Status "warn" -Required $false -Detail "Working tree has uncommitted changes; gate is advisory" -Meta @{ artifact = $gitStatusPath } + Add-Check -Key "working_tree" -Label "工作区状态" -Status "warn" -Required $false -Detail "工作区存在未提交改动;本次门禁按提示性结果记录" -Meta @{ artifact = $gitStatusPath } } else { - Add-Check -Key "working_tree" -Label "working tree" -Status "pass" -Detail "Working tree is clean" -Meta @{ artifact = $gitStatusPath } + Add-Check -Key "working_tree" -Label "工作区状态" -Status "pass" -Detail "工作区干净" -Meta @{ artifact = $gitStatusPath } } if (Test-Path -LiteralPath $LibraryRoot -PathType Container) { - Add-Check -Key "library_root" -Label "phase13 library root" -Status "pass" -Detail "Library root exists" -Meta @{ root = $LibraryRoot } + Add-Check -Key "library_root" -Label "阶段 13 资料包根目录" -Status "pass" -Detail "资料包根目录存在" -Meta @{ root = $LibraryRoot } } else { - Add-Check -Key "library_root" -Label "phase13 library root" -Status "fail" -Detail "Library root is missing" -Meta @{ root = $LibraryRoot } + Add-Check -Key "library_root" -Label "阶段 13 资料包根目录" -Status "fail" -Detail "资料包根目录缺失" -Meta @{ root = $LibraryRoot } } $requiredDirs = @( @@ -237,9 +293,9 @@ $requiredDirs = @( $missingDirs = @($requiredDirs | Where-Object { -not (Test-Path -LiteralPath (Join-Path $repoRoot $_) -PathType Container) }) if ($missingDirs.Count -eq 0) { - Add-Check -Key "directory_structure" -Label "directory structure" -Status "pass" -Detail "Required directories exist" + Add-Check -Key "directory_structure" -Label "目录结构" -Status "pass" -Detail "必需目录均已存在" } else { - Add-Check -Key "directory_structure" -Label "directory structure" -Status "fail" -Detail "Missing directories: $($missingDirs -join ',')" -Meta @{ missing = $missingDirs } + Add-Check -Key "directory_structure" -Label "目录结构" -Status "fail" -Detail "缺少目录:$($missingDirs -join ',')" -Meta @{ missing = $missingDirs } } $commonDocFiles = @( @@ -251,9 +307,9 @@ foreach ($docPath in $commonDocFiles) { $absoluteDocPath = Join-Path $repoRoot $docPath $key = "doc_" + ([System.IO.Path]::GetFileNameWithoutExtension($docPath) -replace "[^A-Za-z0-9]+", "_") if (Test-Path -LiteralPath $absoluteDocPath -PathType Leaf) { - Add-Check -Key $key -Label $docPath -Status "pass" -Detail "Document exists" -Meta @{ path = $absoluteDocPath } + Add-Check -Key $key -Label $docPath -Status "pass" -Detail "文档存在" -Meta @{ path = $absoluteDocPath } } else { - Add-Check -Key $key -Label $docPath -Status "fail" -Detail "Document missing" -Meta @{ path = $absoluteDocPath } + Add-Check -Key $key -Label $docPath -Status "fail" -Detail "文档缺失" -Meta @{ path = $absoluteDocPath } } } @@ -267,27 +323,27 @@ $generationSampleColumns = @("sample_id", "template_id", "contract_type", "varia $kbQaSampleColumns = @("sample_id", "question", "expected_answer_boundary", "expected_source_ids", "expected_citation_required", "expected_refusal_required", "status", "owner", "legal_reviewer", "review_required", "production_ready", "notes") $expertReviewColumns = @("review_id", "asset_type", "asset_id", "reviewer", "reviewer_role", "review_date", "review_result", "required_changes", "follow_up_owner", "evidence_path", "status", "notes") -$legalSourceRows = Add-RequiredFileCheck -Key "inventory_legal_sources" -Label "legal source inventory" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\legal-source-inventory.csv" -Columns $legalSourceColumns -Add-RequiredFileCheck -Key "inventory_knowledge_cards" -Label "legal knowledge card inventory" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\legal-knowledge-card-inventory.csv" -Columns $knowledgeCardColumns | Out-Null -Add-RequiredFileCheck -Key "inventory_risk_rules" -Label "review risk rule inventory" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\review-risk-rule-inventory.csv" -Columns $riskRuleColumns | Out-Null -Add-RequiredFileCheck -Key "inventory_clauses" -Label "clause library inventory" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\clause-library-inventory.csv" -Columns $clauseColumns | Out-Null -Add-RequiredFileCheck -Key "inventory_templates" -Label "contract template inventory" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\contract-template-inventory.csv" -Columns $templateColumns | Out-Null -Add-RequiredFileCheck -Key "inventory_review_samples" -Label "review golden sample inventory" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\review-golden-sample-inventory.csv" -Columns $reviewSampleColumns | Out-Null -Add-RequiredFileCheck -Key "inventory_generation_samples" -Label "generation golden sample inventory" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\generation-golden-sample-inventory.csv" -Columns $generationSampleColumns | Out-Null -Add-RequiredFileCheck -Key "inventory_kb_qa_samples" -Label "KB QA golden sample inventory" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\kb-qa-golden-sample-inventory.csv" -Columns $kbQaSampleColumns | Out-Null -Add-RequiredFileCheck -Key "inventory_expert_reviews" -Label "expert review register" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\expert-review-register.csv" -Columns $expertReviewColumns | Out-Null +$legalSourceRows = Add-RequiredFileCheck -Key "inventory_legal_sources" -Label "法源清单" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\legal-source-inventory.csv" -Columns $legalSourceColumns +Add-RequiredFileCheck -Key "inventory_knowledge_cards" -Label "法律知识卡清单" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\legal-knowledge-card-inventory.csv" -Columns $knowledgeCardColumns | Out-Null +Add-RequiredFileCheck -Key "inventory_risk_rules" -Label "审核风险规则清单" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\review-risk-rule-inventory.csv" -Columns $riskRuleColumns | Out-Null +Add-RequiredFileCheck -Key "inventory_clauses" -Label "标准条款库清单" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\clause-library-inventory.csv" -Columns $clauseColumns | Out-Null +Add-RequiredFileCheck -Key "inventory_templates" -Label "合同模板清单" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\contract-template-inventory.csv" -Columns $templateColumns | Out-Null +Add-RequiredFileCheck -Key "inventory_review_samples" -Label "合同审核黄金样本清单" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\review-golden-sample-inventory.csv" -Columns $reviewSampleColumns | Out-Null +Add-RequiredFileCheck -Key "inventory_generation_samples" -Label "合同生成黄金样本清单" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\generation-golden-sample-inventory.csv" -Columns $generationSampleColumns | Out-Null +Add-RequiredFileCheck -Key "inventory_kb_qa_samples" -Label "知识库问答黄金样本清单" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\kb-qa-golden-sample-inventory.csv" -Columns $kbQaSampleColumns | Out-Null +Add-RequiredFileCheck -Key "inventory_expert_reviews" -Label "专家复核登记表" -RelativePath "project-docs\phase13-legal-knowledge-template-library\inventories\expert-review-register.csv" -Columns $expertReviewColumns | Out-Null if ($legalSourceRows.Count -ge $MinLegalSources) { - Add-Check -Key "legal_source_minimum" -Label "legal source minimum" -Status "pass" -Detail "Legal sources=$($legalSourceRows.Count), minimum=$MinLegalSources" + Add-Check -Key "legal_source_minimum" -Label "法源数量下限" -Status "pass" -Detail "法源数量=$($legalSourceRows.Count),最低要求=$MinLegalSources" } else { - Add-Check -Key "legal_source_minimum" -Label "legal source minimum" -Status "fail" -Detail "Legal sources=$($legalSourceRows.Count), minimum=$MinLegalSources" + Add-Check -Key "legal_source_minimum" -Label "法源数量下限" -Status "fail" -Detail "法源数量=$($legalSourceRows.Count),最低要求=$MinLegalSources" } $duplicateSourceIds = @($legalSourceRows | Group-Object source_id | Where-Object { $_.Count -gt 1 } | Select-Object -ExpandProperty Name) if ($duplicateSourceIds.Count -eq 0) { - Add-Check -Key "legal_source_ids_unique" -Label "legal source IDs unique" -Status "pass" -Detail "No duplicate legal source IDs" + Add-Check -Key "legal_source_ids_unique" -Label "法源编号唯一性" -Status "pass" -Detail "未发现重复法源编号" } else { - Add-Check -Key "legal_source_ids_unique" -Label "legal source IDs unique" -Status "fail" -Detail "Duplicate IDs: $($duplicateSourceIds -join ',')" -Meta @{ duplicates = $duplicateSourceIds } + Add-Check -Key "legal_source_ids_unique" -Label "法源编号唯一性" -Status "fail" -Detail "重复编号:$($duplicateSourceIds -join ',')" -Meta @{ duplicates = $duplicateSourceIds } } $missingRequiredFields = @($legalSourceRows | Where-Object { @@ -300,57 +356,59 @@ $missingRequiredFields = @($legalSourceRows | Where-Object { [string]::IsNullOrWhiteSpace($_.owner) } | Select-Object -ExpandProperty source_id) if ($missingRequiredFields.Count -eq 0) { - Add-Check -Key "legal_source_required_fields" -Label "legal source required fields" -Status "pass" -Detail "Required fields are populated" + Add-Check -Key "legal_source_required_fields" -Label "法源必填字段" -Status "pass" -Detail "必填字段均已填写" } else { - Add-Check -Key "legal_source_required_fields" -Label "legal source required fields" -Status "fail" -Detail "Rows missing required fields: $($missingRequiredFields -join ',')" -Meta @{ rows = $missingRequiredFields } + Add-Check -Key "legal_source_required_fields" -Label "法源必填字段" -Status "fail" -Detail "以下行缺少必填字段:$($missingRequiredFields -join ',')" -Meta @{ rows = $missingRequiredFields } } $nonOfficialUrls = @($legalSourceRows | Where-Object { -not (Test-AllowedOfficialUrl -Url $_.source_url) } | Select-Object -ExpandProperty source_id) if ($nonOfficialUrls.Count -eq 0) { - Add-Check -Key "official_source_urls" -Label "official source URLs" -Status "pass" -Detail "All legal source URLs use official allowlisted domains" + Add-Check -Key "official_source_urls" -Label "官方来源地址" -Status "pass" -Detail "所有法源地址均使用白名单官方域名" } else { - Add-Check -Key "official_source_urls" -Label "official source URLs" -Status "fail" -Detail "Non-allowlisted source URLs: $($nonOfficialUrls -join ',')" -Meta @{ rows = $nonOfficialUrls; allowed_domains = $allowedDomains } + Add-Check -Key "official_source_urls" -Label "官方来源地址" -Status "fail" -Detail "以下法源地址不在官方域名白名单内:$($nonOfficialUrls -join ',')" -Meta @{ rows = $nonOfficialUrls; allowed_domains = $allowedDomains } } $unknownValidityRows = @($legalSourceRows | Where-Object { $_.validity_status -eq "VERIFY_REQUIRED" -or $_.effective_date -eq "VERIFY_REQUIRED" } | Select-Object -ExpandProperty source_id) if ($unknownValidityRows.Count -gt 0) { - Add-Check -Key "legal_review_required" -Label "legal review required" -Status "warn" -Required $false -Detail "Legal source validity still requires legal review: $($unknownValidityRows.Count) rows" -Meta @{ rows = $unknownValidityRows } + Add-Check -Key "legal_review_required" -Label "法务复核要求" -Status "warn" -Required $false -Detail "仍有 $($unknownValidityRows.Count) 条法源需要法务确认有效状态或施行日期" -Meta @{ rows = $unknownValidityRows } } else { - Add-Check -Key "legal_review_required" -Label "legal review required" -Status "pass" -Detail "Legal source validity is verified" + Add-Check -Key "legal_review_required" -Label "法务复核要求" -Status "pass" -Detail "法源有效状态已确认" } $publishedWithoutReview = @($legalSourceRows | Where-Object { @("APPROVED", "PUBLISHED") -contains $_.status -and - ([string]::IsNullOrWhiteSpace($_.legal_reviewer) -or $_.legal_reviewer -eq "pending" -or $_.validity_status -eq "VERIFY_REQUIRED") + ([string]::IsNullOrWhiteSpace($_.legal_reviewer) -or @("pending", "待法务复核", "待复核") -contains $_.legal_reviewer -or $_.validity_status -eq "VERIFY_REQUIRED") } | Select-Object -ExpandProperty source_id) if ($publishedWithoutReview.Count -eq 0) { - Add-Check -Key "no_unreviewed_publication" -Label "no unreviewed publication" -Status "pass" -Detail "No legal source is published without review" + Add-Check -Key "no_unreviewed_publication" -Label "未复核资料禁止发布" -Status "pass" -Detail "未发现未经复核即发布的法源" } else { - Add-Check -Key "no_unreviewed_publication" -Label "no unreviewed publication" -Status "fail" -Detail "Published/approved rows missing review: $($publishedWithoutReview -join ',')" -Meta @{ rows = $publishedWithoutReview } + Add-Check -Key "no_unreviewed_publication" -Label "未复核资料禁止发布" -Status "fail" -Detail "以下已批准或已发布法源缺少复核记录:$($publishedWithoutReview -join ',')" -Meta @{ rows = $publishedWithoutReview } } $statusValues = @("DRAFT", "LEGAL_REVIEW", "BUSINESS_REVIEW", "APPROVED", "PUBLISHED", "DEPRECATED") $invalidStatuses = @($legalSourceRows | Where-Object { $statusValues -notcontains $_.status } | Select-Object -ExpandProperty source_id) if ($invalidStatuses.Count -eq 0) { - Add-Check -Key "legal_source_status_values" -Label "legal source status values" -Status "pass" -Detail "Legal source statuses are allowed" + Add-Check -Key "legal_source_status_values" -Label "法源状态值" -Status "pass" -Detail "法源状态均在允许范围内" } else { - Add-Check -Key "legal_source_status_values" -Label "legal source status values" -Status "fail" -Detail "Invalid statuses: $($invalidStatuses -join ',')" -Meta @{ rows = $invalidStatuses; allowed = $statusValues } + Add-Check -Key "legal_source_status_values" -Label "法源状态值" -Status "fail" -Detail "以下法源状态无效:$($invalidStatuses -join ',')" -Meta @{ rows = $invalidStatuses; allowed = $statusValues } } $domainsCovered = @($legalSourceRows | Select-Object -ExpandProperty knowledge_domain -Unique) $requiredDomains = @("civil-code", "judicial-interpretations", "company-commercial", "labor-employment", "data-privacy", "intellectual-property", "procurement-tendering") $missingKnowledgeDomains = @($requiredDomains | Where-Object { $domainsCovered -notcontains $_ }) +$domainsCoveredText = (@($domainsCovered | ForEach-Object { Convert-KnowledgeDomainText -Domain $_ }) -join "、") +$missingKnowledgeDomainsText = (@($missingKnowledgeDomains | ForEach-Object { Convert-KnowledgeDomainText -Domain $_ }) -join "、") if ($missingKnowledgeDomains.Count -eq 0) { - Add-Check -Key "knowledge_domain_coverage" -Label "knowledge domain coverage" -Status "pass" -Detail "Domains covered: $($domainsCovered -join ',')" + Add-Check -Key "knowledge_domain_coverage" -Label "知识领域覆盖" -Status "pass" -Detail "已覆盖领域:$domainsCoveredText" } else { - Add-Check -Key "knowledge_domain_coverage" -Label "knowledge domain coverage" -Status "fail" -Detail "Missing knowledge domains: $($missingKnowledgeDomains -join ',')" -Meta @{ missing = $missingKnowledgeDomains } + Add-Check -Key "knowledge_domain_coverage" -Label "知识领域覆盖" -Status "fail" -Detail "缺少知识领域:$missingKnowledgeDomainsText" -Meta @{ missing = $missingKnowledgeDomains } } $secretHits = Test-SecretLeak -Root $LibraryRoot if ($secretHits.Count -eq 0) { - Add-Check -Key "secret_scan" -Label "secret scan" -Status "pass" -Detail "No administrator password literal found in Phase 13 package or gate script" + Add-Check -Key "secret_scan" -Label "敏感信息扫描" -Status "pass" -Detail "阶段 13 资料包和门禁脚本中未发现管理员密码明文" } else { - Add-Check -Key "secret_scan" -Label "secret scan" -Status "fail" -Detail "Sensitive literal found" -Meta @{ hits = $secretHits } + Add-Check -Key "secret_scan" -Label "敏感信息扫描" -Status "fail" -Detail "发现敏感明文" -Meta @{ hits = $secretHits } } $legalSourceRows | @@ -412,37 +470,41 @@ $summary = [ordered]@{ } Save-Json -Path $summaryJson -Value $summary +$overallStatusText = Convert-GateStatusText -Status $overallStatus +$alertSeverityText = Convert-AlertSeverityText -Severity $alertSeverity $md = New-Object System.Collections.Generic.List[string] -$md.Add("# Phase 13 Legal Knowledge Library Gate") | Out-Null +$md.Add("# 阶段 13 法律知识库资料门禁") | Out-Null $md.Add("") | Out-Null -$md.Add("- Status: $overallStatus") | Out-Null -$md.Add("- Alert severity: $alertSeverity") | Out-Null -$md.Add("- Generated at: $($summary.generated_at)") | Out-Null -$md.Add("- Branch: $branch") | Out-Null -$md.Add("- Commit: $commit") | Out-Null -$md.Add("- Artifact dir: $artifactDir") | Out-Null -$md.Add("- Library root: $LibraryRoot") | Out-Null +$md.Add("- 门禁状态:$overallStatusText($overallStatus)") | Out-Null +$md.Add("- 告警级别:$alertSeverityText($alertSeverity)") | Out-Null +$md.Add("- 生成时间:$($summary.generated_at)") | Out-Null +$md.Add("- 分支:$branch") | Out-Null +$md.Add("- 提交:$commit") | Out-Null +$md.Add("- 产物目录:$artifactDir") | Out-Null +$md.Add("- 资料包根目录:$LibraryRoot") | Out-Null $md.Add("") | Out-Null -$md.Add("## Metrics") | Out-Null +$md.Add("## 指标") | Out-Null $md.Add("") | Out-Null -$md.Add("| Metric | Count |") | Out-Null +$md.Add("| 指标 | 数量 |") | Out-Null $md.Add("|---|---:|") | Out-Null -$md.Add("| Legal sources | $($legalSourceRows.Count) |") | Out-Null -$md.Add("| Allowed official domains | $($allowedDomains.Count) |") | Out-Null -$md.Add("| Knowledge domains | $($domainsCovered.Count) |") | Out-Null -$md.Add("| Inventory files | $($inventoryReport.Count) |") | Out-Null -$md.Add("| Legal review required rows | $legalReviewRequired |") | Out-Null +$md.Add("| 官方法源 | $($legalSourceRows.Count) |") | Out-Null +$md.Add("| 允许的官方域名 | $($allowedDomains.Count) |") | Out-Null +$md.Add("| 知识领域 | $($domainsCovered.Count) |") | Out-Null +$md.Add("| 清单文件 | $($inventoryReport.Count) |") | Out-Null +$md.Add("| 仍需法务复核的法源 | $legalReviewRequired |") | Out-Null $md.Add("") | Out-Null -$md.Add("## Checks") | Out-Null +$md.Add("## 检查项") | Out-Null $md.Add("") | Out-Null -$md.Add("| Check | Required | Status | Detail |") | Out-Null +$md.Add("| 检查项 | 必需 | 状态 | 说明 |") | Out-Null $md.Add("|---|---:|---|---|") | Out-Null foreach ($check in $checks) { $detail = ([string]$check.detail).Replace("|", "/") - $md.Add("| $($check.label) | $($check.required) | $($check.status.ToUpperInvariant()) | $detail |") | Out-Null + $requiredText = Convert-BoolText -Value $check.required + $statusText = Convert-CheckStatusText -Status $check.status + $md.Add("| $($check.label) | $requiredText | $statusText($($check.status.ToUpperInvariant())) | $detail |") | Out-Null } $md.Add("") | Out-Null -$md.Add("Local artifacts:") | Out-Null +$md.Add("本地产物:") | Out-Null $md.Add("") | Out-Null $md.Add('- `legal-knowledge-library-gate-summary.json`') | Out-Null $md.Add('- `legal-knowledge-library-gate-summary.md`') | Out-Null @@ -452,15 +514,15 @@ $md | Set-Content -Encoding UTF8 -Path $summaryMd if ($overallStatus -eq "FAIL") { Write-Host "PHASE13_LEGAL_KNOWLEDGE_LIBRARY_GATE_FAIL $artifactDir" - throw "Phase 13 legal knowledge library gate failed. See $summaryMd" + throw "阶段 13 法律知识库资料门禁未通过。查看:$summaryMd" } if ($overallStatus -eq "WARN" -and $FailOnWarn) { Write-Host "PHASE13_LEGAL_KNOWLEDGE_LIBRARY_GATE_WARN $artifactDir" - throw "Phase 13 legal knowledge library gate has warnings. See $summaryMd" + throw "阶段 13 法律知识库资料门禁存在警告。查看:$summaryMd" } if ($overallStatus -eq "PASS_WITH_LEGAL_REVIEW_REQUIRED" -and $FailOnLegalReviewRequired) { Write-Host "PHASE13_LEGAL_KNOWLEDGE_LIBRARY_GATE_PASS_WITH_LEGAL_REVIEW_REQUIRED $artifactDir" - throw "Phase 13 legal knowledge library gate requires legal review. See $summaryMd" + throw "阶段 13 法律知识库资料门禁仍需法务复核。查看:$summaryMd" } Write-Host "PHASE13_LEGAL_KNOWLEDGE_LIBRARY_GATE_$overallStatus $artifactDir"