Repository navigation
Conversation
命中已带 policy、owning_unit、clause_hash(知识源的 metadataFields), 技能不再为这三项按条款 id 查一次 brightrule_policy_clause;命中没有 metadata 时保留回查作为退路。section_key 不随条文入索引,只在要看 同节前后条时才按条款 id 取。 技能文字由 5677 降到 5590,policy-inquiry-length 测试恢复通过 (main 上此前为 5677 > 5600)。 Refs #97 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dn2Af3j32UkLgdzhb7Zu3
brightrule#76 之后制度是私有的,员工靠 brightrule_policy_unit_<单位> 规则读本单位和上级单位的制度。drive.ts setup 从不写这些规则,所以 评测环境里每个员工身份读到的制度是 0 份,检索全部 0 命中。 setupEnvironment 在载入制度之后调用应用自己的 reconcilePolicyUnitRules(scripts/sharing/policy-unit-sharing.mjs), 用 setup 已登录的管理员会话;--skip-policies 时同样跑。结果里新增 sharingRules(新建、改写、删除、不变的规则数)。规则写入失败时 setup 报错并点名 manage_sharing,不再静默产出 0 命中的评测。 Refs #93 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dn2Af3j32UkLgdzhb7Zu3
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
本 PR 有两处互不相关的改动,各一个提交。它们在同一个分支上,是因为开 PR 的会话只被允许推这一个分支;需要分开合并时可以拆成两个 PR。
一、制度问询技能直接读命中的 metadata(Refs #97)
制度问询技能在「没有指定制度」一步,检索后不再按条款 id 回查
brightrule_policy_clause取policy、owning_unit、clause_hash。这三项已经在命中的metadata里(知识源policy_clause的metadataFields,平台 objectstack#38291),技能改为直接读。metadata时,保留按 id 回查作为退路,所以在不带metadata的平台版本上行为和现在一样。section_key没有加进metadataFields(加了要重建索引,把全部条款再发一次给向量模型)。它只在「要看同节前后条或整张表」时用,改为那时才按条款 id 取。clause_hash查本公司同文条款」和「写出处前查制度表」两步没有动。policy-inquiry-length测试在 main 上是失败的(5677 > 5600),本改动把技能文字降到 5590,恢复通过。专题:objectstack-ai/objectstack#38901 行 0。
二、评测 setup 写入按单位共享的规则(Refs #93)
scripts/eval/driver/setup.ts的setupEnvironment在载入制度之后调用应用自己的reconcilePolicyUnitRules(scripts/sharing/policy-unit-sharing.mjs),用 setup 已登录的管理员会话。--skip-policies时同样跑,因为制度可能是之前导入的。sharingRules:新建、改写、删除、不变的规则数,日志里也有一行。manage_sharing。brightrule_policy_admin不含这个权限(它只有诊断和维护两项),所以 setup 登录的账号要是平台管理员。脚本的拒绝条件没有放宽。验证
pnpm run validate通过;pnpm run typecheck通过。vitest run src/skills8 个用例通过;vitest run scripts/eval62 个用例通过,其中新增 3 个:每个拥有制度的单位一条规则且在制度之后写、重跑不改动任何规则;--skip-policies时也写;规则接口返回 403 时 setup 报错。还没做的,所以是草稿
search_knowledge返回,确认命中带metadata。开 PR 时 os-4 的 MCP 端点连续返回 Service Unavailable,没抓到。https://claude.ai/code/session_012dn2Af3j32UkLgdzhb7Zu3
Generated by Claude Code