Files
Agent-System-Backend/.task/feature-regulations-kb-ext20.md
T
weichenandCursor 499ad47153
governance / governance (pull_request) Successful in 19s
ci / vet-and-test (pull_request) Successful in 1m11s
Close the EXT-20 task card before merge
Why: Card closes in the same PR per delivery rules.
Evidence: Card only.
Impact: None.
Refs: https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Backend/pulls/212
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-18 09:52:33 +00:00

3.3 KiB
Raw Blame History

feature/regulations-kb-ext20 任务卡

任务主记录:本文件随 PR 描述维护。 状态:已完成(合入前闭合);owner:weichen。PR:https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Backend/pulls/212

基线与授权

  • 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Backend.git;root_target:main;immediate_target:main
  • branch_kind:standalone;跨仓总任务:Agent-System-Dev feature/regulations-kb(Dev PR #614)
  • R0(initial_main_sha):cac60c0;工作区:/home/weichen/projects/Agent-System-Backend-wt-feature-regulations-kb-ext20;分支:feature/regulations-kb-ext20
  • 授权与交付终点:用户 2026-10-18 /goal 指示按法规知识库计划实现全部内容;本任务交付 U9 的基座公开契约 EXT-20(提案:Documents docs/proposals/2026-10-18-ext-20-regulations-provider.md,分支 feature/regulations-kb-u9-contract),经 PR 合入 main。不含法规提供方实现(属 KB 仓)与 RDM 消费(U6)。
  • 实施执行:agent-per-unit(配置:AGENT-EXECUTION.md)

目标与非目标

  • 目标:pkg/extension 新增 RegulationsProvider/RegulationsRegistrar/RegulationsHost 与 DTO;进程内注册槽仅接受插件 kbreg 且只注册一次;分发 Host 实现四个方法并强制调用方身份、查询最小化(机密词拒绝、长度限制)、状态透传与无明文审计;快照、边界与契约/兼容测试。
  • 非目标:不实现搜索或语料检索;不改 KnowledgeSearch 语义。

Agent 实施收据

单元 ID 预期范围 角色 候选顺序 attempt CLI/模型 终态 transport fallback 源码外收据路径
backend-ext20-regulations-provider pkg/extension、internal/app implementation cursor, antigravity, pi 1 cursor-agent-stable / auto(session not-observable,新进程) success refs/agent-exec/cfc2e055f212789112cf11716f5649c5/c04b36e76696 → aaed108(apply 快进) 否 /tmp/regkb-u9-receipt.json

结果与验证(完成后填写)

  • 结果:pkg/extension/regulations.go(EXT-20 接口、DTO、状态常量、ErrRegulationsUnavailable)、surface.txt 与 SurfaceVersion 2.15.0-experimental;internal/app/regulations.go 注册槽(仅 kbreg、一次、非 nil;声明式拒绝)与 inprocHost 四方法(有效账户检查、调用方取自分发上下文、schema 校验、查询去空白/1–256 字符/排除词拒绝且不调用提供方、状态透传、审计仅含修订/计数/状态/查询 sha256);单元与兼容测试。
  • 验证(SELF,host 于 HEAD aaed108):go vet ./pkg/extension/ ./internal/app/ 与 go test ./pkg/extension/... ./internal/app/... PASS;全量 GOWORK=off go vet ./... && go test -count=1 ./... 40 包 ok,仅 pkg/identity TestDSNFileMode 失败——在未改动基线 cac60c0 上同样失败(本机环境问题,本变更未触及 pkg/identity),以 CI(GATE)为准。
  • Review:host 主模型审阅实际 diff(base 3187a00 / head aaed108),与提案第 2、4、5 节一致,无阻塞项。
  • 影响与剩余项:新增可选能力,未注册提供方时返回不可用,既有行为不变。