-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Feat/workflow init wiki #2566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
YH-1600
wants to merge
12
commits into
main
Choose a base branch
from
feat/workflow-init-wiki
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat/workflow init wiki #2566
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
df9a67d
docs(drive): add knowledge_base_bootstrap workflow
YH-1600 5c497ff
docs(drive): address knowledge_base_bootstrap review comments
YH-1600 ccd3311
docs(drive): add write gate and action-scoped permissions to knowledg…
YH-1600 95164bc
docs(drive): address knowledge_base_bootstrap PR review comments
YH-1600 b57f856
docs(drive): add knowledge_ingest workflow
YH-1600 869edb0
docs(drive): harden knowledge_ingest and kb gates from review
YH-1600 e519064
docs(drive): address CodeRabbit review on output-dir and readback
YH-1600 6dd22a0
docs(drive): enforce action routing and safe overwrite from review
YH-1600 ac6cae1
docs(drive): close gate routing and scan-completeness gaps from review
YH-1600 11ac0e8
docs(drive): drop unused VALID_PUBLISH_ROLES constant
YH-1600 8e449af
docs(drive): fix missing-Wiki handoff, governance gaps, attachment pa…
YH-1600 4166827
docs(drive): document scan-completeness signal in knowledge_ingest
YH-1600 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
158 changes: 158 additions & 0 deletions
158
...s/lark-drive/references/lark-drive-workflow-knowledge-base-bootstrap-outputs.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| # 知识库维护标准初始化 — 规范模板与输出模板 | ||
|
|
||
| 本文件是 [`lark-drive-workflow-knowledge-base-bootstrap.md`](lark-drive-workflow-knowledge-base-bootstrap.md) 的配套引用文档,在 workflow 进入 `OUTLINE_PROPOSE`、`GEN_STANDARD` 和 `WRITE_CONFIRM` 状态时加载。 | ||
|
|
||
| 本文件承载两类内容:`GEN_STANDARD` 生成维护规范时的内容模板,以及各状态用户可见输出的表格样式。所有模板是结构骨架,实际文本由 agent 结合知识库主题、节点名称和现有草稿填充。不要将本文件的模板原样照抄为死板套话。 | ||
|
|
||
| ## 维护规范内容模型 | ||
|
|
||
| 维护规范分两层写入:通用规范写入根节点,专属维护要求写入各子节点。通用规范只在根节点写一次,子节点不重复通用规范全文。 | ||
|
|
||
| 每个节点的维护规范文档统一由两部分组成:**顶部一张 6 行治理表**(结构化元数据,供门禁校验和后续维护)+ **正文**(该节点的维护规范内容)。治理表字段名称和顺序保持一致,不因节点类型删减;字段未知时填“待确认”,并把 `page_status` 保持为“进行中”。 | ||
|
|
||
| ### 6 行治理表(所有节点统一表头) | ||
|
|
||
| | 字段 | 填写规则 | 门禁相关 | | ||
| |------|----------|----------| | ||
| | 来源 | 这份维护规范的制定依据:用户提供的标准、上位制度,或“据业务常识制定”。多来源逐条列出 | 不得为空 | | ||
| | 负责人 | 本节点维护规范的负责人,优先“姓名|团队”。未知填“待确认” | 待确认时 `page_status` 须为进行中 | | ||
| | 版本与状态 | 写成 `v1.0|已完成`;状态只能是 `进行中 / 已完成 / 已废弃` | 状态须合规;有“待确认”时不得为已完成 | | ||
| | 适用与可见范围 | 适用的组织、岗位、人群和可见范围;全员适用也显式写明 | 不得为空 | | ||
| | 生效与更新 | 写成 `生效:YYYY-MM-DD|更新:YYYY-MM-DD|原因:首次创建 + 说明`;无独立生效日期写“不适用(原因)” | 允许“待确认” | | ||
| | 复核策略 | 写成 `类型:<知识类型>|周期:<天>|下次复核:YYYY-MM-DD` | 允许“待确认” | | ||
|
|
||
| 字段值未确定时统一填“待确认”,不得编造。含“待确认”的节点 `page_status` 保持“进行中”;只有 6 行齐备、无“待确认”的节点才可标为“已完成”。 | ||
|
|
||
| ### 根节点:通用维护规范 | ||
|
|
||
| 根节点文档 = 6 行治理表 + 通用规范正文。正文包含以下六个部分,缺乏来源依据的部分据知识库业务领域的通用文档管理常识补全,并保持与知识库主题一致。 | ||
|
|
||
| | 部分 | 内容要点 | 来源 | | ||
| |------|----------|------| | ||
| | 维护总则 | 维护的基本原则,例如及时更新时限、内容真实完整、分类存放、可追溯 | 据业务常识生成 | | ||
| | 文件命名规范 | 统一命名格式,例如 `[资料类别]-[项目/部位]-[编制单位]-[日期]`,并约定日期格式 | 据业务常识生成,格式贴合知识库主题 | | ||
| | 文件格式要求 | 各类资料的文件格式约定,例如图纸、报告、照片分别用什么格式 | 据业务常识生成 | | ||
| | 维护职责分工 | 各子节点分别由谁维护、谁审核 | 结构来自节点树;具体人员留占位待用户补充 | | ||
| | 更新与检查机制 | 日常维护、定期检查、归档锁定等机制 | 据业务常识生成 | | ||
| | 节点导航 | 指向各子节点的导航,便于快速进入 | 结构来自节点树 | | ||
|
|
||
| ### 子节点:专属维护要求 | ||
|
|
||
| 子节点文档 = 6 行治理表 + 专属维护要求正文。正文聚焦“这个节点收什么、怎么收”,不复述根节点通用规范。 | ||
|
|
||
| | 部分 | 内容要点 | 来源 | | ||
| |------|----------|------| | ||
| | 收录范围 | 本节点应收录的资料类别清单 | 优先从该节点现有草稿归纳;草稿缺失再据节点名称和业务常识补全 | | ||
| | 分类细则 | 节点内资料的进一步分类或编号规则(如有必要) | 从草稿归纳或据常识补全 | | ||
| | 命名与格式适用 | 本节点资料适用的命名与格式约定,引用根节点通用规范并给出本节点示例 | 据根节点通用规范派生 | | ||
| | 维护与审核人 | 本节点的维护人和审核人 | 留占位待用户补充 | | ||
|
|
||
| ## 用户可见输出模板 | ||
|
|
||
| 以下表格是各状态用户可见输出的样式骨架。列名使用中文;内部枚举值转为自然语言中文标签展示。 | ||
|
|
||
| ### READ_STRUCTURE:结构概览 | ||
|
|
||
| ```text | ||
| 知识库:<知识库名称> | ||
| 根节点:<根节点标题> | ||
| 节点总数:<N>(docx <a> / 非 docx <b> / 快捷方式 <c>) | ||
|
|
||
| | 层级 | 节点标题 | 类型 | 现有内容 | | ||
| |------|----------|------|----------| | ||
| | 根 | 建材经贸大厦改造项目验收 | 文档 | 默认占位 | | ||
| | 子 | 消防验收 | 文档 | 已有草稿 | | ||
| | 子 | 质量验收 | 文档 | 已有草稿 | | ||
| ``` | ||
|
|
||
| 类型列:文档 / 表格 / 多维表格 / 思维笔记 / 幻灯片 / 快捷方式。 | ||
| 现有内容列:默认占位 / 已有草稿 / 空。 | ||
|
|
||
| ### OUTLINE_PROPOSE:大纲提议表 | ||
|
|
||
| 仅在结构过简(如只有根节点)时展示。基于知识库主题和根节点标题提议子节点大纲,请用户确认后新建。确认表除节点名和收录范围外,必须给出每个拟建节点的精确 `--title`、目标位置(`--parent-node-token` 指向 `root_node`,或 `--space-id` 建在空间顶层)和对象类型,以便用户逐项核对。 | ||
|
|
||
| ```text | ||
| 当前知识库仅有根节点 <根节点标题>(root_node token: wikcn_ROOT),缺少承载分类的子节点。 | ||
| 基于主题提议以下子节点大纲,确认后新建(新建为文档节点,可再调整): | ||
|
|
||
| | 拟建 --title | 目标位置(parent) | 对象类型 | 收录范围(简述) | | ||
| |--------------|--------------------|----------|------------------| | ||
| | 消防验收 | wikcn_ROOT | docx | 消防设计图、验收报告、现场照片 | | ||
| | 质量验收 | wikcn_ROOT | docx | 质量检验记录、整改单、验收结论 | | ||
| | 集团项目验收 | wikcn_ROOT | docx | 批复、招标、合同、竣工验收总结 | | ||
|
|
||
| 确认后对每个节点执行: | ||
| wiki +node-create --as <runtime identity> --parent-node-token wikcn_ROOT --title "<拟建标题>" --obj-type docx | ||
| → 记录返回的 node_token 与 obj_token,回读并入 node_inventory;obj_token 即后续 docs +update 的写入目标 | ||
|
|
||
| 确认新建这些节点吗?也可增删或改名后再建;如只想为现有根节点写规范,可跳过新建。 | ||
| ``` | ||
|
|
||
| 新建后回读并入结构,再继续分诊与规范撰写。 | ||
|
|
||
| ### TYPE_TRIAGE:分诊表 | ||
|
|
||
| ```text | ||
| | 节点标题 | 类型 | 分诊 | 处理方式 | | ||
| |----------|------|------|----------| | ||
| | 消防验收 | 文档 | 可写正文 | 写入维护规范 | | ||
| | 验收台账 | 表格 | 非文档节点 | 默认跳过(可选:新建文档规范页) | | ||
| | 外部资料 | 快捷方式 | 快捷方式 | 跳过(无自有正文) | | ||
| ``` | ||
|
|
||
| 分诊列:可写正文 / 非文档节点 / 快捷方式。 | ||
|
|
||
| ### WRITE_CONFIRM:写入计划 | ||
|
|
||
| R2 高风险写入。确认前必须展示每个目标节点的稳定标识(`node_token`,重名子节点靠它区分)、写入命令族、写法、`kb_gate.py` 门禁结果,以及将写入的精确内容或相对现状的 diff——不能只给标题和摘要。内容较长时,逐节点展示其完整拟写正文(可折叠为分节,但必须可供用户逐字核对)。 | ||
|
|
||
| ```text | ||
| 即将写入 <M> 个节点,门禁拦截 <B> 个,状态收紧 <N> 个,跳过 <K> 个。写入为高风险操作(docs +update),确认后执行。 | ||
|
|
||
| | 节点标题 | node_token | 写法 | 命令族 | 门禁 | 写入内容 | | ||
| |----------|------------|------|--------|------|----------| | ||
| | 建材经贸大厦改造项目验收(根) | wikcn_ROOT | 覆盖 | docs +update overwrite | 通过 | 通用维护规范(六部分,全文见下) | | ||
| | 消防验收 | wikcn_A | 追加 | docs +update append | 收紧为进行中:负责人待确认 | 收录范围 + 分类细则(全文见下) | | ||
| | 质量验收 | wikcn_B | 覆盖 | docs +update overwrite | 通过 | 收录范围 + 分类细则(全文见下) | | ||
| | 验收台账·规范页(新建) | 建后回填 | 新建文档 | wiki +node-create → docs +update | 通过 | 该节点专属维护要求(全文见下) | | ||
|
|
||
| <逐节点展开将写入的精确正文;append 场景标明追加位置,overwrite 场景标明将替换的占位内容> | ||
|
|
||
| 新建文档(new_docx)项,须展示完整命令序列(原对象不改动): | ||
| 1) wiki +node-create --as <runtime identity> --parent-node-token <目标父节点,如非docx原节点同级 wikcn_T 的父> --title "<精确标题,如:验收台账·维护规范>" --obj-type docx | ||
| 2) 记录返回的 node_token 与 obj_token | ||
| 3) docs +update --as <runtime identity> --doc <上一步 obj_token> --command overwrite --content <规范正文> | ||
| 说明:new_docx 目标位置必须显式(--parent-node-token 或 --space-id),标题必须精确给出;node-create 返回的 obj_token 才是 docs +update 的写入目标,不得写向原非 docx 节点。 | ||
|
|
||
| 门禁拦截(不写入,记入 unsupported_checks): | ||
| | 节点标题 | node_token | 门禁原因 | | ||
| |----------|------------|----------| | ||
| | 验收台账 | wikcn_T | 载体不是文档节点:obj_type=sheet | | ||
|
|
||
| 跳过节点: | ||
| | 节点标题 | node_token | 类型 | 原因 | | ||
| |----------|------------|------|------| | ||
| | 外部资料 | wikcn_C | 快捷方式 | 无自有正文 | | ||
| ``` | ||
|
|
||
| 门禁列:通过 / 收紧为进行中(原因) / 拦截(原因)。写法列:覆盖 / 追加 / 新建文档 / 跳过。 | ||
|
|
||
| ### VERIFY:验证与汇总 | ||
|
|
||
| ```text | ||
| | 节点标题 | 写入 | 校验 | | ||
| |----------|------|------| | ||
| | 建材经贸大厦改造项目验收(根) | 成功 | 已确认通用规范落地 | | ||
| | 消防验收 | 成功 | 已确认收录范围落地 | | ||
|
|
||
| 汇总:已更新 <M> 个节点,跳过 <K> 个节点。 | ||
| 未写入节点(unsupported_checks): | ||
| | 节点标题 | 类型 | 原因 | | ||
| |----------|------|------| | ||
| | 验收台账 | 表格 | 非文档节点 | | ||
|
|
||
| 知识库链接:<URL> | ||
| ``` | ||
|
|
||
| 校验列:已确认落地 / 未落地(需重试)/ 失败。 | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.