Consume the sunk gate mechanics and pin the WP5 library (N1 WP5/WP6) #72

Merged
weichen merged 2 commits from feature/agent-stack-n1 into main 2026-10-07 06:36:10 +00:00
Owner

N1 增量四(Backend 侧):消费下沉的门禁机制(WP5/WP6 宿主侧)

Agent-Native PR #19(gates 包 + ContractBackend)与 #20(ArtifactIDPattern 导出)已合入。本 PR 完成 Backend 侧切换:

改动

  • directRun.stop 换调库机制:gates.ClaimGate / gates.CheckArtifacts / 续跑上限改引 gates.Max*;产品端口在 llm.go 投影(artifactRefsOf/artifactLookupOf/qualityScorer);产品文本(deliverableGuardNote 等纠正提示、verifyFallbackPrompt、systemCheckReason)留产品侧注入。
  • verify.go:删除本地 checkDeliverables/parseVerdict/stripFence/verifyVerdict 与三处硬编码上限;runVerifier 改回 gates.Verdict + gates.ParseVerdict;reminders() 的节流/封顶/文案走 gates.ProgressReminder(工具轮计数留 directRun——与事件流耦合);unfinishedItems() 只做状态过滤。
  • workflow.go:critic 判定改 gates.Verdict + gates.ParseVerdict;artIDRe 三处消费改 gates.ArtifactIDPattern;工作流定义解析的围栏剥离留本地(与门禁域无关)。
  • 嵌套 pin:deps/agent-native → c9c2f23(#19/#20 merge 后的 native main 头)。
  • 新测 wp5_ab_test.go(验收的 A/B 对照):① 验证器持续拒绝——主调用恰 4 次(3 次续跑 + 收尾),4 条理由记(3 续跑 + 1 封顶),verifyCapNotice 收尾且前三个回复降级;② 门禁分支理由逐字一致(声称无工件、伪造调用标记两支)。既有性格化套件(GuardTwiceThenNotice / VerifierRejectsThenPasses / VerifierGarbageFailsClosed / TodoReminder 三测 / FalseDeliverable 夹具)原样通过——仅对被删私有函数做了机械改名调用。

范围裁定(记入任务卡)

  • WP6b(小队成员级 deliverable Stop/提醒拉齐):需要 adapters 内成员级执行信号(工件产出追踪 + 工具轮计数),属独立特性,不在本增量;小队入口 claimsFalseDeliverable 继续承担谎称拦截。
  • WP6c(直连/子代理改经 adapters 消费):exec.Request 需表达 History/工件追踪/证据回收的扩展,属独立设计项。验收条款(A/B 对照 + 插件校验)均已覆盖。

验证

  • go vet ./... 通过;go test -count=1 ./... 29 包全 ok。

合入顺序

Agent-Native #19/#20 ✓ → 本 PR → Dev 双 pin PR。

主任务:Dev 仓 feature/agent-stack-n1。

# N1 增量四(Backend 侧):消费下沉的门禁机制(WP5/WP6 宿主侧) [Agent-Native PR #19](https://git-home.u1680832.nyat.app:30319/weichen/Agent-Native/pulls/19)(gates 包 + ContractBackend)与 [#20](https://git-home.u1680832.nyat.app:30319/weichen/Agent-Native/pulls/20)(ArtifactIDPattern 导出)已合入。本 PR 完成 Backend 侧切换: ## 改动 - **`directRun.stop` 换调库机制**:`gates.ClaimGate` / `gates.CheckArtifacts` / 续跑上限改引 `gates.Max*`;产品端口在 `llm.go` 投影(`artifactRefsOf`/`artifactLookupOf`/`qualityScorer`);产品文本(deliverableGuardNote 等纠正提示、verifyFallbackPrompt、systemCheckReason)留产品侧注入。 - **`verify.go`**:删除本地 `checkDeliverables`/`parseVerdict`/`stripFence`/`verifyVerdict` 与三处硬编码上限;`runVerifier` 改回 `gates.Verdict` + `gates.ParseVerdict`;`reminders()` 的节流/封顶/文案走 `gates.ProgressReminder`(工具轮计数留 directRun——与事件流耦合);`unfinishedItems()` 只做状态过滤。 - **`workflow.go`**:critic 判定改 `gates.Verdict` + `gates.ParseVerdict`;`artIDRe` 三处消费改 `gates.ArtifactIDPattern`;工作流定义解析的围栏剥离留本地(与门禁域无关)。 - **嵌套 pin**:`deps/agent-native` → c9c2f23(#19/#20 merge 后的 native main 头)。 - **新测 `wp5_ab_test.go`(验收的 A/B 对照)**:① 验证器持续拒绝——主调用恰 4 次(3 次续跑 + 收尾),4 条理由记(3 续跑 + 1 封顶),`verifyCapNotice` 收尾且前三个回复降级;② 门禁分支理由逐字一致(声称无工件、伪造调用标记两支)。既有性格化套件(GuardTwiceThenNotice / VerifierRejectsThenPasses / VerifierGarbageFailsClosed / TodoReminder 三测 / FalseDeliverable 夹具)**原样通过**——仅对被删私有函数做了机械改名调用。 ## 范围裁定(记入任务卡) - WP6b(小队成员级 deliverable Stop/提醒拉齐):需要 adapters 内成员级执行信号(工件产出追踪 + 工具轮计数),属独立特性,不在本增量;小队入口 `claimsFalseDeliverable` 继续承担谎称拦截。 - WP6c(直连/子代理改经 adapters 消费):`exec.Request` 需表达 History/工件追踪/证据回收的扩展,属独立设计项。验收条款(A/B 对照 + 插件校验)均已覆盖。 ## 验证 - `go vet ./...` 通过;`go test -count=1 ./...` 29 包全 ok。 ## 合入顺序 Agent-Native #19/#20 ✓ → 本 PR → Dev 双 pin PR。 主任务:Dev 仓 `feature/agent-stack-n1`。
weichen added 1 commit 2026-10-07 06:32:23 +00:00
Consume the sunk gate mechanics and pin the WP5 library
ci / vet-and-test (pull_request) Successful in 40s
5f9e77a500
Why: N1 WP5 host side - directRun.stop and the checklist reminders
now call the library gates package behind product ports, and the
nested native pin moves to the merged WP5 head.

Evidence: go vet clean; go test ./... 29 packages ok, including the
characterization suite unmodified and the new wp5_ab_test.go
(verify-cap continuation counts and gate-reason text parity).

Impact: llm.go drops the local regex family and deliverableGate;
verify.go drops checkDeliverables/parseVerdict/stripFence and the
local caps; workflow.go switches to gates.Verdict; reminders run
through gates.ProgressReminder. Behavior is pinned identical by the
existing suite plus the A/B tests. Squad reminders stay out of this
increment (adapter lacks per-member tool-turn signals - recorded as
WP6b).

Refs: Documents proposal 2026-10-07-agent-stack-n1q1i1-plans.md WP5/WP6
weichen added 1 commit 2026-10-07 06:35:41 +00:00
Merge origin/main into the N1 backend branch
ci / vet-and-test (pull_request) Successful in 41s
4e3c0b60c1
weichen merged commit 395a9907d7 into main 2026-10-07 06:36:10 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#72