Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/objects/policy.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const Policy = ObjectSchema.create({
category: Field.select({
label: '制度分类',
group: 'basic',
description: '按制度体系的分类;导入时取自制度信息表的「制度类别」',
// The values of the first five predate this list and stay as they were
// (seed data and stored records use them); only their labels moved to the
// policy system's own wording.
Expand All @@ -57,24 +56,24 @@ export const Policy = ObjectSchema.create({
summary: Field.textarea({
label: '目录摘要',
group: 'basic',
description: '一两句话说明本制度管什么,供按目录挑选制度;可能为空,为空不代表没有正文',
description: '一两句话说明本制度管什么',
}),
status: Field.select({
label: '状态',
group: 'effect',
description: 'published = 已发布,可据以作答;draft = 草稿,尚无现行版本;revising = 修订中;abolished = 已废止,不再有效',
options: [
{ label: '草稿', value: 'draft', color: '#6B7280', default: true },
{ label: '已发布', value: 'published', color: '#10B981' },
{ label: '修订中', value: 'revising', color: '#F59E0B' },
{ label: '已废止', value: 'abolished', color: '#EF4444' },
],
}),
// 版本设为现行时由 src/qa/version-current.hook.ts 自动填写,不在表单里手填(hidden 只影响界面,接口照常读写)。
// AI 怎么用它读正文,写在 src/skills/policy-inquiry.skill.ts。
current_version: Field.lookup('brightrule_policy_version', {
label: '现行版本',
group: 'effect',
description:
'指向现行版本记录(由版本设为现行时自动填写);get_record 读这条版本即得正文 body_md,版本号 version_no 写在引用出处的制度名之后',
hidden: true,
}),
effective_date: Field.date({ label: '生效日期', group: 'effect' }),
next_review_date: Field.date({ label: '下次复审日', group: 'effect' }),
Expand Down
4 changes: 2 additions & 2 deletions src/skills/policy-inquiry.skill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export const PolicyInquirySkill = defineSkill({

## 数据在哪里

- 制度目录:对象 brightrule_policy。只看 status = "published" 的制度;字段 id、title、category、issuing_unit、department、summary、current_version、effective_date。
- 制度正文:在现行版本上。制度的 current_version 指向现行的版本记录(对象 brightrule_policy_version),正文全文在它的字段 body_md(Markdown,已脱敏)。
- 制度目录:对象 brightrule_policy。只看 status = "published" 的制度;字段 id、title、category、issuing_unit、department、summary、current_version、effective_date。status 的取值:published 已发布(可据以作答)、draft 草稿(还没有现行版本)、revising 修订中、abolished 已废止(不再有效,不据以作答)。summary 是一两句话的目录摘要,可能为空,为空不代表没有正文。
- 制度正文:在现行版本上。制度的 current_version 指向现行的版本记录(对象 brightrule_policy_version,版本设为现行时自动填写),正文全文在它的字段 body_md(Markdown,已脱敏);引用出处时把版本号 version_no 写在制度名之后。
- 附件:对象 brightrule_policy_attachment,挂在版本下。label 是原文里的编号(附件1、附表2),title 是附件自己的名称。只有 attachment_class = "normative"(规范性)的附件是正文的一部分,全文在它的 body_md;"form"(表单)、"original"(仅原件)不作答复依据。
- 条款对象 brightrule_clause 不是正文来源:导入的制度没有条款记录,不要用它判断一份制度「没有内容」。
- 不读 original_file(原件文件),也不调用 read_file:交给你的只能是脱敏正文。
Expand Down