Files
Agent-System/.doc/ops/short-term/2026-09-15-multi-intent-u1-contracts.md
T
weichenandCursor 3d326ad81e docs(status): record U1 multi-intent contract freeze
Archive the arch/parity/short evidence and mark the U1 claim done so U2 can take the intent mutex next.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:27:03 +00:00

3.5 KiB
Raw Blame History

title, status, created, updated, owner, branch, worktree, mutex
title status created updated owner branch worktree mutex
多意图 HITL U1:契约冻结 done 2026-09-15 2026-09-15 Cursor feature/multi-intent-u1-contracts - architecture-docs

多意图 HITL U1:契约冻结

目标

冻结 app/intentflow 边界、状态机、BatchActionPolicy、错误码、事件契约与默认 legacy tier;不改识别路由、不建表、不接 HTTP。

范围

  • module-boundaries.yaml:app/intentflow allowlist、三表 owner、unwrap_owners、三条 intent.plan.* 事件
  • events.StaticContracts 与 YAML 对等;archtest 扫描 intent.plan.*
  • internal/app/intentflow 骨架:状态、错误码、Service 端口、政策、tier 开关
  • CSRF/认证结论:现有 Bearer + CORS 对 U5 足够,不是 blocker

非目标

  • 不修改 internal/intent 业务类型或 MULTI_INTENT_ENABLED
  • 不建 Goose 表、不接线 app.Assemble、不改 chat/coordinator/Web
  • 不 Append 事件、不实施 U2–U12

REST(U5 再挂路由)

  • GET /api/v1/intent-plans/active
  • GET /api/v1/intent-plans/{plan_id}
  • POST /api/v1/intent-plans/{plan_id}/decisions
    • body:expected_revision、decision_nonce、decision_digest、kind、步骤选择

CSRF / 认证(U5 前置结论,非 blocker)

现有认证是 Authorization: Bearer 或 X-Session-Token 请求头(internal/server/auth_handlers.go),无 cookie 会话,无独立 CSRF 中间件;另有 Origin allowlist CORS。

  • 自定义头不会被浏览器跨站表单自动带上,现有模式对 U5 足够
  • decision_nonce / 幂等键只防重放与并发,不替代 CSRF 或身份认证
  • U5 必须 requireAuthenticatedUser + 四元作用域(environment/project/session/user)
  • 禁止为计划 API 改成 cookie 自动提交
  • 若未来改 cookie 认证,另立 auth 任务,不得在 intent-plan 端点发明弱 CSRF

步骤

  1. 从最新 dev 检出 feature/multi-intent-u1-contracts 并认领 CURRENT
  2. 登记边界 YAML、事件契约、archtest regex
  3. 落地 intentflow 骨架与 BatchActionPolicy
  4. arch/parity/short 测试与 U1 报告

验收标准

  • intent -> maturity 保持;server/chat 不直写计划表
  • YAML ↔ StaticContracts parity 绿
  • 未知 action/policy key fail closed;ActionRegistry 无 batch/tier 字段
  • 默认 MULTI_INTENT_PLAN_TIER=legacy
  • 单意图生成策略不变(本单元无运行时改动)

相关链接

证据 / 备注

  • 事件登记窗口同时占用 events mutex;U1 不改 intent 代码。
  • 生产者含 events:StaticContracts 字面量落在 internal/events/registry.go,与现有 document.* 先例一致。
  • CSRF:Bearer / X-Session-Token + CORS allowlist,U5 非 blocker。
  • 冒烟:go vet ./...、go test -short ./...、./scripts/arch-check.sh --mode block PASS。U1 无 schema/容器变更,集成槽位保持 idle。
  • 提交:bdccb4d docs(ops);aefb1e4 feat(events);9364da4 feat(intentflow);随后 docs(status)。