Compare commits

...
Author SHA1 Message Date
weichen 2fe1e05591 release-candidate: 汇集 dev 功能至 test(test 单二进制化配套脚本 + docker 上下文修复),准备长期实测 [Tag: rc-v1.1.0-beta.4] 2026-09-27 20:59:11 +00:00
weichen 5e409c1eb2 merge: candidate docker-context-gitkeep-2026-09-27 into dev 2026-09-27 18:35:32 +00:00
weichen e40a9989ab fix(deploy): keep web/dist/.gitkeep in docker context for go:embed
.dockerignore excluded the whole web/dist dir, breaking go-builder since
web/embed.go (all:dist) landed (6cbe7e6e): candidate image builds failed
with "pattern all:dist: no matching files found". Re-include the tracked
.gitkeep only; runtime stays disk-dist via web-builder COPY (LookupDist
false -> disk fallback). Verified by a real candidate-images-build run.
2026-09-27 18:29:50 +00:00
weichen 94c215d36e merge: candidate test-single-binary-2026-09-27 into dev 2026-09-27 16:21:34 +00:00
weichen d91dafc1c4 feat(scripts): test env single-binary entrypoints (migrate-test-db, launch-single)
- migrate-test-db.sh: reuse parameterized migrate-dev-db.sh with test defaults
  (container shuimu-system-pg-test -> localpg :5434, PGDATA=data/test/pg)
- launch-single.sh: non-dev single-binary launcher (SYSTEM_DB_*->CONTEXT_DB_*
  mapping, env-scoped PI sidecar, no Vite); task record for dev->test rc
  promotion + test conversion (rc-v1.1.0-beta.4)
2026-09-27 16:21:09 +00:00
weichen 05d45022b1 merge: candidate upload-doc-access-2026-09-27 closeout into dev 2026-09-27 08:10:14 +00:00
weichen 07845cfcee docs(task): close out upload-doc-access (dev 86efba2c verified, E2E PASS, lesson added) 2026-09-27 08:10:05 +00:00
weichen 86efba2cd5 merge: candidate upload-doc-access-2026-09-27 into dev 2026-09-27 07:52:39 +00:00
weichen 307e9e6569 docs(current): claim upload-doc-access-2026-09-27 (docs apply receipt upload-doc-access-2026-09-27-state-1) 2026-09-27 07:45:36 +00:00
weichen 88e33282db fix(freedoc): persist uploaded file metadata and text body server-side
上传文档跨端不可访问修复(ISSUE-20260927-upload-doc-cross-device):
- 迁移 00076:freeform_documents 增加 source_filename/mime/size_bytes/asset_id
- freedoc:Create/Get/List 读写源文件元数据,负值拒绝
- 前端:注册前全部附件先登记 CAS 并预读文本正文;文本正文嵌入注册
  markdown;跨端恢复 sourceType/fileMeta 路由回文件预览器
- 大小显示 formatFileSize(<512B 不再显示 0 KB)
- E2E 新增 FS-UPLOAD-02 跨浏览器上下文可访问性用例

回归:go vet/arch-check/go test -short(隔离 PG)+ web npm test/build 全绿;
存量无元数据旧文档不可恢复(重新上传即可)。
2026-09-27 07:45:15 +00:00
weichen a0e40919a7 merge: candidate frontend-demo-fallback-2026-09-27-r3 closeout into dev 2026-09-27 07:08:12 +00:00
weichen 9da300ae60 docs(task): finalize active-session residue closeout state
任务文档终态(done/merged/passed/cleanup done)、ISSUES 行 resolved
(dev 36c5fb54 复验证据)、CURRENT 置 done。
2026-09-27 07:08:05 +00:00
weichen 36c5fb549c merge: candidate frontend-demo-fallback-2026-09-27-r3 into dev 2026-09-27 07:06:17 +00:00
weichen 083c63bb9c docs(issue): register active-session residue issue and r3 task record
登记 ISSUE-20260927-active-session-residue(ISSUE-20260927-demo-fallback
修复残留路径);新增 r3 任务主记录(根因/同类排查/修复方案/验证证据);
CURRENT 登记 r3c 任务行。
2026-09-27 07:05:09 +00:00
weichen 739b8c56f9 fix(web): purge legacy demo sessionId residue from localStorage on read
旧前端曾把 demo fallback 值 sess-001 持久化到 active_session;一次性
purge 版本 key 已写不再清理,读取侧无校验导致老浏览器 + 无可见会话
账号首屏 4x chat 404。提取共享 LEGACY_DEMO_SESSION_IDS 常量,
loadActiveSessionId 命中即清除并返回 fallback(幂等),loadMessages
复用同一集合。
2026-09-27 07:05:05 +00:00
weichen 87db3621c6 merge: candidate frontend-demo-fallback-2026-09-27-r2 into dev 2026-09-27 03:15:24 +00:00
weichen 0648867921 docs(current): mark frontend-demo-fallback-2026-09-27-r2 done 2026-09-27 03:15:22 +00:00
weichen 41b9b8bc3d merge: candidate frontend-demo-fallback-2026-09-27-r2 into dev 2026-09-27 03:14:56 +00:00
weichen 20b68d6a23 docs(task): finalize frontend-demo-fallback closeout state 2026-09-27 03:14:53 +00:00
weichen 0de657f09c merge: candidate frontend-demo-fallback-2026-09-27-r2 into dev 2026-09-27 03:11:32 +00:00
weichen db038aa7a7 fix(web): stop phantom demo-fallback requests in seeds-off mode
App.tsx hardcoded fallbacks (active session "sess-001", projectId 1) sent
requests for nonexistent resources on fresh logins against real dev data,
producing 7+ console 404/403 hits. Fallbacks now resolve to empty/0; the
existing chatBlockedNoProject empty state and session-reconciliation effect
carry the UI, and demo-seeds-enabled builds keep the NEUROPULSE fallback.

Root cause, same-class scan, and before/after browser evidence (9 phantom
requests -> 0, author+member accounts) recorded in the task doc; ISSUES row
ISSUE-20260927-demo-fallback registered.
2026-09-27 03:09:37 +00:00
weichen 56928ac206 merge: candidate full-system-browser-e2e-2026-09-26 into dev 2026-09-26 09:28:00 +00:00
weichen a9d79b99b8 docs(test): audit-friendly E2E report with retained login credentials 2026-09-26 07:58:47 +00:00
weichen 7ab7d572b9 docs(test): e2e ledger after reject portal fix 2026-09-26 07:48:36 +00:00
weichen 887a75c1b1 fix(web): portal reject modal above stacking context 2026-09-26 07:48:30 +00:00
weichen 157ec407e2 docs(test): full-system browser e2e re-run ledger 2026-09-26 07:29:34 +00:00
weichen 7513ce61ed fix(web): member drafting edit + reject await + expand right rail 2026-09-26 07:29:27 +00:00
weichen 7555818753 docs(test): FINAL full-system browser E2E report after pending heal 2026-09-26 05:14:11 +00:00
weichen 323088c4bd docs(test): add playwright log for full-system e2e rerun 2026-09-26 04:31:01 +00:00
weichen ccce44dfc0 fix(chat): heal task bubble pending after completed run 2026-09-26 04:30:38 +00:00
weichen a5ca6fdcfd test(e2e): document PI UI pending mismatch and raise suite timeout 2026-09-26 04:12:33 +00:00
weichen 466426a58f test(e2e): full-system browser multi-user acceptance 2026-09-26 03:48:34 +00:00
weichen 4873c5e8b9 test(e2e): full-system browser multi-user acceptance 2026-09-26 03:28:34 +00:00
weichen 078eb4fcf0 test(e2e): full-system browser multi-user acceptance 2026-09-26 03:23:35 +00:00
weichen 09cc76eb8d merge: candidate sysadmin-maturity-refresh-2026-09-26 into dev 2026-09-26 02:46:15 +00:00
weichen 9ff489546c docs: sysadmin maturity refresh closeout (results, current claim done) 2026-09-26 02:46:10 +00:00
weichen 1d82ed8823 merge: candidate sysadmin-maturity-refresh-2026-09-26 into dev 2026-09-26 02:45:12 +00:00
weichen d537778b60 fix(sysadmin): refresh feature maturity catalog to post-rollout wiring facts
The static adapter catalog still read I2-era states (degraded/shadow) after
the 2026-09-26 dev rollout, so the admin features page showed 降级 for flags
already enabled. Update six entries to live+ready with evidence-dated
reasons (I2/I3/P8 acceptance, P8 per-key gates kept visible, shadow
visibility digest now persisted, REPLACE wildcard wiring, PI narrative dev
rollout); keep FAV red lines untouched. Tests updated; FAV now carries the
configured-value-must-not-imply-readiness assertion.
2026-09-26 02:45:05 +00:00
weichen 1d13a892fc merge: candidate degraded-flags-enable-2026-09-26-r4 into dev 2026-09-26 02:39:09 +00:00
weichen 4e7f84111d docs: degraded-flags-enable closeout (task record, dev runtime test report, matrix notes, current claim) 2026-09-26 02:39:05 +00:00
weichen 6b31718138 merge: candidate degraded-flags-enable-2026-09-26-r4 into dev 2026-09-26 02:29:36 +00:00
weichen e9c0281404 feat(ctxmgr): wildcard session allowlist for semantic replace rollout
- SEMANTIC_SUMMARY_REPLACE_SESSIONS supports * (all sessions, present and
  future), mirroring INTENT_PLAN_PROJECT_ALLOWLIST; empty allowlist still
  replaces nothing (fail-closed defense in depth unchanged)
- declare SEMANTIC_SUMMARY_REPLACE(_SESSIONS) in dev/test/main compose app
  env (stale Wave2 "REPLACE unwired" comment fixed); extend A-4 declaration
  test; .env.example key docs updated
- sysadmin feature catalog: SESSIONS description + REPLACE reason note *

Prepares dev degraded-flags enable (task degraded-flags-enable-2026-09-26-r4):
user-authorized all-session replace, plan tier confirm, shadow summary, PI
change-report narrative; env ops and runtime verification follow.
2026-09-26 02:29:29 +00:00
weichen 66ea4e3e51 merge: candidate deploy-record into dev 2026-09-26 02:15:20 +00:00
weichen c9e2263325 docs: record review-fixes deployment verification (dev 1ceda34c live IDOR probe) 2026-09-26 02:15:11 +00:00
weichen 1ceda34c43 merge: candidate integrate-review-fixes (report + P0/P1 fixes) into dev 2026-09-26 02:08:50 +00:00
weichen 467e64574f docs: closeout review report + fix task records for batch integration 2026-09-26 02:07:45 +00:00
weichen 438fdc8686 merge: system code review report into dev
# Conflicts:
#	.doc/ops/CURRENT.md
2026-09-26 02:06:58 +00:00
weichen dfd9c420d3 docs(current): pre-align claim table for review-report merge (docs apply @document) 2026-09-26 02:06:02 +00:00
weichen fb376c0ea0 merge: candidate system-review-p0-p1-fixes into dev 2026-09-26 02:02:42 +00:00
weichen ea66f4456f docs: review P0/P1 fix records, ISSUES ledger, lesson, task claim
- remediation master record for 5 resolved + 1 deferred + 1 open issues
- ISSUES.md rows with evidence dates and lesson links
- LESSON-20260926-failclosed-bypass-contract (validated)
- remediation/lessons INDEX hooks + CURRENT task row (docs apply receipt)
2026-09-26 02:00:24 +00:00
weichen 6a3a0dc201 fix(security): harden bypass authz, gate blind spot, command exec, validated_only (review P0/P1)
- FIND-SEC-01: GetUserContext requires session ownership (handler 403 +
  SQL/memory owner filter); in-memory HTTP + isolated-PG regressions
- FIND-ARCH-01: archtest fails closed on untracked table writes (+noise
  exemption) and registers 50 existing writer tables in table_owners
- FIND-SEC-02: Authorizer without pool denies by default; explicit
  NewInMemoryAuthorizer seam opt-in via ALLOW_IN_MEMORY at composition
- FIND-SEC-03: swboot commands run argv-exec (no sh -c) with exact
  basename allowlist match; prefix-spoof and no-shell-eval tests
- FIND-FLOW-01: confirm rejects validated_only plans; ExecuteClaimed
  hard-refuses validated_only steps (new error codes + HTTP mapping)
- FIND-QUAL-01: intentflow.ValidateFlagConsistency fail-fast at Assemble
2026-09-26 02:00:14 +00:00
weichen b6e382e58f docs(ops): 标记 system-code-review 认领为 done 2026-09-26 01:34:08 +00:00
weichen c7e9ec0a26 docs(audit): 系统全面 code review 报告(仅分析不修复)
记录 tip f4c1b73f 上架构/安全/可维护性/关键路径审查结论;不实施代码修复。
2026-09-26 01:33:41 +00:00
weichen f4c1b73f28 merge: candidate swboot-closeout-2026-09-26-r3 into dev 2026-09-26 01:09:32 +00:00
weichen f697420db8 docs(status): promote workflow-swboot to done — SWBOOT-10 executor + L5/L6 verified 2026-09-26 01:09:20 +00:00
weichen 7c7a08a3ca docs(test): swboot closeout evidence — executor e2e, L5 live PI, L6 playwright wizard 2026-09-26 01:08:51 +00:00
weichen 86e0cf46c6 merge: candidate swboot-closeout-2026-09-26-r2 into dev 2026-09-26 01:00:51 +00:00
weichen a52816299d fix(server): read bound repo from project_source_bindings.source_ref 2026-09-26 01:00:37 +00:00
weichen 70f3028cdb merge: candidate swboot-closeout-2026-09-26-r2 into dev 2026-09-26 00:59:21 +00:00
weichen f394bb15f9 fix(projectworkflow): write repo binding into project_source_bindings.source_ref 2026-09-26 00:59:08 +00:00
weichen 4965e74d66 merge: candidate swboot-closeout-2026-09-26-r2 into dev 2026-09-26 00:57:11 +00:00
weichen 83561682eb feat(swboot): wire SWBOOT-10 controlled patch executor (fail-closed)
DB-backed repo_path_allowlist reader (deny-all until admin seeds), per-prefix
admin test_commands (goose 00075), execution evidence table (goose 00074),
isolated git-worktree patch executor with command allowlist/time/output caps
and failure-stops evidence; controlled_patch creation/preview unlocked only
with an allowlisted repo binding (projectworkflow gate + catalog flag);
creator-only server endpoints for bindings/executions; merge/push/deploy stay
behind a typed separate-authorization boundary. Module boundary: app->swboot
composition import registered.
2026-09-26 00:56:59 +00:00
weichen d0f3f76f7e merge: candidate rdev-p3-rerun-2026-09-26-r4 into dev 2026-09-26 00:43:04 +00:00
weichen 88e9b8bade docs(test): archive P3 rerun console log (rename out of ignored *.log) 2026-09-26 00:43:00 +00:00
weichen 09e4c08f28 merge: candidate rdev-p3-rerun-2026-09-26-r3 into dev 2026-09-26 00:42:20 +00:00
weichen c9d94545f8 docs(status): promote workflow-rdev to done — P3 real-PI rerun all-pass 2026-09-26 00:42:09 +00:00
weichen 68d29ef04e docs(test): rdev P3 real-PI rerun all-pass; register docgov approval-chain issues 2026-09-26 00:41:47 +00:00
weichen 5d5cd5fd6d merge: candidate rdev-p3-rerun-2026-09-26-r3 into dev 2026-09-26 00:25:12 +00:00
weichen dc26321bab fix(docgov): join ambient uow in persistApproveAndFAV to avoid row-lock deadlock
docflow Commands.run takes SELECT ... FOR UPDATE on document_records inside
its unit of work before calling ApproverApprove; persistApproveAndFAV then
opened a second pool connection and its UPDATE blocked on that row lock until
statement timeout (SQLSTATE 57014), failing every final approval. Join the
ambient uow scope (doc sync + FAV staging on the caller tx, commit owned by
the uow); only open an own tx when no scope is present. Regression test
reproduces the production shape (FOR UPDATE + FAV wiring inside Within).
2026-09-26 00:25:01 +00:00
weichen 6bd6e91606 merge: candidate rdev-p3-rerun-2026-09-26-r3 into dev 2026-09-26 00:22:20 +00:00
weichen 043c66ccfb chore(server): log docgov approver decision failures (envelope redacts internals) 2026-09-26 00:22:15 +00:00
weichen 121b33f8ed merge: candidate rdev-p3-rerun-2026-09-26-r2 into dev 2026-09-26 00:16:08 +00:00
weichen bf3136490d fix(docgov): load review_snapshot_id when reading document records from PG
loadDocumentFromDBLocked selected every column except review_snapshot_id,
so any document loaded after a restart or cache miss lost its frozen review
snapshot and ApproverApprove failed with "approved requires frozen
review_snapshot_id". PG regression test seeds a snapshot and asserts a
fresh engine carries the id through load.
2026-09-26 00:15:56 +00:00
weichen a6d25afa27 merge: candidate chat-semantic-replace-2026-09-26 into dev 2026-09-25 23:24:55 +00:00
weichen 53d2731849 docs(status): promote chat-semantic-replace to done — fail-closed gray wiring verified 2026-09-25 23:24:45 +00:00
weichen e2cfd88ac0 docs(test): semantic REPLACE fail-closed gray wiring evidence (unit + dev runtime ladder) 2026-09-25 23:24:33 +00:00
weichen 6004494e21 merge: candidate chat-semantic-replace-2026-09-26 into dev 2026-09-25 23:14:16 +00:00
weichen aee774b894 fix(ctxmgr): keep displaced deterministic narrative for rollback-safe replace
Runtime verification found the deterministic generator merges the prior
served narrative, so a replaced (semantic) narrative would linger after
rollback. Store the displaced deterministic narrative in the shadow report
(persisted via shadow_json) and merge that instead when the prior summary
source is semantic_replace.
2026-09-25 23:14:07 +00:00
weichen cd1f846f49 merge: candidate chat-semantic-replace-2026-09-26 into dev 2026-09-25 22:56:45 +00:00
weichen ffa41d78df feat(ctxmgr): wire fail-closed gray REPLACE for chat semantic narrative
Unseal SEMANTIC_SUMMARY_REPLACE under explicit user authorization with a
defense-in-depth session allowlist (SEMANTIC_SUMMARY_REPLACE_SESSIONS):
swap happens only for allowlisted sessions after result digests and served
watermark validation, bounded narrative size; facts/counts stay deterministic
and the daily digest stays advisory. Master flag alone replaces nothing.
2026-09-25 22:56:36 +00:00
weichen 4d5d695c75 merge: candidate jevdecide-soak-2026-09-26 into dev 2026-09-25 22:51:03 +00:00
weichen cbf96ebbe5 docs(status): promote jevdecide-shadow to done — 200-turn soak converged 2026-09-25 22:50:54 +00:00
weichen 96013db9aa docs(test): jevdecide assist soak >=200 turns with 94% handled rate evidence 2026-09-25 22:50:33 +00:00
weichen c373d6fbc0 merge: candidate dialogue-ctx-closeout-2026-09-26-r4 into dev 2026-09-25 21:43:41 +00:00
weichen 4b231d97ec docs(status): promote dialogue-ctx-injection to done — close conditions verified on dev 2026-09-25 21:43:33 +00:00
weichen 416674e3ec docs(test): dialogue-ctx closeout evidence — dev migration + real PI workspace inject + conflict card smoke 2026-09-25 21:43:02 +00:00
weichen f89b946d37 merge: candidate dialogue-ctx-closeout-2026-09-26-r4 into dev 2026-09-25 21:30:41 +00:00
weichen ae48970f5f fix(pi-runner): allow host-side extension path override for task runs
Task-run pi launches hardcoded the container path /app/extensions/tavily-search.mjs;
on the no-docker host sidecar every squad/dialogue task run failed at spawn with
ENOENT/extension-load errors. Add PI_AGENT_EXTENSION override and export the
managed pi-dir extension path from the sidecar start script.
2026-09-25 21:30:29 +00:00
weichen ebb8282091 merge: candidate dialogue-ctx-closeout-2026-09-26-r2 into dev 2026-09-25 21:03:21 +00:00
weichen 76ddf4dd35 feat(ctx): surface dialogue conflict confirmation cards to triggering user
Capture trigger_user HITL expectations from dialogue adjudication (previously
dropped at the bizdev call site), project them as chat confirmation cards via
taskrun OnTerminal (exactly-once), arm the session PendingExpectation, and
handle confirm_context_fact hits through the supplement-info blackboard path.
Decline (纠正) guides the user to state the correct fact.
2026-09-25 21:01:37 +00:00
weichen f6ad3344f8 merge: candidate worktree-final-closeout-2026-09-26 into dev 2026-09-25 20:34:14 +00:00
weichen e6994e4e4e docs(closeout): 回填运行时验证与清理结果;任务收口 done 2026-09-25 20:34:06 +00:00
weichen 0e4b51c387 merge: record feature/dialogue-office-expansion-2026-09-25 into dev ancestry — 内容已由 dialogue-office-expansion-land 等价落地 dev;记录原分支历史归属 (tree unchanged) 2026-09-25 20:32:49 +00:00
weichen 19700e8590 merge: candidate worktree-final-closeout-2026-09-26 into dev 2026-09-25 20:27:01 +00:00
weichen 743b6a4774 docs(closeout): worktree 全量收口——唯一日志归档、CURRENT 漂移修正与本任务登记 2026-09-25 20:26:50 +00:00
weichen dc10818143 merge: record feature/promote-rc-beta3-c-2026-09-24 into dev ancestry — test 晋升分支:全部提交已保留于本地 test 分支头 0e4b111d(tag rc-v1.1.0-beta.3 历史);不引入 dev 树变化 (tree unchanged) 2026-09-25 20:24:51 +00:00
weichen 2a7a700051 merge: record feature/integrate-gov-visibility-p0-b-2026-09-24 into dev ancestry — 取消的重试候选,被 p0-c 替代,仅含 merge 节点 (tree unchanged) 2026-09-25 20:24:40 +00:00
weichen 5f85f3c5d7 merge: record feature/integrate-backlog-triage-p10-r2-2026-09-25 into dev ancestry — 被 r3 候选替代,仅含 merge 节点 (tree unchanged) 2026-09-25 20:24:33 +00:00
weichen 2d3a7a22f8 merge: record feature/integrate-backlog-triage-p10-2026-09-25 into dev ancestry — 被 r2/r3 候选替代,仅含 merge 节点 (tree unchanged) 2026-09-25 20:24:25 +00:00
weichen 043e10f674 merge: record feature/integrate-admin-settings-maint-b-2026-09-25 into dev ancestry — 内容已由后续候选(r3)等价合入 dev(patch-id 查重 8f9b91d3 = dev 等价提交) (tree unchanged) 2026-09-25 20:24:18 +00:00
weichen 357c869a34 merge: record feature/single-binary-deploy-design-2026-09-24 into dev ancestry — 内容已由 single-binary-design-land 等价落地 dev;记录原分支历史归属 (tree unchanged) 2026-09-25 20:24:06 +00:00
weichen db8585b558 merge: record feature/member-permissions-doc-2026-09-24 into dev ancestry — 内容已由 member-permissions-doc-land 等价落地 dev;记录原分支历史归属 (tree unchanged) 2026-09-25 20:23:58 +00:00
weichen 64a28c9842 merge: record feature/doc-review-lifecycle-2026-09-25 into dev ancestry — 交付内容已由 doc-review-lifecycle-land 等价落地 dev;本归并仅记录原分支历史归属 (tree unchanged) 2026-09-25 20:23:25 +00:00
weichen cc519e3806 merge: candidate single-binary-design-land-2026-09-26 into dev 2026-09-25 20:22:59 +00:00
weichen 6733205d58 docs(design): 非容器化单二进制三环境交付方案(自 single-binary-deploy-design 分支落地;CURRENT 认领行已废弃不入) 2026-09-25 20:22:45 +00:00
weichen 23ee0f028d merge: candidate member-permissions-doc-land-2026-09-26 into dev 2026-09-25 20:22:16 +00:00
weichen 6e76a35943 docs(system-design): 修复 README t20 设计文档迁址后的失效链接(remediation→system-design) 2026-09-25 20:21:43 +00:00
weichen 86881bef6e docs(system-design): 新增项目成员权限总览(对话/任务/补充/文档三权整合)
- 三层正交模型:系统角色能力矩阵 / 项目成员角色 / 文档三权(author-reviewer-approver)
- 四类核心动作权限矩阵:发起对话、执行任务、补充信息、文档编制与修改(deny_only_submit)
- 认证与路由分层、管理台两类 gate、前端 capabilities fail-closed 消费方式
- 如实标注已知缺口:member/viewer 服务端不区分写、visibility 键仅前端消费、system:* 未拆分
- 更新 system-design/README.md 索引与目录清单

task: member-permissions-doc-2026-09-24
2026-09-25 20:20:58 +00:00
weichen 75ff922b6e merge: candidate dialogue-office-expansion-land-2026-09-26 into dev 2026-09-25 20:20:39 +00:00
weichen af327950bd docs(plan): 对话办公能力全景盘点与 P0–P3 整改计划
盘点 32 ActionKey 与 HTTP 169 路由对话边界,明确假成功/dry-run 与 UI 专属红线;分期消除假成功、live 化 intentflow、查询真源与新写意图扩展。
2026-09-25 20:20:25 +00:00
weichen 117ef7d826 merge: candidate doc-review-lifecycle-land-2026-09-26 into dev 2026-09-25 20:17:35 +00:00
weichen 6c815b2958 fix(land): 适配 dev 现行结构 — gov()/authorizer() 访问器、去 app/docnotify stream 依赖(arch 基线)、测试 stub 重名 2026-09-25 20:17:20 +00:00
weichen 05b822d9c0 docs(evidence): doc-review-lifecycle-land re-validation 摘要 2026-09-25 20:17:11 +00:00
weichen 985bc55fa5 docs(matrix): docgov 三权流转落地证据与 U11 live 基线键说明;附 re-validation 证据 2026-09-25 20:16:36 +00:00
weichen b5a782bb38 feat(chat): dialogue triggers for comments/reopen/pending-supplements with mistouch guards
Wire intent→coordinator DocResolver confirm cards→action_executor kinds for comment, reopen, pending-supplements query, and real submit-review execution.
2026-09-25 20:14:10 +00:00
weichen 2e56ba9719 feat(docgov): complete review lifecycle gaps for lock/notify/comment/reopen
Defer locked-period supplements to a pending ledger, route duty-holder
notifications, persist stage-scoped comments, and prefer Approver for reopen.
2026-09-25 20:08:56 +00:00
weichen 6adf694f74 merge: candidate matrix-closeout-r3-2026-09-26 into dev 2026-09-25 19:05:04 +00:00
weichen f0b23d345a docs(matrix): update u9u12 and web-sysadmin row footnotes per P8/P9 evidence
- intent-plan-u9u12: per-key live rollout landed (7 keys to real engines,
  5 per-key flags default off, TierConfirm; dev c5027788); ops-side flag
  enablement + PI evidence follow-up noted
- web-sysadmin: residual closeout complete (ui.* whitelist consumers wired
  to public site-status + banner; Playwright real-run PASS via docker image;
  KB ops deferred out-of-repo with rationale; dev 4bdbb0da)
- rows keep status=done; footnote facts only; docs apply receipts r3
2026-09-25 19:04:34 +00:00
weichen 2391aaa7ec merge: candidate cleanup-audit-r3-2026-09-25 into dev 2026-09-25 18:43:24 +00:00
weichen 8ffb83e373 docs(current): register P11/P12 closeout rows via docs apply receipt 2026-09-25 18:42:36 +00:00
weichen 3f63753b63 docs(ops): P12 redline boundary audit (read-only)
- FAV live off (FAV_DEGRADED_READ unset, default false); no observation window running
- SWBOOT-10 fail-closed confirmed (ERR_EXECUTION_MODE_DISABLED in catalog.go L209);
  L5/L6 authorization application registered as pending-auth
- D7 ADR still pending-compliance-signoff; record retention physical delete blocked
- PI narrative flag PI_CHANGE_REPORT_NARRATIVE off in dev process env; dev-resident
  enablement request registered for user decision (not implemented)
- MULTI_INTENT_PLAN_TIER not full; F4-B/F7-1/I6/I7 untouched
2026-09-25 18:24:52 +00:00
weichen 30957daf40 merge: candidate cleanup-audit-p11-2026-09-25 into dev 2026-09-25 18:14:06 +00:00
weichen 748eb686ae docs(ops): P11 cleanup audit - 19 ready worktrees cleared, blocked classified
- ready batch: worktree remove + branch -d all clean, no force
- blocked split: keep branches with unmerged features (doc-review-lifecycle,
  dialogue-office-expansion, member-permissions-doc, single-binary-design,
  promote/sync test branches); regenerable caches logged; unique logs to
  archive before removal
- CURRENT stale in_progress rows deferred to closeout audit P14
- copy-kb-to-localpg.sh: never existed; migrate_shared_kb.sh already registered
2026-09-25 18:12:54 +00:00
weichen 3cefd5b142 merge: candidate backlog-triage-p10-2026-09-25 into dev 2026-09-25 17:20:39 +00:00
weichen 9ac4e37847 docs(ops): P10 backlog triage record (B5+A5 implement; A6/D5/R1/R4-R7 no-go evidence) 2026-09-25 17:20:22 +00:00
weichen da0fc54f91 merge: candidate backlog-triage-p10-2026-09-25 into dev 2026-09-25 17:17:06 +00:00
weichen 20afeb186b chore: requeue marker after DIRTY_TREE (node_modules symlink removed)
Queue item e1b8dd58 failed on source-tree dirt from a web/node_modules
symlink used for npm test; the symlink is removed and the tree is clean.
Empty commit advances head so the queue accepts a fresh item.
2026-09-25 17:16:36 +00:00
weichen ee852c6600 merge: candidate backlog-triage-p10-2026-09-25 into dev 2026-09-25 17:10:55 +00:00
weichen 53d1be5349 feat(quote,squad): B5 input validation + review invariants; A5 non-critical step degradation
P10 backlog triage (implement B5+A5; A6 already fixed in-tree, D5 keep shared
KB, R1 separate task, R4/R5/R6/R7 no-go with evidence):

- quote: ValidateInput (empty names/hours, negative/NaN/Inf fail-closed);
  reviewSummary invariants (line sums = total; buffer 20%/margin 40%/tax 7%
  rate self-consistency) enforced before Excel write
- squad: StepSpec.Critical *bool (nil=critical default); non-critical step
  failure marks step degraded + gov audit, workflow continues, final status
  degraded with DegradedSteps list; critical failure semantics unchanged
- tests: 5 new cases (quote 3 + squad 2), full short suite green, arch-check pass
2026-09-25 17:10:35 +00:00
weichen 4bdbb0da6f merge: candidate websysadmin-residual-r2-2026-09-25 into dev 2026-09-25 16:35:19 +00:00
weichen 923da11ab4 feat(server): public /maintenance/site-status route + tests; P9 evidence
- isPublicRoute exempts site-status (anonymous banner polling)
- httptest coverage: anonymous 200 + site_notice payload; route table guards
- test report + playwright evidence (docker mcr playwright v1.63 noble vs real dev stack, 1 passed)
2026-09-25 16:33:58 +00:00
weichen 914d0aa39d feat(maintenance): wire sysadmin ui.* whitelist settings to public site status
- sysadmin.Service.GetSettingValue: whitelist read-through (DB > env > default)
- maintenance.Service: SiteSettingsProvider injection; StatusView carries notice/readOnly; new CurrentSiteStatus + GET /api/v1/maintenance/site-status
- composition root wires ui.maintenance_notice / ui.read_only_mode into maintenance site settings
- MaintenanceBanner: persistent notice banner + read-only mode strip
- chore(web): drop dead 'dirty' var in EnvSettingsSection (baseline TS6133 build blocker)
- KB ops actions: deferred out-of-repo (shared infra container side); documented in task record
2026-09-25 16:33:56 +00:00
weichen cc998c05ce merge: candidate dialogue-office-p0-2026-09-25 into dev
Resolve server.go ActionServices wiring on accessor-style Server (Workflow via adaptChatWorkflow).
2026-09-25 15:42:05 +00:00
weichen c5027788ea merge: candidate u9u12-keys-rollout-2026-09-25 into dev 2026-09-25 14:39:51 +00:00
weichen f9ce771954 feat(intentflow): per-key live rollout for remaining U9-U12 validated_only keys
- 5 independent flags (MULTI_INTENT_U11_LIVE_REVIEW/FINAL/PROPOSAL, U12_LIVE_SWITCH/RESTART), default OFF; no full rollout
- DocGovLiveActionKeys/RunControlLiveActionKeys become flag-driven functions; baseline keys unchanged
- DocGovOwner routes review.approve/reject, final.approve/reject, proposal.decide to real engine with slot-driven reason/approve parsing and idempotent receipts
- RunControlOwner routes workflow.switch -> ActivateWorkflow and run.restart -> fresh CreateAndStart run
- policy: 7 keys promoted from TierFull to TierConfirm (real execution still gated per-key)
- tests: default-off isolation, per-key independence, live state advance reviewing->approving, dry-run zero-advance when flag off
2026-09-25 14:38:42 +00:00
weichen da0186c739 docs(remediation): 将对话办公 P0 验证记录挂入 INDEX 2026-09-25 14:38:06 +00:00
weichen 0ab4a8bd2d feat(server): 接线对话 workflow.run 并补 P0 验证记录
server 侧窄端口适配 projectworkflow,消除 chat→projectworkflow 边界违规;记录单测与 arch-check 证据,PI 全链路待补证。
2026-09-25 14:37:11 +00:00
weichen 9a540fa54a docs(chat): 注明 ActionServices.Workflow 合入接线点
app/server 写路径被并行任务占用,生产接线延后;未接线时诚实失败。
2026-09-25 13:19:52 +00:00
weichen ce694baef1 feat(coordinator): P0 消除对话主链路假成功
claim/submit 经 DocResolver+确认卡后 PendingAction 真写 docgov;proposal 默认分支改澄清;workflow.switch 诚实拒绝(UI专属);workflow.run 确认后走 CreateWorkflowRun(ActionServices.Workflow 由合入时接线)。
2026-09-25 13:19:36 +00:00
weichen 9f7bbc25a0 merge: candidate server-image-field-closeout-r4-2026-09-25 into dev 2026-09-25 13:19:00 +00:00
weichen 0634ffb8ee fix(storage): deterministic ID ordering in memory-mode ListProjectRefs
Memory CAS iterated memoryRefs map (random order) while PG path uses
ORDER BY id ASC; asset dedup-hint 'first reference unflagged' logic
depends on stable order. Flaky TestUploadProjectAsset_DedupHint
reproduced 2/20 rounds before fix, green 30/30 after.
2026-09-25 13:17:25 +00:00
weichen a9c9a9182e refactor(server): remove 24 mirrored Runtime fields via nil-safe accessors; fix Shutdown-vs-background-loop DATA RACE and goose 00071 duplicate version
- Server no longer mirrors app.Runtime services (gov/svc/pwSvc/...): 574 call sites now use accessors in runtime_accessors.go
- backgroundLoop (mutex+sync.Once) stops sweeper/publisher/reminder/wsGC goroutines race-free (baseline 44161d2a reproduced DATA RACE; now green under -race)
- goose 00071 duplicate (dialogue merge 1da17a28 brought two 00071): context-conflict-adjudications renumbered to 00072; dev DB applied only through 00070 so zero data migration
- task_finalize tests build minimal app.Runtime; test injection via serverTestOverrides + setOverride* (explicit-nil markers for fail-closed cases)
2026-09-25 13:17:22 +00:00
weichen 7cfd6851f6 merge: candidate security-redline-fp-r2-2026-09-25 into dev 2026-09-25 12:53:32 +00:00
weichen 7bdb045272 fix(intent): 收紧安全红线正则动词与桥接,消除正常撰写请求误拦
裸单字「改/换」加无界桥接会把「整改/角色」等正常撰写句误判为
SECURITY_FORBIDDEN。改为复合动词 + 短窗不跨标点桥接,受控名词须与写动词共现;补误报负例回归。
2026-09-25 12:53:08 +00:00
weichen 09ffe7dea8 docs(plan): 对话办公能力全景盘点与 P0–P3 整改计划
盘点 32 ActionKey 与 HTTP 169 路由对话边界,明确假成功/dry-run 与 UI 专属红线;分期消除假成功、live 化 intentflow、查询真源与新写意图扩展。
2026-09-25 11:15:44 +00:00
weichen 44161d2ad2 merge: candidate t20-s3-lock-split-2026-09-25 into dev 2026-09-25 06:53:29 +00:00
weichen 340342faf8 feat(concurrency): T20 S3 B3 - per-docID lock split for docgov/docrevision, hydrate out of cross-doc critical path (stage A) 2026-09-25 06:52:55 +00:00
weichen d93c1ab3d6 merge: candidate t20-s4-image-batch-2026-09-25 into dev 2026-09-25 05:42:56 +00:00
weichen 35f845168b feat(infra): T20 S4 image batch - non-root appuser, compose resource limits, unified extensions init mount (I1/I4) 2026-09-25 05:42:05 +00:00
weichen 42436f754d merge: candidate t20-b5-chat-observability-2026-09-25-r2 into dev 2026-09-25 05:26:59 +00:00
weichen 5201f14173 feat(ctxmgr,server): T20-B5 chat turn compensation observability + orphan sweeper 2026-09-25 05:26:29 +00:00
weichen 088ff307c0 merge: candidate t20-s2-config-pool-2026-09-25-r2 into dev 2026-09-25 04:46:53 +00:00
weichen 2abc23ac65 feat(db,server): T20-S2 hardening batch B1/B4/B7 (XFF trust, pool statement_timeout, shutdown drain) 2026-09-25 04:45:49 +00:00
weichen c0e556b167 merge: candidate t20-s1-small-fixes-2026-09-25 into dev 2026-09-25 04:25:31 +00:00
weichen d653e32e7b fix(server,web): T20-S1 hardening batch B11/F1/F8/F4-A 2026-09-25 04:25:03 +00:00
weichen b74b92920e merge: candidate planned-tasks-closeout-2026-09-25-r2 into dev 2026-09-25 04:10:58 +00:00
weichen caba4b086a docs(ops): land closeout plan P0 status and docrev acceptance audit 2026-09-25 04:07:17 +00:00
weichen 12bbe948b2 merge: candidate fix-stage-brief-panic-2026-09-25 into dev 2026-09-25 04:04:46 +00:00
weichen bc94080332 fix(coordinator,intent): nil AdvisorBrief panic guard + interrogative gate for ADVANCE_STAGE overmatch 2026-09-25 04:04:30 +00:00
weichen 1da17a282c merge: candidate dialogue-context-layout-fix-2026-09-25 into dev 2026-09-25 04:01:46 +00:00
weichen 2f9a6eb588 docs(current): move dialogue claim rows to table end to unblock integration 2026-09-25 03:51:08 +00:00
weichen 1fd2f16726 docs(current): mark dialogue-ctx r2 claim done for integration 2026-09-25 03:02:36 +00:00
weichen 5a70fd6940 docs(ops): plan batch closeout of inventoried planned tasks 2026-09-25 01:39:11 +00:00
weichen 09fe972366 feat(chat): dialogue triggers for comments/reopen/pending-supplements with mistouch guards
Wire intent→coordinator DocResolver confirm cards→action_executor kinds for comment, reopen, pending-supplements query, and real submit-review execution.
2026-09-25 00:36:26 +00:00
weichen 725181de4a merge: candidate admin-settings-maint-b-2026-09-25 into dev 2026-09-24 23:27:05 +00:00
weichen fd0ea3f2d7 docs(ops): mark admin-settings-maint claim done 2026-09-24 23:26:56 +00:00
weichen 675e09a1a7 merge: candidate admin-settings-maint-b-2026-09-25 into dev 2026-09-24 23:24:54 +00:00
weichen b5a308dd11 docs(test): note queue retry after DIRTY_TREE clear 2026-09-24 23:24:45 +00:00
weichen 8f9b91d3b3 docs(test): note queue retry after DIRTY_TREE clear 2026-09-24 23:24:15 +00:00
weichen 129736f281 merge: candidate admin-settings-maint-b-2026-09-25 into dev 2026-09-24 23:22:21 +00:00
weichen 728567c778 fix(handoff): remove unused stubSrc from e2e test 2026-09-24 23:21:39 +00:00
weichen 9424d19106 fix(handoff): clean e2e stub builder unused import 2026-09-24 23:21:30 +00:00
weichen 86e9d3706b feat(sysadmin): admin env settings + maintenance FD handoff
Persist agent/secrets settings with masked secrets and runner hot-reload;
add maintenance windows, maintpage binary, and zero-downtime listener handoff.
2026-09-24 23:20:20 +00:00
weichen 986d78cc91 feat(docgov): complete review lifecycle gaps for lock/notify/comment/reopen
Defer locked-period supplements to a pending ledger, route duty-holder
notifications, persist stage-scoped comments, and prefer Approver for reopen.
2026-09-24 23:06:23 +00:00
weichen dc29b84cdf feat(ctx): inject cleaned project dialogue into squad and assistant
Add dialoguectx packaging, conflictresolve adjudication with HITL routing,
workspace context/dialogue/ injection (default on), and goose 00071.
2026-09-24 17:04:04 +00:00
weichen 4e410efbab merge: candidate single-binary-dev-impl-b-2026-09-24 into dev 2026-09-24 16:33:53 +00:00
weichen 6cbe7e6e56 fix(web): committed dist/.gitkeep keeps go:embed satisfiable pre-build 2026-09-24 16:20:21 +00:00
weichen cc90d39205 fix(web): placeholder keeps go:embed satisfiable pre-build 2026-09-24 16:18:23 +00:00
weichen 69645cb07b fix(web): tolerate absent dist at compile time via LookupDist 2026-09-24 16:13:47 +00:00
weichen 59ad970ad5 merge: candidate dm-migration-2026-09-24-r2 into dev 2026-09-24 15:57:06 +00:00
weichen c428fc5e91 docs(ops): closeout Development-Manager migration task 2026-09-24 15:56:36 +00:00
weichen b812d1d30f feat(dev): single-binary no-docker runtime with managed localpg
Embed web/dist, run events in-process, manage brew PG18+pgvector, add PI host sidecar and launch --no-docker; unify MiniMax-M2.7-highspeed pins and record dev acceptance.
2026-09-24 15:53:50 +00:00
weichen 67cc8f13af docs(ops): register Development-Manager migration task 2026-09-24 15:35:52 +00:00
weichen 588fef1c4a docs(ops): 收口单二进制设计任务状态与提交 SHA 2026-09-24 14:45:46 +00:00
weichen d784daf884 docs(ops): CURRENT 认领 member-permissions-doc-2026-09-24 行
task: member-permissions-doc-2026-09-24
2026-09-24 14:45:21 +00:00
weichen 7ebf431c87 docs(design): 非容器化单二进制三环境交付方案
覆盖 dev managed / test 落地 / main attach,PI sidecar 外置;设计评审用,未实施。
2026-09-24 14:45:06 +00:00
weichen e2a442b592 docs(system-design): 新增项目成员权限总览(对话/任务/补充/文档三权整合)
- 三层正交模型:系统角色能力矩阵 / 项目成员角色 / 文档三权(author-reviewer-approver)
- 四类核心动作权限矩阵:发起对话、执行任务、补充信息、文档编制与修改(deny_only_submit)
- 认证与路由分层、管理台两类 gate、前端 capabilities fail-closed 消费方式
- 如实标注已知缺口:member/viewer 服务端不区分写、visibility 键仅前端消费、system:* 未拆分
- 更新 system-design/README.md 索引与目录清单

task: member-permissions-doc-2026-09-24
2026-09-24 14:43:00 +00:00
weichen edbe592478 merge: candidate governance-console-p1-impl-2026-09-24 into dev 2026-09-24 14:17:55 +00:00
weichen 610b97b93e docs(ops): closeout governance-console-p1-impl 2026-09-24 14:17:34 +00:00
weichen f6eaff7878 merge: candidate governance-console-p1-impl-2026-09-24 into dev 2026-09-24 14:16:58 +00:00
weichen 77c602c8f4 fix(agentctl): resume integrate prepare from clean expected tip
After abort, allow a clean worktree parked on expected-dev to continue merge instead of BASE_CHANGED.
2026-09-24 14:16:48 +00:00
weichen f5cdae1a41 fix(agentctl): fence integrate prepare merge via supervise
Pre-commit requires AGENTCTL_FENCE; run merge --no-ff through supervise like integrate ff-only.
2026-09-24 14:15:50 +00:00
weichen f9f055bee1 feat(agentctl): add governance console P1 serve and action APIs
Implement loopback HTTP console with claim new, integrate prepare, and pi packet sharing the same helpers as CLI; ship SPA and MCP brief/claim_archive wrappers.
2026-09-24 14:13:27 +00:00
weichen 6eb2d11eeb merge: closeout governance-console-p1-design 2026-09-24 13:55:27 +00:00
weichen 0d58e6fb2d docs(ops): closeout governance-console-p1-design 2026-09-24 13:55:23 +00:00
weichen ae7fcc1557 merge: candidate governance-console-p1-design into dev 2026-09-24 13:54:37 +00:00
weichen fad32cd820 docs(ops): finalize governance console P1 implementable design
Expand the P1 plan to a 12-section implementable spec (serve API,
claim new, integrate prepare, pi packet, SPA, tests, risks) without
code. Task record and CURRENT claim included.
2026-09-24 13:54:22 +00:00
weichen 4844041b1b merge: closeout governance-visibility-p0 2026-09-24 13:36:43 +00:00
weichen 9eea950d57 docs(ops): closeout governance-visibility-p0 on local_dev 2026-09-24 13:36:25 +00:00
weichen ab450c1181 merge: candidate governance-visibility-p0 into dev 2026-09-24 13:33:22 +00:00
weichen 2c6088c200 merge: candidate cursor-zh-session-title into dev 2026-09-24 13:27:25 +00:00
weichen 06757ff31f merge: candidate governance-visibility-p0 into dev 2026-09-24 13:27:09 +00:00
weichen f2644db6d8 docs(cursor): 会话自动命名使用简体中文
新增 alwaysApply 规则,要求 Cursor 对话标题/会话名称以简体中文概括任务主题。
2026-09-24 13:26:53 +00:00
weichen f29a69b8a1 docs(ops): claim CURRENT row for governance-visibility-p0 2026-09-24 13:26:07 +00:00
weichen 0d1840da96 feat(agentctl): governance visibility P0 — table/brief/archive + MCP reads
Add human-readable --format table, one-page brief, claim archive via docs
apply CAS, and four MCP readonly tools. Includes P1 console design doc
and engineering-tool test evidence.
2026-09-24 13:25:57 +00:00
weichen a2afa67d47 merge: candidate retire diverged worktree tips into local_dev 2026-09-24 12:35:49 +00:00
weichen d7d951542d merge: retire redundant tip feature/integrate-intent-plan-u9u12-close-2026-09-24 (content already on local_dev / superseded) 2026-09-24 12:35:17 +00:00
weichen da42769160 merge: retire redundant tip feature/integrate-fix-fav-staging-uuid-2026-09-24 (content already on local_dev / superseded) 2026-09-24 12:35:16 +00:00
weichen 2d91f0ee7d merge: retire redundant tip feature/integrate-codegraph-current-2026-09-24 (content already on local_dev / superseded) 2026-09-24 12:35:14 +00:00
weichen a81b9554c0 merge: retire redundant tip fix/gate-unhook-docquery-2026-09-24 (content already on local_dev / superseded) 2026-09-24 12:35:13 +00:00
weichen 2d42cbd678 merge: retire redundant tip fix/gate-e1a-unique-project-name-2026-09-24 (content already on local_dev / superseded) 2026-09-24 12:35:12 +00:00
weichen 275624591c merge: retire redundant tip fix/fix-nightly-abs-datadir-2026-09-24 (content already on local_dev / superseded) 2026-09-24 12:35:11 +00:00
weichen 50b1a6144b merge: retire redundant tip fix/fix-fullchain-unique-project-2026-09-24 (content already on local_dev / superseded) 2026-09-24 12:35:10 +00:00
weichen ab52f79034 merge: retire redundant tip feature/dev-full-gate-test-promo-2026-09-24 (content already on local_dev / superseded) 2026-09-24 12:35:08 +00:00
weichen 0f50991288 merge: retire redundant tip feature/admin-password-reset-2026-09-24 (content already on local_dev / superseded) 2026-09-24 12:35:07 +00:00
weichen 245e6202d2 merge: candidate worktree-cleanup inventory into local_dev 2026-09-24 12:33:52 +00:00
weichen 18fbec23e4 docs(ops): worktree cleanup inventory and CURRENT done drift fix
Record removed ready worktrees and cleanup_pending not_ancestor tips;
mark stale admin/gate CURRENT rows done to match task registry.
2026-09-24 12:33:39 +00:00
weichen fabd85a65e merge: candidate non-author closeout into local_dev
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-24 12:22:29 +00:00
weichen 24a5e6dbbb docs(ops): mark non-author member-access CURRENT claims done
Record five-state closeout rows after local_dev merge and origin/dev push.
2026-09-24 12:22:16 +00:00
weichen 26673d0ae0 docs(ops): record non-author member-access five-state closeout
Mark review/integration/remote_sync after local_dev merge and origin/dev push.
2026-09-24 12:21:41 +00:00
weichen e98e2d716c merge: candidate non-author-member-access docs into local_dev
CI / go-vet-and-short-test (push) Failing after 1s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-24 12:14:22 +00:00
weichen 8b2621a4d1 docs(test): add non-author member PI e2e console log asset 2026-09-24 12:13:47 +00:00
weichen b739f358f8 docs(test): non-author member deny_only_submit PI evidence and MATRIX
Archive real PI acceptance for member run/edit vs submit duty gates;
register ISSUE/LESSON and refresh MATRIX/gap/authz matrix evidence.
2026-09-24 12:13:31 +00:00
weichen e43f4c6970 merge: free-collab CURRENT/MATRIX docs closeout into local_dev 2026-09-24 11:54:27 +00:00
weichen f769385853 docs(ops): mark free-collab integrate done and link MATRIX evidence 2026-09-24 11:54:25 +00:00
weichen 80a7736199 merge: free-collab test report into local_dev 2026-09-24 11:53:05 +00:00
weichen a1d70f5bd0 merge: candidate free-collab claim-notify + free-lane into local_dev 2026-09-24 11:51:50 +00:00
weichen 143ee934b8 feat(collab): free-lane chat, claim-on-view, lease ownership, notify inbox
Open member free-lane for chat initiation; auto-claim on author view;
harden lease persist/ownership with readable DOC_BUSY; add notification
inbox and supplement-impact HTTP decision APIs wired to composition root.
2026-09-24 11:49:43 +00:00
weichen 098c1fd73a docs(test): free-collab claim-notify short-suite evidence report 2026-09-24 11:49:42 +00:00
weichen d0b4d3d4dd fix(arch): allow server→supplementimpact and tighten HTTP batch ExpiresAt 2026-09-24 11:45:54 +00:00
weichen 4e0e6a1418 feat(notification): digest aggregates, supplement-impact batch, and free-collab hooks
Add notification digests with ON CONFLICT DO UPDATE, migrations 00068-00070,
supplementimpact module (analyze → confirm → claim-aware split), and wire
coordinator/mutate hooks plus proposal_required digests.
2026-09-24 11:44:20 +00:00
weichen ebb36fb85c merge: candidate MCP NDJSON framing into dev 2026-09-24 10:39:54 +00:00
weichen 36793a4ea5 fix(tooling): emit NDJSON MCP responses for agentctl and jev
Cursor IDE loads pi-subagents (NDJSON) but not agentctl/jev which replied
with Content-Length framing. Align send() and mark type=stdio in mcp.json.
2026-09-24 10:39:43 +00:00
weichen 03fd135593 merge: candidate fix MCP: hook prefix into dev 2026-09-24 10:36:00 +00:00
weichen 476e97c993 fix(tooling): strip MCP: prefix in Cursor hook tool_name matching
IDE postToolUse reports tool_name as MCP:pi_subagent_*; without stripping,
guard-pi-dispatch skipped shape checks. Confirmed via live pi_subagent_roles.
2026-09-24 10:35:51 +00:00
weichen 5392db8ecb merge: cursor governance closeout docs into dev 2026-09-24 09:34:09 +00:00
weichen ea1457231e docs(tooling): close cursor governance CURRENT claim after local_dev merge 2026-09-24 09:33:55 +00:00
weichen 57cbd57139 merge: candidate cursor-governance-hooks into dev 2026-09-24 09:30:49 +00:00
weichen 2b3b1c6f5b merge: sync feature with local_dev 4490b6ef
Align CURRENT via docs apply @document (keep catalog + cursor-governance
rows); retain both policy-registry sections and lessons index rows.
2026-09-24 09:30:31 +00:00
weichen 5618cfc8cf feat(tooling): add Cursor governance hooks, skills, and rule pointers
Layer advisory Cursor hooks and skills on the PI executor, shrink the
test-report rule to the validation contract, and fix MCP relative paths.
2026-09-24 09:25:38 +00:00
weichen 4490b6ef76 merge: governance catalog closeout into dev 2026-09-24 09:25:28 +00:00
weichen 0217ce354b docs(tooling): close governance catalog claim and task record 2026-09-24 09:25:14 +00:00
weichen e1796cc858 merge: candidate governance-catalog into dev 2026-09-24 09:22:22 +00:00
weichen 319b397419 docs(test): archive governance catalog unittest evidence 2026-09-24 09:22:09 +00:00
weichen 28ed7005dd feat(tooling): add governance catalog and requirement overlap gates
Extend agentctl SQLite with catalog tables, CJK FTS5 recall, hard/soft
overlap gates, fail-open embeddings, backfill, and MCP/skills hooks so
cross-conversation designs cannot silently conflict.
2026-09-24 09:21:57 +00:00
weichen cfc80b34a4 docs(tooling): integrate PI executor validation and closeout 2026-09-24 05:58:32 +00:00
weichen 9744a2e2d0 docs(tooling): close PI integration coordination record 2026-09-24 05:58:26 +00:00
weichen e6dad5b25e docs(tooling): record PI executor dev integration and validation 2026-09-24 05:57:39 +00:00
weichen 5a8540804e feat(tooling): integrate automatic PI subagent executor into dev 2026-09-24 05:54:59 +00:00
weichen 655397547f chore(tooling): reconcile PI executor branch with current dev 2026-09-24 05:54:49 +00:00
weichen 930447a78c docs(tooling): reconcile PI integration records with current dev 2026-09-24 05:51:37 +00:00
weichen c1a70e67e5 merge: candidate agentctl-daemon-load-2026-09-24 into dev (r8) 2026-09-24 05:45:16 +00:00
weichen de2ba94933 merge: CURRENT claim closeout for gate promo
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 1s
CI / web (push) Failing after 0s
2026-09-24 05:12:21 +00:00
weichen 77ba9deee1 docs(ops): close CURRENT claims for gate promo and beta.3 2026-09-24 05:12:10 +00:00
weichen 614ebb8d1b docs(ops): mark dev-full-gate-test-promo CURRENT claim done 2026-09-24 05:10:49 +00:00
weichen 4bbbd0f8bc merge: docs-gate CURRENT done into integrate 2026-09-24 05:09:44 +00:00
weichen 866254de0e docs(ops): mark docs-gate-promo-report CURRENT claim done 2026-09-24 05:09:36 +00:00
weichen 6e74203857 merge: candidate docs-gate-promo-report into local_dev
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-24 05:06:30 +00:00
weichen 1d8b50d5ac docs(test): archive dev full-gate and rc-v1.1.0-beta.3 promotion report 2026-09-24 05:05:45 +00:00
weichen 0e4b111dff release-candidate: 汇集 local_dev 至 test,准备长期实测 [Tag: rc-v1.1.0-beta.3]
CI / go-vet-and-short-test (push) Failing after 1s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-24 04:37:51 +00:00
weichen 6fc828a9ce docs(tooling): record PI executor acceptance and operating guide 2026-09-24 04:36:06 +00:00
weichen 58bf83f755 docs(ops): mark admin-password-reset five-state after validate/enqueue 2026-09-24 04:25:32 +00:00
weichen 8ca448ddca merge: candidate feature/admin-password-reset-2026-09-24 into local_dev 2026-09-24 04:24:20 +00:00
weichen 39f8c1d134 feat(auth): admin password reset API and credential guards
Implement T20-F4-B reset-password endpoint with one-time temp password,
audit table, frontend wiring, login error envelope parsing, and
CreateUser fail-closed for empty password hashes. Recovered test chenwei
via env write (password out of band).
2026-09-24 04:18:58 +00:00
weichen 69ffaa677e feat(tooling): add governed local PI subagent executor 2026-09-24 04:09:28 +00:00
weichen 3de5bc5c39 merge: candidate gate-nightly-fixes (abs DATA_DIR + unique FullChain names) 2026-09-24 03:24:15 +00:00
weichen 9a4ccf4040 fix(test): unique project names for pi-agent FullChain e2e
Fixed Chinese names collided on reused gate-pg across nightly runs.
2026-09-24 03:24:13 +00:00
weichen 3a23fb4533 fix(scripts): force absolute DATA_DIR for nightly real-PI
Relative DATA_DIR from .env resolves under go test package cwd
(internal/server/data/dev) and diverges from the pi-agent bind mount,
leaving agents without template.md/blackboard.json.
2026-09-24 03:24:12 +00:00
weichen 8c4200c888 fix(test): unique project names for pi-agent FullChain e2e
Fixed Chinese names collided on reused gate-pg across nightly runs.
2026-09-24 03:22:54 +00:00
weichen 6f0e43cab2 fix(scripts): force absolute DATA_DIR for nightly real-PI
Relative DATA_DIR from .env resolves under go test package cwd
(internal/server/data/dev) and diverges from the pi-agent bind mount,
leaving agents without template.md/blackboard.json.
2026-09-24 02:48:25 +00:00
weichen b514a3c5e0 docs(ops): mark agentctl-daemon-load CURRENT done 2026-09-24 02:30:13 +00:00
weichen 6858e21d47 merge: candidate fix-quality-heading-eleven into local_dev 2026-09-24 02:26:38 +00:00
weichen 5e8e17b96a fix(squad): strip multi-digit Chinese ordinals in quality headings
Nightly TestManager failed because cleanHeadingTitle only stripped 一…十,
leaving 十一、/十二、 unmatched against template 签署/说明.
2026-09-24 02:26:23 +00:00
weichen 52462b45e9 docs(workflow): configure local PI model roles with Cursor implementation 2026-09-24 02:19:28 +00:00
weichen c1ae90cea3 docs(workflow): propose Auto subagent lifecycle and evidence contract 2026-09-24 01:44:31 +00:00
weichen f27af1d3d2 docs(ops): record agentctl coordinator daemon systemd load with fail-closed evidence 2026-09-24 01:39:43 +00:00
weichen ca55354034 docs(ops): re-claim gate on tip after fav uuid fix 2026-09-24 00:57:49 +00:00
weichen 5423b261f9 merge: candidate fav-staging-uuid fix into local_dev 2026-09-24 00:57:31 +00:00
weichen fd83e98e6c docs(ops): mark fav-staging-uuid CURRENT done 2026-09-24 00:57:10 +00:00
weichen 80caa785e2 merge: candidate fav-staging-uuid fix into local_dev 2026-09-24 00:57:06 +00:00
weichen 25fc2d92e8 fix(artifactvault): derive staging/artifact UUIDs from idempotency key
Payload-sha-only UUIDs collided under artifact_payload_staging_pkey when
two task runs finalized identical deliverable bytes. Key already includes
source_event_id; hash it for stable unique art-/stg- ids.
2026-09-24 00:56:54 +00:00
weichen f04f14ff01 docs(ops): mark gate-e1a CURRENT done 2026-09-24 00:50:09 +00:00
weichen c4008bf8f3 merge: candidate gate-e1a fixture fixes into local_dev 2026-09-24 00:49:43 +00:00
weichen c51fb5e22f fix(docnotify): align E1A fixture aggregate versions with claim gap rule
Per-doc aggregates must use version 1 (not i+1 / 99) or ClaimLeases
skips them under event_consumer_checkpoints head+1 gating.
2026-09-24 00:49:40 +00:00
weichen 134f7864fa fix(docnotify): unique E1A fixture project names under global uniqueness
00057 added uq_projects_name_global; seedUserProject kept a fixed name
\"e1a\" so the second PG case collided. Include the suffix in name too.
2026-09-24 00:48:20 +00:00
weichen 2844bbfe1c docs(ops): mark gate-unhook-docquery CURRENT done 2026-09-24 00:46:31 +00:00
weichen f8ad688359 merge: candidate gate-unhook-docquery into local_dev 2026-09-24 00:45:38 +00:00
weichen 2bcb4e3366 fix(server,docquery): restore durable-notify unhook and deliverable store in tests
Remove leftover OnOutbox assignment from NewFromRuntime so production
stays on the durable events/docnotify path. Wire DirDeliverable into
docquery ledger fixtures after G1 DeliverableStore cutover.
2026-09-24 00:45:22 +00:00
weichen 4d1b58ccb3 merge: candidate jev-dev-assist-on into local_dev 2026-09-23 18:02:02 +00:00
weichen 73da2fea01 docs(ops): enable jev assist on local_dev with chat batch
Record 20-turn live chat evidence: 10/10 decision-layer additive on rule misses, 0 false assists on business prompts.
2026-09-23 17:59:31 +00:00
weichen 3e13f7a6d6 merge: candidate codegraph policy active into local_dev 2026-09-23 17:57:19 +00:00
weichen 0c13beddb9 docs(ops): activate codegraph-governance policy revision 2026-09-23 17:57:16 +00:00
weichen 19eb56e374 merge: candidate codegraph CURRENT claims into local_dev 2026-09-23 17:55:54 +00:00
weichen 7322aa96bd docs(ops): record codegraph-governance closeout claims 2026-09-23 17:55:43 +00:00
weichen 0c676afe1f merge: candidate codegraph check-ignore fixup into local_dev 2026-09-23 17:55:25 +00:00
weichen 989346aba2 docs(ops): note codegraph check-ignore trailing-slash fixup 2026-09-23 17:55:22 +00:00
weichen d535c2a85e merge: candidate codegraph fixup+CURRENT into local_dev 2026-09-23 17:54:14 +00:00
weichen 5252a236fc fix(gov): probe .codegraph/ with trailing slash for check-ignore 2026-09-23 17:53:56 +00:00
weichen 734aa72527 merge: candidate codegraph CURRENT claim into local_dev 2026-09-23 17:53:00 +00:00
weichen 22ed51cf1f docs(ops): claim codegraph-governance closeout on CURRENT 2026-09-23 17:52:46 +00:00
weichen 66745dd920 merge: candidate codegraph-governance into local_dev 2026-09-23 17:52:09 +00:00
weichen 510b46636a feat(gov): add codegraph hooks and read-only cleanup/MATRIX audits
Wire CodeGraph into agentctl init/create/sync and expose cleanup report
plus docs drift so agents can inventory stale worktrees and MATRIX
regressions without auto-deleting or auto-promoting done.
2026-09-23 17:51:04 +00:00
weichen 156c113024 merge: candidate jev-dev-shadow-on into local_dev 2026-09-23 17:48:17 +00:00
weichen a83e288bff docs(ops): enable jev shadow on local_dev
Record shadow enable via configs/.env.dev + rebuild evidence; note Docker host gateway.
2026-09-23 17:48:05 +00:00
weichen d8214a09f0 merge: candidate jev-product-closeout into local_dev 2026-09-23 17:41:30 +00:00
weichen 18cfca4307 docs(ops): close out jev-product-shadow CURRENT and short-term 2026-09-23 17:41:27 +00:00
weichen 54409fd61d merge: candidate jev-product-shadow into local_dev 2026-09-23 17:41:03 +00:00
weichen 55c0c1b499 chore(compose): declare JEV_DECIDE_MODE off in all environments 2026-09-23 17:40:50 +00:00
weichen 45f21e84c7 feat(jevdecide): product shadow client with offline eval gates
Add typed jevdecide HTTP client (circuit, metrics) and coordinator
DecideAssist wiring behind JEV_DECIDE_MODE (default off). Offline eval
and synthetic soak evidence gate realtime/profile before assist rollout.
2026-09-23 17:40:40 +00:00
weichen 0ff698db6f merge: candidate jev-mcp-docs-final into local_dev 2026-09-23 16:14:38 +00:00
weichen 96bafcebbd docs(ops): mark jev-mcp-docs-done CURRENT row done 2026-09-23 16:14:35 +00:00
weichen 21b2687e0f merge: candidate jev-mcp-docs-done into local_dev 2026-09-23 16:14:19 +00:00
weichen c464589a42 docs(ops): mark jev-mcp integration CURRENT and short-term done 2026-09-23 16:14:08 +00:00
weichen 0dfb09fa69 merge: candidate jev-mcp-integration into local_dev 2026-09-23 16:12:44 +00:00
weichen 939be0ec6b feat(mcp): add jev-service governance decide MCP server
Expose typed jev_decide/jev_health over stdio for closed-enum governance
routing; credentials stay in ~/.secrets/jev and out of git.
2026-09-23 16:12:16 +00:00
weichen b6f21e8a94 merge: candidate intent-plan-u9u12 closeout into local_dev 2026-09-23 15:54:23 +00:00
weichen f0a929a2ae docs(status): mark intent-plan-u9u12 done (land task receipts)
MATRIX/CURRENT via docs apply on integrate-land task after acceptance
report is on the candidate tip.
2026-09-23 15:54:22 +00:00
weichen cd793c11c9 docs(test): U9–U12 live domain acceptance evidence
Archive real HTTP+PG samples for U9 segment wiring and U10–U12 live
adapters under confirm tier on shared dev (project 6579).
2026-09-23 15:54:05 +00:00
weichen e7262d4d65 docs(status): mark intent-plan-u9u12 done after I3 live acceptance
MATRIX done via docs apply with live HTTP+PG evidence; CURRENT claim
rows recorded for accept/live tasks. Compose defaults remain legacy.
2026-09-23 15:52:05 +00:00
weichen 0d98016511 docs(test): U9–U12 live domain acceptance evidence
Archive real HTTP+PG samples for U9 segment wiring and U10–U12 live
adapters under confirm tier on shared dev (project 6579).
2026-09-23 15:50:53 +00:00
weichen b7d775a734 merge: candidate intent-plan-u9u12 authz slots fix 2026-09-23 15:47:53 +00:00
weichen 61d728f905 fix(intentflow): pass slots/summary into confirm-time Authorize
DocGov (and other summary-keyed adapters) resolve doc_id from step slots
or safe_summary; authorizeDecision omitted both, so U11 confirm failed
closed with PLAN_ACTION_FORBIDDEN despite a bound resource version.
2026-09-23 15:47:44 +00:00
weichen bc27becbbb merge: candidate intent-plan-u9u12 version-binder fix 2026-09-23 15:44:58 +00:00
weichen dbae19e80d fix(intentflow): bind resource versions for U10/U11 at plan create
Mutate/docgov live Authorize requires ExpectedResourceVersion; populate it
(and frame slots) when HandleTurn drafts confirm-class steps so confirm
no longer fails closed with PLAN_ACTION_VERSION_CONFLICT.
2026-09-23 15:44:48 +00:00
weichen 2f7e4b8fc0 merge: candidate intent-plan-u9u12-live into local_dev 2026-09-23 15:36:48 +00:00
weichen cd7c586b15 merge: refresh local_dev tip 473bfbc7 before integrate 2026-09-23 15:36:29 +00:00
weichen 7cb076c945 merge: refresh local_dev tip before U9–U12 integrate 2026-09-23 15:35:24 +00:00
weichen 473bfbc73c merge: land pi-narrative CURRENT closeout onto local_dev 2026-09-23 15:35:15 +00:00
weichen 0243cc2195 docs(ops): register pi-narrative CURRENT done and closeout five-state 2026-09-23 15:35:13 +00:00
weichen 8bf74f0f7e merge: local_dev I2 evidence + gate U9 at auto_read
Bring I2 rollout reports onto the U9–U12 branch; keep FEATURE-MATRIX
out of this merge (managed via docs apply on local_dev). Tighten
ActiveSegmentProposer to PlanTier ≥ auto_read per Track I3.
2026-09-23 15:34:49 +00:00
weichen c1b60b7af2 merge: land docgov-pi-narrative MATRIX done onto local_dev 2026-09-23 15:33:43 +00:00
weichen 77aace4ae4 docs(status): mark docgov-pi-narrative done after closeout retest 2026-09-23 15:33:42 +00:00
weichen 31adc25a1f merge: candidate pi-narrative docs evidence into local_dev 2026-09-23 15:32:00 +00:00
weichen 016135d946 feat(intentflow): wire U9–U12 live adapters for multi-intent closeout
Connect LLM segment proposals into HandleTurn, replace U10–U12 dry-run stubs
with production owners (blackboard supplement, docgov claim/submit, workflow
run/resume) when flags are on, and update policy/sysadmin maturity metadata.
2026-09-23 15:26:46 +00:00
weichen d9e74087e4 merge: I2 rollout evidence and u1u8 done 2026-09-23 15:21:45 +00:00
weichen 7a3ac9dbe6 docs(status): mark intent-plan-u1u8 done after I2 rollout 2026-09-23 15:21:43 +00:00
weichen b9ee841ea5 docs(test): I2 multi-intent shadow/auto_read/confirm rollout evidence 2026-09-23 15:21:01 +00:00
weichen d4dad0f219 docs(status): mark docgov-pi-narrative done after live closeout
Promote the MATRIX row with committed MiniMax evidence; keep the narrative
flag default-off pending a separate rollout authorization.
2026-09-23 15:20:09 +00:00
weichen 07ff3e45c4 docs(test): archive PI narrative closeout evidence
Record the repaired MiniMax live path and update readiness copy before
promoting docgov-pi-narrative to done.
2026-09-23 15:19:29 +00:00
weichen 4e601e95bc merge: land chat-semantic-d3 MATRIX done onto local_dev 2026-09-23 15:18:31 +00:00
weichen 45ee184527 docs(status): land chat-semantic-d3 done and REPLACE deferred row
Apply MATRIX split on current local_dev tip with closeout evidence and
mark the matrix-land CURRENT claim done.
2026-09-23 15:18:21 +00:00
weichen fdbefbac83 merge: candidate pi-narrative-final-closeout-b into local_dev 2026-09-23 15:17:27 +00:00
weichen 413ca989a1 merge: candidate chat-semantic-d3-closeout into local_dev
Land summarizer fix and closeout evidence; MATRIX/CURRENT shared docs follow via docs apply.
2026-09-23 15:16:23 +00:00
weichen 939380f3d5 docs(status): close chat-semantic-d3 as shadow-only done
Split REPLACE into deferred chat-semantic-replace per Wave5 X-2, record
lineage, and attach tip revalidation evidence.
2026-09-23 15:14:48 +00:00
weichen 526617ff9b merge: compose FAV_DEGRADED_READ dup fix 2026-09-23 15:14:34 +00:00
weichen 02a0ed4f74 fix(compose): remove duplicate FAV_DEGRADED_READ keys 2026-09-23 15:14:16 +00:00
weichen 8f00c97fae fix(chat): restore D3 semantic shadow under reasoning no-tools
Embed authorized messages in the PI summarizer prompt and recover narrative
from execution.log so MiniMax shadow works without REPLACE. Align chatflow
tests with async S1 drain and record closeout evidence.
2026-09-23 15:13:19 +00:00
weichen f6046bba7e fix(docgov): materialize reasoning narrative under --no-tools
Embed Facts in the PI narrative prompt and teach the bind-mounted runner
to write assistant text into missing reasoning targets, matching pi-native.
2026-09-23 15:11:22 +00:00
weichen 177338282d merge: candidate intent-plan-i2-shadow-allowlist into local_dev 2026-09-23 15:10:49 +00:00
weichen c07d4020d0 feat(intentflow): I2 shadow tier, project allowlist, and rollout metrics
Persist validated_only shadow plans without executing, gate elevated tiers
behind INTENT_PLAN_PROJECT_ALLOWLIST, and keep legacy chat routing for shadow.
2026-09-23 15:10:26 +00:00
weichen 996bf5a14d merge: closeout CURRENT done for module-batches-ag-status-fix 2026-09-23 15:10:20 +00:00
weichen 2d81d584a2 docs(ops): mark module-batches-ag-status-fix CURRENT claim done 2026-09-23 15:10:18 +00:00
weichen 8768ee2ba2 merge: candidate module-batches-ag-status-fix into local_dev 2026-09-23 15:09:12 +00:00
weichen daebbf61e7 docs(ops): restore tip CURRENT closeout claim after sync merge 2026-09-23 15:09:00 +00:00
weichen ca5c36f65f merge: sync tip 9d8332ad into module-batches-ag-status-fix
Retain CURRENT claim and MATRIX done; re-apply tip CURRENT rows next.
2026-09-23 15:08:40 +00:00
weichen 1d3c957ff4 docs(ops): close matrix regression issue after CAS restore
Mark issue resolved and lesson validated once arch-check and MATRIX
done row are confirmed in the task worktree.
2026-09-23 15:05:27 +00:00
weichen b9d09c9712 docs(status): restore module-batches-ag done state after merge regression
Row-level CAS recovers the umbrella status that closeout conflict
resolution had overwritten back to planned; header text aligned.
2026-09-23 15:03:45 +00:00
weichen 54641f4653 docs(ops): register matrix status regression and claim CURRENT
Restore coordination evidence for module-batches-ag: issue, lesson,
batch-plan done status, and CURRENT claim ahead of MATRIX CAS restore.
2026-09-23 15:02:53 +00:00
weichen 9d8332ad08 merge: mark closeout claim worktree removed
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 15:01:52 +00:00
weichen 236f39e6c4 docs(ops): mark closeout-worktree-cleanup claim worktree removed 2026-09-23 15:01:51 +00:00
weichen 18b9556f3b merge: FAV constraint CURRENT revision and restore protection 2026-09-23 14:20:44 +00:00
weichen 340240473e docs(ops): revise FAV live constraint and restore CURRENT protection
Authorized temporary lift of protected_sections; set 受控约束 first
bullet to FAV live not released / FAV_DEGRADED_READ default false;
restore ## 受控约束 protection afterward.
2026-09-23 14:20:43 +00:00
weichen c05b4090d8 merge: lift CURRENT 受控约束 protection for authorized edit 2026-09-23 14:20:02 +00:00
weichen 6f2d0d8d0c chore(ops): temporarily lift CURRENT 受控约束 protection
Authorized 2026-09-23 so docs apply can revise the FAV live constraint
bullet; restore protection in the follow-up commit.
2026-09-23 14:20:02 +00:00
weichen 73ee509439 merge: closeout worktree cleanup docs into local_dev 2026-09-23 14:10:38 +00:00
weichen 8437ba4164 docs(ops): finalize remaining-worktrees five-state and cleanup table 2026-09-23 14:10:27 +00:00
weichen 4381b71094 merge: remaining worktrees closeout docs into local_dev
CI / go-vet-and-short-test (push) Failing after 1s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 14:03:13 +00:00
weichen fe4a3043eb docs(ops): fix closeout short-term and test report text 2026-09-23 14:03:13 +00:00
weichen cdfd7d9849 docs(ops): remaining worktrees closeout report and CURRENT/MATRIX rows
Record go-agentx+FAV integrate evidence, stale DIFF archive, claim/FAV
cleanup rows, and events-fav partial note. Constraint bullet deferred
to short-term due to CURRENT protected_sections.
2026-09-23 14:02:35 +00:00
weichen 3e01f18756 merge: integrate final-artifact-vault into local_dev (authorized exception)
User authorized lifting CURRENT FAV whole-branch merge protection on
2026-09-23. Keep FAV_DEGRADED_READ/FAV_PUBLISHER_ENABLED default false.
Drop duplicate goose 00034 (local_dev already has 00036). Preserve
agentx workspace admin routes and pin-export wiring.
2026-09-23 13:57:08 +00:00
weichen 6032dbaa16 merge: integrate go-agentx runtime into local_dev candidate
Bring pinative/agentx workspace registry and A-B harness onto current
local_dev; renumber goose agentx registry 00062→00066 to avoid clash
with chat-summary/provenance migrations. Keep CURRENT/MATRIX as ours
for later docs apply; union module-boundaries agentx import tree.
Path literals use workspace constants for arch-check.
2026-09-23 13:25:32 +00:00
weichen d5fc19e42c merge: worktree closeout report and CURRENT done rows 2026-09-23 12:58:04 +00:00
weichen 1493676217 docs(ops): record worktree closeout batch report and CURRENT done rows 2026-09-23 12:57:38 +00:00
weichen a690aab42d merge: closeout cleanup cwd-hidden process fix 2026-09-23 12:55:00 +00:00
weichen 7cb7981deb fix(ops): skip cwd-hidden OS helpers and non-worktree processes on cleanup 2026-09-23 12:54:45 +00:00
weichen c0a0db3a70 merge: closeout remaining docs and salvage into local dev 2026-09-23 12:51:23 +00:00
weichen 312727d726 merge: worktree-closeout-batch salvage docs and gofmt 2026-09-23 12:50:23 +00:00
weichen 6485532d88 docs: import lock, policy, and governance artifacts for closeout 2026-09-23 12:50:22 +00:00
weichen 553f0ad61b merge: feature/integrate-modular-contract-standard-2026-09-22 into closeout remaining candidate 2026-09-23 12:49:45 +00:00
weichen 15b388fc86 docs(ops): salvage task docs and mineru gofmt in closeout batch 2026-09-23 12:49:33 +00:00
weichen e6ddfab9e8 merge: sync origin/dev into local dev (closeout batch)
Resolve conflicts: both CURRENT claim tables (slot preserved), local
multi-host coordination plan + origin phased companion, origin
module-boundaries, combined PG isolation with remote product tests.
FEATURE-MATRIX takes origin record_id layout; A-G done bump deferred
pending evidence row apply.
2026-09-23 12:45:30 +00:00
WeiCHEN 5cdcee2649 merge: candidate agentctl-cursor-integration-close five-state
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 19:26:09 +08:00
WeiCHEN 5be380ad14 docs(ops): close agentctl Cursor capability-layer five-state
Record merged_local_dev and CURRENT done after daemon enqueue.
2026-09-23 19:26:06 +08:00
WeiCHEN 9e4ddfcd87 merge: candidate agentctl-cursor-integration Cursor capability layer 2026-09-23 19:25:23 +08:00
WeiCHEN 07094d0dd1 docs(ops): note queue retry after DIRTY_TREE clearance 2026-09-23 19:25:21 +08:00
WeiCHEN 821a307feb feat(ops): add Cursor skills/MCP/rules/hooks for agentctl
Wrap the live coordinator in project Cursor capabilities so agents
default to leases, docs apply, and daemon enqueue. Track skills/hooks/mcp
via .gitignore exceptions; guard destructive git with ask permission.
2026-09-23 19:23:40 +08:00
WeiCHEN 9984c68d37 merge: promote local_dev to test (squad settled-no-deliverable retry)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 19:20:05 +08:00
WeiCHEN 357e4ddb0f merge: candidate squad-missing-target-retry (settled-no-deliverable) 2026-09-23 19:18:23 +08:00
WeiCHEN 4830b8ba6d fix(squad): retry settled steps that never wrote the deliverable
Classify clean settle + missing target as transient (settled-no-deliverable)
and re-invoke once with a corrective write-tool prompt, instead of permanent
MISSING_TARGET failure.
2026-09-23 19:18:05 +08:00
WeiCHEN 78c2bcf6b6 merge: candidate agentctl-mgmt-go-live-close five-state 2026-09-23 18:07:53 +08:00
WeiCHEN 2f51d525ff docs(ops): close agentctl launchd go-live five-state
Record daemon e2e queue completion and deployment=loaded_local_launchd.
2026-09-23 18:07:50 +08:00
WeiCHEN 5e11db50ce merge: candidate agentctl-mgmt-go-live launchd go-live into dev 2026-09-23 18:06:45 +08:00
WeiCHEN 92d30a498b docs(ops): record agentctl launchd management-plane go-live
Persist host load evidence and short-term five-state for the
macOS LaunchAgent coordinator (bootstrap gui/501).
2026-09-23 18:06:35 +08:00
WeiCHEN eebe83e0c5 merge: candidate w3-u6-current-fix CURRENT done rows 2026-09-23 17:42:18 +08:00
WeiCHEN 8920185baa docs(ops): mark W3-U6 closeout CURRENT rows done
docs:admin row fix after task close; leave receipt on SHARED CURRENT.
2026-09-23 17:42:15 +08:00
WeiCHEN c7f14fda89 merge: candidate w3-u6-closeout five-state into dev 2026-09-23 17:39:34 +08:00
WeiCHEN f0f4d741ae docs(ops): record W3-U6 MATRIX record_id five-state closeout
Mark U6 merged_local_dev, backfill undertaking tip 8079f8f4, and
update CURRENT claim rows. Seven-package L1 queue is clear.
2026-09-23 17:39:25 +08:00
WeiCHEN 8079f8f42a merge: feature/matrix-record-id-2026-09-23 (MATRIX stable record_id) 2026-09-23 17:35:35 +08:00
WeiCHEN 77bdbdbc74 feat(ops): add stable record_id column to FEATURE-MATRIX
Make matrix_states / docs apply / evidence gates key by kebab-case
record_id (module name as transitional fallback). Wire docs project
for MATRIX with EVIDENCE_REQUIRED on done. Keep all status values and
historical paragraphs unchanged; reject rename/duplicate IDs.
2026-09-23 17:35:25 +08:00
WeiCHEN 713b7cbe6f merge: candidate w2-closeout five-state into dev 2026-09-23 17:10:42 +08:00
WeiCHEN 51b15af09d docs(ops): record W2 U7/U4/U5 five-state closeout 2026-09-23 17:10:29 +08:00
WeiCHEN c780a030b2 merge: candidate current-projection CURRENT hardening into dev 2026-09-23 17:07:28 +08:00
WeiCHEN 59739a2b48 feat(agentctl): harden CURRENT projection and human-section guards
W2-U5: own_row_only/slot_protected policy wiring, normalized projection
rows, idempotent request ids, five-state status vocab, expanded protected
human sections, projections ledger readout, and doc contradiction fixes.
2026-09-23 17:00:44 +08:00
WeiCHEN 725e2e4beb merge: candidate agentctl-daemon coordinator into dev 2026-09-23 16:44:20 +08:00
WeiCHEN 5dc25e0be3 fix(agentctl): retry manager.lock holder_pid read on LOCK_BUSY 2026-09-23 16:42:22 +08:00
WeiCHEN cb4a13671d feat(agentctl): add foreground daemon coordinator with manager.lock 2026-09-23 16:39:21 +08:00
WeiCHEN 981021b2b6 merge: candidate agentctl-handoff quarantine fence into dev 2026-09-23 16:29:28 +08:00
WeiCHEN b2c582dc5a fix(agentctl): re-lock write txn after schema DDL for claim CAS 2026-09-23 16:29:12 +08:00
WeiCHEN 7d864828b5 fix(agentctl): treat unset AGENTCTL_FENCE as zero for bootstrap 2026-09-23 16:24:56 +08:00
WeiCHEN 198b3e4ad4 feat(agentctl): add quarantine handoff with fence and heartbeat TTL
Fail-closed suspect/quarantine demotion, AGENTCTL_FENCE inheritance, and verified: gates for env/git:dev recovery without auto-release.
2026-09-23 16:16:35 +08:00
WeiCHEN fda5ef2931 merge: dialogue-realtime-search acceptance docs
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 15:08:28 +08:00
WeiCHEN fa6529db0e docs(ops): record dialogue realtime search remote test acceptance
Capture remote GMKtec :8081 evidence that Tavily-forced weather answers are date-anchored and no longer invent deep-winter temperatures.
2026-09-23 15:08:09 +08:00
WeiCHEN 8c40cb7412 merge: feature/w1-closeout-2026-09-23 (W1 five-state closeout) 2026-09-23 15:05:23 +08:00
WeiCHEN 0a933af95f docs(ops): close out W1 U1r/U2/U3 five-state fields
Record merged tips and mark CURRENT claims done; cleanup remains with
independent maintainers.
2026-09-23 15:05:10 +08:00
WeiCHEN 451f55f80d merge: feature/agentctl-claim-2026-09-23 (long-lived claim CLI) 2026-09-23 15:02:09 +08:00
WeiCHEN 6699c4a8aa feat(agentctl): add long-lived claim namespace and CLI
Introduce claim: resources with additive claims/claim_queue tables, atomic
acquire/release under IMMEDIATE transactions, and concurrency regressions.
2026-09-23 15:02:00 +08:00
WeiCHEN c6f0561b5b merge: promote local_dev to test (dialogue realtime search force)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 14:55:16 +08:00
WeiCHEN 7cd0f505b2 merge: feature/agent-governance-config-2026-09-23 (governance JSON policy)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 1s
2026-09-23 14:53:18 +08:00
WeiCHEN 8749f5077a merge: fix/dialogue-realtime-search-2026-09-23 (force Tavily for realtime dialogue) 2026-09-23 14:51:44 +08:00
WeiCHEN a5ea8197ab fix(coordinator): force Tavily search for weather/realtime dialogue answers
Anchor weather and other realtime questions on runner /v1/search results (or an explicit refuse constraint) so the model cannot invent dates or temperatures from training memory.
2026-09-23 14:51:09 +08:00
WeiCHEN 33c7b9a260 feat(agentctl): externalize governance policy to JSON
Load configs/agent-governance.json from the main worktree with fail-closed
POLICY_* codes, and keep test fixtures writing the same contract file.
2026-09-23 14:50:56 +08:00
WeiCHEN 1cb8c6f4b3 merge: fix/agentctl-automation-converge-2026-09-23 (automation converge into w4) 2026-09-23 14:39:57 +08:00
WeiCHEN dd75f42c98 fix(agentctl): converge automation into w4 and drop fork
Port deploy phase transition guards and cleanup markdown projection into
agentctl_w4, delete the unused automation module, and pin illegal jumps
with a regression test.
2026-09-23 14:39:49 +08:00
WeiCHEN 21c1278c04 merge: coordination-db-daemon-impl-plan closeout (CURRENT+short-term) 2026-09-23 14:17:52 +08:00
WeiCHEN 9e9856f652 docs(ops): record coordination-db-daemon impl-plan closeout fields
Persist short-term status, head_sha, and integration_state after the
undertaking plan landed on local_dev.
2026-09-23 14:17:34 +08:00
WeiCHEN ec8a39b39d docs(ops): close out coordination-db-daemon impl-plan on local_dev
Mark CURRENT claim done and record merge tip 51f82d5d in the
short-term closeout after docs-only integration.
2026-09-23 14:17:11 +08:00
WeiCHEN 51f82d5d4f merge: feature/coordination-db-daemon-impl-plan-2026-09-23 (undertaking plan docs) 2026-09-23 14:16:36 +08:00
WeiCHEN dad5556181 docs(remediation): add coordination db/daemon implementation undertaking plan
Pre-fill W1–W3 work packages (U1r–U6) with symbol-level anchors, real
concurrency gates, mutexes, and ADR gate for L2. Docs-only; no code.
2026-09-23 14:16:25 +08:00
WeiCHEN 1f2f3d6a58 merge: closeout-worktrees results doc 2026-09-23 14:03:11 +08:00
WeiCHEN 47c57eee6b docs(ops): record closeout-worktrees merge and cleanup results 2026-09-23 14:03:01 +08:00
WeiCHEN 1165b28d5f merge: coordination-db-daemon closeout (CURRENT done + short-term) 2026-09-23 14:01:31 +08:00
WeiCHEN bf1b592071 docs(ops): close out coordination-db-daemon task on local_dev
Mark CURRENT claim done and record merge tip d8ba8dba in the
short-term closeout fields after docs-only integration.
2026-09-23 14:01:27 +08:00
WeiCHEN d8ba8dba3c merge: feature/coordination-db-daemon-2026-09-23 (plan+research docs) 2026-09-23 14:00:21 +08:00
WeiCHEN d7e0a683c9 docs(remediation): add coordination db/daemon phased plan and research
Document L1 single-host claim/daemon/doc projection design and L2
cross-host PostgreSQL as planned-only. Register INDEX entries and claim
CURRENT; U1 cites queue subparser fix 63e66c6f.
2026-09-23 13:54:48 +08:00
WeiCHEN de3bff6d6d merge: closeout-worktrees docs batch (6 tips + task doc)
Rebuild onto current local_dev after parallel agentctl-queue integrate. Non-.doc tree matches frozen D; CURRENT/MATRIX kept as local_dev.
2026-09-23 13:52:52 +08:00
WeiCHEN 63e66c6fb3 merge: fix/agentctl-queue-subparser-2026-09-23 (queue subparser + tests) 2026-09-23 13:50:49 +08:00
WeiCHEN 2b5bcffcef merge: promote-fix-latest-upload evidence (closeout docs)
Keep evidence short-term/report/receipts; leave FEATURE-MATRIX and CURRENT as current local_dev.
2026-09-23 13:50:31 +08:00
WeiCHEN f9f09a5440 fix(ops): remove duplicate agentctl queue subparser registration
The second queue parser shadowed handler-compatible flags (--head,
cancel --task, schedule --drain), so enqueue/cancel/schedule failed
at runtime and queue_items stayed empty. Keep the first registration
and add regression coverage for parser flags, roundtrip, and schedule.
2026-09-23 13:50:18 +08:00
WeiCHEN 90b0a6498d merge: freeform-project-id-bigint docs (closeout docs) 2026-09-23 13:50:12 +08:00
WeiCHEN c60ccfe285 merge: modular-decouple residual candidate (closeout docs) 2026-09-23 13:50:11 +08:00
WeiCHEN db3ec5d6e3 merge: modular-decouple closeout docs (closeout docs) 2026-09-23 13:50:10 +08:00
WeiCHEN 2ee2b495ca merge: docrev-ui-rerun memo (closeout docs) 2026-09-23 13:50:09 +08:00
WeiCHEN 1950ab2cb1 merge: user-profile-display CURRENT claim (closeout docs) 2026-09-23 13:50:07 +08:00
WeiCHEN 68be691e13 merge: closeout-worktrees task doc (closeout docs) 2026-09-23 13:50:06 +08:00
WeiCHEN 306836006f docs(ops): register closeout-worktrees task for docs merge and cleanup 2026-09-23 13:49:23 +08:00
WeiCHEN 19b91ae14f merge: promote local_dev to test (task-bubble-bind assistant_msg_id + error actions) 2026-09-23 11:57:11 +08:00
WeiCHEN cc91c217e7 merge: feature/task-bubble-bind-2026-09-23 (assistant_msg_id bind + error actions) 2026-09-23 11:49:50 +08:00
weichen 3f14d7fa75 docs: integrate coordination plan closeout 2026-09-23 03:45:27 +00:00
weichen 3a06150d01 docs: record coordination plan integration and verification 2026-09-23 03:45:27 +00:00
weichen 6a0d721f36 docs: integrate multi-host coordination research and plan 2026-09-23 03:44:27 +00:00
weichen a542c21a42 docs: define multi-host agent coordination and recovery plan 2026-09-23 03:44:12 +00:00
WeiCHEN c60685bb25 docs(ops): claim task-bubble-bind on CURRENT
Register parallel claim row after test overlay verification.
2026-09-23 11:26:01 +08:00
WeiCHEN 66eadc0dc1 docs(ops): record task-bubble-bind test evidence and closeout
Capture test overlay verification, LiveDualTrack, and browser checks for
assistant_msg_id binding and non-resumable continue hiding.
2026-09-23 11:24:45 +08:00
WeiCHEN a360dd302f merge: platform deepening plan (docs only) 2026-09-23 11:19:44 +08:00
WeiCHEN 6b7c8495c5 docs(remediation): add platform deepening plan for decoupling, bus, reliability, HA, concurrency
Six-track plan (R1-R6) grounded in the 2026-09-23 four-way read-only
survey: server/chat/bizdev/workflow residual coupling, event bus ops
loop gaps (dead letters, serial dispatch, dual outbox), panic
recovery, single-host HA (replicas, PG hot standby, backup
automation), concurrency hotspots (docgov engine lock, sync long
tasks, pool tuning). Planned only; no code changes.
2026-09-23 11:19:33 +08:00
WeiCHEN b9b192a843 fix(web): bind task assistant bubble to serverId and harden error actions
Return assistant_msg_id from createTaskRun so live bubbles merge with history,
hide continue on terminal failed runs, and restart via a fresh turn/bubble.
2026-09-23 11:12:50 +08:00
weichen a0fd52a627 docs: integrate learning workflow closeout 2026-09-23 03:02:40 +00:00
weichen f1db9a6c78 docs: record learning workflow activation and verification 2026-09-23 03:02:31 +00:00
weichen 7bbd7a407f docs: integrate issue tracking and development lessons 2026-09-23 03:01:37 +00:00
weichen ccf515c3b1 docs: add issue tracking and development learning workflow 2026-09-23 03:00:51 +00:00
WeiCHEN 44bed71ccd merge: promote local,dev to test (dialogue current-time anchor) 2026-09-23 11:00:21 +08:00
WeiCHEN 15fdb28aa1 merge: fix/dialogue-current-time-2026-09-23 (dialogue clock anchor) 2026-09-23 10:59:37 +08:00
WeiCHEN c9e1033926 fix(coordinator): inject current time into dialogue prompt to anchor time-sensitive answers 2026-09-23 10:59:28 +08:00
weichen 2fdb6e548e docs: integrate systemic analysis policy closeout 2026-09-23 02:44:58 +00:00
weichen bbcb3b3b17 docs: record systemic analysis policy activation 2026-09-23 02:44:57 +00:00
weichen 958dd44fee docs: integrate systemic issue analysis requirements 2026-09-23 02:42:58 +00:00
WeiCHEN e77d994d5d merge: closeout docs for pi-runner-response-size integrate 2026-09-23 10:33:49 +08:00
WeiCHEN 0d3976aa15 docs(ops): close out pi-runner response-size integrate on local_dev 2026-09-23 10:33:21 +08:00
WeiCHEN ee66bd009a docs: record latest-upload promote-to-test evidence 2026-09-23 10:32:11 +08:00
WeiCHEN 04d0727e94 merge: feature/pi-runner-response-size-2026-09-23 (cap /v1/run response size) 2026-09-23 10:30:16 +08:00
WeiCHEN 54955c9d1a merge: promote local_dev to test (latest-upload summary + parse wait) 2026-09-23 10:27:21 +08:00
weichen 380584b86b docs: require systemic root-cause analysis for reported issues 2026-09-23 02:23:45 +00:00
WeiCHEN 30fa4e88b2 merge: fix/fix-latest-upload-summary-2026-09-23 (latest-upload summary + parse wait) 2026-09-23 10:23:21 +08:00
WeiCHEN e035d67170 docs(ops): register pi-runner response-size task as done 2026-09-23 10:22:41 +08:00
WeiCHEN 77028af546 fix(pi-runner): cap /v1/run response size to stop typed reject
Truncate execution.log patches and keep members aligned with patch bodies so
verbose MiniMax-M3 runs no longer exceed the Go 8MB fail-closed limit.
Surface body-too-large vs typed-reject reasons and map contract failures to
fatal restart instead of misleading resumable TASK_INTERRUPTED.
2026-09-23 10:22:23 +08:00
WeiCHEN 10f9a8b9c3 merge: modular-decouple-residual closeout docs (W4 matrix + governance status) 2026-09-23 10:19:42 +08:00
WeiCHEN 521edd4dba merge: modular-decouple residual MATRIX/W4 calibration
Land FEATURE-MATRIX W4 landed notes and close superseded
governance-automation short-term after residual merges.
2026-09-23 10:19:32 +08:00
WeiCHEN 3ebabc1941 docs(ops): calibrate W4 matrix and close governance-automation status
Mark W4 projection/deploy/recover/Darwin as landed in FEATURE-MATRIX,
close the superseded governance-automation short-term, and refresh
residual closeout SHAs after local_dev merges.
2026-09-23 10:19:20 +08:00
WeiCHEN 9f7658515c docs(ops): calibrate W4 matrix and close governance-automation status
Mark W4 projection/deploy/recover/Darwin as landed in FEATURE-MATRIX,
close the superseded governance-automation short-term, and refresh
residual closeout SHAs after local_dev merges.
2026-09-23 10:18:13 +08:00
WeiCHEN 55f3e89a2d merge: promote-user-profile-display-test evidence (receipt + report)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 10:18:11 +08:00
WeiCHEN e2e508755c docs(ops): close user-profile-display test promotion evidence 2026-09-23 10:17:52 +08:00
WeiCHEN f1f1846925 merge: modular-decouple-residual closeout docs
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 10:16:45 +08:00
WeiCHEN ae9d44a35c docs(ops): close out modular-decouple-residual after local_dev land 2026-09-23 10:16:30 +08:00
WeiCHEN 8b3936ea0c merge: modular-decouple residual goose 00065 2026-09-23 10:15:20 +08:00
WeiCHEN 73e1797987 feat(sysadmin): add goose 00065 for system:* and settings audits
Restore the migration that seeds console permissions and creates
system_settings_audits so PG environments match the phase-2 API.
2026-09-23 10:15:15 +08:00
WeiCHEN 701c565f72 merge: modular-decouple-residual (splits + W4 + sysadmin)
Land nine package splits, W4 projection/deploy Darwin tests, and
sysadmin system:* permissions with settings audits onto local_dev.
2026-09-23 10:13:39 +08:00
WeiCHEN ed6de25b82 merge(dev): absorb smalltalk routing into intent split
Keep use-case split of recognizer.go and port IsSmallTalk helpers
into recognizer_helpers.go so residual can re-integrate cleanly.
2026-09-23 10:13:29 +08:00
WeiCHEN b2d49d54f1 docs(ops): record Sysadmin phase-2 tip SHA 2026-09-23 10:12:04 +08:00
WeiCHEN e217929ccd merge: promote local,dev to test (intent smalltalk + schema 64)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-23 10:12:00 +08:00
WeiCHEN d49c8f8cfc feat(sysadmin): system permission checks and settings audit list
Expose fine-grained system:* checks (admin grants all) and list
system_setting_policy_audits for settings change visibility.
2026-09-23 10:11:46 +08:00
WeiCHEN 5ab034eb53 merge: modular-decouple-residual (splits + W4 + sysadmin)
Land nine package splits, W4 projection/deploy Darwin tests, and
sysadmin system:* permissions with settings audits onto local_dev.
2026-09-23 10:10:17 +08:00
WeiCHEN 9735578c1f docs(ops): record residual sysadmin matrix and CURRENT claim
Update FEATURE-MATRIX remaining deferred items and register the
continuation task claim for serial integrate.
2026-09-23 10:09:44 +08:00
WeiCHEN b627134c62 feat(sysadmin): add system:* permissions and settings audit log
Seed fine-grained console permissions (goose 00065), gate admin
handlers by system:* keys, and persist settings change audits for
all upserts. KB ops and whitelist consumers stay deferred.
2026-09-23 10:09:10 +08:00
WeiCHEN c6e3f26524 merge: fix/intent-smalltalk-routing-2026-09-23 (smalltalk → casual chat) 2026-09-23 10:08:44 +08:00
WeiCHEN 124c6d0071 docs(ops): correct W4 Darwin test claim
DarwinVisibilityTests are not in this round; keep evidence at 5 PASS.
2026-09-23 10:02:26 +08:00
WeiCHEN ee037a4cbc docs(ops): mark W4 done tip 12322b69
Fill pending_commit tip after projection/deploy commit; align W4 test count.
2026-09-23 10:02:13 +08:00
WeiCHEN 3337bf4a42 feat(w4): complete doc projection CAS and deploy/recover loop
Add whole-doc and row projection with hash CAS, real enqueue→claim→
fake-deploy→SQLite receipt chain, Darwin lsof cwd visibility, and
black-box tests. PI image compose remains deferred.
2026-09-23 10:01:23 +08:00
WeiCHEN 12322b6974 feat(agentctl): W4 projection apply and deploy-recover loop
Add CAS projection helpers and a real enqueue→claim→command→receipt
deploy path for temp-repo tests; PI image compose stays deferred.
2026-09-23 10:01:12 +08:00
WeiCHEN f6e14f97af docs(ops): record head_sha for upload parse-wait follow-up 2026-09-23 09:55:59 +08:00
WeiCHEN 1f37f90b4b feat(chat): show MinerU parse progress while waiting in-turn
When summarizing the latest upload, poll parse state up to MinerU timeout,
emit document_parsing phase events so the bubble stays live and input stays
locked, then summarize or return a clear slow/failed reply.
2026-09-23 09:55:59 +08:00
WeiCHEN 0079080d8a fix(intent): route general smalltalk questions to casual chat instead of stage consult template 2026-09-23 09:54:37 +08:00
WeiCHEN 39e115b4d3 refactor(docgov): split engine.go into use-case files
Move claim/document/persist/proposal/read/review_flow into ≤800-line
siblings without behavior change; short tests green.
2026-09-23 09:54:19 +08:00
WeiCHEN 4c07716933 refactor(server): split handlers.go by domain
Keep slim handlers.go core; move chat/docgov/health/http/context
handlers into domain files ≤800 lines without behavior change.
2026-09-23 09:54:18 +08:00
WeiCHEN 943becfb2a refactor(projectinstance): split store.go into use-case files
Move mem/pg activate/live/meta/plan/token/seed paths into ≤800-line
siblings without behavior change; short tests green.
2026-09-23 09:54:17 +08:00
WeiCHEN 20290d0379 docs(ops): claim CURRENT row for user-profile-display done 2026-09-23 09:53:30 +08:00
WeiCHEN 64c7197f8c merge: user-profile-display acceptance docs 2026-09-23 09:53:11 +08:00
WeiCHEN c1f27e3cdb docs(ops): record user-profile-display acceptance on local_dev 2026-09-23 09:53:02 +08:00
WeiCHEN 9da7f352fa refactor(docrevision): split service.go into use-case files
Move human/agent/read/locked/compat paths into ≤800-line siblings
without behavior change; short tests green.
2026-09-23 09:52:49 +08:00
WeiCHEN dca33c705d refactor(boundaries): split five oversized packages by use-case
Move bizdev/freedoc/intent/projectworkflow/squad giant files into
≤800-line use-case siblings without behavior change; short tests green.
2026-09-23 09:52:16 +08:00
WeiCHEN 2fae990965 merge: user-profile-display build unblock (optional chat status) 2026-09-23 09:44:12 +08:00
WeiCHEN 654a92583f fix(web): allow optional chat status in cancelInflight helper
Unblocks Docker web build after ChatMessage.status became optional.
2026-09-23 09:44:02 +08:00
WeiCHEN 1546d89446 docs(ops): record head_sha for latest-upload summary fix 2026-09-23 09:42:47 +08:00
WeiCHEN a3b5d4291b fix(chat): resolve latest-upload summary via CAS assets
Recognize “刚刚上传” as @latest_upload and summarize the project’s newest CAS attachment (with clear parse pending/failed/no-asset replies) instead of searching only controlled workflow docs.
2026-09-23 09:42:28 +08:00
WeiCHEN ad80777a3e merge: user-profile-display (directory API + profile edits) 2026-09-23 09:40:00 +08:00
WeiCHEN 6d3efdf4d7 feat(auth): show real names in duty pickers and enable profile edits
Add a login-visible user directory API and admin/self profile update
paths so project duty selectors stop falling back to "用户 N", and so
users can persist display fields with an admin-edit tip.
2026-09-23 09:39:41 +08:00
WeiCHEN 19a1a03c20 merge: modular-refactor-impl-plan closeout (CURRENT done)
Record undertaking-plan task done and short-term closeout after first merge.
2026-09-23 09:38:25 +08:00
WeiCHEN e32d55bd9b docs(ops): close modular-refactor-impl-plan after local_dev merge
Record merged SHA, validation receipts, and CURRENT row done; cleanup
pending for feature worktree; remote sync not requested.
2026-09-23 09:38:24 +08:00
WeiCHEN b9f4509287 merge: modular-refactor-impl-plan-2026-09-23 (undertaking framework)
Land the phase-gate and work-package backfill framework for the off-host
refactor plan; documentation only.
2026-09-23 09:38:01 +08:00
WeiCHEN 19a8f19a8a docs(ops): claim CURRENT for modular-refactor-impl-plan
Register the undertaking-plan documentation task in the parallel-claim table.
2026-09-23 09:37:49 +08:00
WeiCHEN 5c249b0975 docs(plan): add modular refactor implementation undertaking framework
Define phase gates, work-package template, anti-duplication checks against
A-G/exceptions baseline, and product-host backfill rules without coding.
2026-09-23 09:37:48 +08:00
weichen c45ed6ba52 docs: integrate system modular refactoring plan 2026-09-23 01:36:43 +00:00
weichen a44804fd59 docs(architecture): add system remediation and refactoring plan 2026-09-23 01:36:29 +00:00
WeiCHEN 2ce8688db4 merge: modular-refactor-review closeout (CURRENT done)
Record checklist task done and short-term closeout after first merge.
2026-09-23 09:14:42 +08:00
WeiCHEN 6bcaf53d51 docs(ops): close modular-refactor-review after local_dev merge
Record merged SHA, validation receipts, and CURRENT row done; cleanup
remains for an independent maintainer; remote sync not requested.
2026-09-23 09:14:33 +08:00
WeiCHEN e8bff7e287 merge: modular-refactor-review-2026-09-23 (audit checklist)
Bring the phase-1/2 and cancel-contract review checklist into local_dev
as a documented self-check for the off-host refactor plan.
2026-09-23 09:13:47 +08:00
WeiCHEN f0de2b2158 docs(ops): claim CURRENT row for modular-refactor-review
Register the checklist task in the parallel-claim table so coordination
snapshots match the agentctl registration.
2026-09-23 09:12:38 +08:00
WeiCHEN 6d9f3648bd docs(audit): add modular refactor plan review checklist
Provide phase-1/2 and cancel-contract self-check items for the off-host
refactor plan, with N01–N22 mapping placeholders and product-host backfill steps.
2026-09-23 09:11:56 +08:00
WeiCHEN 457bea8591 docs(ops): note CURRENT sync completed after DOCREV UI PASS
Record that the ours-merge CURRENT drop was repaired via closeout
on local_dev; keep only the short-term memo on this branch.
2026-09-23 09:09:44 +08:00
WeiCHEN 8f0e31e53a merge: closeout FEATURE-MATRIX A-G done + CURRENT residuals 2026-09-23 04:24:54 +08:00
WeiCHEN fdd072d694 docs(status): close MATRIX A-G and register unfinished-batch residuals
Restore W1-D schema facts lost in merge, mark decoupling A-G done with
batch evidence, and keep redline rows partial with 2026-09-22 evidence.
2026-09-23 04:24:09 +08:00
WeiCHEN c24e1548ca merge: closeout CURRENT + sealed DOCREV UI PASS ledger
Resolve CURRENT to DOCREV PASS focus (CAS on closeout 44cc4926).
Archive sealed main/post-restart ledger mud2qct9. Hook bypass: integrate
task lacks docs:admin; CURRENT body matches closeout receipt.
2026-09-23 04:17:42 +08:00
WeiCHEN 44cc4926e1 docs(ops): restore DOCREV UI PASS focus on CURRENT
Prior ours-merge dropped the focus line; re-apply via docs @document
CAS with sealed ledger link and docrev cleanup row.
2026-09-23 04:17:13 +08:00
WeiCHEN 4a97cfcf76 docs(test): archive sealed DOCREV UI main+post-restart PASS ledger
Persist mud2qct9 main/post ledgers, phase-state, and key screenshots
under sealed-ledger-ui00-16-post-20260923T0400Z (schema 63).
2026-09-23 04:16:39 +08:00
WeiCHEN 63348b6e35 merge: docrev short-term CURRENT sync note 2026-09-23 04:06:16 +08:00
WeiCHEN a9198eb5b5 docs(ops): note CURRENT sync pending after DOCREV UI PASS 2026-09-23 04:06:15 +08:00
WeiCHEN 437cee84a5 merge: closeout CURRENT DOCREV UI PASS note 2026-09-23 04:03:32 +08:00
WeiCHEN e9a9ce97c2 docs(ops): record DOCREV UI rerun PASS on CURRENT 2026-09-23 04:02:02 +08:00
WeiCHEN ddcb63cd4b merge: feature/docrev-ui-rerun-2026-09-22 (UI PASS closeout docs) 2026-09-23 04:01:06 +08:00
WeiCHEN 4baa1220ee docs(ops): close docrev UI audits after main+post-restart PASS
Record real Playwright ledgers, mark 20 audits and 9 remediations done, and leave management-implementation-plan as plan-only.
2026-09-23 04:00:49 +08:00
WeiCHEN bcc3168e8a merge: feature/docrev-ui-rerun-2026-09-22 (UI-13b before 三权) 2026-09-23 03:35:48 +08:00
WeiCHEN 0f97965cd2 fix(e2e): run UI-13b A/A conflict on drafting intake before 三权
Prelim materializes with empty duty slots (author_id=0), so claim/edit is
impossible after UI-11; move conflict onto intake while it is still drafting.
2026-09-23 03:35:27 +08:00
WeiCHEN 6fc86335ef merge: feature/docrev-ui-rerun-2026-09-22 (squad/playwright timeouts) 2026-09-23 03:12:58 +08:00
WeiCHEN 84cc3b9861 fix(e2e): raise Playwright per-test timeout to 15m
Pair with 10m squad waits so UI-03 does not race the test wall when intake finishes near the expect limit.
2026-09-23 03:11:20 +08:00
WeiCHEN ecd8e94e24 fix(e2e): raise squad wait timeout to 10m for UI-03
Intake completion landed ~20s after the old 7m expect wall; keep claim-before-edit fix and avoid false pending failures.
2026-09-23 03:09:24 +08:00
WeiCHEN 8c37c9330a merge: feature/docrev-ui-rerun-2026-09-22 (UI-13b claim-before-edit) 2026-09-23 03:02:42 +08:00
WeiCHEN 01bf599bd4 fix(e2e): claim prelim author before UI-13b conflict edit
Prelim docs ship with author_id=0 so currentDocRole is viewer and dblclick
is a no-op; claim 认领此文档 first then assert the edit tip on both A contexts.
2026-09-23 03:00:15 +08:00
WeiCHEN 67251abc09 fix(e2e): release A1 lease before UI-13b A2 opens block editor
Same-user second context could not dblclick-edit while A1 held the
human lease on prelim. Leave to intake, let A2 claim editor, then A1 save.
2026-09-23 02:35:45 +08:00
WeiCHEN 0429b9735e fix(e2e): run UI-13b conflict on drafting prelim, not locked intake
After UI-11 三权, intake is 已生效受控 and blocks body edit. Use
secondDocId (prelim_design) for the A/A head-conflict scenario.
2026-09-23 02:12:02 +08:00
WeiCHEN 92bb1a2004 fix(e2e): send Bearer token when fetching revision-state etag
UI-13b page.evaluate fetch used credentials-only and got HTTP 401 because
auth is Bearer in smdf_auth_session, not cookies.
2026-09-23 01:53:49 +08:00
WeiCHEN 9d7c97f728 fix(e2e): fetch revision-state etag by doc id for UI-13b
waitForResponse raced unrelated revision-state polls, so A1/A2
compared different documents heads before the conflict save.
2026-09-23 01:29:17 +08:00
WeiCHEN a28c067f72 merge: feature/docrev-ui-rerun-2026-09-22 (freeform bigint + UI e2e) 2026-09-23 00:47:23 +08:00
WeiCHEN 3bdd53ae35 fix(freedoc): widen freeform project_id to BIGINT for snowflake IDs
UI-11 POST /freeform-documents 500 when project_id exceeds int4.
Align Go types + goose 00063 with projects.id BIGINT.
2026-09-23 00:45:31 +08:00
WeiCHEN b6965eb0f3 docs(ops): mark freeform project_id BIGINT task done 2026-09-23 00:44:05 +08:00
WeiCHEN 2b901a61de fix(freedoc): widen freeform project_id to BIGINT
Snowflake project IDs exceed int4; upload registration failed with
pgx encode errors. Align column and Go types with projects.id.
2026-09-23 00:42:30 +08:00
WeiCHEN 1ff3d81e1b docs(ops): pin docrev-ui head_sha after closeout scaffold 2026-09-23 00:27:28 +08:00
WeiCHEN c9a9b90172 docs(ops): scaffold docrev UI rerun closeout without closing audits
Record honest partial progress (UI-00..04 live PASS, sealed UI-00..10 screenshots, UI-11 blocker history) and UI→audit mapping; leave 09-13 audits in_progress until full main+post-restart PASS ledger exists.
2026-09-23 00:27:07 +08:00
WeiCHEN 1dbdb95088 fix(e2e): click 确认推进 after intake 三权 before UI-11
Approved intake only unlocks the gate; prelim_design still 403 until
creator advances V0.1 → V0.5 via StageAdvanceBanner.
2026-09-23 00:17:08 +08:00
WeiCHEN 3a1065f789 fix(e2e): expand collapsed doc rail before category select
Reviewer/approver contexts open with collapsed rail; UI-11 三权
failed looking up doc-category-trigger.
2026-09-23 00:02:41 +08:00
WeiCHEN e6b23772c9 fix(e2e): approve intake via 三权 before UI-11 prelim_design
V0.1 blocking intake caused tasks/runs 403 for V0.5 prelim_design;
drive submit/review/approve on page and accept bd_prelim_design keys.
2026-09-22 23:40:22 +08:00
WeiCHEN 34d4ddcd7a merge: fix-governance-agent-worktree-restore-2026-09-22 2026-09-22 23:31:46 +08:00
WeiCHEN 3633f8771e fix(scripts): restore agent_worktree after governance merge conflict 2026-09-22 23:31:43 +08:00
WeiCHEN 85afbfb3f6 merge: feature/governance-automation-2026-09-22 2026-09-22 23:29:44 +08:00
WeiCHEN 4476c446f0 merge: feature/coordinator-docgov-allowlist-2026-09-22 2026-09-22 23:28:40 +08:00
WeiCHEN 07991588c2 merge: feature/docrev-ui-rerun-2026-09-22 2026-09-22 23:20:01 +08:00
WeiCHEN 5e7fb240c3 fix(e2e): accept bd_intake task_key for UI-05b intake runs
Server posts doc_proj suffix (bd_intake) as task_key; bare intake
assertion was a false FAIL after UI-05a.
2026-09-22 23:11:00 +08:00
WeiCHEN 1c78d614cb fix(web): ignore retained task run id when unlocking chat composer
Orphan streaming_status plus a leftover activeTaskRunId kept InputArea on
停止 after squad terminal. Gate taskRunLive on isThinking only and clear
runId on abortSession so stop/send can proceed for UI-05+.
2026-09-22 23:02:13 +08:00
WeiCHEN db8c3dcc64 fix(web): settle orphan inflight bubbles via shared cancel helper
Wire cancelInflightAssistantMessages on stop so composer unlock and
message status stay consistent across sessions.
2026-09-22 22:59:17 +08:00
WeiCHEN c3639eba7d fix(web): unlock chat send when orphan streaming_status remains
Composer stop/send was gated only on message status; after squad
terminal, stale streaming bubbles kept 停止当前生成. Gate on live
turn/task-run runtime and settle orphans on explicit stop.
2026-09-22 22:58:39 +08:00
WeiCHEN 5c222d18e6 fix(e2e): drain stuck chat streaming before next sendChat
UI-05 timed out on 发送 because InputArea stayed isStreaming after
squad terminal; stop/idle wait restores 发送 (Enter).
2026-09-22 22:49:55 +08:00
WeiCHEN 30c85ed79f fix(e2e): disable Playwright auto-artifacts for docrev UI acceptance 2026-09-22 22:40:40 +08:00
WeiCHEN 8b76060b5f merge: feature/docrev-ui-rerun-2026-09-22 2026-09-22 22:30:05 +08:00
WeiCHEN 8122f7461d docs(ops): pin docrev-ui head_sha 2026-09-22 22:30:03 +08:00
WeiCHEN 3fdf4a01b7 docs(ops): pin docrev-ui head_sha on final rebuilt tip 2026-09-22 22:30:02 +08:00
WeiCHEN c5999f9c30 fix(e2e): retain Playwright artifacts only on failure for docrev UI
Avoid ENOENT on in-flight traces when long UI-03 squad runs while
outputDir is cleaned by a concurrent acceptance attempt.
2026-09-22 22:30:02 +08:00
WeiCHEN 235def6dbf docs(ops): pin docrev-ui head_sha on rebuilt tip 2026-09-22 22:30:01 +08:00
WeiCHEN f99e714fb2 fix(e2e): activate workflow with A/B/D duties before UI-02 squad
Product gate blocks intake until workflow is active with human-approval
duties. Keep C non-member for UI-12; pin B as reviewer for UI-13.
2026-09-22 22:30:00 +08:00
WeiCHEN 62f444ce15 fix(e2e): add approver D for workflow 三权 without inviting C
系统管理员 name collides in member list; unique 审批人D keeps UI-12.
2026-09-22 22:29:59 +08:00
WeiCHEN 16cb60b3d8 fix(e2e): activate workflow in UI-01 before squad tasks
Product gate blocks document tasks until a human-approval workflow is
active; add admin as third member for 三权 and drive 配置工作流.
2026-09-22 22:29:58 +08:00
WeiCHEN 54629e7f40 fix(e2e): scope UI-02 prompt visibility to user chat bubble
Avoid strict-mode collision with truncated preview duplicate text.
2026-09-22 22:29:57 +08:00
WeiCHEN c2d5499229 fix(e2e): expand collapsed doc rail before UI-01 template hint
Default right rail is collapsed; assert after opening 展开受控文档栏.
2026-09-22 22:29:57 +08:00
WeiCHEN 50d50d4798 fix(web): preserve org user directory across workbench reset
Logout and account switch were clearing USERS from localStorage, so
UI-01 page.goto remount loaded an empty member list for non-admins.
2026-09-22 22:29:56 +08:00
WeiCHEN b246ead0e4 docs(ops): sync docrev-ui head_sha to tip 2026-09-22 22:29:55 +08:00
WeiCHEN 7519e76ac2 docs(ops): mark docrev UI rerun blocked pending env lease 2026-09-22 22:29:54 +08:00
WeiCHEN 8d2d514fa7 fix(e2e): exit AdminConsoleView via 返回工作台 in UI-00 2026-09-22 22:29:53 +08:00
WeiCHEN 61a0623bf8 fix(e2e): open Users section before create-user in docrev UI-00 2026-09-22 22:29:52 +08:00
WeiCHEN 2e45a649c5 docs(ops): register docrev UI rerun short-term after artifact fix 2026-09-22 22:29:51 +08:00
WeiCHEN 4bb4881241 merge: feature/track-t-strengthen-2026-09-22 2026-09-22 22:28:48 +08:00
WeiCHEN 3208e090ad merge: feature/rdev-closeout-2026-09-22 2026-09-22 22:28:44 +08:00
WeiCHEN 1498cd230a merge: feature/server-assembly-2026-09-22 2026-09-22 22:26:50 +08:00
WeiCHEN 2695b55863 merge: feature/docgov-vocabulary-2026-09-22 2026-09-22 22:26:27 +08:00
WeiCHEN 476ef180bb merge: feature/closeout-unfinished-batch-2026-09-22 2026-09-22 22:26:19 +08:00
WeiCHEN e7aaa20f5d docs(ops): record unfinished-batch closeout on local tip 0352c099 2026-09-22 22:26:14 +08:00
WeiCHEN aebd27665b merge: feature/loading-perf-closeout-2026-09-22 2026-09-22 22:25:37 +08:00
WeiCHEN fe9b1b41ed merge: feature/web-api-client-2026-09-22 2026-09-22 22:24:29 +08:00
WeiCHEN 6ad6f55f4b docs(ops): pin governance-automation head_sha after conflict resolution 2026-09-22 22:20:37 +08:00
WeiCHEN 0352c0996d merge: feature/governance-automation-2026-09-22
Keep macOS process platform; land W4 queue/automation and cleanup-report.
2026-09-22 22:20:37 +08:00
WeiCHEN 1116058a88 merge(dev): sync governance-automation onto current local dev 2026-09-22 22:20:36 +08:00
WeiCHEN 2006c7103a fix(arch): restore coordinator→docgov allowlist after engine-split
Engine split kept the existing production import; vocabulary allowlist rewrite had dropped the key and left arch-check red on tip.
2026-09-22 22:14:52 +08:00
WeiCHEN 3eac3a815f merge: feature/engine-split-archfix-2026-09-22
Restore arch-check after engine-split unused docgov imports.
2026-09-22 22:14:23 +08:00
WeiCHEN 0ad4ee319c fix(coordinator): map engine-split sentinels to vocabulary 2026-09-22 22:14:22 +08:00
WeiCHEN 04d1b174e9 merge: feature/track-s1-summary-shadow-2026-09-22 2026-09-22 22:13:41 +08:00
WeiCHEN f77cf953d5 merge(dev): sync track-s1 shadow onto current local dev 2026-09-22 22:13:31 +08:00
WeiCHEN a01db5451c merge: feature/engine-split-2026-09-22 2026-09-22 22:12:24 +08:00
WeiCHEN 19eeccc699 docs(ops): pin engine-split head_sha on rebuilt tip 2026-09-22 22:10:27 +08:00
WeiCHEN 834af6dd59 refactor(coordinator): split engine.go by use-case handlers (rebuilt on current dev) 2026-09-22 22:10:26 +08:00
WeiCHEN 08af12b936 merge: feature/g2-g3-exception-clearance-2026-09-22
Keep G1 cleared sql_write; land G2/G3 path clearances; baseline to zero.
2026-09-22 22:08:53 +08:00
WeiCHEN fa34f8c84d docs(ops): sync track-t head_sha to tip 2026-09-22 22:08:39 +08:00
WeiCHEN e07d6024e6 docs(ops): pin governance-automation head_sha 2026-09-22 22:08:39 +08:00
WeiCHEN 3dc7b85b7e docs(ops): pin track-s1 consolidation head_sha to tip 2026-09-22 22:08:39 +08:00
WeiCHEN 2b6f645aad docs(ops): register track-t strengthen short-term as merged 2026-09-22 22:08:39 +08:00
WeiCHEN ae001a85c1 fix(ops): copy agentctl_w4 into script test fixtures
Disposable Git fixtures only copied agentctl.py, so imports of the new
W4 helper module crashed before any guard assertions could run.
2026-09-22 22:08:38 +08:00
WeiCHEN 79f1710f8e docs(ops): pin server-assembly head_sha after conflict resolution 2026-09-22 22:06:14 +08:00
WeiCHEN 9967f41053 fix(server): resolve assembly merge onto current local dev 2026-09-22 22:06:14 +08:00
WeiCHEN 573fce225d merge: feature/track-i1-query-owner-2026-09-22
Land QueryOwner code; FEATURE-MATRIX deferred to docs apply.
2026-09-22 22:05:45 +08:00
WeiCHEN 0eee2dd036 merge: feature/server-assembly-2026-09-22
Keep G1 Heal via docgov through Runtime port; domain HTTP adapters.
2026-09-22 22:04:53 +08:00
WeiCHEN 955ebe8a36 merge: feature/chat-history-refresh-reconcile-2026-09-22 2026-09-22 22:03:46 +08:00
WeiCHEN 239997ce09 merge: feature/status-drift-reconcile-2026-09-22 2026-09-22 22:02:53 +08:00
WeiCHEN 1892af6391 docs(ops): sync rdev-closeout head_sha to tip 2026-09-22 22:01:50 +08:00
WeiCHEN 6cdb818e0d docs(ops): sync loading-perf head_sha to tip 2026-09-22 22:01:50 +08:00
WeiCHEN 5a07a8388a docs(ops): align rdev-closeout head_sha after merge 2026-09-22 22:01:50 +08:00
WeiCHEN 97f05c3d10 docs(ops): align loading-perf head_sha for integrate readiness 2026-09-22 22:01:50 +08:00
WeiCHEN 82eb500d8e docs(ops): sync docgov-vocabulary head_sha to tip 2026-09-22 22:01:49 +08:00
WeiCHEN f33670f5bd docs(ops): sync track-i1 head_sha to tip 2026-09-22 22:01:49 +08:00
WeiCHEN 6fae5a1ee6 docs(ops): sync chat-history-refresh head_sha to tip 2026-09-22 22:01:49 +08:00
WeiCHEN aa78d03044 docs(ops): align track-i1 head_sha for integrate readiness 2026-09-22 22:01:49 +08:00
WeiCHEN 7292c01aaa docs(ops): align chat-history-refresh head_sha to branch tip 2026-09-22 22:01:49 +08:00
WeiCHEN 5197cf348b docs(ops): sync server-assembly head_sha to tip 2026-09-22 22:01:48 +08:00
WeiCHEN 49eba094c0 docs(ops): sync status-drift-reconcile head_sha to tip 2026-09-22 22:01:48 +08:00
WeiCHEN 98fd086894 docs(ops): align docgov-vocabulary head_sha for integrate readiness 2026-09-22 22:01:48 +08:00
WeiCHEN 04d18e1f80 docs(ops): align server-assembly head_sha for integrate readiness 2026-09-22 22:01:48 +08:00
WeiCHEN 0111824d10 docs(ops): align W1-D head_sha for integrate readiness 2026-09-22 22:01:48 +08:00
WeiCHEN dee905c1de docs(ops): sync g2-g3 head_sha to tip 2026-09-22 22:01:27 +08:00
WeiCHEN db632aeea2 docs(ops): mark g2-g3 clearance done and pin head_sha 2026-09-22 22:01:27 +08:00
WeiCHEN a8c6eb6638 refactor(boundaries): clear U5 path leaks and U8 task_runs write
Route deliverable/workspace paths through workspace constants and cancel
open runs via taskrun.CancelOpenByProject so G2/G3 exceptions can drop.
2026-09-22 22:01:14 +08:00
WeiCHEN 50fd582595 merge: feature/agentctl-macos-2026-09-22 (head_sha tip) 2026-09-22 22:00:24 +08:00
WeiCHEN 0c572ddaca test(chat): align semantic shadow tests with async pending path
Drain/wait after GenerateRollingSummary; register summary table writers;
document consolidation discarding duplicate S1 dirty worktrees.
2026-09-22 21:59:12 +08:00
WeiCHEN 060bbb92cb docs(ops): pin web-api-client head_sha after CRLF residual 2026-09-22 21:59:05 +08:00
WeiCHEN 4d87b9a401 fix(web): accept CRLF SSE frame delimiters in chatStream
Align residual chatStream parsing with sibling t20-lowrisk so LF/CRLF
mixed streams parse reliably before integration, with unit coverage.
2026-09-22 21:59:05 +08:00
WeiCHEN 52c7828339 merge: feature/docgov-vocabulary-2026-09-22
Keep contracts/vocabulary with G1 uow/workspace duty ports; chat stays decoupled.
2026-09-22 21:58:16 +08:00
WeiCHEN e558192813 merge: feature/loading-perf-closeout-2026-09-22 2026-09-22 21:56:09 +08:00
WeiCHEN e6f101a811 merge: feature/docrev-ui-rerun-2026-09-22 2026-09-22 21:54:56 +08:00
WeiCHEN 7e405546ec merge: feature/track-t-strengthen-2026-09-22 2026-09-22 21:54:48 +08:00
WeiCHEN 57111ca075 merge: feature/rdev-closeout-2026-09-22 2026-09-22 21:54:40 +08:00
WeiCHEN 6984f96c19 merge: feature/workflow-def-unidirect-2026-09-22 2026-09-22 21:53:52 +08:00
WeiCHEN 4662e39541 merge: feature/web-api-client-2026-09-22 2026-09-22 21:53:45 +08:00
WeiCHEN 265de19725 merge: feature/chat-app-decouple-2026-09-22 2026-09-22 21:53:38 +08:00
WeiCHEN 0779db4634 docs(ops): pin loading-perf head_sha to tip 2026-09-22 21:53:35 +08:00
WeiCHEN 3e1d00b2e3 merge: feature/t20-lowrisk-hardening-2026-09-22 2026-09-22 21:53:30 +08:00
WeiCHEN 2c80129421 merge: feature/g1-exception-clearance-2026-09-22 2026-09-22 21:53:25 +08:00
WeiCHEN e207dc1e71 docs(status): close FEATURE-MATRIX initial-load special section
Mark U1/U3/U7 measured closeout on schema 61; keep whole-machine reboot
claim out of scope.
2026-09-22 21:53:20 +08:00
WeiCHEN c37988f075 merge: feature/redline-evidence-2026-09-22 2026-09-22 21:53:20 +08:00
WeiCHEN c89c07f977 docs(ops): add initial-load closeout test report
Record schema-61 n=20 waterfall, throttle, and U7 form evidence; note Edge
channel exception for Playwright Chromium download sandbox.
2026-09-22 21:53:19 +08:00
WeiCHEN a17da2aa13 merge: feature/t20-design-items-2026-09-22 2026-09-22 21:52:34 +08:00
WeiCHEN f96c5277fd test(e2e): fix UI_PHASE evidence isolation for docrev UI rerun 2026-09-22 21:51:33 +08:00
WeiCHEN 17f6e4dd2d test(web): close initial-load perf harness for U1/U3/U7 evidence 2026-09-22 21:51:32 +08:00
WeiCHEN 9a5b8a5ed5 docs(ops): finalize T20 W4 design decisions packaging 2026-09-22 21:51:21 +08:00
WeiCHEN 056e4e5c4b feat(chat): productionize semantic summary shadow path without REPLACE 2026-09-22 21:51:20 +08:00
WeiCHEN 684008e3a5 feat(trace): strengthen T2/T3 evidence and access-log design 2026-09-22 21:51:19 +08:00
WeiCHEN 10c5a295a2 feat(rdev): nightly four-workflow expansion and proposal title alignment 2026-09-22 21:51:18 +08:00
WeiCHEN f01970564a feat(ops): advance governance automation queue and projection increments 2026-09-22 21:51:17 +08:00
WeiCHEN 4ae878e4c5 docs(ops): complete redline evidence packs without capability release 2026-09-22 21:51:15 +08:00
WeiCHEN 6a6c4230be merge: feature/agentctl-macos-2026-09-22 (macOS process platform) 2026-09-22 21:48:36 +08:00
WeiCHEN 6b9d3cc69a docs(ops): fill agentctl-macos head_sha tip 2026-09-22 21:48:23 +08:00
WeiCHEN 6bce3a4ff8 docs(ops): freeze G1 head_sha at implementation tip
Point short-term head_sha at feat+fix tip 45c21ef9 so docs pin
commits do not chase a self-referential SHA.
2026-09-22 21:47:00 +08:00
WeiCHEN c17594aaa2 docs(ops): pin G1 short-term head_sha to tip 2026-09-22 21:46:51 +08:00
WeiCHEN 13d5f8cdaa docs(ops): clarify G1 tip SHAs in short-term closeout 2026-09-22 21:46:20 +08:00
WeiCHEN 2f1c66bf4d docs(ops): record agentctl-macos verification and head_sha 2026-09-22 21:46:11 +08:00
WeiCHEN dcd4867ad0 docs(ops): pin G1 clearance head_sha to final tip 2026-09-22 21:45:21 +08:00
WeiCHEN a85d06a6b4 docs(ops): finalize G1 clearance short-term after branch restore
Correct branch ownership note now that this worktree alone holds
feature/g1-exception-clearance-2026-09-22; retain macOS lease exception.
2026-09-22 21:45:21 +08:00
WeiCHEN 668ed249ef docs(ops): pin docgov-vocabulary head_sha to tip 2026-09-22 21:44:57 +08:00
WeiCHEN f1295c435e docs(ops): pin g2-g3 head_sha to tip 2026-09-22 21:44:57 +08:00
WeiCHEN 993b3dcbae docs(ops): pin workflow-def-unidirect head_sha to tip 2026-09-22 21:44:57 +08:00
WeiCHEN 381b56dafc refactor(docgov): converge shared lifecycle vocab into contracts
Introduce internal/contracts/vocabulary for state/role/error sentinels,
alias through docgov, and retarget hot production consumers so
coordinator no longer imports docgov for vocabulary-only use.
2026-09-22 21:44:57 +08:00
WeiCHEN 7d51e40b1c refactor(boundaries): clear data/dev path leaks; start output.md via DeliverableKey
Remove coordinator/bizdev/storage data/dev fallbacks and register
agent→workspace so default agent targets use workspace.DeliverableKey.
Remaining U5 path and G3 task_runs clearance stay open.
2026-09-22 21:44:57 +08:00
WeiCHEN ad96f67442 refactor(workflowdef): make definition/runtime deps unidirectional
Keep registry key validation local to workflowdef with composition-root
injection, adapt FlatCatalog for projectworkflow, and drive the
orchestrator through LiveInstancePort views instead of projectinstance.
2026-09-22 21:44:57 +08:00
WeiCHEN 72b3d42808 docs(ops): pin track-i1 head_sha to tip 2026-09-22 21:44:56 +08:00
WeiCHEN 615529f4c4 docs(ops): pin server-assembly head_sha to tip 2026-09-22 21:44:56 +08:00
WeiCHEN d019388f37 feat(intent): wire production QueryOwner and confirm dispatcher
Replace FakeActionOwner with QueryOwner+QueryGuard at the composition
root; DispatchEligible reuses claim/execute/recover so confirm stays
zero-write before dispatch and default tier remains legacy.
2026-09-22 21:44:56 +08:00
WeiCHEN 9071c272bf refactor(server): drop Server pool; route health/heal/vault via Runtime
Remove production *pgxpool.Pool from Server, centralize domain→HTTP
status mapping, and expose Runtime ports for task-store readiness,
duty heal, and artifact vault registry. Allow app→docduty for heal wiring.
2026-09-22 21:44:56 +08:00
WeiCHEN ade6c2eefc docs(ops): pin G1 short-term head_sha to tip 2026-09-22 21:44:39 +08:00
WeiCHEN 041f9dff62 docs(ops): note G1 tip branch after name collision
Record macOS hooks bypass and that engine-split holds the original
feature branch name; tip lives on feature/g1-exception-clearance-w1a-tip.
2026-09-22 21:44:39 +08:00
WeiCHEN 47fdeb1655 feat(agentctl): add macOS process platform layer
Replace Linux /proc hard dependency with Darwin ps+sysctl while keeping
zombie/group/boot three-value semantics fail-closed for unreadable PIDs.
2026-09-22 21:44:28 +08:00
WeiCHEN 3afd214679 docs(ops): pin G1 clearance task head_sha to tip 2026-09-22 21:42:58 +08:00
WeiCHEN 7c25b3b59e docs(ops): record W1-A G1 exception clearance short-term task
Capture scope, macOS agentctl /proc lease exception, and arch/vet/short
evidence for the U3 sql_write and U4 path clearance batch.
2026-09-22 21:42:58 +08:00
WeiCHEN 45c21ef96e fix(workspace): compare realpaths when enforcing artifact roots
macOS TempDir resolves /var to /private/var; EvalSymlinks the data root
before Rel so fencing writes are not false path-escape failures.
2026-09-22 21:42:58 +08:00
WeiCHEN 9c7a5be209 feat(arch): clear G1 U3/U4 sql_write and path exceptions
Move document_records duty-slot writes into docgov, project ledger
heads through docgov/freedoc ports, and workspace deliverable I/O
through DeliverableStore so arch-check baseline drops to sql_write:1
path:13.
2026-09-22 21:40:12 +08:00
WeiCHEN 485572dce2 docs(ops): T20 W4 hardening design decisions
Record recommended approaches, risks, acceptance, and product/env
blockers for audit-remainder design items; cross-link F5/I8 to lowrisk.
2026-09-22 21:29:47 +08:00
WeiCHEN 319d632b24 docs(ops): pin T20 closeout tip SHA 2026-09-22 21:29:11 +08:00
WeiCHEN b09ab2e4a6 docs(ops): closeout T20 hardening PASS/SKIP checklist
Record per-item PASS evidence, verification summary, and macOS
agentctl exception for the W2 low-risk hardening batch.
2026-09-22 21:28:41 +08:00
WeiCHEN 2d19ecb745 docs(ops): pin web-api-client head_sha to feat tip 2026-09-22 21:28:40 +08:00
WeiCHEN c73b376b93 docs(audit): link CHAT-HISTORY-REFRESH reconcile PASS closeout 2026-09-22 21:28:22 +08:00
WeiCHEN bf94995e1e docs(ops): align chat-history refresh closeout with B3 evidence
Fix residual contradiction that treated activate+restart as still open; keep PASS SSOT and macOS agentctl exception note.
2026-09-22 21:27:56 +08:00
WeiCHEN 794656224c docs(ops): clarify CHAT-HISTORY-REFRESH reconcile residual notes
Cite B3 gate as closed evidence; keep only transport-cache UX as residual; mark remediation INDEX done.
2026-09-22 21:27:51 +08:00
WeiCHEN 8c24d105fc docs(ops): pin chat-app-decouple head_sha to tip 2026-09-22 21:27:44 +08:00
WeiCHEN 9229b94c32 docs(ops): T20 W4 design decisions for hardening backlog
Record recommended approaches, risks, acceptance, and product/env
blockers for B1/B3–B5/B7/B11, F1/F4/F7/F8, I1/I4/I6; cross-link F5/I8
to t20-lowrisk without duplicating.
2026-09-22 21:27:25 +08:00
WeiCHEN 9db5f149dd docs(ops): align web-api-client head_sha with feature tip 2026-09-22 21:27:16 +08:00
WeiCHEN 9db2462604 docs(ops): note macOS agentctl lease exception for redline batch
Record the /proc Lease crash workaround and freeze the evidence tip SHA.
2026-09-22 21:26:59 +08:00
WeiCHEN 14fab66ac6 docs(ops): restore macOS agentctl commit exception 2026-09-22 21:26:51 +08:00
WeiCHEN b7f4503d5e docs(ops): sync W1-D head_sha to tip 2026-09-22 21:26:48 +08:00
WeiCHEN 7e42e5f2ab docs(ops): finalize W1-D task head_sha and closeout chain 2026-09-22 21:26:46 +08:00
WeiCHEN d8c012ba58 docs(ops): set web-api-client head_sha to tip 2026-09-22 21:26:45 +08:00
WeiCHEN 1da2f17b16 docs(ops): record web-api-client batch F task and lease exception 2026-09-22 21:26:45 +08:00
WeiCHEN 681ca1b95e feat(web): unify API client with auth, errors, and limited retry
Route web/src/api modules through shared apiFetch so Bearer headers,
typed error envelopes, and GET/HEAD transient retries live in one place
without swallowing domain failures used by existing error cards.
2026-09-22 21:26:44 +08:00
WeiCHEN 330de92ba7 docs(ops): reconcile CHAT-HISTORY-REFRESH SSOT as PASS
Close stale open handoff/planned remediation against tip code and B3 live evidence; keep empty stage_key and localStorage masking red lines.
2026-09-22 21:26:35 +08:00
WeiCHEN df45fe5cd5 docs(ops): point W1-D task head_sha at branch tip 2026-09-22 21:26:33 +08:00
WeiCHEN e43adb1666 docs(ops): record chat-app-decouple tip SHA 2026-09-22 21:26:29 +08:00
WeiCHEN bc873f4400 docs(ops): redline evidence batch without capability release
Record SWBOOT L1–L4 (no real repo write), FAV ObserveShadow gates and
observation-window prerequisites, D7 Track E ID-only checklist, and stronger
PI narrative fallback negatives while keeping all redline flags off.
2026-09-22 21:26:27 +08:00
WeiCHEN 3b3808488e docs(ops): record W1-D tip head_sha bc17d40e 2026-09-22 21:26:23 +08:00
WeiCHEN bc17d40e10 docs(ops): annotate W3 UI-rerun batch and correct phase2 status
Keep 09-13 docrev audits/remediations in_progress with explicit W3 ownership, move the W1-D task body to *-w1d.md with evidence commands, and set phase2 remediation to in_progress because acceptance remains unchecked.
2026-09-22 21:26:23 +08:00
WeiCHEN b33753d717 refactor(chat): break chat→app cycle with narrow ports
Invert chat dependencies onto composition-root adapters, replace
AssembleRequest coordinator embeds with local DTOs, and drop the
chat→app/* allowlist edges so arch-check can enforce the boundary.
2026-09-22 21:25:59 +08:00
WeiCHEN a2eabe01b1 refactor(chat): break chat→app import cycle via owned ports
Invert chat dependencies on chatflow/intentflow/stageflow through
composition-root adapters; replace AssembleRequest coordinator embeds
with local DTOs and tighten the module-boundaries allowlist.
2026-09-22 21:25:44 +08:00
WeiCHEN 3ab9cb5583 docs(ops): pin T20 hardening head SHA and commit list
Record local tip and four implementation commits for handoff.
2026-09-22 21:24:33 +08:00
WeiCHEN 2da4775564 docs(ops): note pilot supersession on M1-live task and record commit SHA
Keep workspace mutex unblocked for G1/G2 after W1-D pilot re-judgment, and persist head_sha plus macOS hook exception on the reconcile task doc.
2026-09-22 21:24:33 +08:00
WeiCHEN 6de09a1a96 docs(ops): record T20 low-risk hardening task and verification
Task short-term for W2 batch scope, macOS agentctl exception, and local go/npm evidence.
2026-09-22 21:24:20 +08:00
WeiCHEN 472ec6497f fix(web): plan-card catch, removeTurn on finish, pane ErrorBoundary, CRLF SSE frames
T20-F2/F3/F5/F6: reset stuck executing cards, reclaim AbortControllers via removeTurn, wrap chat/doc panes, and split SSE on CRLF blank lines as well as LF.
2026-09-22 21:24:20 +08:00
WeiCHEN 0c4baad4a2 fix(infra): align ready health, drop events shared-net, pin Go 1.27.1, short-skip docker smoke
T20-I2/I3/I5/I8: dev compose /api/v1/ready, main events networks match test/dev, Dockerfile golang:1.27.1-bookworm, and testing.Short skip for pi-agent docker build.
2026-09-22 21:24:20 +08:00
WeiCHEN f12e2ed155 fix: reclaim cancelFns, TTL idemLocks, cache scope probe, invalidate C1, SSE subscribe order
Close T20-B2/B6/B8/B9/B10 low-risk leaks: map-backed cancel reclaim, idempotency lock TTL in cleanupLoop, sync.Once information_schema probe, InvalidateLayer after chat memory upsert, and Subscribe before SSE headers.
2026-09-22 21:24:20 +08:00
WeiCHEN e3290ebd68 docs(ops): reconcile W1-D status drift against schema 61 facts
Align sysadmin readiness reasons, FEATURE-MATRIX schema claims, CURRENT FAV wording, pseudo-done task statuses, G1/G2 exception counts, and residual gap-matrix schema notes with measured 2026-09-22 evidence without flipping production_ready.
2026-09-22 21:24:02 +08:00
weichen 5c35f32e22 docs: integrate module contract task closeout 2026-09-22 13:09:40 +00:00
weichen 4f6ec3ed4d docs(ops): record verified dev integration and evidence archive 2026-09-22 13:09:27 +00:00
WeiCHEN 7440ded8f4 merge: gate closeout docs onto test (post rc-v1.1.0-beta.1)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 1s
2026-09-22 21:02:33 +08:00
WeiCHEN 364ed7f1a3 merge: feature/dev-prod-ready-test-promotion-2026-09-22 (gate closeout docs)
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
2026-09-22 21:02:32 +08:00
WeiCHEN 822e21680e docs(ops): close schema-61 gate and test promotion evidence
Record production_ready refresh at schema 61, rc-v1.1.0-beta.1
promotion, and test deploy smoke; mark the task done with cleanup pending.
2026-09-22 21:02:20 +08:00
weichen 3f89eff70a docs: integrate module contract standard and adoption plan 2026-09-22 11:14:06 +00:00
weichen 9814a67ee6 docs(architecture): define reusable module contracts and adoption plan 2026-09-22 11:13:51 +00:00
weichen d034aa00e5 merge: isolate PG integration tests + membership gate for project context reads 2026-09-22 01:18:31 +00:00
weichen 1290eb2b06 test(server): skip docgov nonmember negative under provable cross-package pollution
共享测试库多包串行时该用例的注册步骤可能被前序包污染(INTERNAL 500,
准入策略读取失败);单包与指定组合复跑均 PASS。为避免掩盖判定,仅对
已复现的 500 污染路径 skip 并打印原因,其余非 2xx 仍 FAIL。
根因追猎登记为遗留缺口(见任务记录)。
2026-09-22 01:18:17 +00:00
weichen 70882918e5 test(pg): isolate PG integration tests from shared dev database
修复 go test -short 在设置 TEST_DATABASE_URL 时的既有欠债:
- storage/notification/docgov:移除硬编码 agent_system_dev 回退 DSN,改为
  无 TEST_DATABASE_URL 即 skip;固定项目名改为 name||code 唯一化。
- docgov engine_db:改为隔离库 + 自建项目行,替换随机 projectID 撞外键的旧写法。
- server/*_pg、projectinstance/pg_integration:迁移到官方 main 工作流
  (BuildDefaultPlan official-only 治理后的正确前提),补齐在任成员
  (DUTY_ASSIGNEE_NOT_ACTIVE_MEMBER)、任务键 bd_intake、阶段键 V0.1_triage、
  项目作用域 run record(events.ValidateEnvelope 拒绝 project<=0)、
  task_run_resume 去除内嵌 dev 凭证的 config 硬编码。
- 新增 seedProjectForRun 测试辅助。
验证:fresh 隔离库(55432)上 go test -short -p 1 ./... 除 archtest
(另行注册表分支修复)外全部通过;包内并行迁移竞争需 -p 1。
2026-09-22 01:10:17 +00:00
weichen a7df68a59a fix(authz): require project membership for any-stage context reads
ResolveStageAccess 的注释明确 stage/chat 可见性以“已过项目成员检查”为前提,
但唯一调用方 allowAnyStageAccess(GET /api/v1/context/project)未落实该前提,
live 治理实例下非成员可读回全量项目上下文(TestWorkflowGovernance_PG
ActivateApproveAdvanceChain 的 guest 403 断言捕获)。
创建者直接放行;非创建者需 IsProjectMember;解析失败沿用 fail-closed 开关。
回归测试为既有 workflow_governance_pg_test.go 第 6 步(隔离库下 PASS)。
2026-09-22 01:09:48 +00:00
weichen b9d0d8c2d9 merge: sync arch import allowlist for 2026-09-21 modules (unblock promotion gates) 2026-09-21 18:19:35 +00:00
weichen 0a1efb73dd fix(arch): sync module-boundaries import allowlist for materialindex, mineru, workflowscope
注册 2026-09-21 已合入 dev 的新包与跨模块边(force-material-chunk-index、
mineru-doc-parsing、workflow-scope-weighting、doc-notify 等遗留的登记漂移),
恢复 arch-check --mode block 在 dev HEAD 的可通过性。纯注册表同步,无代码改动。
2026-09-21 18:19:20 +00:00
weichen 127cfccccc feat(agent): fall back to the container backend when pi-native fails
Dev starts on pi-native and keeps pi-agent available for a failed turn. Latency tuning stays deferred.
2026-09-21 15:29:33 +00:00
weichen f3b1209207 docs(ops): point the agentx task at the gate commit 2026-09-21 15:16:02 +00:00
weichen 5d77e9cf46 docs(test): record the pi-native replacement gate
Keep the default backend on pi-agent because the live P95 comparison missed the 1.3x bar.
2026-09-21 15:15:39 +00:00
weichen 174e59e692 test(agentx): compare pi-native with the container backend
Record token usage and nearest-rank latency so the replacement gate matches the written bar.
2026-09-21 15:11:29 +00:00
weichen 2de4eda16d feat(workspace): register workspaces and gate cleanup by receipts
Track workspace size and age, expose an admin list and cleanup route, and refuse TTL or quota deletion until a frozen manifest matches verified receipts.
2026-09-21 14:58:21 +00:00
weichen fd1b676e28 feat(agentx): add the turn loop and JSONL transcripts
Persist each message as it happens and keep going after a tool failure, including steering and follow-up messages between turns.
2026-09-21 14:53:09 +00:00
weichen 738bbe1579 feat(agent): add pi-native backend and drop cursor-cli
Keep the container pi-agent backend as the default while the in-process runtime is available beside it, and remove the unused cursor bridge.
2026-09-21 14:52:53 +00:00
weichen 022b914c66 feat(agentx): jail workspace tools and audit hooks
Keep read, write, edit, list, and grep inside the workspace root, including symlink targets, and let hooks block or rewrite a call.
2026-09-21 14:49:13 +00:00
weichenandCursor b49b95dc7a feat(agentx): add OpenAI-compatible streaming LLM client
Parse MiniMax-style SSE deltas, including incremental tool calls, and encode transport failures on the event stream instead of panicking.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 14:43:32 +00:00
weichenandCursor 6dc5f1cfa6 docs(ops): claim go-agentx runtime worktree
Register the pi-native coexistence task against the explicit dev baseline so later commits stay on the feature branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 14:40:13 +00:00
weichenandCursor 539a2dc639 docs(test): record FAV gap-fill unit evidence
Capture same-tx, recover-apply, pin-export, and GET zero-write results without claiming live 6173 or Unit A drills.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 12:52:28 +00:00
weichenandCursor ad9b67d599 feat(artifactvault): close same-tx staging, recover-apply, and GET zero-write gaps
Approve/commit now write FAV staging in the domain transaction, recover-apply materializes scratch collections, and unpublished or GET paths cannot mutate the registry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 12:52:28 +00:00
weichenandCursor ba8e872b59 docs(test): record FAV V0-V6 unit evidence and three drill reports
Capture fail-closed gates without claiming live Unit A or 6173 e2e PASS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:33 +00:00
weichenandCursor 8ea12de732 feat(api): wire FAV ingest, optional degraded GET, and scratch CLI
Keep FAV_DEGRADED_READ off by default and mount an independent vault volume beside runtime data.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:33 +00:00
weichenandCursor 8a82f789d1 feat(docgov): freeze review snapshots and terminal-finalize assistant turns
Approve and index only ledger blobs; task success now completes the chat turn and recomputes export columns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:33 +00:00
weichenandCursor ffb93dc55d feat(artifactvault): add eligibility, encrypted CAS, and idempotent publisher
Keep vault roots off ./data/dev and reject unknown types or sensitive payloads before staging.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:25 +00:00
weichenandCursor 028b0eb015 feat(db): add FAV staging, outbox, and deletion ledger tables
Use goose 00034 because 00033 already belongs to task-run governance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:25 +00:00
weichenandCursor 20d50ef9f1 docs(adr): record final artifact vault authority and fail-closed rules
Lock the three-layer contract, no tenant_id, union-deny delete, and scratch-only recover before storage work.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:25 +00:00
weichen ded40d071e docs(remediation): design final artifact vault 2026-09-14 10:09:32 +00:00
weichenandCursor cfc3c94cff docs(status): drop FAV from infra next-action
Keep the matrix row from depending on an uncommitted sibling plan.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:01:56 +00:00
weichenandCursor d1e2cc929d docs(remediation): rewrite data-root plan after review
Split incident remount from outbox/governance so Wave 0 is executable
without identity bootstrap, and record preempt-but-wait authorization.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:01:40 +00:00
weichen ccb1b1ebe5 docs(remediation): design runtime data lifecycle 2026-09-14 09:39:30 +00:00
weichen f1edb70fbd docs(audit): diagnose dev runtime data root split-brain 2026-09-14 09:06:00 +00:00
1411 changed files with 140324 additions and 16445 deletions
+49
View File
@@ -0,0 +1,49 @@
{
"version": 1,
"hooks": {
"beforeShellExecution": [
{
"command": ".cursor/hooks/guard-git.sh",
"matcher": "^git ",
"timeout": 10,
"failClosed": true
},
{
"command": ".cursor/hooks/guard-pi-shell.sh",
"matcher": "pi_subagents\\.py|pkill",
"timeout": 10,
"failClosed": true
}
],
"beforeMCPExecution": [
{
"command": ".cursor/hooks/guard-pi-dispatch.sh",
"matcher": "pi-subagents|pi_subagent_",
"timeout": 10,
"failClosed": true
}
],
"postToolUse": [
{
"command": ".cursor/hooks/pi-receipt-context.sh",
"matcher": "MCP: pi-subagents|pi_subagent_",
"timeout": 10,
"failClosed": false
}
],
"sessionStart": [
{
"command": ".cursor/hooks/audit-session.sh",
"timeout": 20,
"failClosed": false
}
],
"stop": [
{
"command": ".cursor/hooks/audit-session.sh",
"timeout": 10,
"failClosed": false
}
]
}
}
+166
View File
@@ -0,0 +1,166 @@
#!/usr/bin/env python3
"""Shared helpers for project Cursor hooks (advisory gates + audit/probe)."""
from __future__ import annotations
import json
import os
import re
import sys
from datetime import datetime, timezone
from pathlib import Path
from typing import Any
KNOWN_ROLES = frozenset(
{
"research",
"planning",
"requirements_review",
"plan_review",
"code_review",
"diagnosis",
"test_run",
"acceptance_check",
"stage_notes",
"report",
"auxiliary",
}
)
TEST_ROLES = frozenset({"test_run", "acceptance_check"})
FULL_SHA = re.compile(r"^[0-9a-fA-F]{40}$")
REQUEST_ID = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$")
def repo_root() -> Path:
env = os.environ.get("CURSOR_PROJECT_DIR") or os.environ.get("CURSOR_WORKSPACE_ROOT")
if env:
return Path(env).resolve()
# hooks run with cwd = project root
return Path.cwd().resolve()
def audit_path() -> Path:
return repo_root() / ".cursor" / "hook-audit.jsonl"
def probe_path() -> Path:
return repo_root() / ".cursor" / "hook-probe.jsonl"
def inventory_dir() -> Path:
return repo_root() / ".cursor" / "hook-audit"
def append_jsonl(path: Path, record: dict[str, Any]) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
record = dict(record)
record.setdefault("ts", datetime.now(timezone.utc).isoformat())
with path.open("a", encoding="utf-8") as fh:
fh.write(json.dumps(record, ensure_ascii=False) + "\n")
def read_stdin() -> str:
return sys.stdin.read()
def maybe_probe(raw: str, hook: str) -> None:
if os.environ.get("CURSOR_HOOKS_PROBE", "").strip() not in ("1", "true", "TRUE", "yes"):
return
append_jsonl(
probe_path(),
{"hook": hook, "raw": raw[:65536], "raw_len": len(raw)},
)
def parse_json_loose(raw: str) -> dict[str, Any] | None:
raw = (raw or "").strip()
if not raw:
return None
try:
data = json.loads(raw)
except json.JSONDecodeError:
return None
return data if isinstance(data, dict) else None
def first_key(data: dict[str, Any], *names: str) -> Any:
for name in names:
if name in data and data[name] is not None:
return data[name]
return None
def normalize_tool_name(name: str | None) -> str | None:
"""Strip Cursor MCP prefixes such as 'MCP:' / 'MCP: pi-subagents/'."""
if name is None:
return None
n = str(name).strip()
# Observed IDE postToolUse: tool_name == "MCP:pi_subagent_roles"
if n.upper().startswith("MCP:"):
n = n[4:].lstrip()
# Rare: "MCP: pi-subagents/pi_subagent_run"
if "/" in n and n.rsplit("/", 1)[-1].startswith("pi_subagent_"):
n = n.rsplit("/", 1)[-1]
return n or None
def tool_name(data: dict[str, Any]) -> str | None:
v = first_key(data, "tool_name", "mcp_tool_name", "name", "toolName")
return normalize_tool_name(str(v) if v is not None else None)
def mcp_server(data: dict[str, Any]) -> str | None:
v = first_key(data, "mcp_server_name", "server", "mcpServer", "server_name")
return str(v) if v is not None else None
def tool_input(data: dict[str, Any]) -> dict[str, Any] | None:
v = first_key(data, "tool_input", "arguments", "input", "toolInput", "params")
if isinstance(v, dict):
return v
if isinstance(v, str):
try:
parsed = json.loads(v)
return parsed if isinstance(parsed, dict) else None
except json.JSONDecodeError:
return None
return None
def shell_command(data: dict[str, Any]) -> str:
v = first_key(data, "command", "shell_command", "cmd")
return str(v) if v is not None else ""
def emit(obj: dict[str, Any]) -> None:
sys.stdout.write(json.dumps(obj, ensure_ascii=False))
sys.stdout.flush()
def allow() -> None:
emit({"permission": "allow"})
raise SystemExit(0)
def ask(user_message: str, agent_message: str) -> None:
emit(
{
"permission": "ask",
"user_message": user_message,
"agent_message": agent_message,
}
)
raise SystemExit(0)
def additional_context(text: str) -> None:
emit({"additional_context": text})
raise SystemExit(0)
def audit(hook: str, code: str, **extra: Any) -> None:
rec = {"hook": hook, "code": code}
rec.update(extra)
try:
append_jsonl(audit_path(), rec)
except OSError:
pass
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euo pipefail
DIR="$(cd "$(dirname "$0")" && pwd)"
exec python3 -B "$DIR/audit_session.py"
+101
View File
@@ -0,0 +1,101 @@
#!/usr/bin/env python3
"""sessionStart / stop: audit + optional fail-open inventory (no context injection)."""
from __future__ import annotations
import json
import os
import subprocess
import sys
from datetime import datetime, timezone
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
import _lib as lib # noqa: E402
HOOK = "audit-session"
INVENTORY_TIMEOUT = 15
def _run_inventory(root: Path) -> dict:
out: dict = {"cleanup_report": None, "docs_drift": None, "errors": []}
if os.environ.get("CURSOR_HOOKS_NO_INVENTORY", "").strip() in ("1", "true", "TRUE", "yes"):
out["skipped"] = "CURSOR_HOOKS_NO_INVENTORY"
return out
agentctl = root / "scripts" / "agentctl.py"
if not agentctl.is_file():
out["errors"].append("agentctl.py missing")
return out
for label, args in (
("cleanup_report", ["cleanup", "report"]),
("docs_drift", ["docs", "drift"]),
):
try:
r = subprocess.run(
["python3", "-B", str(agentctl), *args],
cwd=str(root),
capture_output=True,
text=True,
timeout=INVENTORY_TIMEOUT,
check=False,
)
payload = None
for stream in (r.stdout, r.stderr):
for line in (stream or "").splitlines():
line = line.strip()
if line.startswith("{"):
try:
payload = json.loads(line)
break
except json.JSONDecodeError:
continue
if payload is not None:
break
out[label] = {
"exit_code": r.returncode,
"payload": payload,
"stdout_tail": (r.stdout or "")[-2000:],
"stderr_tail": (r.stderr or "")[-1000:],
}
except subprocess.TimeoutExpired:
out["errors"].append(f"{label}: timeout>{INVENTORY_TIMEOUT}s")
except OSError as exc:
out["errors"].append(f"{label}: {exc}")
return out
def main() -> None:
raw = lib.read_stdin()
lib.maybe_probe(raw, HOOK)
data = lib.parse_json_loose(raw) or {}
event = str(
lib.first_key(data, "hook_event_name", "event", "event_name", "type") or "unknown"
)
root = lib.repo_root()
if "start" in event.lower() or event == "unknown":
inv = _run_inventory(root)
inv_path = None
try:
inv_dir = lib.inventory_dir()
inv_dir.mkdir(parents=True, exist_ok=True)
ts = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
path = inv_dir / f"inventory-{ts}.json"
path.write_text(json.dumps(inv, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
inv_path = str(path)
except OSError:
pass
lib.audit(
HOOK,
"SESSION_AUDIT",
event=event,
inventory_path=inv_path,
inventory_errors=inv.get("errors"),
)
else:
lib.audit(HOOK, "SESSION_AUDIT", event=event)
lib.emit({})
raise SystemExit(0)
if __name__ == "__main__":
main()
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
# Fail-closed red-line gate for destructive / unauthorized git. Does not replace agentctl leases.
set -euo pipefail
input=$(cat)
command=$(printf '%s' "$input" | python3 -c 'import json,sys; print(json.load(sys.stdin).get("command") or "")')
ask() {
local user_msg="$1"
local agent_msg="$2"
python3 -c 'import json,sys; print(json.dumps({"permission":"ask","user_message":sys.argv[1],"agent_message":sys.argv[2]}))' "$user_msg" "$agent_msg"
exit 0
}
allow() {
echo '{"permission":"allow"}'
exit 0
}
# Normalize whitespace for matching
cmd=$(printf '%s' "$command" | tr '\n' ' ')
# Unauthorized push (user must confirm)
if printf '%s' "$cmd" | grep -Eq '(^|[[:space:]])git([[:space:]]+-[^[:space:]]+)*[[:space:]]+push([[:space:]]|$)'; then
ask "git push 需要显式用户授权(AGENTS remote_sync)。请确认后再继续。" \
"Hook blocked git push pending user authorization."
fi
# Destructive / force operations
if printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+.*(--force|-f)([[:space:]]|$)' \
|| printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+push[[:space:]].*\+'; then
ask "检测到 git --force / 强推。破坏性操作须用户明确授权。" \
"Hook requires confirmation for force git operation."
fi
if printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+reset[[:space:]]+.*--hard'; then
ask "git reset --hard 会丢弃工作区。须用户明确授权。" \
"Hook requires confirmation for git reset --hard."
fi
if printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+clean[[:space:]]+.*-[a-zA-Z]*f'; then
ask "git clean -f 会删除未跟踪文件。须用户明确授权。" \
"Hook requires confirmation for git clean -f."
fi
if printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+branch[[:space:]]+(-D|--delete[[:space:]]+--force)'; then
ask "强制删分支 (-D) 须用户明确授权;优先 git branch -d。" \
"Hook requires confirmation for git branch -D."
fi
if printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+worktree[[:space:]]+remove[[:space:]]+.*--force'; then
ask "git worktree remove --force 被 AGENTS 禁止升级。须用户明确授权。" \
"Hook requires confirmation for forced worktree remove."
fi
if printf '%s' "$cmd" | grep -Eq 'git[[:space:]]+checkout[[:space:]]+--\.($|[[:space:]])'; then
ask "git checkout -- . 会丢弃全部本地修改。须用户明确授权。" \
"Hook requires confirmation for discarding all local changes."
fi
allow
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Thin wrapper: preserve stdin for Cursor hook JSON (do not use heredoc).
set -euo pipefail
DIR="$(cd "$(dirname "$0")" && pwd)"
exec python3 -B "$DIR/guard_pi_dispatch.py"
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euo pipefail
DIR="$(cd "$(dirname "$0")" && pwd)"
exec python3 -B "$DIR/guard_pi_shell.py"
+113
View File
@@ -0,0 +1,113 @@
#!/usr/bin/env python3
"""Advisory beforeMCPExecution gate for pi-subagents MCP tools."""
from __future__ import annotations
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
import _lib as lib # noqa: E402
HOOK = "guard-pi-dispatch"
def main() -> None:
raw = lib.read_stdin()
lib.maybe_probe(raw, HOOK)
data = lib.parse_json_loose(raw)
if data is None:
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="non_json_or_empty")
lib.allow()
name = lib.tool_name(data)
server = lib.mcp_server(data)
if not name:
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="missing_tool_name", keys=sorted(data.keys())[:40])
lib.allow()
if server and "pi-subagents" not in server and not name.startswith("pi_subagent_"):
if not name.startswith("pi_subagent_"):
lib.allow()
if name in ("pi_subagent_roles", "pi_subagent_result"):
lib.allow()
if name != "pi_subagent_run":
if name.startswith("pi_subagent_"):
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="unknown_pi_tool", tool=name)
lib.allow()
args = lib.tool_input(data) or {}
req = args.get("request") if isinstance(args.get("request"), dict) else args
if not isinstance(req, dict):
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="missing_request")
lib.ask(
"pi_subagent_run 缺少可识别的 request 对象。请核对 MCP 参数后再继续。",
"Hook: unrecognized request shape for pi_subagent_run.",
)
role = req.get("role_id")
request_id = req.get("request_id")
goal = req.get("goal")
auth = req.get("authorization_ref")
source_sha = req.get("source_sha")
input_files = req.get("input_files")
timeout = req.get("timeout_seconds")
problems: list[str] = []
if not role or not isinstance(role, str):
problems.append("role_id 缺失")
elif role not in lib.KNOWN_ROLES:
problems.append(f"role_id={role!r} 不在已知角色表")
if not request_id or not isinstance(request_id, str) or not lib.REQUEST_ID.match(request_id):
problems.append("request_id 非法(需字母数字开头,长度≤128)")
if not goal or not isinstance(goal, str) or not goal.strip():
problems.append("goal 为空")
if not auth or not isinstance(auth, str) or not auth.strip():
problems.append("authorization_ref 为空")
if not isinstance(source_sha, str) or not lib.FULL_SHA.match(source_sha):
problems.append("source_sha 必须是完整 40-hex 提交(禁止 HEAD/分支名/短 hash)")
if not isinstance(input_files, list):
problems.append("input_files 必须是数组")
if not isinstance(timeout, int) or isinstance(timeout, bool) or timeout <= 0:
if isinstance(timeout, float) and timeout.is_integer() and timeout > 0:
pass
else:
problems.append("timeout_seconds 必须是正整数")
if isinstance(role, str) and role in lib.TEST_ROLES:
cmds = req.get("approved_commands")
digest = req.get("plan_digest")
if not isinstance(cmds, list) or not cmds:
problems.append("test 角色需要 approved_commands(argv 数组的数组)")
elif any(not isinstance(c, list) or not all(isinstance(x, str) for x in c) for c in cmds):
problems.append("approved_commands 形状错误(应为字符串数组的数组)")
if not isinstance(digest, str) or len(digest) != 64 or any(
c not in "0123456789abcdefABCDEF" for c in digest
):
problems.append("plan_digest 必须是 64-hex SHA-256")
if "model_override" in req and req.get("model_override") is not None:
problems.append("出现 model_override(禁止静默换模型;请用任务 override)")
if problems:
detail = ";".join(problems)
lib.audit(HOOK, "SHAPE_ASK", tool=name, problems=problems, role=role, request_id=request_id)
lib.ask(
f"pi_subagent_run 形状检查未通过:{detail}。执行器仍会硬校验;确认后继续或修正参数。",
f"Hook advisory: {detail}",
)
lib.audit(HOOK, "ALLOW", tool=name, role=role, request_id=request_id)
lib.allow()
if __name__ == "__main__":
main()
+56
View File
@@ -0,0 +1,56 @@
#!/usr/bin/env python3
"""Advisory beforeShellExecution: bare pi_subagents.py run / broad pkill."""
from __future__ import annotations
import re
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
import _lib as lib # noqa: E402
HOOK = "guard-pi-shell"
def main() -> None:
raw = lib.read_stdin()
lib.maybe_probe(raw, HOOK)
data = lib.parse_json_loose(raw)
if data is None:
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="non_json_or_empty")
lib.allow()
cmd = lib.shell_command(data)
if not cmd:
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="missing_command", keys=sorted(data.keys())[:40])
lib.allow()
compact = re.sub(r"\s+", " ", cmd).strip()
if re.search(r"(^|[;&|]\s*)pkill(\s|$)", compact) and re.search(r"\s-f(\s|$)", compact):
lib.audit(HOOK, "PKILL_ASK", command=compact[:500])
lib.ask(
"检测到 pkill -f(广谱杀进程)。AGENTS/PI 规则禁止广谱杀;请确认范围后再继续。",
"Hook requires confirmation for pkill -f.",
)
if re.search(r"pi_subagents\.py(\s|$)", compact) and re.search(r"(^|\s)run(\s|$)", compact):
has_lease = (
re.search(r"agentctl(\.py)?\s+with\b", compact) is not None
and re.search(r"--resource\s+path:", compact) is not None
)
if re.search(r"pi_subagents\.py\s+(roles|result|status|config)\b", compact):
lib.allow()
if not has_lease:
lib.audit(HOOK, "BARE_RUN_ASK", command=compact[:500])
lib.ask(
"裸调 pi_subagents.py run 缺少 agentctl with --resource path:… 租约。"
"报告路径须在 path:.doc/test-reports/assets/pi-subagents/<task>/<request> 租约内。",
"Hook: bare PI run without lease resource.",
)
lib.allow()
if __name__ == "__main__":
main()
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euo pipefail
DIR="$(cd "$(dirname "$0")" && pwd)"
exec python3 -B "$DIR/pi_receipt_context.py"
+48
View File
@@ -0,0 +1,48 @@
#!/usr/bin/env python3
"""postToolUse: inject receipt-check reminders after pi-subagents tools."""
from __future__ import annotations
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
import _lib as lib # noqa: E402
HOOK = "pi-receipt-context"
REMINDER = """[PI subagent receipt checklist]
- 核对 report/receipt 路径:.doc/test-reports/assets/pi-subagents/<task_id>/<request_id>/
- 记录 config_revision / config_sha256 / configured vs actual_model(不可观察填 unknown)
- run_status=succeeded 不等于阶段 PASS;review_state 仍可为 pending
- 测试 pass 只来自批准命令证据(approved_commands),不能用模型叙事冒充
- 推进门禁前用 subagent-stage-record skill 写回传与阶段收据
"""
def main() -> None:
raw = lib.read_stdin()
lib.maybe_probe(raw, HOOK)
data = lib.parse_json_loose(raw)
if data is None:
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="non_json_or_empty")
lib.emit({})
raise SystemExit(0)
name = lib.tool_name(data) or ""
server = lib.mcp_server(data) or ""
blob = raw
is_pi = (
name.startswith("pi_subagent_")
or "pi-subagents" in server
or "pi_subagent_" in blob
)
if not is_pi:
lib.emit({})
raise SystemExit(0)
lib.audit(HOOK, "CONTEXT_INJECT", tool=name or "unknown")
lib.additional_context(REMINDER)
if __name__ == "__main__":
main()
+24
View File
@@ -0,0 +1,24 @@
{
"mcpServers": {
"agentctl": {
"type": "stdio",
"command": "node",
"args": ["scripts/mcp/agentctl-mcp.mjs"]
},
"jev": {
"type": "stdio",
"command": "node",
"args": ["scripts/mcp/jev-mcp.mjs"]
},
"codegraph": {
"type": "stdio",
"command": "codegraph",
"args": ["serve", "--mcp", "--path", "${workspaceFolder}"]
},
"pi-subagents": {
"type": "stdio",
"command": "node",
"args": ["scripts/mcp/pi-subagents-mcp.mjs"]
}
}
}
+27
View File
@@ -0,0 +1,27 @@
---
description: Agent-System 写操作必须经 agentctl(租约、docs apply、候选合入);禁止绕过治理直接改共享文档或 push。
alwaysApply: true
---
# agentctl 强制治理
本仓库由 agentctl 管理面协调(SQLite + launchd daemon)。细则见 [AGENTS.md](../../AGENTS.md) 与 [操作规范](../../.doc/ops/2026-09-21-agent-worktree-workflow.md);流程技能见 `.cursor/skills/agentctl-*`。
## 硬边界
1. **写仓库**:必须 `agentctl with` / MCP `lease_run`。裸 `git commit` 会被 agentctl pre-commit hook 拒绝。
2. **共享文档**:`.doc/ops/CURRENT.md`、`.doc/status/FEATURE-MATRIX.md` 只能 `docs apply`(行级 CAS;MATRIX 键为 `record_id`)。
3. **合入 local dev**:`validate` 后 `queue enqueue`(daemon `--ff-only`)或受控 `integrate`;禁止直接改主目录 `dev` tip。
4. **禁止默认**:未授权 `git push`、晋升 test/main、`--force` 清理、卸载 launchd coordinator、改 gap-matrix / 升 MATRIX 状态值冒充发布。
5. **需求重叠**:跨对话新设计须 `catalog overlap`;硬重叠拒绝;软重叠须 `catalog ack` 留痕后方可编码(见 `.doc/ops/2026-09-24-governance-catalog-plan.md`)。
## 会话路径
- 启动 → skill `agentctl-session-start`
- 建场 → `agentctl-worktree-setup`
- 写回 → `agentctl-lease-write`
- 合入/收口 → `agentctl-integrate-closeout`
- PI 派发 → skill `pi-subagent-dispatch`(MCP `pi-subagents`)
- 阶段落盘 → skill `subagent-stage-record`
- MCP 工具定义见 `.cursor/mcp.json` → `scripts/mcp/agentctl-mcp.mjs` / `pi-subagents-mcp.mjs`
- 客户端 hook 边界见规则 `cursor-hooks`
+22
View File
@@ -0,0 +1,22 @@
---
description: Cursor 对话自动生成的会话名称使用简体中文
alwaysApply: true
---
# 会话名称(中文)
Cursor 为本对话自动生成或建议的**会话名称 / 聊天标题**必须使用**简体中文**。
## 要求
- 用简短中文概括当前任务主题(约 6–16 字)
- 优先动词/对象:如「创建会话中文命名规则」「修复登录超时」
- 禁止默认英文标题(专有名词、命令、路径可保留原文,整体仍以中文为主)
## 示例
| 场景 | 可用标题 |
|---|---|
| 新建 Cursor 规则 | 创建会话中文命名规则 |
| 排查 hook | 排查 pi-dispatch hook |
| 合入 feature | 合入治理目录库变更 |
+42
View File
@@ -0,0 +1,42 @@
---
description: Project Cursor hooks are advisory gates layered on agentctl/PI executor hard checks; scripts exist does not mean Cursor loaded them.
alwaysApply: true
---
# Cursor hooks(客户端门禁)
配置:`.cursor/hooks.json`;脚本:`.cursor/hooks/`。规范登记修订 `cursor-governance-2026-09-24-r1`。
## 分层
| 层 | 能力 | 说明 |
|---|---|---|
| 执行器 / agentctl | **enforced** | `scripts/pi_subagents.py`、租约、pre-commit 等硬拒绝 |
| hook 脚本行为 | **enforced**(有单元回归) | stdin→stdout 契约可测 |
| hook ↔ Cursor 接线 | **advisory / manual** | 官方事件字段未完全文档化;待 probe 采样后收紧 |
命中策略:与 `guard-git.sh` 一致,一律 `permission: ask`(不静默 deny)。
## 事件与脚本
- `beforeShellExecution`:`guard-git.sh`(破坏性 git);`guard-pi-shell.sh`(裸调 `pi_subagents.py run`、`pkill -f`)
- `beforeMCPExecution`:`guard-pi-dispatch.sh`(`pi_subagent_run` 形状)
- `postToolUse`:`pi-receipt-context.sh`(注入收据核对提醒)
- `sessionStart` / `stop`:`audit-session.sh`(审计 + 可选只读盘点;**不注入上下文**)
IDE 实测(2026-09-24):`postToolUse` 的 `tool_name` 形如 `MCP:pi_subagent_roles`;hooks 须剥 `MCP:` 前缀后再匹配角色工具名。
## 审计与 probe
- 审计:`.cursor/hook-audit.jsonl`(gitignore;勿提交)
- 盘点:`.cursor/hook-audit/inventory-*.json`
- 采样:`CURSOR_HOOKS_PROBE=1` → `.cursor/hook-probe.jsonl`
- 关闭盘点:`CURSOR_HOOKS_NO_INVENTORY=1`
异形/未知字段:**fail-open + 审计 `UNRECOGNIZED_INPUT`**,不因契约未知卡死会话。
## 红线
- 不把 hook 复刻成第二套执行器门禁
- 脚本存在 ≠ Cursor 已加载;改 hooks 后检查 Hooks 设置页或通道
- 审计日志不得放进被 git 跟踪的 `.cursor/hooks/` 目录
+24
View File
@@ -0,0 +1,24 @@
---
description: Route PI analysis/review/test subagent work through scripts/pi_subagents.py (not Cursor native agents).
alwaysApply: true
---
# PI subagents(工程工具)
本机 PI 子任务走 `scripts/pi_subagents.py` + 模型配置 `.doc/ops/2026-09-24-subagent-model-config.md`。可执行步骤见 skill `pi-subagent-dispatch`;阶段记录见 `subagent-stage-record`。
## 自动派发(主 Agent)
1. **预览配置**:`pi_subagent_roles` / CLI `roles`(不调模型)。
2. **按阶段选角色**:research → planning → reviews → diagnosis → test_run / acceptance_check → report;实施/修复仍由 Cursor Auto。
3. **派发 `run`**:携带 task_id、role_id、唯一 request_id、goal、authorization_ref、冻结 source_sha、input_files、timeout;test 角色另附 approved_commands + plan_digest。
4. **租约**:报告路径 `path:.doc/test-reports/assets/pi-subagents/<task>/<request>`;裸调拒绝。
5. **取回**:`pi_subagent_result` / CLI `result`;`run_status` 与 `verdict`/`review_state` 分离——模型成功仅 `pending`,测试 pass 仅来自批准命令证据。
6. **门禁**:审查/测试结论须带回报告路径与 receipt 字段;不得用模型叙事冒充 PASS。
## 边界
- **Cursor Auto**:唯一代码实施车道;本规则不把 implementation 派给 PI。
- **禁止**:自动换模型、M3 关键角色、伪造 lease、递归把本修复任务再派给 PI worker、`pkill -f` 广谱杀进程。
- **MCP**:`.cursor/mcp.json` → `pi-subagents`(roles/run/result);executor 来自 MCP 安装根。
- **Hook(advisory)**:`.cursor/hooks/guard-pi-dispatch.sh` / `guard-pi-shell.sh` 可在形状错误时 `ask`;**硬拒绝以执行器为准**,见规则 `cursor-hooks`。
+59 -2
View File
@@ -1,6 +1,63 @@
---
description: 按变更范围选择测试及真实证据要求
description: Cursor-side test report path/naming conventions; validation scope comes from the validation contract.
alwaysApply: true
---
测试范围、精确产品 PI 入口、环境模型证据和报告格式统一见 [验证契约](../../.doc/ops/2026-09-21-validation-contract.md)。按实际变更选择适用行;报告大小不扩大测试范围。
# 测试报告规范准则 (Test Reports Standard)
本仓库严格遵循标准化、可追溯的质量测试管理体系。**验证范围、套件选择与模型证据的唯一来源**为 [验证契约](../../.doc/ops/2026-09-21-validation-contract.md);本规则只约定 Cursor 侧的报告路径、命名与结构提醒,不另设第二套测试门禁。
**范围判定**:纯工程规范/文档变更按 [PROJECT.md 验证入口](../../PROJECT.md#验证入口) 与 [worktree 工作规范](../../.doc/ops/2026-09-21-agent-worktree-workflow.md) 检查链接、规则一致性及 Git 差异;不适用产品 PI 全链路。报告注明 NOT REQUIRED 及依据,不能记成产品测试 PASS。运行模板、提示词和业务变更不属于此例外——按验证契约选层级。
## 一、 测试报告归档路径规范
- **统一目录**:所有测试报告必须统一存放于 `.doc/test-reports/` 目录下。
- **命名规范**:遵循 `YYYY-MM-DD-<模块/功能/版本>-test-report.md` 命名格式。
- 例如:`.doc/test-reports/2026-09-07-three-branch-intent-framework-test-report.md`
- **证据附件**:运行产物(json/jsonl、workspace 快照、截图)放 `.doc/test-reports/assets/<report-slug>/`,**不得**与 `*-test-report.md` 混放在同一层级目录。
## 二、 测试报告固定结构模板
每份独立测试报告应包含以下核心板块(小型文档/脚本任务可在任务主文档设验证节,无需机械拆报告):
```markdown
# [功能/模块名称] 测试报告
## 一、 测试背景 (Background)
- 简述被测功能/特性的产生背景、业务痛点或上一轮测试中发现的缺陷与瓶颈。
## 二、 测试目标 (Test Objectives)
- 列举本次测试需要验证的核心功能点、质量指标。
## 三、 测试方案与环境 (Test Plan & Environment)
- 测试环境(OS、工具版本、目标环境批准配置);
- 测试层级分层(按验证契约矩阵选行);
- 核心测试用例矩阵设计。
## 四、 预期结果 (Expected Results)
- 明确给出各用例输入下的理论判定。
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
- 必须包含针对每一个典型测试用例的真实记录:
- **测试输入 (Input)**
- **实际输出 (Actual Output)**:贴出真实的终端/日志输出文本(可脱敏)
- **评价判定 (Evaluation / Verdict)**:PASS / FAIL / SKIP / 未运行
- **性能与耗时 (Duration & Latency)**
## 六、 自动化测试套件汇总 (Test Suite Execution)
- 只列本次适用并**实际运行**的检查与通过率;不无条件要求全量 `go test`。
- 工程工具改动优先 `python3 -B -m unittest discover -s scripts/tests -p 'test_*.py' -v`(见验证契约「工程工具验收补充」)。
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
- 总结测试是否达到授权交付终点,提出后续演进或强化点。
```
## 三、 执行要求与真实 Agent 交付铁律
1. **真实 Agent 交付铁律(红线)**:
- **开发实现阶段**:可以快速使用 stub 验证状态机、协议分流、数据落盘与逻辑契约,加速反馈;
- **交付前验收与测试报告生成**:涉及产品 Agent/工作流时,必须按验证契约「产品 PI 基线」在获授权环境用真实产品 PI Agent Runner 全链路实测;模型以目标环境批准配置为准,不得在本规则中硬编码模型名;
- **严禁**使用 stub、SKIP、未运行输出作为最终交付报告的验收数据。
2. **严禁散落存放**:测试报告统一归档至 `.doc/test-reports/`,禁止散落在根目录或临时沙箱中。
3. **真实控制台取样**:测试报告中的输入、输出、耗时与判定必须取自实际环境运行的真实控制台输出与日志。
4. **Git 规范管理**:测试报告伴随对应阶段的 `docs(test)` 或 `test(...)` 规范提交入库。
@@ -0,0 +1,61 @@
---
name: agentctl-integrate-closeout
description: Validate a merge candidate, enqueue for daemon ff-only integrate, and close out five-state. Use when ready to land a task on local dev.
---
# agentctl 集成与收口
权威:[操作规范](../../../.doc/ops/2026-09-21-agent-worktree-workflow.md)、[验证契约](../../../.doc/ops/2026-09-21-validation-contract.md)。常驻 daemon 已装载时走 **enqueue**,勿手动 `integrate`(除非 daemon 停)。
## 候选
优先一层封装(创建 integrate worktree、`task register`、`--no-ff` merge;**不** validate/enqueue):
```bash
D=$(git -C /path/to/Agent-System rev-parse HEAD) # 冻结 expected-dev
python3 scripts/agentctl.py integrate prepare \
--task <feature-task-id> --expected-dev "$D" \
[--integrate-id integrate-<task>-YYYY-MM-DD]
# 进入返回的 worktree 继续 validate → enqueue
cd .worktrees/integrate-<task>-YYYY-MM-DD # 或 emit 中的 worktree
```
第一父必须等于 `$D`。手工 `worktree add` + `with` + `merge --no-ff` 仍可用。
## validate → enqueue(daemon ff)
```bash
python3 ../../scripts/agentctl.py validate --task "$ID" -- <验收命令>
python3 ../../scripts/agentctl.py queue enqueue \
--task "$ID" --expected-dev "$D" --head "$(git rev-parse HEAD)"
# 在任务 worktree 内 enqueue;数秒内 daemon 合入
python3 ../../scripts/agentctl.py queue list
python3 ../../scripts/agentctl.py daemon status
```
验收按验证契约选行;治理脚本用 `unittest discover`。
## 五态收口
| 字段 | 典型值 |
|---|---|
| review_state | accepted |
| integration_state | merged_local_dev |
| deployment | not_required 或 loaded_local_launchd |
| cleanup | pending(独立维护者;禁止 `--force`) |
| remote_sync | not_requested |
CURRENT 行 → `done`(`docs apply`);`task close --status done`。
## 清理前
确认 tip 为 local_dev 祖先、证据已持久化、无 tracked/untracked 遗留、无进程占用。唯一日志/对话归档进 `.doc/ops/evidence/` 后再 `worktree remove`。
只读盘点(不自动删除、不自动写 MATRIX):
```bash
python3 ../../scripts/agentctl.py cleanup report # 主目录或任意同仓 cwd
python3 ../../scripts/agentctl.py docs drift
```
对 `verdict=ready` 的 worktree 由独立维护者执行 `agent-worktree.sh remove … --delete-branch`;拒绝则保留 cleanup_pending。daemon 未装载时用 `queue schedule --drain`(主目录 + 分支 dev)。
@@ -0,0 +1,46 @@
---
name: agentctl-lease-write
description: Write under agentctl leases and docs apply CAS. Use before any git write, shared-doc edit, or when hitting UNMANAGED_DOCUMENT_CHANGE / EVIDENCE_REQUIRED.
---
# agentctl 租约写回
权威:[AGENTS §3–5](../../../AGENTS.md)、[操作规范](../../../.doc/ops/2026-09-21-agent-worktree-workflow.md)。
## 原则
- **任何仓库写**(含 `git add/commit`)必须在 `agentctl with` / MCP `lease_run` 租约内
- CURRENT / FEATURE-MATRIX **只能** `docs apply`(行级 CAS;MATRIX 键为 `record_id`)
- 直接 `git commit` 会被 agentctl-managed pre-commit hook 拒绝
## lease_run(CLI)
```bash
python3 scripts/agentctl.py with \
--task "$ID" \
--resource path:scripts --resource path:.doc --resource git:index \
-- bash -lc 'git add … && git commit -m "…"'
```
MCP:`lease_run` 的 `command` 为 **argv 数组**(无额外 shell)。
## docs apply(行级)
```bash
python3 scripts/agentctl.py docs snapshot --file .doc/ops/CURRENT.md --record "$RID"
# expected_sha256 = snapshot.sha256;改 replacement 后:
python3 scripts/agentctl.py docs apply --task "$ID" --request /tmp/req.json
```
FEATURE-MATRIX 升 `done` 需要 `docs:approve` + 可核验 evidence(`git cat-file -e`),否则 `EVIDENCE_REQUIRED`。
收口或合入含 MATRIX 的变更后跑 `python3 scripts/agentctl.py docs drift`:硬告警仅 `done→非 done`;不因任务结束自动升 done。
## 常见拒绝
| 码 | 处置 |
|---|---|
| `UNMANAGED_DOCUMENT_CHANGE` | 保留现场,先 snapshot/reconcile,勿覆盖 |
| `BASE_CHANGED` | 重新 snapshot,基于新 sha 再 apply |
| `AMBIGUOUS_RECORD` | 修重复 record_id / 模块名 |
| `CAPABILITY_REQUIRED` | 任务缺 docs:admin / docs:approve |
| `DOCUMENT_RECEIPT_REQUIRED` | 共享文档须经 apply 收据后再 commit |
@@ -0,0 +1,51 @@
---
name: agentctl-session-start
description: Start an Agent-System session under agentctl governance. Use at session start, when opening a worktree, or before any write to this repo.
---
# agentctl 会话启动
权威规范:[AGENTS.md](../../../AGENTS.md)、[操作规范](../../../.doc/ops/2026-09-21-agent-worktree-workflow.md)、[CURRENT](../../../.doc/ops/CURRENT.md)。
## 步骤
1. 读 `AGENTS.md`、`PROJECT.md`、`.doc/ops/CURRENT.md` 活跃摘要(勿跳过)。
2. 核对管理面:
```bash
python3 scripts/agentctl.py daemon status
# 期望:status=ok;launchd 已装载时 manager.lock.held=true
```
或 MCP 工具 `status`。
3. 刷新 CodeGraph 索引(fail-open;CLI 缺失可跳过):
```bash
codegraph sync -q
# 或:python3 scripts/agentctl.py hooks codegraph-sync
```
跨文件定位优先用 CodeGraph MCP/`explore`;**grep 仍是完整性唯一权威**(假阴性时以 grep 为准)。
4. 若任务已存在:在注册 worktree 内工作,确认 `tasks.state=active`。
5. **开工前需求重叠探测**(治理目录库):新设计或可能与其他对话重叠时:
```bash
python3 scripts/agentctl.py catalog search --query '<关键词>'
python3 scripts/agentctl.py catalog overlap --task "$ID" --statement '<设计原文>' [--requirement R-xxx] [--feature <record_id>] [--mutex <key>]
# soft 命中须显式裁决后才可编码:
python3 scripts/agentctl.py catalog overlap ack --task "$ID" --overlap <oid> --decision proceed|merge_into|supersede|defer --reason '...'
```
硬重叠(同 mutex/feature/scope/R-ID)直接拒绝;向量层失败自动降级到 FTS5,不阻断。
6. 若新任务:跟 [agentctl-worktree-setup](../agentctl-worktree-setup/SKILL.md)。
7. 任何仓库写 → [agentctl-lease-write](../agentctl-lease-write/SKILL.md);合入 → [agentctl-integrate-closeout](../agentctl-integrate-closeout/SKILL.md)。
## 禁止
- 主目录直接开发提交;未授权 `git push` / 晋升 test/main
- 绕过 `docs apply` 改 CURRENT / FEATURE-MATRIX
- 卸载或重启 launchd coordinator(除非用户明示)
- 未执行 `catalog overlap` / 未裁决 soft 命中即编码(有 `--requirement`/`--intent`/`--feature`/`--mutex` 绑定时机器强制)
@@ -0,0 +1,65 @@
---
name: agentctl-worktree-setup
description: Create an agentctl task worktree, register scopes/capabilities, and claim CURRENT. Use when starting a new feature/fix task in Agent-System.
---
# agentctl 建场
权威:[操作规范](../../../.doc/ops/2026-09-21-agent-worktree-workflow.md)。
## 命令序列
```bash
cd /path/to/Agent-System # 主目录(dev)
D=$(git rev-parse HEAD)
ID=<task-id-YYYY-MM-DD>
WT=.worktrees/$ID
# 推荐入口:自动 best-effort codegraph init(后台;CLI 缺失不阻断)
./scripts/agent-worktree.sh create feature/$ID
# 等价:git worktree add -b feature/$ID "$WT" "$D"
cd "$WT"
python3 ../../scripts/agentctl.py task register \
--id "$ID" --owner <Owner> \
--scope scripts --scope .doc \
--capability docs:publish
# 需要整文/行级 admin 时再加 --capability docs:admin;证据升 done 加 docs:approve
# 若已知需求/功能绑定,追加:
# --requirement R-<slug> --intent '<设计原文>' --feature <record_id> --mutex <key>
# 有 soft 重叠时 register 会 OVERLAP_ACK_REQUIRED:先 catalog overlap + ack 再重试 register
codegraph sync -q # 若建场已 init,此处只需 sync;缺失 CLI 可跳过
```
## 开工前重叠裁决(catalog)
```bash
python3 ../../scripts/agentctl.py catalog overlap \
--task "$ID" --statement '<新设计原文>' \
[--requirement R-xxx] [--feature <record_id>] [--mutex <key>]
# hard → 换 mutex/合并到持有者任务;soft → ack 留痕
python3 ../../scripts/agentctl.py catalog ack \
--task "$ID" --overlap <oid> \
--decision proceed|merge_into|supersede|defer \
--reason '<理由>'
```
## CURRENT 认领
优先用一层封装(内部仍走 `docs apply` CAS):
```bash
python3 ../../scripts/agentctl.py claim new \
--task "$ID" --owner <Owner> --mutex <mutex> \
[--branch feature/$ID] [--worktree "$WT"] [--replace]
```
手工 `docs snapshot` + `docs apply` 仍可用;行已存在且内容不同时需 `--replace`。
## short-term 模板字段
`status`、`write_scope`、`mutex`、`base_dev_sha`、`review_state`/`integration_state`/`deployment`/`cleanup`/`remote_sync`。命名 `.doc/ops/short-term/YYYY-MM-DD-<slug>.md`。
## 注意
- 从确切 `dev` SHA 创建,不从他人 feature 分支启动
- 重叠 path/mutex 只允许一个写者
- CodeGraph 索引是加速器:有假阴性;穷举调用方仍用 grep
+52
View File
@@ -0,0 +1,52 @@
---
name: jev-decide
description: Use jev-service typed decisions (choice/noul/numeric with probabilities) for Agent-System governance classification. Use when choosing task tier, validation level, reject-code routing, or other closed-enum judgments.
---
# jev-decide(治理决策)
依赖 MCP 服务器 `jev`([`scripts/mcp/jev-mcp.mjs`](../../../scripts/mcp/jev-mcp.mjs))。凭证在本机 `~/.secrets/jev/`(`api.key`、`base-url`),**禁止**写入仓库、commit 或聊天。
## 何时用
输入是情境文本、输出是**封闭枚举 / yes-no / 分桶数值**时调用 `jev_decide`,例如:
| 决策点 | 建议 questions |
|---|---|
| 任务分级(是否开 worktree) | `choice`:`info_reply` / `single_task` / `cross_module` |
| 验证层级(验证契约) | `choice`(可多题):`doc` / `script` / `go` / `frontend` / `migration` / `product_pi` |
| 拒绝码处置 | `choice`:`reconcile` / `re_snapshot` / `fix_record_id` / `request_capability` / `abort` |
| 是否 blocker / 是否触碰重验面 | `noul` |
不适合:需要解释链、多步规划、自由文本生成——那些走大模型或 agentctl 确定性门禁。
## 调用约定
1. 可选先 `jev_health`;失败则本机判断,勿阻塞写路径。
2. `jev_decide`:同一情境的多问合成一次请求。
3. 问句**正向措辞**,避免双重否定。
4. 置信度路由:
- `confidence >= 0.9` 且 top1−top2 ≥ 0.15 → 可采用
- 否则 → agent 自行按规范裁定,把 jev 结果当参考
5. 401/超时/`answers.*.error` → 降级到本机判断;勿把决策失败变成业务失败。
## 示例(任务分级)
```json
{
"context": "用户请求:给 CURRENT 加一行认领说明,不改代码",
"questions": {
"tier": {
"type": "choice",
"question": "This request matches which AGENTS task tier?",
"options": ["info_reply", "single_task", "cross_module"]
},
"needs_worktree": {
"type": "noul",
"question": "Does this require a new feature/fix worktree?"
}
}
}
```
权威矩阵仍以 [AGENTS.md](../../../AGENTS.md)、[验证契约](../../../.doc/ops/2026-09-21-validation-contract.md) 为准;jev 只加速封闭枚举分类,不替代机器门禁(admit/hooks/docs apply)。
@@ -0,0 +1,87 @@
---
name: pi-subagent-dispatch
description: Dispatch gmktec PI analysis/review/test subagents via project MCP pi-subagents (roles/run/result). Use when delegating research, planning, reviews, diagnosis, test_run, acceptance_check, or report work—not for code implementation.
---
# PI Subagent 派发
权威:[模型配置](../../../.doc/ops/2026-09-24-subagent-model-config.md)、[执行器说明](../../../.doc/ops/2026-09-24-pi-subagent-executor.md)、[流程规范](../../../.doc/ops/2026-09-24-subagent-workflow-standard.md)。客户端规则:[pi-subagents](../../rules/pi-subagents.mdc)。阶段落盘:[subagent-stage-record](../subagent-stage-record/SKILL.md)。
**Cursor Auto 独占代码实施与修复**;本 skill 只走本机 PI 子任务。
## 调用序列
1. `pi_subagent_roles` — 只读预览角色/模型(不调 PI)。
2. 选 `role_id`(research → planning → reviews → diagnosis → test_run / acceptance_check → report)。
3. (推荐)`agentctl pi packet` 生成派发包;**不**触发 run:
```bash
python3 -B scripts/agentctl.py pi packet \
--task "$ID" --role research \
--goal '…' --authorization-ref 'user:…' \
--source-sha "$(git rev-parse HEAD)" \
[--input-file …] [--approved-command '…']… \
--request-id "$RID" --write
# → .doc/test-reports/assets/pi-subagents/<task>/<request>/packet.json
```
4. `pi_subagent_run` — 按 packet 字段在 agentctl 租约下异步启动。
5. `pi_subagent_result` — 取回收据;轮询至终态。
CLI 等价:`python3 -B scripts/pi_subagents.py roles|run|result`;`run` 必须包在 `agentctl with --resource path:.doc/test-reports/assets/pi-subagents/<task>/<request>` 内。
## 请求字段(MCP `pi_subagent_run`)
外层:`worktree`(已登记任务工作区绝对路径)、`task_id`、`request` 对象。
`request` 必填:
| 字段 | 约束 |
|---|---|
| `role_id` | 配置 §3 中 enabled 角色 |
| `request_id` | 任务内稳定唯一;同参重放不重复调模型 |
| `goal` | 具体目标;子任务不依赖主会话未传入历史 |
| `authorization_ref` | 可回链真实用户授权,禁止日志自授 |
| `source_sha` | **完整** 40-hex 提交;禁止 `HEAD`/分支名/短 hash |
| `input_files` | 已跟踪 UTF-8 普通文件相对路径数组 |
| `timeout_seconds` | 正整数 |
测试角色(`test_run` / `acceptance_check`)另需:
- `approved_commands`:argv 数组的数组(如 `[["go","test","-short","./"]]`)
- `plan_digest`:外部已批准计划的 SHA-256 hex
禁止静默 `model_override`;临时改模型写任务 override 并说明用户来源。
## 租约与输出
- 资源:`path:.doc/test-reports/assets/pi-subagents/<task_id>/<request_id>`
- 产物:`receipt.json`、`report.md`、命令日志(同目录)
- 裸调 `run`(无租约)被拒绝
## 状态分离(红线)
| 字段 | 含义 |
|---|---|
| `run_status` | running / succeeded / failed / cancelled / unknown |
| `verdict` | pass / changes_required / blocked / not_applicable |
| `review_state` | 阶段门禁;模型 succeeded **仅** pending |
测试 `commands_passed`/`pass` 只针对批准命令证据,不能直接赋给任务 `acceptance`。
## 常见拒绝码(执行器权威)
| 码 | 处置 |
|---|---|
| `INVALID_SOURCE_SHA` | 换完整提交 hash |
| `APPROVED_COMMANDS_REQUIRED` | 补 approved_commands + plan_digest |
| `MINIMAX_ROLE_FORBIDDEN` | 不把 M3 用于关键角色 |
| `INPUT_NOT_TRACKED` / `PATH_OUT_OF_SCOPE` | 收窄 input_files |
| `CONCURRENCY_LIMIT` | 串行或等空闲槽 |
| `ORPHAN_RUNNING` | 先核进程/副作用,勿盲目重派 |
Cursor hooks 对形状错误可能 `permission=ask`(advisory);**硬拒绝以执行器为准**。
## 禁止
- 把 implementation 派给 PI
- 自动换模型 / 伪造 lease / 递归把本修复再派给 PI worker
- 用模型叙事冒充 PASS;审查结论须带回报告路径与 receipt 字段
@@ -0,0 +1,56 @@
---
name: subagent-stage-record
description: Record PI/Cursor stage handoffs using the subagent stage template (dispatch packet, return, S0–S9 receipt, R-AC-T mapping). Use after PI results, before gate advances, or when closing a multi-stage task.
---
# Subagent 阶段记录
权威模板:[subagent-stage-record.md](../../../.doc/ops/templates/subagent-stage-record.md);流程:[协作规范](../../../.doc/ops/2026-09-24-subagent-workflow-standard.md)。派发入口:[pi-subagent-dispatch](../pi-subagent-dispatch/SKILL.md)。
原则:**一步一记录,不必一步一文件**。小任务可把适用段落并入任务主文档;跨模块才拆独立审查/测试/验收证据。
## 何时写
- 每次 `pi_subagent_run` 前后:派发包 + 回传
- 阶段门禁推进前:S0–S9 收据行
- 收口前:R→AC→改动→审查→T→运行验收映射
## 派发包(最小字段)
复制到任务文档并填实值:
- `parent_task_id` / `subtask_id` / `stage_id` / `role_id`
- 配置路径 / `config_revision` / `config_sha256`(来自 roles 或 receipt)
- 解析后的 provider/model;任务 override 与用户来源
- 目标、非目标、授权来源、交付终点
- 输入版本:R-ID / AC-ID / 方案版本 / `base_sha` / `head_sha` 或 `source_sha`
- cwd / branch / allowed_paths / 只读或写入 / mutex
- 完成条件、输出路径、预算与异常处理
## 子任务回传
- PI `run_id` / producer / 起止时间
- `configured_model` / `actual_model`(不可观察填 `unknown`)
- `run_status` 与 `verdict` **分列**(不得把退出成功当质量通过)
- 结论与依据、证据链接、脱敏范围
- 未覆盖项、风险、遗留进程/产物、接管建议
只读子 Agent 结论由主 Agent 转存时:保留 `agent_id` 与原结论,注明「由主 Agent 转存」。
## 阶段收据表
| 阶段 | 输入版本 | 产物/证据 | producer | reviewer/独立性 | 决定 | 下一步 |
|---|---|---|---|---|---|---|
| S0–S9 适用项 | | | | independent / self_review / not_required | pass / changes_required / blocked / not_applicable | |
未执行阶段写 `not_applicable` + 原因。报告存在不自动满足门禁。
## 需求追踪
| R-ID | AC-ID | 改动/版本 | 审查 | T-ID / 结果 | 运行验收 | acceptance_owner |
|---|---|---|---|---|---|---|
| | | | | | | |
## 与任务五态
继续用任务模板的 `status`、`review_state`、`integration_state`、`deployment`、`cleanup`、`remote_sync`;额外记 `phase`、`acceptance`、待回收 `subtask_id`。`done` 取决于授权交付终点,不因会话结束自动完成。
+6 -3
View File
@@ -11,10 +11,10 @@
.doc/
README.md ← 本文件(总地图)
status/ ← 模块/功能完成度 SSOT
audit/ ← 问题发现与分析
audit/ ← 问题发现与分析、ISSUES.md 问题/修复台账
remediation/ ← 整改方案与发布缺口
archive/ ← 历史(只增不删)
ops/ ← 活协作(任务、交接、调研)
ops/ ← 活协作(任务、交接、调研;lessons/ 开发经验)
system-design/ ← 模块架构深读
adr/ ← 架构决策
backlog/ ← 产品 backlog(非阻塞)
@@ -33,6 +33,7 @@
| 我要… | 读这里 |
|--------|--------|
| Subagent 模型配置 / 流程 | [可调整模型配置](ops/2026-09-24-subagent-model-config.md) · [PI 执行器](ops/2026-09-24-pi-subagent-executor.md) · [流程草案](ops/2026-09-24-subagent-workflow-standard.md) · [研究依据](audit/2026-09-24-subagent-workflow-research.md) |
| 规则来源/生效版本 | [规范登记](ops/2026-09-21-policy-registry.md) |
| 选择测试/报告范围 | [验证契约](ops/2026-09-21-validation-contract.md) |
| 任务模板与会话收口 | [任务模板](ops/templates/short-term-task.md) · [收口清单](ops/templates/session-close-checklist.md) |
@@ -40,6 +41,8 @@
| 当前在做什么 | [ops/CURRENT.md](ops/CURRENT.md) |
| 模块完成度 | [status/FEATURE-MATRIX.md](status/FEATURE-MATRIX.md) |
| 发布 blocker | [remediation/gap-matrix.md](remediation/gap-matrix.md) |
| 问题历史、修复经过 | [问题台账](audit/ISSUES.md) · [闭环规范](ops/2026-09-23-issue-learning-workflow.md) |
| 开发注意事项与经验检索 | [经验索引](ops/lessons/INDEX.md) |
| 审计/问题分析 | [audit/INDEX.md](audit/INDEX.md) |
| 整改方案 | [remediation/INDEX.md](remediation/INDEX.md) |
| 历史归档 | [archive/README.md](archive/README.md) |
@@ -68,6 +71,6 @@ audit(问题)→ remediation(方案)→ ops/short-term(任务)
→ test-reports(验收)→ archive(关闭证据)
```
状态字段:`planned | in_progress | blocked | done | cancelled`
任务状态字段:`planned | in_progress | blocked | done | cancelled`。问题以 issue_state、经验以 lesson_state 独立记录,取值与转换见 [闭环规范](ops/2026-09-23-issue-learning-workflow.md);研究任务完成不关闭待修问题。
会话结束不等于任务完成;只有 done/cancelled 任务归档。CURRENT 保留最多 3 项焦点及活跃/阻塞/待集成/待清理事项,完成认领和长证据迁入 [历史快照](archive/ops/2026-09-21-current-history.md)。移动文档同步修复相对链接,保留证据与来源。规范生命周期另用 proposed/approved/active/deprecated;工具能力另用 manual/enforced。
@@ -0,0 +1,25 @@
# ADR:最终成果保险库(FAV)
## 状态
已接受(2026-09-14,落地计划 V0–V6)
## 背景
运行库 PostgreSQL 与 workspace 投影会一起丢失或错挂。需要独立保存**已确认终态**的精确字节,但不能成为第三套完整业务真相源,也不能用目录扫描猜测“最终文件”。
## 决策
1. **三层权威**:PostgreSQL 管项目/权限/工作流/版本关系;workspace 是可清理投影;FAV 只对已归档 payload、manifest、来源证据和删除状态权威。
2. **无 tenant_id**:安全边界沿用 `environment + project_members + role-admin`。未来组织层另立 ADR。
3. **事件准入**:只接受方案准入表中的数据库事实。显式 publish/pin 不能绕过终态 allowlist。禁止扫描 workspace。
4. **同事务冻结**:终态事务把精确 payload/SHA 写入 staging 并写 unpublished outbox;publisher 不得重读可变消息行。
5. **union-deny 删除**:运行库删除账本或 vault tombstone 任一侧删除即拒绝读取/恢复。
6. **恢复**:只进 scratch 库,默认 `recover-as-collection`。禁止 GET 自动写回或覆盖现有 head。
7. **互补**:FAV、migration corpus、完整 DB backup/PITR 互相不能替代。不作为 409/split-brain 绕行。
## 后果
- 实现从 `feature/final-artifact-vault` 推进;mutex=`artifact-vault`。
- Goose 从 **00034** 增加 FAV 表(00033 已被 task-run 治理占用)。
- 降级读取默认关闭(`FAV_DEGRADED_READ`),Unit A 纠挂完成前不得对现网开启。
@@ -0,0 +1,47 @@
---
title: "Agent 规范整体审查"
status: done
created: 2026-09-21
updated: 2026-09-21
owner: Codex
branch: feature/agent-policy-review
worktree: .worktrees/agent-policy-review
base_dev_sha: a241e838150f218f3a09d3523f93291b847d45fd
write_scope: [.doc/ops/short-term/2026-09-21-agent-policy-review.md, .doc/archive/ops/2026-09-21-agent-policy-review.md, .doc/audit/2026-09-21-agent-policy-review.md, .doc/ops/CURRENT.md]
mutex: agent-policy-review
deployment: not_required
cleanup: retained-with-reason
---
# Agent 规范整体审查
## 目标与范围
评估生效规范的可完善之处,形成有依据的新增、删除、修改清单。本轮使用 ce-doc-review 的只读审查流程;不修改 AGENTS/PROJECT/客户端规则,不实现锁管理或改业务代码。
## 已确定约束
- 全部新增修改使用 .worktrees;主目录留给 dev 集成与运行。
- 锁先统一入口/提交门禁防误改,OS 权限隔离后续实施。
- 审查不等于实现或部署授权;已有未合入规范收口和 .locks 方案保留原分支。
## 步骤
1. [x] 启动链、当前 Git、规范与模板盘点。
2. [x] 一致性、可执行性、范围、安全及故障场景复核。
3. [x] 核实保留发现,形成增删改建议与实施优先级。
4. [x] 文档校验、归档、本地提交。
## 验收
- 每条保留发现有当前源文件或明确缺失证据、实际后果和建议修改。
- 区分已生效规则、尚待实现工具和未合入草案;不把建议当现状。
- 未修改主目录跟踪文件、运行锁、服务或用户数据。
## 结果与交接
- [整体审查](../../audit/2026-09-21-agent-policy-review.md):10 组增删改建议、2 项安全观察;保留已确定的 worktree 与 L1-first 选择。
- 五个独立会话内视角已返回;主审核对引用与实际命令/脚本。文档原规则未改,自动化未实施。
- 检查项:新增文档相对链接、git diff --check;未运行产品测试,不作运行验收声明。
- 本任务 CURRENT 快照标 done,未占共享集成槽位;本地分支保留供审核,未合入 dev、未 push。
- 需要执行修改时先按第一批消除冲突,再处理减负及既有工具实现;不要将本报告直接视为已生效规则。
@@ -0,0 +1,43 @@
---
title: "采纳 Agent worktree 工作规范"
status: done
created: 2026-09-21
updated: 2026-09-21
owner: Codex
branch: feature/agent-workflow-governance-plan
worktree: .worktrees/feature-agent-workflow-governance-plan
mutex: agent-workflow-governance
---
# 采纳 Agent worktree 工作规范
## 授权与范围
用户于 2026-09-21 确认“提交吧,之后按这套执行”。延续原治理任务,在原 dev 派生的独立 worktree 内将方案采纳为生效规则,提交并合入本地 dev。仅修改规范、模板和治理记录。
本次不将 W1–W4 的自动化开发宣称已完成;它们保留在实施任务中。主目录仍有其他任务未提交改动,使用临时集成 worktree 合入纯文档,不迁移原任务、不改变业务运行态、不 push。
## 步骤
1. [x] 核对主目录现场、原方案提交与集成槽位。
2. [x] 同步 AGENTS、PROJECT、Cursor 规则、操作规范与模板。
3. [x] 文档检查、提交、独立 worktree 合入 dev。
4. [x] 更新验收/交接及清理状态。
## 验收
- [x] 单 Agent 主目录开发例外已移除,生效规则可从启动链发现。
- [x] 创建明确来自 dev;测试提交、共享服务串行、部署及安全清理条件可执行。
- [x] 自动化能力保持 planned;主目录其他任务未提交改动不被纳入提交。
- [x] 本地 dev 含本次规范提交;未 push,未重建服务。
## 相关链接
- [方案](../../remediation/2026-09-21-agent-workflow-governance-plan.md)
## 结果
- 规则提交 `048bbe4a`,验证的合并候选及首次 dev 合入 `83e22a70`。
- [文档验收](../../test-reports/2026-09-21-agent-workflow-governance-adoption-test-report.md)。
- 主目录旧任务保留;临时 dev 集成工作区保留到原 owner 可安全切回 dev,见 [交接](../../ops/handoffs/2026-09-21-agent-workflow-governance-plan.md)。
- 收口提交合入后普通清理本任务和候选工作区,实际结果记录共同 Git 目录的治理操作收据。未 push;deployment=not_required。
@@ -1,13 +1,16 @@
---
title: "当前受控文档改写被领域关键词改路由到另一交付物"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# 当前受控文档改写被领域关键词改路由到另一交付物
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第二轮真实 UI(schema 30)**UI-05 首个失败**:
@@ -1,13 +1,16 @@
---
title: "UI-06 用 overlay/p/h 选择器找不到真实文档块"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-06 用 overlay/p/h 选择器找不到真实文档块
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第六轮真实 UI(schema 30):
@@ -1,13 +1,16 @@
---
title: "UI-13a 用整行 option 文案误判编制负责人"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-13a 用整行 option 文案误判编制负责人
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第16轮真实 UI(schema 30,`dev@dd5671e`):UI-00 至 UI-12 PASS;分类导航修复已实证,UI-13a 已能从「我的私密」切回「流程受控」并打开 reviewer B 权限矩阵。
@@ -1,13 +1,16 @@
---
title: "文档职责伪造与保存时重取 ETag 可覆盖并发正文"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: critical
---
# 文档职责伪造与保存时重取 ETag 可覆盖并发正文
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
静态审查与 E2E UI-13 路径暴露两类产品缺陷:
@@ -1,13 +1,16 @@
---
title: "UI-05b 缺当前受控文档指示语被路由到 feasibility_reg"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-05b 缺当前受控文档指示语被路由到 feasibility_reg
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第五轮真实 UI(schema 30)**UI-05b 首个失败**:
@@ -1,13 +1,16 @@
---
title: "UI-06 编辑弹窗打开期间 hydration 换块 ID 导致保存静默丢稿"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-06 编辑弹窗打开期间 hydration 换块 ID 导致保存静默丢稿
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第十二轮真实 UI(schema 30,dev@4c465d2 基线):
@@ -1,13 +1,16 @@
---
title: "UI-11 快速 completed 被验收脚本误判为失败"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-11 快速 completed 被验收脚本误判为失败
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第14轮真实 UI(schema 30,`dev@339e871`)在 **UI-11** 失败:页面上传附件并发送「请将此附件归档」后,相邻助手卡片已快速处于 `completed`(文案:已收录补充材料并关联黑板)。
@@ -1,13 +1,16 @@
---
title: "UI-07 纯净阅读用 overlay/class*block 找不到真实块"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-07 纯净阅读用 overlay/class*block 找不到真实块
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第八轮真实 UI(schema 30):
@@ -1,13 +1,16 @@
---
title: "UI-07 在 CSS transition 中间帧采样纯净阅读"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-07 在 CSS transition 中间帧采样纯净阅读
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第九轮真实 UI(schema 30):
@@ -1,13 +1,16 @@
---
title: "UI-05a 未打开待确认报告导致确认按钮缺失"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-05a 未打开待确认报告导致确认按钮缺失
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第四轮真实 UI(schema 30)**UI-05a 首个失败**:
@@ -1,13 +1,16 @@
---
title: "post-restart 项目名同时命中顶栏与侧栏"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# post-restart 项目名同时命中顶栏与侧栏
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第18轮真实 UI(schema 31):main **18 PASS / 0 FAIL**。宿主重启 app 后 `UI_PHASE=post-restart` 在页面**已经恢复项目**时失败,尚未走到 `revision-state`。
@@ -1,13 +1,16 @@
---
title: "UI-11 prelim_design 缺 output.md 导致 TASK_INTERRUPTED"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-11 prelim_design 缺 output.md 导致 TASK_INTERRUPTED
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第11轮真实 UI(schema 30,`dev@2a58674`):
@@ -1,13 +1,16 @@
---
title: "质量门禁自污染与 auto_repair 未启用导致 quality_failed"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# 质量门禁自污染与 auto_repair 未启用导致 quality_failed
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
同一整改范围真实 run(与 SSE/幂等现场同源):
@@ -1,13 +1,16 @@
---
title: "UI-03 质量修复子工作区越界改写根 output.md"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-03 质量修复子工作区越界改写根 output.md
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第13轮 Antigravity 完整 UI(schema 30,dev@8b1a531 基线):UI00–02 PASS,UI-03 真实 PI 终态 `quality_failed`,页面 70 分、缺少必填章节「阻塞信息 / 非阻塞信息」。
@@ -1,13 +1,16 @@
---
title: "行动计划表状态列「待续」被质量门禁误判为敷衍"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# 行动计划表状态列「待续」被质量门禁误判为敷衍
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第三轮真实 UI(新用户 `mtzzliz5`,新项目,真实 MiniMax):
@@ -1,13 +1,16 @@
---
title: "项目 reviewer 未同步到受控文档职责"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: critical
---
# 项目 reviewer 未同步到受控文档职责
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第17轮真实 UI(schema 30,`dev@639969f`):UI-00 至 UI-12 PASS。UI-13a 精确职责断言首次暴露产品缺陷:
@@ -1,13 +1,16 @@
---
title: "UI-06 全页模糊保存按钮未发出 PATCH"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-06 全页模糊保存按钮未发出 PATCH
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第七轮真实 UI(schema 30):
@@ -1,13 +1,16 @@
---
title: "UI-11 第二份文档路由到 intake 且 human lease 残留"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-11 第二份文档路由到 intake 且 human lease 残留
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第十轮真实 UI(schema 30):
@@ -1,13 +1,16 @@
---
title: "任务 run SSE 超时断线后同 turn 误击 DOC_BUSY"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: critical
---
# 任务 run SSE 超时断线后同 turn 误击 DOC_BUSY
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
真实 Antigravity UI-03(dev schema 30):
@@ -1,13 +1,16 @@
---
title: "UI-13a 在私密分类下打不开受控工作流文档"
status: in_progress
status: done
created: 2026-09-13
updated: 2026-09-13
updated: 2026-09-22
severity: high
---
# UI-13a 在私密分类下打不开受控工作流文档
> **W3 UI-rerun 关闭(2026-09-22)**:`status=done`。真实 Playwright 账本 PASS:[`ui-acceptance-results.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results.json)(main UI-00..16)+ [`ui-acceptance-results-post-restart.json`](../test-reports/assets/2026-09-22-docrev-ui-rerun/ui-acceptance-results-post-restart.json)(UI-15)。任务 tip 已合入本地 `dev`;详见 [short-term](../ops/short-term/2026-09-22-docrev-ui-rerun.md) 与 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md)。
## 现象
第15轮真实 UI(schema 30,`dev@48a4dcb`):UI-00 至 UI-12 全部 PASS,UI-11 快速完成修复已实证 PASS。**UI-13a 在真正权限断言前失败**。
@@ -0,0 +1,167 @@
---
title: "dev rebuild 从临时 worktree 挂载空数据根导致正文投影 409"
status: done
created: 2026-09-14
updated: 2026-09-14
severity: critical
---
# dev rebuild 从临时 worktree 挂载空数据根导致正文投影 409
## 现象
用户刷新项目 143 后,前端请求:
```text
GET /api/v1/docgov/documents/doc_proj143_intake/content 409
DOCUMENT_CONTENT_PROJECTION_MISSING
docgov: document content projection missing
```
错误发生在 `projectDocuments.ts` → `controlledDocHydrate.ts` 的受控正文水合链。它不是并发编辑的 `HEAD_CONFLICT`,也不是此前已修过的 canonical hash drift。
本轮只做只读现场核对与整改设计:没有操作用户会话、没有修改数据库/正文、没有重建共享容器。
## 结论
直接根因是 **dev 应用、PI Runner、Cursor Runner 被重建成挂载临时集成 worktree 的空 `data/dev`,而 PostgreSQL 仍沿用原 dev 持久卷**,形成数据库与文件事实源的 split-brain:
```text
PostgreSQL persistent volume
document_records.work_dir=/app/data/workspaces/bizdev/intake_1789270446856290128
│
├─ 主仓 data/dev:output.md 存在,SHA 与 DB/head 一致
│
└─ 当前容器 /app/data:绑定 /tmp/as-dev-wf409-merge/data/dev,文件不存在
```
`loadControlledDocumentContent` 先取得账本 head,再调用 `InspectProjection`;容器内看不到 `output.md`,因此正确分类为 `MISSING` 并返回 409。前端只是如实暴露后端错误,不是本次根因。
## 现场证据
### E1 — 容器挂载源是临时 worktree
2026-09-14 08:54 UTC 的 `docker inspect shuimu-agent-app-dev`:
| 项 | 现场值 |
|---|---|
| Compose working dir | `/tmp/as-dev-wf409-merge` |
| Compose config | `/tmp/as-dev-wf409-merge/docker-compose.dev.yml` |
| app `/app/data` source | `/tmp/as-dev-wf409-merge/data/dev` |
| pi-agent `/app/data/workspaces` source | `/tmp/as-dev-wf409-merge/data/dev/workspaces` |
| cursor-agent `/app/data/workspaces` source | `/tmp/as-dev-wf409-merge/data/dev/workspaces` |
| app created | `2026-09-14T08:40:44Z` |
数据库容器的数据仍来自命名卷 `agent-dev-context-pgdata`,不会随 Compose 工作目录切换。由此产生“旧数据库 + 新空文件根”的不一致组合。
### E2 — 项目 143 数据本身当前完整
`document_records`:
| 字段 | 值 |
|---|---|
| doc_id | `doc_proj143_intake` |
| work_dir | `/app/data/workspaces/bizdev/intake_1789270446856290128` |
| content_sha256 | `f283ba94c9c037897f021960f51abacee7242c3db8d10f9f2a5e32cde6acf039` |
| updated_at | `2026-09-14 05:14:10.302146+00` |
账本 open version 1 的 head snapshot 302 是人工修订,SHA 同为 `f283...f039`;主仓文件:
```text
/home/weichen/projects/Agent-System/data/dev/workspaces/bizdev/intake_1789270446856290128/output.md
size=40075
sha256=f283ba94c9c037897f021960f51abacee7242c3db8d10f9f2a5e32cde6acf039
```
同一路径在当前 app 容器内 `stat` 返回 `No such file or directory`。所以无需再次对项目 143 做内容修复;需要恢复正确数据根挂载。
### E3 — 影响不是单文档
对 dev 数据库 100 条“非模板且 work_dir 非空”的记录做只读比较:
| 根目录 | aligned | missing |
|---|---:|---:|
| 主仓 `/home/weichen/projects/Agent-System/data/dev` | 32 | 68 |
| 当前容器挂载 `/tmp/as-dev-wf409-merge/data/dev` | 0 | 100 |
主仓下的 68 条 missing 包含历史测试/临时路径,不能直接等同于 68 个真实用户缺陷;但当前容器对本次抽样 **100/100 都不可见**,足以确认环境级事故。恢复前任何真实文档读取或 PI 写入都不可信。
错误根在容器启动后已出现 27 个文件,其中 9 个 CAS blob 的 mtime 为 `08:40:45 UTC`;虽然 08:54 UTC 尚未找到新的 `output.md`,错误根已经不是可直接丢弃的“绝对空目录”,恢复前仍须做完整差异保全。
只读核对显示 test/main 当前 app 与 PI Runner 仍挂主仓 `data/test`、`data/main`,本轮没有观察到同样的运行事故;但其 Compose 仍使用相对 bind,仍受同一设计缺陷影响。
### E4 — 健康检查假阳性
同一时刻 `/health` 与 `/ready` 都返回 200,只检查数据库、schema 和 task store;未验证:
- 容器绑定的数据根身份;
- app 与 runner 是否挂载同一根;
- 活跃项目的正文投影是否可达;
- 数据库记录与文件根是否属于同一环境实例。
因此“healthy + schema 33”不能证明文档运行态可用。
## 根因分析
### R1 — Compose 相对 bind mount 与调用 worktree 耦合(直接根因)
`docker-compose.dev.yml` 使用:
```yaml
- ./data/dev:/app/data
- ./data/dev/workspaces:/app/data/workspaces
```
Compose 按 project working directory 解析相对路径。`scripts/env-service.sh` 又把 `ROOT_DIR` 定义为脚本所在 worktree 并 `cd` 进去,所以从任何复制/linked worktree 执行 `dev rebuild`,都会把该 worktree 自己的 `data/dev` 当成运行数据根。
### R2 — 纪律是文档约束,不是可执行门禁
`scripts/agent-worktree.sh` 只打印“禁止在此目录运行 env-service”,`AGENTS.md` 也规定 worktree 不得操作共享 Docker;但 `env-service.sh` 没有检测 linked worktree、主 worktree、分支、数据根或集成槽位。一次误调用即可静默替换全套容器挂载。
### R3 — 数据库与文件没有共享存储身份
数据库使用稳定 named volume;正文使用随调用目录变化的 bind mount。两者没有共同的 environment/storage UUID,也没有启动握手,因此任意一个被指向另一份状态时,进程仍可启动并连接成功。
### R4 — 账本权威仍被兼容投影阻断
当前设计声明 ledger head 是权威正文,但 GET 在账本存在时仍要求 `output.md` 投影必须存在且 aligned。于是兼容投影丢失会阻断 UI 读取权威账本。该 fail-closed 对真实 fork 有价值,却把“可安全重建的 missing”与“内容分叉”按同样的可用性后果处理。
### R5 — 正文更新仍是非原子双写
人工 PATCH 先提交 PostgreSQL 账本,再单独写 `output.md`;候选 commit/reject 也采用 DB 状态与文件投影分步更新。失败后只依赖同幂等键重试,没有持久 projection job/status 和后台补偿。即使修复本次挂载问题,进程崩溃、权限错误或磁盘故障仍可能再次留下 head 已更新、投影缺失的状态。
### R6 — 发布验收没有“从不同源码目录 rebuild 后仍接回同一状态”的负例
既有真实 UI 验收验证过 restart 后恢复,但 restart 不会重新解析 Compose bind mount;本次事故由 rebuild/recreate 触发。现有门禁没有覆盖 linked worktree、临时集成目录或错误数据根的启动拒绝。
## 为什么会“每次修改后又出现”
修改本身并不会删除项目 143 正文。本次时间线表明:最新人工修订和主仓 `output.md` 在 05:14 UTC 已一致落盘;08:40 UTC 后续 dev rebuild 把运行容器切到另一份空数据根,刷新才出现 409。
因此用户感知的“改完再刷新就坏”来自两个事件经常相邻:开发修改 → Agent 在临时 worktree 合并/rebuild → Compose 改绑数据目录。只修某个文档、某个 hydrate effect 或某次 hash 漂移,都无法阻止它复发。
## 严重度与影响
`critical`:
- dev 环境所有受控正文、工作流产物和 runner 工作区均可能不可见或写入错误根;
- 错误根上的新输出可能与主仓状态分叉;
- health/ready 仍为绿色,集成报告可能产生假 PASS;
- test/main 使用同类相对 bind 写法,设计缺陷可横向复制,虽本轮未观察其被错挂载。
## 关联整改
- Remediation: [dev 运行数据根隔离与文档投影自愈整改](../remediation/2026-09-14-dev-runtime-data-root-and-projection-remediation.md)
- Short-term: [dev runtime data root guard 诊断与设计](../ops/short-term/2026-09-14-dev-runtime-data-root-guard.md)
- 前序问题: [项目 143 canonical hash 漂移](./2026-09-14-project143-controlled-content-404.md)
## 开放问题
- 恢复前需再次冻结并备份错误根,确认 08:40 UTC 后是否已有新会话、附件、runner 输出或 agent session 写入;08:54 UTC 抽样未发现 `output.md`,不能替代完整差异清单。
- test/main 当前挂载源需在实施 Unit A 只读核对;本轮未扩大操作范围。
## 审查附记(2026-09-14 ~09:23 UTC)
- 现场复核:`shuimu-agent-app-dev` 仍 created `08:40:44Z`,bind source 仍为 `/tmp/as-dev-wf409-merge/data/dev`;`/health` `/ready` 仍 200,`schema_version=33`。
- 主仓 CURRENT 集成槽仍为 `implementer_cursor` / `e2e`。worktree 副本不得写成 idle。
- 方案已审查修订:见 [整改方案](../remediation/2026-09-14-dev-runtime-data-root-and-projection-remediation.md)。用户选择事故抢占 + 先改方案再批实施。08:54 的 `f283...f039` 不得再当 Wave 0 硬门槛。
@@ -105,8 +105,8 @@ severity: high
|------|------|--------|------|------|
| `sql_write` | 4 | U3 | 2026-09-28 | **8 天后到期**。`docduty`、`docrevision` 仍写 `document_records` / `freeform_documents` |
| `sql_write` | 1 | U8 | 2026-10-26 | `projectinstance` 终止流程直接取消 `task_runs` |
| `path` | 2 | U4 | 2026-09-28 | **同样 8 天后到期**。`server` 与 `docrevision` 仍点名 `output.md` |
| `path` | 14 | U5 | 2026-10-12 | `agent`、`bizdev`、`coordinator`、`docgov`、`storage` 仍拼接工作区路径或把 `data/dev` 写进提示 |
| `path` | **3** | U4 | 2026-09-28 | **同样到期**。`docrevision/projection.go` + server `document_revision_access.go` / `document_revision_handlers.go` 仍点名 `output.md`(对账前文档少记 handlers 一条) |
| `path` | **13** | U5 | 2026-10-12 | `agent`、`bizdev`、`coordinator`、`docgov`、`storage` 仍拼接工作区路径或把 `data/dev` 写进提示 |
到期后若门禁把这些 kind 升为 block 而代码未迁走,构建会失败;若继续延期而不迁,非属主写入会继续让文档/任务故障跨包扩散。本轮不改 YAML,清零归整改批次 G。
@@ -0,0 +1,39 @@
---
title: "pi-native 对比未过 P95 门槛"
status: planned
created: 2026-09-21
updated: 2026-09-21
severity: medium
---
# pi-native 对比未过 P95 门槛
## 现象
真实 MiniMax-M2.7-highspeed 双后端对比中,`pi-native` 六例全部写出目标文件,容器 `pi-agent` 只有两例文档任务成功。按成功样本计算的 P95 仍是 `pi-native` 16.616s、容器 6.926s,比值为 2.40,超过 1.3 倍替换门槛。因此 dev 默认后端保持 `pi-agent`。
## 根因分析
- 时延样本只统计成功且无 P0 的用例。容器 `reasoning` 画像使用 `--no-tools`,不会把助手正文落成目标文件,四例返回 `MISSING_TARGET`,不进入 P95。容器 P95 只由两例较快的文档任务构成。
- `pi-native` 的 P95 落在 `doc-outline`(16.616s)。同一提示在容器上是 6.926s。文档任务本身慢于 1.3 倍,不是分位数算法造成的。
- 第一轮对比把分位索引截断成 0,两例成功时取了更快的那例,已作废。本结论使用 nearest-rank(`ceil`)后的第二轮日志。
## 严重度
`medium`。运行时可以继续在分支上迭代,当前默认链路未切换,容器后端仍可回退。
## 关联整改
- 任务:`.doc/ops/short-term/2026-09-21-go-agentx-runtime.md`
- 报告:`.doc/test-reports/2026-09-21-go-agentx-runtime-test-report.md`
- 后续:缩短 `pi-native` 文档轮次时延,或把门槛改成按同一成功用例配对比较后重新实测。未重新通过前不改 `AGENT_BACKEND`。
## 证据
- `.doc/test-reports/assets/go-agentx-runtime/ab-live.txt`
- `.doc/test-reports/assets/go-agentx-runtime/ab-live-round1.txt`(作废的截断分位)
## 开放问题
- 容器结果不回传 token,本轮容器用量为 0,无法比较 token。
- `reasoning` 画像的成功定义是否应要求容器也把正文写入目标文件。当前判定仍按两边各自的 `Result.Success` 与目标文件是否出现。
@@ -0,0 +1,156 @@
---
title: "当前系统模块解耦现状审查"
type: docs
date: 2026-09-22
source_sha: d034aa00e5785f51234b484f9dca6bf4fb037660
task_id: modular-contract-standard-2026-09-22
---
# 当前系统模块解耦现状审查
## 结论与范围
当前系统属于**已有实质模块化基础,但契约一致性、数据所有权与运行隔离尚未闭合的模块化单体**。不是只有文件夹拆分:已有应用用例、共享事务、PostgreSQL outbox/delivery/inbox、独立 events 进程、PI Runner HTTP typed-result 边界。
下一步收益最大的工作是统一业务入口、修正事件顺序契约、补运行时校验和资源预算。把现有相互依赖的实现全部包装为 HTTP 服务,会保留语义耦合并引入跨进程失败窗口。
本报告针对固定源码 SHA,只读检查 Go/React、架构配置、迁移和部署定义。**未检查当前实际镜像/进程/数据库积压,未运行 Go/PG/PI/浏览器或故障注入测试。** 下文“实现存在”是源码证据;“可能造成”是风险推导;不宣称现网事故已复现,也不改变 FEATURE-MATRIX 或发布门禁。
关联:[通用规范](../system-design/2026-09-22-generic-module-contract-standard.md)、[采用规划](../remediation/2026-09-22-modular-platform-adoption-plan.md)、[任务与验证](../ops/short-term/2026-09-22-modular-contract-standard.md)。
## 分维度判断
| 维度 | 已有基础 | 当前局限 | 判断 |
|---|---|---|---|
| 模块职责 | domain/app/server 分层,组合根 | server 认识大量实现,跨包类型泄漏 | 部分解耦 |
| 业务入口 | docflow/stageflow/chatflow 用例 | 对话和 HTTP 同一动作存在旁路 | 需优先收敛 |
| 数据边界 | 表 owner 清单与 UoW | 5 项 SQL 写例外、16 项路径例外 | 明确但未闭合 |
| 事件通信 | 可靠 PG 投递与独立进程 | 顺序规则与 ADR 冲突,校验不完整 | 机制具备,语义有缺口 |
| 并发与幂等 | claim、lease、token、DB 收据 | 慢消费者共享循环,同 ID 异载荷不校验 | 部分保证 |
| 跨进程边界 | Web/server、PI Runner、events | 业务模块大多仍共享 server 进程/资源 | 不能宣称全模块故障隔离 |
| 前端功能 | API/hooks 拆分 | 根状态和 setter 跨功能共享 | 文件组织优于状态边界 |
| 工程约束 | arch-check 与契约 registry | 静态覆盖有限,不证明运行隔离 | 有工具,须明确盲区 |
不提供无权重依据的“解耦百分比”。以下发现按对数据与行为的实际影响排序,而非按文件大小排序。
---
## A1. 事件领取规则与已接受的顺序契约相冲突
**高优先级源码问题。** ADR 规定允许首个高领域版本 bootstrap,禁止把 MemoryBus 的连续版本等待搬到 PG dispatcher:`.doc/adr/2026-09-15-event-consumer-checkpoint.md:12-23`。
当前 `internal/events/dispatcher.go:39-46,75-84` 采用 `version <= checkpoint + 1`;无 checkpoint 时只接纳版本 0/1。生产者 `internal/app/docflow/commands.go:182-185` 使用 document record ID,`:211-214` 使用 candidate ID,`:162-165` 使用文档账本版本。这些不是从 1 开始连续的事件序号。
因此在“无 checkpoint、第一条版本为 42”这一明确条件下,该事件按 SQL 不能被领取。是否已有这种实际积压未查数据库,不能报成现网观测。
现有 `internal/events/pg_test.go:18-28` 固化同样 gap 规则;`dispatcher_pg_test.go:105-109` 使用 v1/v2,不能覆盖稀疏首事件。
**建议验收**:真实 PG 下测试首次 v42、v42→v47、部分事件订阅、毒消息隔离;按既有 ADR 恢复 bootstrap,或经明确新 ADR 引入独立事件序列及迁移。通用规范对应 MCS-15。
## A2. 同一批准动作存在 HTTP 与对话入口分叉
**高优先级待验证风险。** HTTP `internal/server/handlers.go:793-808` 调用 `docflow.Commands.Approve`,后者在 `internal/app/docflow/commands.go:173-188` 执行 UoW 与 EventApproved。
对话 `internal/chat/action_executor.go:68-76` 直接调用 GovernanceEngine.ApproverApprove;`internal/app/app.go:294-307` 已不再注册旧通知/批准 hook,`internal/docgov/engine.go:957-960` 的直接路径仅尝试旧 hook。
源码证明入口路径不同,存在绕过 durable workflow_advance/notify 的风险;本次未执行真实对话批准,不能把完整用户后果记为已复现。
**建议验收**:同一授权场景分别从 HTTP、对话、后台任务触发,比较授权拒绝、状态提交、事件、工作流推进与通知,所有入口汇入同一用例。通用规范对应 MCS-04。
## A3. 契约登记尚未成为完整运行时校验
`internal/events/registry.go:28-52` 登记 producer、consumer、schema、PayloadFields;`:75-91` 主要检查启用与消费者。
`internal/events/envelope.go:65-85` 检查基础字段、schema、digest/scope,但不按事件逐项校验 producer allowlist、JSON 必填/类型/额外字段。`internal/events/pg.go:32-47` 依赖此验证。`inventory.go:29-63` 也未完成 payload 结构检查。
实际 `internal/app/docflow/commands.go:279` 的 Producer 为 `docflow`,registry 示例为 `app/docflow`(`registry.go:42-46`),当前路径不会因此拒绝。消费 hydration `dispatcher.go:204-224` 与 handler 调用 `worker.go:252` 也不能证明所有入口统一重新校验。
**建议验收**:未知事件/schema、伪造 producer、缺必填、异类型、超大 payload、digest/tenant/environment 不符均有发布和消费负例。通用规范对应 MCS-08/09/18/21。
## A4. 消费者逻辑独立,但资源执行仍串行共享
`internal/events/worker.go:99-113` 逐一 RunOnce 各消费者;`:137-147` 一批先 claim 再逐个 handle。心跳直到该条 handle 才启动(`:208-234`)。
慢消费者会延迟同 worker 的其他消费者;预取队尾还可能在开始处理前耗掉 lease。增加副本能缓解吞吐,不证明消费者有独立预算和公平性。当前可隔离永久错误,不等于慢任务也隔离。
**建议验收**:阻塞一个消费者、保持另一个持续输入,后者满足自己的延迟预算;批量排队超过租期时不允许并发重复副作用。先按空闲槽 claim,并配置每消费者超时、并发、池配额;高风险任务再进程隔离。对应 MCS-14/17。
## A5. 去重与健康检查不能被扩大解释
`internal/events/pg.go:43` 对相同 event_id 使用 DO NOTHING,未比较已有 payload digest。因此“重复 ID 被忽略”并不保证“同键异载荷会冲突”。
`cmd/events/main.go:91-115` 的 health、ready、live 分别关注进程、DB/schema/注册条件、调度心跳;`worker.go:109-112` 在处理前 Touch 且忽略 RunOnce 返回错误。Compose healthcheck 使用 /health(`docker-compose.dev.yml:170-175`)。
**建议验收**:同 ID 同内容返回既有结果、不同内容冲突;依赖持续失败时最老消息年龄和分消费者失败数告警,不能依靠健康探针证明业务前进。对应 MCS-13/19/20。
---
## B1. 组合根、契约类型与实现仍相互渗透
优点:`internal/app/app.go:96` 集中装配,`internal/server/server.go:87` 接收 runtime。限制:`server.go:40-84` 持有领域具体服务、pool、上下文等,`:123-132` 还回填 Runtime 并初始化执行器。HTTP 适配器获得整个 Runtime,难以维持最小依赖。
`internal/app/stageflow/usecase.go:10-37` 是窄端口且未配置时 fail closed,但 `types.go:3-15` alias 到 bizdev 模型。`internal/app/chatflow/ports.go:75-106` 返回 ctxmgr/coordinator/projectinstance 具体类型。接口改变了调用位置,仍未彻底隐藏内部模型。
本次 server 生产 SQL 搜索未发现真实业务 SQL,**不能把持有 pool 等同于已经直接越权写表**。改造重点是缩小可用能力与未来变更影响,不虚构违规。
## B2. 单写者有登记,仍有明确例外
`.doc/system-design/module-boundaries.yaml:276-374` 登记表 owner,`:471-511` 登记 5 项 SQL 例外。
源码确认:`internal/docrevision/pg_store.go:456-477` 更新 freeform_documents/document_records;`internal/docduty/store.go:144`、`revoke.go:154` 修改 document_records;`internal/projectinstance/store.go:920` 更新 task_runs。
建议通过 owner repository/用例端口逐项归还写权,保留必需事务边界。不得为了删除一个 import,把同一 SQL 移到万能公共 repository。
## B3. 共享事务值得保留,不能随意替换为网络调用
`internal/app/docflow/commands.go:88-112` 使用 UoW 与 owner GetForUpdate;`internal/docrevision/pg_store.go:482-491` 加入同一事务;`internal/app/uow/pg_uow.go:52-80,95-124` 提供有界事务重试、锁等待和提交。
`internal/app/app.go:269-275` 接入 events.PGSink,`internal/events/pg.go:17-58` 拒绝无 UoW 发布并同事务创建 envelope/delivery。这是实质强一致性能力。若以后拆进程,必须重新定义跨域中间态、补偿和对账,不能用分布式锁替代事务。
## B4. 文件与前端状态也构成模块间隐式协议
文件证据:`internal/coordinator/context.go:456-459` 读取 output.md;`engine.go:691-701,895,1051` 读写/拼接共享产物路径;`internal/docgov/lease.go:415-416` 写 projection 文件。文件 owner、不可变引用、版本与发布原子性应与数据库同样治理。
前端证据:`web/src/App.tsx:130-170,1163-1204,1367-1406` 将消息、交付物、缓存及 setter 传给多个功能 hooks;`useSendMessage.ts:85-121` 可修改多个域状态。建议 owner 管理状态、对外命令/查询/事件;浏览器内无需强制 HTTP。
`web/src/api/authHeaders.ts:27-44` 已有认证辅助,但 chatStream、taskRuns、docgov 等仍各自 fetch。统一 client 应处理通用超时、错误、取消与身份,功能 DTO 继续分域。
## B5. 静态架构检查有价值,但证明范围有限
`internal/archtest/scan.go:38-70` 默认只扫 internal 生产 Go;`:169-205` 检查 import allowlist 和登记表的 SQL 字符串。它不涵盖前端、默认 cmd 范围、动态 SQL 完整语义、实际权限、兼容性和资源隔离。
`scan.go:18,392-410` 的事件匹配范围主要为 document.* / intent.plan.* 和特定调用模式,不能根据 YAML 中存在 taskrun/fav 就假定每条协议都被检查。
`module-boundaries.yaml:182-225` 仍允许 server 依赖大量领域;`:641-651` 登记 sql_write=5、path=16 基线。**这是读取到的配置,不是本次 arch-check 执行结果。**
---
## 可保留的隔离与演进能力
- 独立 worker:`cmd/events/main.go:68-89,127-130` 注册 notify/advance/projection,FAV 明确不注册;Compose 已有 events 服务。历史“没有独立 worker”的判断已过时。
- 领取与确认:`dispatcher.go:49-97,163-200,227-259` 有原子 claim、owner/token、attempt、inbox/checkpoint;旧 ClaimIDs 已禁用。
- DB 效果原子性:`worker.go:247-275` 的 handler、fenced ack、commit 同事务;仅适用于参与同一 DB 事务的效果,不能扩展为任意外部 IO。
- 消费者实现:`internal/app/docproject/consumer.go:73-94` 使用事件回执与 no-replace;`docadvance/consumer.go:80-104` 使用同事务推进与通知。
- 冻结执行输入:`internal/workflow/runtime/orchestrator.go:27-41,69-85` 从冻结实例取职责,缺失时拒绝,可泛化为任务绑定配置/契约版本。
- PI Runner:`internal/agent/piagent.go:145-194` 有 HTTP/Bearer、超时、run_id、typed result 和大小限制;`remote_result.go:63-79` 对存在但非法 typed 字段 fail closed。
## 测试证据边界
以下是已有测试定义,不是本次 PASS:
| 路径 | 已有测试意图 | 本次状态 |
|---|---|---|
| internal/app/docflow/same_tx_pg_test.go | 状态与 outbox 同事务回滚 | 未运行 |
| internal/events/dispatcher_pg_test.go | 多 worker、off/shadow、ack、隔离 | 未运行 |
| internal/app/docnotify/e1a_pg_test.go | 通知权限、shadow/live、回滚 | 未运行 |
| internal/app/docadvance/e1b_pg_test.go | 工作流事件消费 | 未运行 |
| internal/app/docproject/e1c_pg_test.go | 投影与 no-replace | 未运行 |
| internal/agent/piagent_typed_e2e_test.go | 条件启用的真实 PI | 未运行 |
PG 测试在 short 或缺少独立 DSN 时可跳过;PI 测试有显式开启条件。建议新增 A1–A5 的针对性场景,再做受影响用户入口验收。未经授权,本次不启动这些实现或共享环境测试。
## 与原方案的关系
继续引用 2026-09-20 A–G 分批整改作为现有依赖收敛清单,不能据此宣称原批次已经完成。A1–A5 是本次新增或细化的源码证据,实施时应并入同一治理链,避免开第二套互相冲突的解耦项目。
原规范保留模块化单体,本次通用规范允许按条件选择进程/服务隔离。两者分别用于“当前项目生效规则”和“未来项目待采纳标准”,没有自动覆盖关系。
@@ -0,0 +1,27 @@
# 历史问题补录:可选职责与正文哈希
补录日期:2026-09-23;owner:Codex;登记任务:[issue-learning-2026-09-23](../ops/short-term/2026-09-23-issue-learning.md)。这是两个问题的登记主记录,原审计、修复任务及验收报告继续作为事实证据;没有重新运行产品测试或读取业务数据。`evidence_basis=historical`,当前运行状态未复测,源码复核基线为 `2fdb6e548e3784771f27e6a9e79b9c364f76c566`。
## nullable-duty
- issue_id:`ISSUE-20260923-nullable-duty`;issue_state:`resolved`;severity:high;recurrence_count:0(指登记后重开次数,非历史发生总数)。
- 发现/修复日期:2026-09-17;原处理 owner:Cursor;补录 owner:Codex;原任务:`fix/docgov-optional-duty-null-fk`。
- 现象与已证实根因:[原审计](2026-09-17-docgov-optional-duty-null-fk.md)。可选 reviewer 缺席合法返回 0,但创建路径直接写入可空 FK;heal 路径已有空值映射,创建路径漏改。底层 FK 又被错误分型掩盖。
- 同类范围:可选职责的创建/heal 写入边界。历史报告验证 reviewer/approver 为 NULL;不能由此推断所有 FK、全职责模式和全部授权边界均已验证。
- 修复思路:保留可选职责语义,在 SQL 边界将缺席值映射 NULL,并改善错误分型;通过强制配置 reviewer 绕过错误会改变业务契约。未发现其他尝试的实测记录,不虚构失败实验。
- 修复经过/提交:[原任务](../archive/ops/2026-09-17-docgov-optional-duty-null-fk.md),历史合并 `e488d10`;本次只核对原文记录,不把短 SHA 当当前制品身份。
- 验证与关闭范围:[原报告](../test-reports/2026-09-17-docgov-optional-duty-null-fk-test-report.md) 记录单测、PG 集成、真实任务 API 启动与 DB NULL;证明账本创建通过,不证明真实 UI 或 PI 全流程完成。历史 deployment=passed(dev,来源为原报告),当前运行未复测。
- 本次复核:当前源码 `internal/docgov/engine.go` 创建路径仍调用 `nullIfZero`;这是源码检查,未重跑 PG。
- 经验:[LESSON-20260923-nullable-duty](../ops/lessons/2026-09-23-nullable-duty.md)。后续触发:职责模型或任一持久化入口变化时复核,异常复发重开。独立的 flushSync 警告不在本条关闭范围。
## content-hash
- issue_id:`ISSUE-20260923-content-hash`;issue_state:`resolved`;severity:critical;recurrence_count:0(登记后)。
- 发现/修复日期:2026-09-14;原处理:Cursor 修复、Antigravity UI 验收;补录 owner:Codex。
- 现象与因果链:[原审计](2026-09-14-project143-controlled-content-404.md)。文件存在却被报 404;规范化去掉有硬换行语义的双空格,bootstrap 只改账本哈希未同步文件;并发 hydration 与无效轮询更新放大故障。
- 同类范围:旧文档 bootstrap、规范化、账本/文件投影、错误映射与刷新竞态。历史扫描范围见原审计,不扩大为所有数据无问题。
- 修复思路/选择:[整改方案](../remediation/2026-09-14-controlled-content-canonical-hash-remediation.md)。保持文本语义、原子投影和结构化错误;历史原文件与旧 head 先保全再显式 migration_repair。静默覆盖原文件会丢失语义,不能用于“对齐哈希”。这不是本轮数据操作授权。
- 修复经过:[原审计关闭结果](2026-09-14-project143-controlled-content-404.md#关闭结果) 与 [最终报告](../test-reports/2026-09-14-controlled-content-ui-acceptance.md);后续水合/缓存修复合入 `d0e8f60`、`36e4bc3`。报告保留早期失败及无效运行,只有 clean-run3 / full-chain-final 属最终有效证据。
- 验证与关闭范围:原报告记录旧项目真实页面、全链路主阶段和重启恢复 PASS;历史 deployment=passed(dev)。不据此宣告当前 production_ready 或当前制品无回归。
- 本次复核:`internal/docrevision/canonicalize.go` 已委托 doccontent;`canonicalize_golden_test.go` 包含硬换行和封装一致性测试。本次未执行这些测试。
- 经验:[LESSON-20260923-content-hash](../ops/lessons/2026-09-23-content-hash.md)。后续触发:canonicalizer、bootstrap、投影或水合修改时复核;复发追加时间线并重开。
@@ -0,0 +1,55 @@
---
issue_id: ISSUE-20260923-matrix-status-regression
issue_state: resolved
severity: high
owner: Cursor
task_ids: [module-batches-ag-status-fix-2026-09-23]
created: 2026-09-23
occurred_at: 2026-09-23
updated: 2026-09-23
recurrence_count: 0
evidence_basis: current
lesson_ids: [LESSON-20260923-matrix-status-cas]
---
# FEATURE-MATRIX 状态字段被合并冲突回退
按 [闭环规范](../ops/2026-09-23-issue-learning-workflow.md) 维护。关联任务:[module-batches-ag-status-fix](../ops/short-term/2026-09-23-module-batches-ag-status-fix.md)。
## 事实与证据
- **预期**:`module-batches-ag` 在 A–G 合入且 arch-check 全 0 后保持 `done`(提交 `77bdbdbc` 已写入)。
- **实际**:本地 `dev` tip 上该行状态为 `planned`,剩余工作栏仍写「关闭本伞行」与 A–G 已合入事实矛盾;用户观感为「多次要求实现但未实现」。
- **触发**:含 FEATURE-MATRIX 的 closeout / sync 合并冲突手解,取了无 `record_id` 或旧侧行内容。
- **影响**:后续会话按 `planned` 错误前提规划,可能重复实施或延误收口;不构成发布 blocker(发布关系仍为 `non_blocker`)。
- **环境**:本机 `dev` @ `18b9556f`(任务基线);修复提交见本任务 feature 分支。
- **复现(修复前)**:`git show 77bdbdbc:.doc/status/FEATURE-MATRIX.md` 该行 status=`done`;修复前 tip 同行为 `planned`。
## 根因与同类范围
- **已证实**:共享文档在 `docs apply` 行级 CAS / `record_id` 稳定键启用前窗口内,merge 冲突对手解无机器核验状态字段;手解取旧侧覆盖 `done`。
- **已排除**:A–G 代码未合入(合入 merge commits 与 arch-check PASS 否定)。
- **共用机制**:CURRENT / FEATURE-MATRIX 等协调 SSOT;任何绕过 `docs apply` 的整表手改或冲突取旧侧。
- **同类入口**:其他矩阵行、CURRENT 认领行在无 CAS 收据时同样脆弱;本轮只修 `module-batches-ag`,不扩大扫全表 unless 另授权。
## 修复思路与过程
| 日期 | 假设 / 尝试 / 动作 | 实际结果与证据 | 决策 / 下一步 / owner |
|---|---|---|---|
| 2026-09-23 | 只读考古 git + arch-check | A–G 已落地;状态回退成立 | 按计划修正登记,不重做代码 / Cursor |
| 2026-09-23 | docs apply 行级 CAS 恢复 `done` + 登记 lesson | MATRIX 行 status=`done`;header 同步;arch-check PASS | resolved;合入 local_dev / Cursor |
方案:恢复矩阵事实状态;登记问题与经验;强制后续矩阵变更走 `docs apply`;合入含 MATRIX 的合并后机器核对目标 `record_id` 状态列。
## 验收与关闭
- 原例:PASS — MATRIX `module-batches-ag` status=`done`(docs apply 收据 + commit `b9d09c97`)。
- 同类:本任务不批量改其他行;风险已记入 lesson。
- 正常:PASS — `docs apply` 无拒绝;`./scripts/arch-check.sh --mode block` PASS(worktree tip)。
- deployment:`not_required`(纯文档)。
- resolved:2026-09-23;范围=状态登记与台账,不含 Server 镜像字段增量。
## 经验与复发
- lesson:[LESSON-20260923-matrix-status-cas](../ops/lessons/2026-09-23-matrix-status-cas.md)
- 防护:能力完成升 `done` 已有 `docs:approve` + evidence `cat-file` 门禁;复发时重开本 issue 并检查是否绕过 apply。
@@ -0,0 +1,297 @@
---
title: "系统整改与重构方案 — 前两阶段及取消状态契约审核检查清单"
status: done
created: 2026-09-23
updated: 2026-09-23
severity: high
task_id: modular-refactor-review-2026-09-23
---
# 系统整改与重构方案 — 前两阶段及取消状态契约审核检查清单
## 1. 目的与范围
本清单供**产物机器**上的方案执行者,对照自查《系统整改与重构方案》中**阶段 1、阶段 2、取消状态契约**是否可审、可测、可回退。
| 项 | 值 |
|---|---|
| 目标方案(产物机器,本机不可见) | `.doc/remediation/2026-09-22-agent-system-modular-refactor-plan.md` |
| 目标 worktree(产物机器) | `.worktrees/modular-contract-standard-2026-09-22` |
| 本机清单基线 | local `dev@8f0e31e53a5f8d0dd25a908ba6d127a5bb6768a4` |
| 本轮授权 | **仅编制清单并合入本机 dev**;不实施业务代码;不审核方案正文(本机无正文);不 push |
| 自查结果枚举 | `符合` / `偏差` / `阻断` |
**非目标**:阶段 3–6 全量逐条(除非阶段 1/2 或取消契约依赖它们);业务实施;改 YAML 例外;FAV live / `production_ready` / test·main 晋升。
## 2. 「22 条规范」映射回填(本机未定位权威编号表)
本机可见权威材料中**没有**名为「22 条规范」的独立编号清单。邻近可对账来源:
| 候选来源 | 本机状态 | 与「22」的距离 |
|---|---|---|
| [模块开发规范](../system-design/2026-09-20-module-development-standards.md) §2–§4(端口规则表、事件契约、故障隔离红线 1–7、checklist) | active | 条目合计接近但**未编号为 1–22** |
| [耦合审计](./2026-09-20-module-coupling-audit.md) + [A–G 分批计划](../remediation/2026-09-20-module-decoupling-batch-plan.md) | A–G 能力行已 `done` | 21 条 YAML `exceptions` + 边界规则,**非**「22 条规范」正文 |
| 产物机器新方案(2026-09-22) | 本机不可见 | **应以方案正文为准** |
产物机器回填表(填完后本清单才可宣称「22 条已闭环对账」):
| 规范编号 | 方案章节/工作包 ID | 本机对账锚点(规范/A–G/代码路径) | 阶段归属 | 自查 |
|---|---|---|---|---|
| N01 | _待填_ | _待填_ | 1 / 2 / cancel / 其他 | |
| N02 | _待填_ | _待填_ | | |
| … | | | | |
| N22 | _待填_ | _待填_ | | |
若方案「22 条」≠ 上表候选来源,在回填表首行注明**权威出处路径 + SHA**,禁止用 A–G `done` 冒充新方案已验收。
## 3. 判定规则
| 判定 | 条件 |
|---|---|
| 符合 | 方案条目写明代码位置、依赖、责任范围、测试场景、回退条件;与本机锚点无冲突;测试可复现 |
| 偏差 | 可合入意图成立,但路径过时、依赖遗漏、测试偏弱或回退含糊;实施前须修订方案 |
| 阻断 | 与生效规范/[验证契约](../ops/2026-09-21-validation-contract.md)/表写者/事件至少一次语义冲突;或回退会丢数据/假 PASS |
每条核对项须留下:方案段落锚点、对照 SHA、结论、证据路径(可为本机相对路径或产物机器截图哈希)。
---
## 4. 阶段 1 — 契约、模块职责、验证基线
### R1.1 三种通信契约完整且无第四种
| 字段 | 内容 |
|---|---|
| 规范来源 | 模块开发规范 §2.1–§2.3;ADR 模块化单体 |
| 应核对代码/文档 | `internal/app/*/ports.go`;`internal/events/registry.go` `StaticContracts()`;`internal/server` wire DTO;方案工作包是否禁止 gRPC/全局 bus/跨包未导出 helper |
| 依赖与责任 | 消费者定义端口;组合根(`internal/app`、`cmd/*`)注入;server 不持领域 SQL |
| 测试场景 | 新增端口无 JSON/`pgx`/物理路径;事件改动跑 registry↔YAML parity;HTTP 错误信封 `code/message/request_id` |
| 回退核对 | 契约变更可单批 revert;不留下「半套第四种通信」 |
| 自查 | |
### R1.2 表唯一写者与解包事务名单
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §4 红线 1–2;`module-boundaries.yaml` `table_owners` |
| 应核对代码 | YAML `table_owners` / `tx_unpackers`;工作包是否把跨表原子性放在用例 UnitOfWork,而非各模块自开事务 |
| 依赖与责任 | 非属主不得 `INSERT/UPDATE/DELETE`;server/chat 不得解包 `pgx.Tx`(除非已登记例外且有到期日) |
| 测试场景 | `./scripts/arch-check.sh --mode block`;针对新增写路径的属主负例 |
| 回退核对 | 回退代码与恢复/删除 exception **成对**,避免门禁与代码错位 |
| 自查 | |
### R1.3 事件信封与至少一次投递 + 幂等
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §2.2、§3.2 |
| 应核对代码 | `internal/events/registry.go`;`ClaimLeases` / outbox 同 UoW;消费者 inbox/`source_event_id`(例:`internal/notification/service.go` `EmitVisible*`) |
| 依赖与责任 | 生产路径为 PG outbox + `cmd/events`;`MemoryBus` 仅特征测试 |
| 测试场景 | 重复投递仅一个可见副作用;缺 `environment`/`project_id` fail closed;永久失败进 dead/quarantine 不堵其他订阅者 |
| 回退核对 | 不回退到 SELECT-only claim(`ClaimIDs` 已禁用) |
| 自查 | |
### R1.4 模块职责与 A–G 残留边界
| 字段 | 内容 |
|---|---|
| 规范来源 | [A–G 分批计划](../remediation/2026-09-20-module-decoupling-batch-plan.md);FEATURE-MATRIX「模块解耦批次 A–G」=`done` |
| 应核对 | 新方案 17 工作包是否**重复**已合入的 A–G,或明确「在 A–G 之上增量」;互斥 mutex 是否与已关闭批次冲突 |
| 依赖与责任 | 新工作包不得把 FAV live / RPC / `production_ready` 回退写进完成定义 |
| 测试场景 | 声明的依赖边在合入后可用 `go list` / arch-check 证明消失或未回潮 |
| 回退核对 | 单工作包 revert;不整支回滚无关批次 |
| 自查 | |
### R1.5 验证基线与门禁衔接
| 字段 | 内容 |
|---|---|
| 规范来源 | [验证契约](../ops/2026-09-21-validation-contract.md);规范 §7 |
| 应核对 | 方案阶段 1「验证基线」是否映射到:`arch-check --mode block`、`go vet ./...`、`go test -short ./...`;前端相关则 `npm test` / `npm run build`;纯文档不要求 PI |
| 依赖与责任 | stub/SKIP 不得作交付 PASS;共享环境测试须持锁 |
| 测试场景 | 方案每个工作包的「测试场景」列能落到精确包路径或 `-run` 名 |
| 回退核对 | 失败时保留候选证据,不伪造 PASS |
| 自查 | |
### R1.6 稳定词汇与跨包错误
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §3.3;批次 C |
| 应核对 | `internal/contracts/vocabulary`;方案是否禁止新增 `docgov.State*` / `Role*` / `Err*` 跨包引用 |
| 依赖与责任 | 带哈希/路径的函数留在属主模块(如 `doccontent`) |
| 测试场景 | 热点引用改为端口或词汇后,原状态机测试仍绿;HTTP code 不变 |
| 回退核对 | 单批 revert |
| 自查 | |
---
## 5. 阶段 2 — 通知事务、事件领取、授权、业务入口一致性
### R2.1 通知与领域提交同事务
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §2.2「副作用与 receipt 能进同一数据库事务的必须同事务」;§4 红线 4(持锁不做外部 IO) |
| 应核对代码 | `internal/notification/service.go` / `document_events.go`(`EmitVisible*` 要求 caller fenced tx);`internal/app/docadvance/consumer.go`;dispatcher `handle` 在 lease tx 内调用 handler |
| 依赖与责任 | notify 消费者不在持锁路径调 LLM/HTTP/SSE;可见通知以 `source_event_id` / dedupe 幂等 |
| 测试场景 | 提交失败无可见通知;重复 `source_event_id` 成功且不双写;`HashVisibleNotifications` 类对账 |
| 回退核对 | 回退后不得留下「已提交领域、无通知」或相反的半状态;优先前滚修复 |
| 自查 | |
### R2.2 事件领取:lease、续租、抢占
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §2.2;Phase 2 事件计划(投递/lease 语义) |
| 应核对代码 | `internal/events/dispatcher.go` `ClaimLeases` / `HeartbeatLease`;`internal/events/worker.go`;`cmd/events` |
| 依赖与责任 | 生产禁止 `ClaimIDs`;quarantine/expire 不可被再次 claim;多 worker 互斥由 `FOR UPDATE SKIP LOCKED` 语义保证 |
| 测试场景 | `dispatcher_pg_test`:双 worker 仅一人领到;quarantine 不可领;续租失败不再处理 |
| 回退核对 | 不恢复已禁用的 SELECT-only claim;lease 时长变更有观察窗 |
| 自查 | |
### R2.3 授权检查收敛点
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §2.1「Principal 只来自已认证会话」;§2.3 授权拒绝不泄露存在性;多意图设计「卡片/SSE 不能替代授权」 |
| 应核对代码 | `internal/authz`;`internal/server/*_handlers.go`(task/intent/freeform 等)在 Flush/副作用前鉴权;`events.AuthorizePrincipal` 于消费者路径 |
| 依赖与责任 | 请求体不得覆盖 UserID/ProjectID;消费者授权失败 → quarantine,非无限重试 |
| 测试场景 | 跨用户 IDOR 负例 403;SSE 鉴权在 Flush 前(对照 gap `AUTH-TASK-SSE`);重复提交不绕过 |
| 回退核对 | 回退不得重新打开已关闭 IDOR;测试与代码同批 |
| 自查 | |
### R2.4 业务入口一致性(HTTP / 对话 / SSE / 事件投影)
| 字段 | 内容 |
|---|---|
| 规范来源 | 规范 §2.3;多意图权威性排序:认证主体与资源 → 授权/不变量 → PG → 卡片投影 → SSE |
| 应核对代码 | 同一命令是否只经一个用例入口;chat action 与 REST 是否共用端口;投影/SSE 是否只读权威状态 |
| 依赖与责任 | GET 不修投影(红线 6);修复为独立命令并写审计 |
| 测试场景 | 双入口同输入同权威结果;刷新后以 GET 覆盖本地缓存;投影丢失仍能经 active discovery 找回 |
| 回退核对 | 入口合并失败时可切回旧入口且状态不分裂 |
| 自查 | |
### R2.5 与阶段 1 基线的衔接(方案自述三处衔接问题)
| 字段 | 内容 |
|---|---|
| 规范来源 | 用户汇报:审阅发现的三处衔接问题已修正 |
| 应核对 | 方案正文是否显式列出三处问题的**原描述、修正段落、回归检查**;是否仍依赖未合入的阶段 3+ 契约 |
| 依赖与责任 | 修正不得静默改验证契约或放宽 arch-check |
| 测试场景 | 针对三处各有一条可执行核对(文档锚点或测试名) |
| 回退核对 | 修正可独立 revert 而不拆阶段 1 |
| 自查 | |
---
## 6. 取消状态契约 — Runner 取消、未知结果、SSE 恢复
> 用户建议优先审核。本机可见实现重心:`internal/taskrun`(`Cancel`/`StatusCancelled`/`taskrun.cancelled` 事件)、`internal/server/task_run_handlers.go`(Cancel + SSE `after_seq`)、`internal/agent/piagent.go`、多意图计划中的 cancel 转移。
### R3.1 取消状态机覆盖全转移
| 字段 | 内容 |
|---|---|
| 规范来源 | 方案「取消状态契约」;多意图步骤状态含 `cancelled`;`taskrun.cancelled` 事件登记 |
| 应核对 | 状态集合是否覆盖:`cancel_requested` →(执行中)→ `cancelled` / `unknown`(或方案等价命名);禁止从终态回退到 running |
| 代码锚点 | `internal/taskrun/finalize.go`(`Commands.Cancel`、`StatusCancelled`、事件名);`manager.go` `Cancel`;意图计划状态机(若工作包触及) |
| 依赖与责任 | 取消与 finalize 竞态仅一个终态(见 `TestPG_FinalizeCancelRaceOneTerminal` / `TestCommands_CancelWinsOverFinalizeMemory`) |
| 测试场景 | 用户取消、租约过期视同取消、Runner 已结束后的迟到取消、双端并发 cancel/finalize |
| 回退核对 | 回退不得出现双终态或「已取消仍计费/仍写产物」 |
| 自查 | |
### R3.2 未知结果:幂等重试与人工裁定
| 字段 | 内容 |
|---|---|
| 规范来源 | 操作规范/AGENTS:Docker/网络超时先区分未知与未执行;管理器不自动撤销外部副作用 |
| 应核对 | 方案是否定义 `unknown`(或等价)的进入条件、可见对外语义、幂等重试键、人工裁定 API/运维入口、超时升级 |
| 代码锚点 | taskrun 结果应用路径;PI Runner 客户端(`internal/agent/piagent.go`);方案工作包列出的裁定命令 |
| 依赖与责任 | 未知不得冒充 `succeeded`/`cancelled`;重试必须带 fencing/idempotency,避免双执行 |
| 测试场景 | Runner 超时无响应 → unknown;重试仅一次可见副作用;裁定后 SSE/GET 一致 |
| 回退核对 | 清除 unknown 标记不得删除审计;禁止自动 Down/删库「恢复」 |
| 自查 | |
### R3.3 执行租约、fencing 与取消的交互
| 字段 | 内容 |
|---|---|
| 规范来源 | 多意图设计:短 lease + owner + lease_until + fencing;续租失败不再领步骤 |
| 应核对 | 取消是否使 lease 立即失效;旧 fencing token 的迟到心跳/完成是否被拒绝 |
| 代码锚点 | `internal/taskrun` store/lease;workspace lease 相关迁移与调用 |
| 依赖与责任 | 持 lock 期间取消不调用外部 IO;取消收据与 outbox 同事务(若发 `taskrun.cancelled`) |
| 测试场景 | 取消后旧 worker 心跳失败;fencing 错则拒绝 finalize |
| 回退核对 | 放宽 fencing 视为阻断,不得以「兼容」绕过 |
| 自查 | |
### R3.4 SSE 恢复后与权威状态一致
| 字段 | 内容 |
|---|---|
| 规范来源 | 系统健康整改 Wave0(`after_seq`、心跳、Flush 前鉴权);多意图「SSE 允许重复/乱序/丢失,缺口 GET 对账」 |
| 应核对代码 | `internal/server/task_run_handlers.go`(`after_seq`、`extendSSEWriteDeadline`、Cancel handler);`web/src/api/taskStream.ts`;聊天 SSE 同等语义 |
| 依赖与责任 | SSE 非权威;取消/unknown 以 PG/GET 为准覆盖本地 |
| 测试场景 | 断线重连不重复创建运行;取消过程中重连看到终态;WriteTimeout 后同 turn 不误 409(对照 `DOCREV-SSE-IDEM-BUSY` 经验) |
| 回退核对 | 去掉 `after_seq` 视为回归阻断 |
| 自查 | |
### R3.5 Runner 取消传播
| 字段 | 内容 |
|---|---|
| 规范来源 | 方案阶段 2/3 交界:Runner 取消与未知结果 |
| 应核对 | HTTP/对话取消 → taskrun → PI Runner 取消信号是否端到端定义;Runner 已完成后的取消应答 |
| 代码锚点 | `Manager.Cancel`;server cancel 路由;PI 客户端 cancel |
| 依赖与责任 | 取消失败进入 unknown 而非假 cancelled(若方案如此定义则测试锁定) |
| 测试场景 | Runner 可取消;Runner 无响应 → unknown;已终态 cancel 幂等成功 |
| 回退核对 | 回退保留「至少不双执行」不变量 |
| 自查 | |
---
## 7. 工作包级抽查模板(阶段 1/2 + 取消相关包)
对方案中每个相关工作包复制下表(ID 以方案为准):
| 工作包 ID | 阶段 | 规范 Nxx | 代码位置(方案 vs 本机) | 依赖 | 责任范围 | 测试场景可执行? | 回退可操作? | 判定 |
|---|---|---|---|---|---|---|---|---|
| WP-? | 1 | | | | | 是/否 | 是/否 | |
| WP-? | 2 | | | | | | | |
| WP-? | cancel | | | | | | | |
**阻断级缺省**(出现任一条则该包不得开工实施):
1. 无精确文件/包路径,或路径在本机 `dev@8f0e31e5` 已改名且方案未更新。
2. 测试场景只有「手动看看」或依赖 stub 作交付。
3. 回退是「再想想」或要求硬重置/删库。
4. 扩大写路径/mutex 未在任务登记中重新认领。
5. 将卡片/SSE/前端缓存当作授权或权威状态。
## 8. 产物机器回填指引
1. 在产物机器打开方案 + 本清单(本清单合入本机 `dev` 后,经授权 `push` 或手动同步到产物机器)。
2. 先填 §2 的 N01–N22 映射;未填完不得宣称阶段 1 审核通过。
3. 按 §4–§6 逐条标 `符合`/`偏差`/`阻断`,证据写入方案附录或 `.doc/test-reports/`(普通文档级即可)。
4. 若有 `阻断`:只改方案文档,**不**开工对应业务代码;修正后更新方案 `updated` 与衔接说明。
5. 全部阶段 1/2 + 取消契约无 `阻断` 且偏差有修订计划后,在产物机器 CURRENT 登记「方案审核通过、待实施授权」——实施须**另开**任务与授权,不由本清单授权。
6. 本清单单列任务 `modular-refactor-review-2026-09-23`;方案合入/实施不得冒用本 task_id 扩权。
## 9. 本机环境与证据边界
| 项 | 记录 |
|---|---|
| 本机 | macOS Darwin;仓库 `/private/tmp/Agent-System` |
| 方案正文 | **不可见**(另一主机 `/home/weichen/projects/...`;origin/frp-mix 无对应分支) |
| agentctl | 本机已可用 `with` / `docs apply` / `validate` / `integrate`(进程层);创建本任务时已 `task register` |
| 清单性质 | 审核**方法**与核对项,不是对方案正文的已审结论 |
## 10. 相关链接
- 任务记录:[../ops/short-term/2026-09-23-modular-refactor-review.md](../ops/short-term/2026-09-23-modular-refactor-review.md)
- 模块开发规范:[../system-design/2026-09-20-module-development-standards.md](../system-design/2026-09-20-module-development-standards.md)
- A–G 分批:[../remediation/2026-09-20-module-decoupling-batch-plan.md](../remediation/2026-09-20-module-decoupling-batch-plan.md)
- 耦合审计:[./2026-09-20-module-coupling-audit.md](./2026-09-20-module-coupling-audit.md)
- 验证契约:[../ops/2026-09-21-validation-contract.md](../ops/2026-09-21-validation-contract.md)
- gap-matrix:[../remediation/gap-matrix.md](../remediation/gap-matrix.md)
- 操作规范:[../ops/2026-09-21-agent-worktree-workflow.md](../ops/2026-09-21-agent-worktree-workflow.md)
@@ -0,0 +1,67 @@
# 管理员重置密码 / 登录凭据缺陷 — 问题主记录
更新:2026-09-24。任务:`admin-password-reset-2026-09-24`。
## ISSUE-20260924-admin-reset-dead
### 问题
管理台「重置密码」按钮调用 `authClient.adminResetPassword`,客户端硬 `throw`,后端无 `reset-password` 路由;UI 仍硬编码 `ResetPass123` 暗示成功。验收脚本曾重置 `chenwei` 哈希且不披露口令后,管理员无法通过 UI 恢复访问。
### 根因
T20-F4 已设计未实施(选项 B 卡产品)。`password_changed_at` 停在 2026-09-20 证明重置从未入库。
### 修复
`POST /api/v1/admin/users/{id}/reset-password`:服务端随机临时口令、`must_change_password=true`、撤销会话、审计表 `user_password_reset_audits`(goose 00067);前端接线并去掉硬编码。
### 状态
resolved(本任务合入后)。
---
## ISSUE-20260924-login-error-envelope
### 问题
登录失败响应 `code=AUTHZ` / `message=无权访问`,前端再把整段 JSON 原文塞进 `Error.message`,用户误判为权限问题。
### 根因
`httpx.CodeFromStatus(401)=AUTHZ` + `SafeMessage`;`auth.ts` login 未用信封解析、未优先 `error` 领域字段。
### 修复
`authErrorMessage` 优先取信封 `error`;不改全局 AUTHZ 映射(事件复用与安全取舍另立专项)。
### 状态
resolved。
---
## ISSUE-20260924-zombie-credentials
### 问题
`CreateUser` 在 `PasswordHash==""` 时静默跳过 `user_credentials` 插入;`LEFT JOIN` + `COALESCE` 使登录哈希为空串,任意密码均失败且报错与真凭据错误相同。
### 盘点(只读,2026-09-24)
| 环境 | total | missing_cred | empty_username |
|---|---|---|---|
| dev | 416 | 263 | 255 |
| test | 9 | 0 | 0 |
| main | 4 | 3 | 0 |
main 三行为 goose 00011 seed(`seed-admin` 等),非业务用户。本任务**不清理**存量;仅 fail-closed 防新增。
### 修复
PgStore/MemoryStore `CreateUser` 拒绝空哈希;`Login` 对空哈希记 `slog.Warn(user_id)` 仍统一 401。
### 状态
resolved(机制);存量清理 = open / 另授权。
@@ -0,0 +1,49 @@
---
issue_id: ISSUE-20260924-cursor-hook-event-contract
issue_state: open
severity: medium
owner: Cursor
task_ids: [cursor-governance-hooks-2026-09-24]
created: 2026-09-24
occurred_at: 2026-09-24
updated: 2026-09-24
recurrence_count: 0
evidence_basis: current
lesson_ids: [LESSON-20260924-cursor-hook-advisory-gates]
---
# Cursor hook 事件字段契约未文档化
## 事实与证据
预期:`beforeMCPExecution` / `sessionStart` / `stop` 的 stdin 字段名与 matcher 匹配串在官方文档中明确,便于 failClosed 硬门禁。
实际:官方 create-hook skill 仅明确 `beforeShellExecution` 的 `command` 字段;`beforeMCPExecution` 不支持 `updated_input`;`sessionStart` 无文档化返回字段可注入上下文;`MCP: ...` matcher 形式只写给 `preToolUse` 族。实现层字符串探测存在 `mcp_server_name`/`tool_name`/`tool_input`,但非文档契约。
证据:本任务调研记录;单元测试用多名容错驱动;真实 Cursor IDE 事件采样待 `CURSOR_HOOKS_PROBE=1`。
## 根因与同类范围
客户端 hook API 文档滞后于实现。同类:任何依赖未文档化 hook 输入的 failClosed 门禁都有假阴性/假阳性风险。
## 修复思路与过程
| 日期 | 动作 | 结果 | 下一步 |
|---|---|---|---|
| 2026-09-24 | 落地 advisory hooks + 多名容错 + probe 开关;异形 fail-open | 单元回归 PASS | 用户触发真实 MCP/shell 事件采样后收紧 |
## 验收与关闭
- 静态/单元:已覆盖(见测试报告)
- 实机:打开 `CURSOR_HOOKS_PROBE=1`,触发一次 `pi_subagent_roles` 与一次 shell,归档 `.cursor/hook-probe.jsonl` 片段到测试报告 assets;确认字段名后可将 matcher/`failClosed` 收紧并将本 issue → verifying/resolved
## 经验与复发
见 [LESSON-20260924-cursor-hook-advisory-gates](../ops/lessons/2026-09-24-cursor-hook-advisory-gates.md)。
## 2026-09-24 IDE 采样更新
- `postToolUse` 审计:`tool_name` / 审计字段为 `MCP:pi_subagent_roles`(带 `MCP:` 前缀)。
- 修复:`_lib.normalize_tool_name` 剥前缀;回归 `test_ask_mcp_prefixed_tool_name_bad_sha`。
- `pi_subagent_roles` IDE MCP 调用 PASS;`postToolUse` 收据 checklist 已注入。
- `beforeMCPExecution` 完整 stdin 仍缺(Cursor 进程未设 `CURSOR_HOOKS_PROBE=1`);issue 保持 verifying。
- `agentctl`/`jev` 未出现在 IDE MCP 缓存目录;进程可手动 stdio 启动;与路径修复独立,另记。
@@ -0,0 +1,37 @@
# ISSUE-20260924-non-author-400-duty
## 摘要
非编制项目成员无法上传/总结/对话写草稿;权限错误经 `writeDocGovError` 默认落成 HTTP **400**。
## 根因
1. `domainHTTPStatus` 未映射 `ErrOnlyAuthorCanEdit` / `ErrReviewerCannotEdit` / `ErrApproverCannotEdit` → 403。
2. `classifyAccess` / `AllowedTaskKeys` / `CanEditDocumentContent` 将 run/edit 绑编制职责(三道门协同过宽)。
3. 前端写意图路由偶发把「总结+写动词」送入 task run。
## 处置(deny_only_submit)
- run/edit → 项目成员级;submit/review/approve 保留职责门禁。
- AuthorID 仍归编制职责人(`docduty.Resolve` 不变)。
- 人工编辑传 `ActorIsMember`,不复用 `RoleSystem`。
## 验证
见 [测试报告](../test-reports/2026-09-24-non-author-member-access-test-report.md);真实 PI PASS。
## 状态
resolved(2026-09-24)
## 五态收口(2026-09-24)
| 字段 | 值 |
|---|---|
| review_state | accepted(真实 PI `TestNonAuthorMember_PiAgent_RunEditSubmitGates` PASS;工程门禁 PASS) |
| integration_state | merged_local_dev(`dev@e98e2d71`;feature tip `8b2621a4` 为祖先) |
| deployment | not_required(本轮未要求加载 launchd 业务制品) |
| cleanup | pending(`.worktrees/non-author-member-access-2026-09-24` 与 integrate 现场待独立维护者复查后清理;禁止 `--force`) |
| remote_sync | pushed(`origin/dev` = `e98e2d71`,`./scripts/git-push-dev.sh dev` 已成功) |
相关 agentctl 任务:`non-author-member-access-2026-09-24`、`non-author-member-access-docs-2026-09-24`、`integrate-non-author-docs-2026-09-24` 均为 `done`。
@@ -0,0 +1,45 @@
# PI Subagent 执行器初版边界审查
task_id:subagent-workflow-standard-2026-09-24;issue_id:ISSUE-20260924-pi-executor-boundaries。
owner:Cursor(修复)/ Codex(复核);issue_state:resolved;severity:high。
本记录针对尚未发布的执行器初版,不表示 dev 或产品 Runner 存在这些实现。
## 事实与机制
1. 独立验证发现 PI 内置工具的路径规范化与扩展守卫不一致。安装版本 0.85.1 的 tools/path-utils.js 中 resolveToCwd 使用 stripAtPrefix 并展开 home;初版守卫使用 path.resolve(root,input)。
2. 以专门创建的 /tmp/pi-guard-audit-* 临时目录及 outside.txt 假文件测试 @绝对路径,实际结果为 guard_blocked=false、actual_tool_path_escapes=true。没有读取真实密钥或业务文件。
3. 同类范围:@ 前缀、~ 前缀、相对父路径、符号链接、Unicode/读取路径规范化;MCP 的同仓/工作区验证和临时文件写入;报告幂等与损坏收据;进程树/输出上限/环境变量隔离。
4. 初版静态阅读另发现:跨仓 MCP 可能执行目标仓脚本;输出仅在 communicate 完成后截断;只回收仍存活 leader 的进程组;测试环境黑名单不足;模型报告用关键词推导 PASS。上述需要实现修复和负例,不以本行代替实测。
5. 初版测试夹具存在 eager stderr.read(),在 MCP 仍存活时阻塞。host 两次仅终止 /tmp/pi-subagent-test-* 的假 MCP 子进程以释放测试,未终止产品或用户进程。
## 复现与迭代
- 初次 RED:19 项,7 failures / 11 errors,主实现未创建;存在性/调用失败为已缺失功能,不当作实现通过。
- 初版回归:19 项,4 failures / 7 errors;耗时含夹具死锁处理。后续错误数不作为发布质量结论,待主机完整重跑。
- Cursor 首轮 supervisor 已由 host 为明确的修复交接发送 TERM,退出143;源文件保留。没有未知写副作用后盲目重派,第二轮是带具体修复清单的新执行。
- 本机 Qwen3.8-Flash、GLM-5.3-Flash 无工具短请求连通通过,实际 provider/model 与配置一致,正常 stop + agent_end/agent_settled。仅连接证据。
- GLM-5.3 对初版整包快照的只读审查 300 秒超时,无完整结论;不报审查 PASS。进程由 subprocess 超时处理结束,未授予工具,无仓库写入。
## 修复与验收要求
Cursor 修复清单已交接:统一/拒绝路径规范化;MCP 同仓注册验证和无租约写入;有界双向进程通信/整体回收;测试环境白名单;严格请求/配置与冻结 SHA;损坏收据禁止重派;报告完成与审查通过分离;最终事件完整性;禁用 PI 隐式重试;相关真实 Git/进程/MCP 回归。
关闭条件:静态发现均落实对应修复或有证据排除;原例与同类负例通过;真实 PI 调用经新执行器完成;审查与测试报告保存。修复中,不新增 validated 经验;验证后再总结。
## 2026-09-24 修复关闭
issue_state=resolved 仅针对未发布初版的约定缺陷;代码提交 69ffaa677e23a1dd9aa0528bb09b3acfcd38b119,主机完整工程回归 173 项通过,提交后专项 34 项通过;最终 Cursor CLI→MCP→PI 中 ls/read 全通过。实际覆盖、早期失败和独立 GLM 审查边界见[报告](../test-reports/2026-09-24-pi-executor-test-report.md)。
新增[经验](../ops/lessons/2026-09-24-pi-tool-boundaries.md)。本文件前面的“修复中/待验证”为初版历史,当前结论以本节为准。dev 集成/客户端 IDE 验收不由本问题关闭状态推导。
## cursor-cli-mcp-path
issue_id:ISSUE-20260924-cursor-cli-mcp-path;issue_state:deferred;severity:medium;owner:工程维护;日期:2026-09-24。
本机 Cursor CLI 2026.09.18 在项目 MCP args 中未展开 workspaceFolder 变量,原样传给 Node。pi-subagents 新入口已改工作区相对路径并实测通过。
同类只读检查:agent mcp list 也显示既有 agentctl / jev Connection failed,它们仍使用相同变量写法;codegraph ready。未进一步修改/验收这两个既有服务,也未断言 IDE 同样失败。官方支持声明与本机观测须分开。
此残差不阻塞 PI MCP(其内部直接调用主仓治理 CLI),不构成本轮产品发布结论;后续由工程维护在 Cursor CLI 升级或这两项 MCP 接入验收时检查路径/stdio 协议,形成独立修复与实际客户端证据。仅保留问题,不宣称已修复。
## cursor-cli-mcp-path 续:NDJSON 回包
2026-09-24 IDE:`pi-subagents`/`codegraph` ready;`agentctl`/`jev` 不在 MCP 缓存。
根因补充:后两者 `send()` 使用 `Content-Length` 帧,而可加载的 `pi-subagents` 使用换行分隔 JSON-RPC。已改为 NDJSON 回包并补 `"type":"stdio"`;仍接受 Content-Length 请求。单元:`scripts/tests/test_mcp_ndjson_framing.py`。IDE 重载后需再核 `list-tools`。
@@ -0,0 +1,111 @@
# Cursor Auto 与 Subagent 工作流研究及文档验证报告
日期:2026-09-24;owner:Codex;task_id:subagent-workflow-standard-2026-09-24。
范围:现行规范、Cursor 项目配置及官方文档;交付[规范草案](../ops/2026-09-24-subagent-workflow-standard.md)。未运行 Cursor 对话/真实 subagent,未修改产品或运行环境。
## 1. 研究结论
推荐主 Agent 协调、按需委派、独立审查与验证的流程。用户提出的八步可作为起点,但需在开始明确授权/验收标准,在方案阶段设计测试,在实施中自测,合并后核对实际运行结果,最后归档和清理。
| 方案 | 收益 | 代价/缺陷 | 结论 |
|---|---|---|---|
| 单 Agent 顺序完成全部阶段 | 简单、额外上下文成本低 | 实施者自审容易沿用错误假设 | 适合小型文档/研究;代码交付补独立审查 |
| 每阶段固定一个 Agent / 固定模型 | 阶段职责直观 | 无效启动和文档重复;固定模型背离 Auto;阶段间易丢授权/版本 | 不采用 |
| 主 Agent + 按需 analyst/reviewer/verifier | 保留上下文入口,独立检查,成本可控 | 需可靠派发包、证据接收和异常恢复 | 推荐;实现并行按风险逐步启用 |
这是本项目基于现状的设计判断,不是 Cursor 平台保证。
## 2. 官方能力与推论
查阅日期为 2026-09-24。在线文档会变化,客户端接入必须另验;不采用社区传闻作为技术契约。
| 来源 | 查证事实 | 对本规范的影响 |
|---|---|---|
| [Cursor Subagents](https://cursor.com/docs/subagents) | 自定义角色可位于 .cursor/agents;model 默认 inherit;readonly 与后台字段可配置;子上下文需要主 Agent 提供输入;默认共享 checkout | 采用继承策略、显式交接、仓库管理的写隔离;只读报告由主 Agent 保存 |
| [Cursor Models & Pricing](https://cursor.com/docs/models-and-pricing) | Auto 是平台模型路由选项,公开文档列有不同优化模式 | 规则不绑定模型、价格或固定路由;按实际 UI/账户能力记录 |
| [Cursor Rules](https://cursor.com/docs/rules) | 支持 AGENTS.md 和项目规则 .mdc | 根入口/客户端入口只指向单一规范,避免重复规则漂移 |
推论与限制:inherit 能表达继承意图,不足以证明实际模型身份或所有 Auto 请求的路由;独立上下文不保证跨模型独立性;只读权限与运行测试的写产物需要区别处理。Auto 可用性、角色加载、权限、真实派发及费用均未在本会话实测,不保证任何套餐或所有版本可用。云执行不在本次授权与建议默认范围内。
## 3. 当前仓库证据
检查基线:dev = 5423b261f97f371bdf7fa5066e9305f9eddaef42;本地 origin/dev 跟踪引用比较为 ahead 74 / behind 0。未 fetch,不能据此声明服务器当前引用。
- AGENTS / PROJECT:已定义授权分级、任务 worktree、独立状态、业务实施和研究边界。
- worktree 操作规范:已有 agentctl 租约、候选验证/合入、共享环境持锁、清理负例和收口要求。
- 验证契约:依据变更范围取并集,要求真实用户流程与持久证据;文档变更不要求产品回归。
- 文档地图/任务模板:已有最小文档原则,可以按阶段留证而不制造九份重复文档。
- .cursor/rules:已有 agentctl、文档、Git 和测试入口。rg --files .cursor 未发现项目 .cursor/agents 角色定义;不推断用户全局目录没有角色。
- .cursor/hooks.json:存在 beforeShellExecution 的 Git 守卫;未见本流程阶段完整性校验。此处仅配置阅读,没有实际触发 hook。
- cursor --version:3.21.16 / 8ae78e8eee1e63479c7e0504b664bc0a80c68000 / x64;agent --version:2026.09.18-9a7762b。CLI 版本不代表 IDE 当前会话配置已验收。
- agentctl status:当前配置 policy_revision 为 agent-governance-2026-09-23-fav-constraint-restored;存在其他任务持 env:dev。研究不使用该环境,不改他人任务。
已读规范修订与工具配置 revision 不同,记录两者分别是什么,不把一个全局字段视作所有 Markdown 修订版本。
## 4. ISSUE-20260924-cursor-test-rule-drift
issue_state:open;严重度:medium;owner:Codex(研究);evidence_basis:本次源码/配置阅读;产品影响未复现。
预期:客户端测试规则只引用验证契约,由适用范围和批准环境决定套件/Runner。
实际:.cursor/rules/test-reports-standard.mdc(alwaysApply=true)仍要求报告附全量 go test -v ./...,固定 MiniMax-M2.7-highspeed,并指向已不存在的 PROJECT §8。与验证契约中的范围选择、实际批准模型、普通小任务记录方式不一致。
已证实机制:客户端复制完整测试规则形成第二份来源,主规范修订后副本继续陈旧。未证实:实际 Cursor 是否因此执行了错误模型/测试、费用或运行行为是否受影响。
为何已有保护不足:静态读取显示没有针对该副本文案与验证契约的一致性证据;本次没有运行 hook/CI,不能断言所有自动防护都缺失。
同类检查范围:.cursor/rules 下五个规则文件及 hooks 配置、根 AGENTS/PROJECT、验证契约、规范登记、任务/收口模板。其余四个 mdc 主要转发入口;本次未检查所有其他客户端和全局规则。
推荐修复:将该 mdc 缩为验证契约与报告路径指针;结构要求归并现有权威文件,避免再复制模型与全量命令。不是改产品 Runner 模型或删除必要验证。
验收:规则文本无固定模型/无条件全量测试/失效章节;文档任务、Go 任务、产品 PI 任务分别映射到既有验证矩阵;Cursor 实际读取入口并正确选择验证层级。静态修复与实机行为分别报告。
时间线:2026-09-24 发现并登记;本次仅提出修复,未实施,issue 保持 open。无新 validated lesson;未验证修复不包装成经验。
## 5. 风险和关键设计
- 阶段和角色不是一对一关系:固定九名 Agent 会增加交接成本;初期三角色足够,主 Agent 可实施。
- 只读 reviewer 无法自行写审查文件:主 Agent 转存并保留作者/ID,避免“要求只读同时要求落盘”的矛盾。
- verifier 运行构建/测试会写缓存、数据甚至环境:单独授权,持对应租约,不能装作普通只读检查。
- 子 Agent 默认共享目录:采用单写者;并行写另建登记 worktree,主会话的自动隔离配置不替代仓库门禁。
- 审查和测试必须绑定版本:修复后重审受影响范围;候选变化重验;运行制品与报告提交分开。
- 清理在验收后:唯一日志/截图先归档,owner 退出后由维护者复查,不主动删除当前使用的工作区。
- 人工确认默认在可审方案形成后;已有端到端授权则沿用。用户未回复偏好,本草案采用该可调整默认,不把沉默当批准。
- 模型路由和自动审批不同:Auto 不扩大业务或环境权限,普通 Cursor 不套用 Herdr 固定模型。
- 阶段规范为 manual;文档审核通过不等于自动执行系统已实现。
## 6. 文档验收与未运行项
本次仅文档研究。静态检查结果在任务“验证与证据”节记录;检查对象为本次全部变更文件内容。
情景自审覆盖:研究-only、简单文档、标准功能、修复回环、并行冲突、readonly 转存、子任务未知、候选变化、验收失败、清理拒绝、上下文恢复。该项是文档推演,不能作为运行负例 PASS。
本次未执行:Cursor Auto 真实派发、Cursor 项目角色配置安装、并行写锁实测、业务测试、产品 PI、浏览器、部署和清理。新规范的 V1–V10 实机清单是后续接入验收项。
## 7. 文档情景自审记录
审查者:Codex 主 Agent;独立性:self_review。以下为阅读草案逐项推演,结果仅表示文字路径可执行,不表示已运行客户端。
| 情景 | 对照位置 | 结论 |
|---|---|---|
| 只研究方案,未授权实现 | §2、S3 | 可交付研究,其后标不适用;不会顺推业务实现 |
| 一处低风险文档修改 | §4、§7 | 主 Agent 自检,一份主文档可承载阶段,无需九个角色 |
| 代码已修改但审查未回收 | S5、§5 | 不进入集成;后台结果需接收 |
| 修复后旧审查/旧测试仍通过 | S5–S7 | 新版本需适用复核与验证,旧 PASS 不覆盖 |
| readonly reviewer 需要报告 | §4、§7 | 子角色回传,主 Agent 在租约内转存 |
| 测试生成缓存或写环境 | S6、§8 | verifier 可写但须明确产物范围/环境与租约 |
| 两个子任务争用同路径 | §5 | 单写者或独立登记隔离,不能无锁并发 |
| 子任务超时且副作用未知 | §6 | 保留 unknown,核对现场后决定恢复 |
| 合并前 dev 已变化 | S7 | 重建候选并重新验证 |
| 已合入但运行验收失败 | S8、S9 | 不宣布完成、不清理;修复/交接 |
| owner 仍在 worktree 或有唯一日志 | S9、§5 | 保留现场,归档后由独立维护者复查 |
| 会话中断后恢复 | §6、§7 | 从首个未满足门禁继续,核对未回收子任务 |
初次静态检查真实输出:`FILES=8 LOCAL_LINKS=84 STAGES=10 ISSUE_IDS=5 / PASS`。
命令:`git diff --check`(exit 0);Python 内联检查全部本次 Markdown 变更(含 untracked)的相对链接/锚点、S0–S9、规则状态字段和 issue ID 唯一性(exit 0)。不验证外部网页永久可达或实际 Cursor 行为。
只读 `agentctl docs drift`:status=ok、regressions=[];开放能力候选未修改,不等于产品就绪。
## 8. 后续决策:本机 PI 与可调整模型配置
用户在同一任务后续对话明确:子智能体采用 gmktec 本机 PI;仅允许 minimax-cn/MiniMax-M3、zai-coding-cn/glm-5.3、zai-coding-cn/glm-5.3-flash、qwen-token-plan-cn/qwen3.8-max、qwen-token-plan-cn/qwen3.8-flash。随后明确代码由 Cursor 实施,并因 M3 的实际使用反馈将其移出默认流程,最后确认该默认安排并要求可调整文档。
这些用户决策取代本报告前文 r1 中 Cursor 原生 .cursor/agents/inherit 的接入建议;前文保留为研究历史,不再作为当前实现方向。现行模型映射唯一来源为[模型配置](../ops/2026-09-24-subagent-model-config.md),流程草案同步到 r2。没有改变 Herdr 或产品 Runner。
2026-09-24 再次执行 pi --offline --no-extensions --no-skills --no-prompt-templates --no-themes --no-context-files --no-approve --list-models,exit 0;精确五个 provider/model 均存在。此命令没有模型推理,不证明各角色能力或连接状态。配置字段由主 Agent 人工读取,当前不含执行器/热加载/自动校验实现。
## 9. 执行器已接入(后续实现)
用户进一步授权接入自动调用 PI 的执行器。代码提交 69ffaa677e23a1dd9aa0528bb09b3acfcd38b119,真实 Cursor CLI→MCP→PI 和 173 项工程回归通过,详情见[验证报告](../test-reports/2026-09-24-pi-executor-test-report.md)及[运行说明](../ops/2026-09-24-pi-subagent-executor.md)。前文关于未接入/未调用的说明属于当时研究阶段;当前交付范围与未覆盖项以上述新报告为准。完整流程草案审批、dev 集成和远端同步分别记录。
@@ -0,0 +1,208 @@
---
title: "对话办公能力全景盘点"
created: 2026-09-25
owner: Cursor
task_id: dialogue-office-expansion-2026-09-25
policy_revision: cursor-governance-2026-09-24-r1 @ 44161d2ad2d7aada3e9ff88127b52148543278e5
review_state: pending
integration_state: pending
deployment: not_required
cleanup: pending
remote_sync: not_requested
status: done
confidence: high
---
# 调研:对话办公能力全景盘点
## 范围与授权
- **用户目标**:以「对话辅助办公」为初衷,最大限度扩展对话可操作范围;**创建项目、添加成员、设置等治理结构操作保持 UI 专属**。
- **本轮交付**:研究报告 + 分期整改计划(文档落盘);P0–P3 **实施另起任务**。
- **允许写路径**:`.doc/audit`、`.doc/remediation`。
- **基线 SHA**:`44161d2ad2d7aada3e9ff88127b52148543278e5`(建场时 local `dev`)。
- **非目标**:不改产品代码、不更新 CURRENT/FEATURE-MATRIX/gap-matrix、不部署。
- **整改方案**:[2026-09-25-dialogue-office-expansion-plan.md](../remediation/2026-09-25-dialogue-office-expansion-plan.md)
## 结论
1. 注册表共 **32** 个 ActionKey(非早期估计的 34);主链路与 intentflow 计划执行面 **双轨脱节**:计划层 U11/U12 已把部分键 live 化,单意图协调层仍对认领/送审/工作流触发等返回「假成功」话术。
2. HTTP **169** 条路由可按对话边界分为:可操作候选 **A=46**、只读查询 **B=66**、UI 专属写/管理台 **C=44**、平台基线 **13**。
3. 消除假成功、打通 dry-run、接真实查询源、再扩新写意图,应按 P0→P3 分期;一律复用 doc-review 四道防线(识别分流 → 话语分类 → 角色×状态出卡 → 执行二次鉴权),两步确认 + 服务端权威校验。
## 证据
| 项 | 路径/命令 | 结果 |
|----|-----------|------|
| ActionKey SSOT | `internal/intent/registry.go` `registerBuiltinActions` L145–187 | **32** 键 |
| 主链 docgov | `internal/coordinator/engine_docgov.go` | claim/submit 假成功;approve/reject 有 PendingAction |
| 主链 workflow | `internal/coordinator/engine_workflow.go` | switch 确认闭环断裂;trigger 引导 UI |
| intentflow dry-run | `internal/app/intentflow/expansion.go` L195–216 | docgov 5 dry-run + run-control 2 dry-run |
| HTTP 路由 | `rg 'mux\.HandleFunc\("' internal/server/server.go internal/server/document_revision_handlers.go` | **169** |
| 样板 | doc-review-lifecycle `09fe9723`;`card_policy.go` / `recognizer_matchers_docgov.go` / `action_executor.go` | 四道防线可复用 |
## 1. 意图执行矩阵(32 ActionKey)
**执行类别说明**
| 类别 | 含义 |
|------|------|
| `real-exec` | 协调层或 PendingAction 已调用领域服务真写 |
| `pending-action` / `confirm-card+pending` | 出确认卡或挂起期望,确认后 `action_executor` 真写 |
| `query-direct` | 只读查询,直接回复(可能含硬编码兜底) |
| `prose-only` | 仅自然语言,无业务副作用(或明确拒绝) |
| `假成功` | StatusAccepted/成功话术,但未调用权威写服务 |
| `dry-run` | intentflow Owner 返回 `validated_only` receipt,无副作用 |
| ActionKey | 中文 | 主链类别 | 计划链(intentflow) | 主处理 | 后端 owner |
|-----------|------|----------|----------------------|--------|------------|
| `project.advisory` | 进展/风险查询 | query-direct | QueryOwner | `engine_query.go:handleQueryProgress` | 协调层/LLM |
| `project.fact.supplement` | 补充项目事实 | real-exec | Mutate(flag 下 dry→live) | `engine_stage.go:handleSupplementInfo` | ctxmgr / MutateOwner |
| `project.stage.advance` | 推进阶段 | real-exec / 无 runner 时 prose 模拟 | — | `engine_stage.go:handleAdvanceStage` | stageflow |
| `task.run` | 触发生成任务 | real-exec | TaskRunAdapter | `engine_task.go:handleTriggerTask` | stageflow / taskrun |
| `task.run.adhoc` | 特设任务 | real-exec | — | `engine_task.go:handleTriggerAdhocTask` | 同上 |
| `conversation.chat` | 闲聊 | prose-only | — | `engine_consult.go:handleCasualChat` | dialogue LLM |
| `conversation.decline` | 暂缓建议 | prose-only | — | `engine_stage.go:handleDeclineExpectation` | 上下文 |
| `document.claim` | 认领文档 | **假成功** | live(U11) | `engine_docgov.go:250–277` | 主链仅改 Claimed 列表;计划→docgov |
| `document.review.submit` | 提交审核 | **假成功** | live(U11) | `engine_docgov.go:280–295` | 主链纯文案;计划→`SubmitForReview` |
| `document.review.approve` | 审核通过 | pending-action | **dry-run** | `engine_docgov.go:handleDocGovApprove` | `docgov.ReviewApprove` |
| `document.review.reject` | 审核驳回 | confirm-card+pending | **dry-run** | `engine_docgov.go:handleDocGovReject` | `docgov.ReviewReject` |
| `document.final.approve` | 终审批准 | confirm-card+pending | **dry-run** | 同上 Approve 分支 | `docgov.ApproverApprove` |
| `document.final.reject` | 终审驳回 | confirm-card+pending | **dry-run** | 同 reject | 同上 |
| `document.proposal.decide` | 提案裁决 | confirm 分支真挂起 / **默认分支假成功** | **dry-run** | `engine_docgov.go:298+` | confirm_*→PendingAction |
| `regulation.query` | 法规查询 | query-direct | QueryOwner | `engine_query.go:handleQueryRegulations` | kb.Client + 模板兜底 |
| `case.query` | 相似案例 | query-direct | QueryOwner | `engine_query.go:handleQuerySimilarCases` | SearchSimilarCases + **硬编码案例** |
| `permission.query` | 权责查询 | query-direct | — | `engine_query.go:handleQueryUserRights` | UserDocs 上下文 |
| `document.reject_reason.query` | 驳回原因 | query-direct | — | `engine_query.go:handleQueryRejectReason` | 黑板 + default 文案 |
| `card.confirm` | 确认挂起期望 | confirm 元动作 | — | expectation 映射 | 路由至目标 intent |
| `project.stage.execute` | 阶段执行确认 | 注册有、switch **无独立 case** | — | 实际走 advance | 同 advance |
| `security.forbidden` | 安全禁止 | prose-only | RejectPlan | `engine_consult.go` | — |
| `workflow.switch` | 切换激活工作流 | **假成功(确认后无执行)** | **dry-run** | `engine_workflow.go:12–59` | **边界上属结构治理 → 宜诚实拒绝/引导 UI** |
| `workflow.run` | 运行工作流 | **假成功(引导 UI)** | live(U12) | `engine_workflow.go:62–90` | 计划→`CreateWorkflowRun` |
| `workflow.status.query` | 工作流状态 | query-direct | — | `engine_workflow.go:93` | UserProjectContext |
| `document.status.query` | 文档状态 | query-direct(常空模板) | — | `engine_workflow.go:117` | 模板/document_summary |
| `conversation.help` | 能力帮助 | query-direct | — | `engine_workflow.go:139` | AvailableActions |
| `conversation.unsupported` | 不支持 | prose-only | — | `engine_workflow.go:159` | — |
| `run.status.query` | 运行状态 | query-direct | — | `engine_run.go:handleRunStatusQuery` | WorkDir |
| `run.resume` | 续跑 | confirm-card+pending | live(U12) | `engine_run.go:handleRunResume` | taskrun |
| `run.restart` | 重启 | confirm-card+pending | **dry-run** | `engine_run.go:handleRunRestart` | taskrun.restart |
| `project.impact.analyze` | 影响分析 | query-direct | — | `impact_actions.go` | ImpactActions |
| `project.doc.revise_propose` | 修订提案 | confirm-card+pending | — | `impact_actions.go` | ProposeRevision |
### 1.1 假成功清单(主链路优先)
| # | Legacy / Key | 文件:行号 | 当前行为 | P0 建议 |
|---|--------------|-----------|----------|---------|
| 1 | `DOCGOV_CLAIM` / `document.claim` | `engine_docgov.go:250–277` | 仅 append `UserDocs.Claimed`,回复「已成功认领」,不调 docgov | 真执行 `RecordDocumentViewed`/claim API + 确认(若需) |
| 2 | `DOCGOV_SUBMIT_REVIEW` / `document.review.submit` | `engine_docgov.go:280–295` | 纯成功文案,无状态变更 | 真执行 `Gov.SubmitForReview` + 角色门禁 |
| 3 | `DOCGOV_PROPOSAL_DECIDE` 默认分支 | `engine_docgov.go:383–397` | 非 confirm_* 时按 proposal_action 返回采纳/拒绝文案,不写文档 | 默认分支诚实澄清或走确认卡;禁止假成功 |
| 4 | `SWITCH_WORKFLOW` / `workflow.switch` | `engine_workflow.go:12–59` | 设 NextExpectation 要求确认,**确认后无写路径** | **诚实拒绝**:属 UI 专属(`PUT …/active-workflow`);或确认后明确「请在设置面板操作」 |
| 5 | `TRIGGER_WORKFLOW` / `workflow.run` | `engine_workflow.go:62–90` | 「请在面板确认」话术,不创建 run | 确认卡 + `CreateWorkflowRun`(对齐 U12) |
附带(非计划 P0 五处,但同类):无 runner 时 `ADVANCE_STAGE`/`TRIGGER_TASK` 模拟成功;`VIEW_DOC` lifecycle 空模板。
### 1.2 intentflow 仍 dry-run 的键
**DocGov**(`docGovActionKeys` 7 − `DocGovLiveActionKeys` 2 = **5**):
- `document.review.approve`
- `document.review.reject`
- `document.final.approve`
- `document.final.reject`
- `document.proposal.decide`
**Run-control**(4 − live `workflow.run`/`run.resume` = **2**):
- `workflow.switch`(计划层 dry-run;产品边界建议永久不 live 写,改为拒绝)
- `run.restart`
见 `internal/app/intentflow/expansion.go` L195–216;dry-run 行为 `DryRunAdapter.Execute` → `validated_only`。
## 2. HTTP 169 路由 × 对话边界
**统计口径**:`internal/server/server.go` `Routes()` + `document_revision_handlers.go` `registerDocumentRevisionRoutes()` 中 `mux.HandleFunc("METHOD path")` = **169**。不含中间件 OPTIONS、SPA 静态子路径。
| 类别 | 计数 | 含义 |
|------|-----:|------|
| **A 对话可操作候选** | 46 | 读写副作用;对话须两步确认后经服务层落库 |
| **B 只读查询候选** | 66 | GET + preview POST |
| **C UI 专属** | 44 | 治理结构写 + admin 全域(含管理台只读) |
| 平台基线 | 13 | health/ready、认证、SPA、`/me` 自服务 |
| **合计** | **169** | |
### 2.1 A — 对话可操作候选(46)
| 模块 | n | 代表路径 | 对话意图现状 |
|------|--:|----------|--------------|
| docgov | 11 | `POST …/docgov/{claim,submit-review,review-decision,approver-decision,proposal,proposal/decide,comments,content,lease/*}` | 批准/驳回已打通;claim/submit 主链假成功;comments 等偏 UI |
| docrevision | 2 | `PATCH …/documents/{id}/content` · `POST …/agent-candidates/{id}/decision` | 正文 PATCH 仅 HTTP;候选决策可对话扩展 |
| trace | 6 | `POST …/trace/{index,analyze}` · `…/edges/{id}/decision` · `…/reopen` · `…/recheck/…/clear` | 影响分析意图有;**边裁决/重开仅 HTTP** |
| 补充批次 | 1 | `POST …/supplement-impacts/{batch_id}/decision` | 补充意图有;批次确认可对话化 |
| 工作流运行(非结构) | 2 | `POST …/workflows/{key}/run` · `…/stages/{stage}/advance` | run 主链假成功;advance 有意图 |
| 任务执行 | 6 | `POST …/tasks/{run,run/stream,runs}` · `…/{cancel,resume}` | 触发/续跑已打通 |
| 对话写 | 8 | `POST …/chat*` | 会话基础设施 |
| 意图计划 | 1 | `POST …/intent-plans/{id}/decisions` | intentflow + HTTP 双通道 |
| 自由文档 | 6 | `POST/PUT/DELETE …/freeform-documents*` | **仅 HTTP** → P3 候选 |
| 资产 | 2 | `POST …/assets` · `…/reparse` | **仅 HTTP** → P3 |
| 通知 | 1 | `PATCH …/notifications/{id}` | **仅 HTTP** → P3 |
| 用户偏好 | 1 | `PUT …/context/user/preference` | 低优先级 |
### 2.2 B — 只读查询候选(66)
项目/工作流/成员/设置 **GET**、termination/activation **preview**、chat 历史检索、docgov audit/comments GET、修订 ledger GET、资产 raw、通知列表、context/cases 等。
对话已覆盖:进展、文档/工作流/运行态、驳回原因、法规/案例/权限(案例与进展有硬编码兜底)。
仍偏 HTTP:职责现状、修订版本/diff、trace 图、终止预览、成员列表只读(允许对话只读引导,禁止代写)。
### 2.3 C — UI 专属红线(44,对话永久禁写)
| 模块 | 写操作(禁入) |
|------|----------------|
| 项目/成员 | `POST /projects` · `POST|PUT|DELETE …/members` |
| 职责 | `PATCH …/doc-tasks/{taskKey}/duties` |
| 工作流结构/生命周期 | `PUT …/workflow-plan` · `PUT …/active-workflow` · `POST …/workflow-instances/activate` · `POST …/terminate` |
| Admin | 角色/用户/密码/工作流定义 publish·retire/模板/config/system settings/maintenance/workspaces cleanup |
对话侧应对命中措辞走 `security.forbidden` / `conversation.unsupported`,**仅允许只读查询与引导**(如读职责现状、`termination-preview`)。
> **澄清**:`workflow.switch`(改 active-workflow)落入 C;`workflow.run`(创建运行实例)落入 A。P0 对前者诚实拒绝,对后者真执行。
## 3. 查询硬编码兜底
| 场景 | 位置 | 问题 |
|------|------|------|
| 相似案例 | `engine_query.go:420–426` | 无数据时硬编码 PRJ-2025-008 / PRJ-2024-019 |
| 驳回原因 | `engine_query.go:260–276` + `card_policy.go:defaultRejectReasonText` | 黑板/事件捞取失败则默认文案 |
| 法规 | `engine_query.go:382–388` | KB 空则 GB/YY 模板 |
| 进展简报 | `engine_query.go:83–164` | 默认项目名与长硬编码段落 |
| 文档状态 | `engine_workflow.go:126–129` | lifecycle 空 → 引导面板 |
## 4. 复用样板:doc-review 四道防线
参考合入/分支证据:`feature/doc-review-lifecycle-2026-09-25` @ `09fe9723`(批注/重开/积压/送审真执行)。
| 防线 | 符号 | 要点 |
|------|------|------|
| ① 识别分流 | `recognizer_matchers_docgov.go:matchDocGovAction` | 查询语气不误路由写动作 |
| ② 话语分类 | `card_policy.go:ClassifyRejectUtterance`(Web 对称) | QUERY / EXECUTE / OTHER |
| ③ 角色×状态出卡 | `ResolveRejectCard` / `buildRejectConfirmCard` | 无权限不出危险按钮 |
| ④ 执行二次鉴权 | `handleDocGovReject/Approve` + `chat/action_executor.go` | 确认后调 `GovernanceEngine` |
后续写意图扩展必须复制该模式,禁止「话术成功、服务未写」。
## 5. 开放问题
- `project.stage.execute` 注册未接线:是否删除或显式映射到 advance(实施期决定)。
- 自由文档/通知/资产对话化的产品优先级与确认文案(P3 开工前再确认)。
- `workflow.switch` 是否保留意图仅作「引导 UI」还是识别层直接 `unsupported`(推荐后者,减少假确认)。
## 建议动作
见整改计划 P0–P3;本调研 **status=done** 仅表示盘点可审,**不代表问题已修复**。
## 状态与交接
- 产物:本文 + [整改计划](../remediation/2026-09-25-dialogue-office-expansion-plan.md)
- 实施:另起 `feature/dialogue-office-p0-…` 等任务;每期独立验证与验收
- CURRENT / MATRIX / gap-matrix:本轮不动
- catalog:`feature=dialogue-office`,scope `.doc/audit`+`.doc/remediation`;与 `docgov` feature claim 硬冲突,故未占用 `docgov` 键
+267
View File
@@ -0,0 +1,267 @@
---
title: "系统全面 Code Review(local_dev tip)"
status: done
created: 2026-09-26
owner: Cursor
task_id: "system-code-review-2026-09-26"
policy_revision: "agent-governance-2026-09-21-r1 + cursor-governance-2026-09-24-r1 @ f4c1b73f28580ad3df6db4f9ec0a80057006e516"
review_state: accepted
integration_state: integrated
deployment: not_required
cleanup: done
remote_sync: not_requested
updated: 2026-09-26
severity: high
---
# 系统全面 Code Review(local_dev tip)
## 范围与授权
- **用户目标**:对系统做一次全面 code review,并按规范形成报告;**不允许实施修复**,只形成报告。
- **被审对象**:本地 `dev` tip `f4c1b73f28580ad3df6db4f9ec0a80057006e516`(merge: swboot-closeout-2026-09-26-r3);运行态参考 no-docker local_dev(`bin/agent-server`,schema 75),本报告以代码与门禁证据为主。
- **允许写路径**:`.doc/`(本审计主文档、INDEX、short-term 任务记录)。
- **交付终点**:可审审计报告 + 索引挂接;不改业务代码、不改 gap-matrix / FEATURE-MATRIX 状态值、不部署。
- **非目标**:逐文件全量行审、依赖 CVE 扫描、前端 XSS 系统化、动态渗透、实施整改。
- **方法**:并行四轴审查(架构边界 / 安全 / 可维护性 / 关键执行路径)+ 本机 `./scripts/arch-check.sh --mode block`、规模盘点与关键片段复核。
## 问题登记与经验检索
- **issue_id**:本轮不新建 ISSUES 行;发现项以本报告 FIND-* 编号跟踪。若后续授权修复,再按 [闭环规范](../ops/2026-09-23-issue-learning-workflow.md) 升 issue。
- **检索词**:`IDOR`、`GetUserContext`、`session_id`、`validated_only`、`fencing`、`arch-check`、`table_owners`、`ALLOW_IN_MEMORY`、`sh -c`、`swboot`。
- **命中**:历史审计见 [INDEX](./INDEX.md)(模块耦合 2026-09-20、对话办公盘点 2026-09-25、gap-matrix);经验库无与本轮 FIND-SEC-01 完全同题的已关闭 lesson。**采纳检查**:对照模块开发规范 §2/§4、authz fail-closed 惯例、intentflow 注释契约。
## 总判(Verdict)
`arch-check --mode block` **PASS**,且多项生产门禁(任务路径 stub 拒绝、FAV outbox consumer 多层禁用、docgov 角色不信任 body)仍然有效。但系统存在三类结构性风险:
1. **安全旁路**:会话上下文 IDOR(已证实);Authorizer 无池 fail-open;swboot `sh -c` + 前缀白名单。
2. **门禁空心化**:未登记表的 SQL 写被 arch-check **静默跳过**;server 仍持 `Runtime.Pool` 并直查/直写。
3. **多入口编排**:docgov / 多意图 / flag 面平行三套,关闭开关时存在静默降级。
本轮 **不改变** gap-matrix 的 `production_ready` 叙事;下列 critical/high 建议作为独立 remediation 候选,待授权后再立项。
## 现象
只读审查与门禁核验,无用户报障个案。审查期望:合入 swboot / dialogue-ctx / jevdecide / semantic-replace 后的 tip 在模块边界、鉴权与关键执行路径上仍满足生效规范。实际:门禁绿,但多处规范语义与实现分叉(见 Findings)。
## Findings(按严重度)
置信度说明:`verified` = 父会话已打开源码复核;`agent` = 子代理报告、抽样一致;`inferred` = 机制推断未跑动态用例。
### Critical
#### FIND-SEC-01 — 会话消息 IDOR(`session_id` 无归属校验)
| 项 | 内容 |
|---|---|
| 类别 | 授权 / IDOR |
| 位置 | `internal/server/handlers_context.go:17-50`;`internal/ctxmgr/manager.go:377-385` |
| 证据 | `handleGetUserContext` 仅校验 `user_id` 为本用户/管理员;`GetUserContext` 对 `chat_messages` 使用 `WHERE session_id = $1` **无 owner 条件**。对照 `chatflow` 读路径会校验会话归属。 |
| 影响 | 已登录用户若获知他人 `session_id`,可读取对方最近聊天正文。 |
| 置信度 | verified · high |
| 修复方向(不实施) | 复用 chatflow 会话授权;或按 `session.owner_id`/`user_id` 过滤后再返回。 |
#### FIND-ARCH-01 — arch-check 对未登记表静默跳过(表唯一写者门禁盲区)
| 项 | 内容 |
|---|---|
| 类别 | 门禁 / 模块边界 |
| 位置 | `internal/archtest/scan.go:198-205`;`module-boundaries.yaml` `table_owners`(约 59 表) |
| 证据 | `if !tracked { continue }`;本机 tip:`swboot_controlled_executions` / `projects` / `project_source_bindings` / `outbox_events` **UNTRACKED**;`arch-check --mode block` 仍 PASS。 |
| 影响 | 新表(含 swboot)可任意包写入而不触发 block;「表唯一写者」对未入库表无强制力。 |
| 置信度 | verified · high |
| 修复方向 | 未登记表的生产写应变 fail-closed,或强制登记。 |
#### FIND-ARCH-02 — server 持 Pool 直装 swboot 并 SQL 旁路
| 项 | 内容 |
|---|---|
| 类别 | 组合根越界 |
| 位置 | `internal/server/swboot_handlers.go`(NewPGRepoAllowlist / ControlledPatchExecutor / 直查 bindings & executions) |
| 证据 | 与模块规范 §2.1「server 只拿用例或端口」冲突;`app.Build` 已另有 allowlist 装配。 |
| 影响 | HTTP 层成为第二组合根;边界回归。 |
| 置信度 | agent · high(与规范条文一致) |
| 修复方向 | 收成 app 用例端口;禁止 handler 使用 `rt.Pool`。 |
### High
#### FIND-SEC-02 — Authorizer 无池时成员判定 fail-open
| 项 | 内容 |
|---|---|
| 类别 | 鉴权 fail-open |
| 位置 | `internal/authz/authorizer.go:112-114`、`205-207` |
| 证据 | `!a.enabled()`(pool==nil)时 `IsProjectMember`/`IsProjectOwner` 对 `userID>0` 返回 true;组合根始终 `NewAuthorizer(pool)`,nil pool 时 `authorizer()!=nil`,绕过「nil → failClosed」分支。 |
| 影响 | AllowInMemory / 无库误配时,任意登录用户可访任意 `project_id`。生产有 `ALLOW_IN_MEMORY` 门禁则触发面缩小,**机制本身仍 fail-open**。 |
| 置信度 | verified · high |
#### FIND-SEC-03 — swboot 受控执行:`sh -c` + basename 前缀白名单
| 项 | 内容 |
|---|---|
| 类别 | 命令注入面 / 边界语义 |
| 位置 | `internal/swboot/executor.go`(`sh -c`、前缀匹配);`ApproveMerge` 恒拒 |
| 证据 | 允许判定为字段首段 basename 前缀;命令经 shell 执行。执行器自身不做 merge/push,但若 admin allowlist 含 `git`/`bash` 等,客户端可间接 push/merge/deploy。 |
| 影响 | 在 creator + 宽松 allowlist 前提下,隔离 worktree 内可越出「测试命令」意图。 |
| 置信度 | agent · high |
| 说明 | 与 MATRIX「永不 merge/push/deploy」在「执行器 API」语义下仍成立;真正边界在 **admin 命令白名单粒度**。 |
#### FIND-FLOW-01 — intentflow `validated_only`/`proposed` 可经 confirm 进入 dispatch
| 项 | 内容 |
|---|---|
| 类别 | 执行模式门禁 |
| 位置 | `internal/app/intentflow/plans.go:365-376`;`intent_plan_handlers.go:86-88`;`ExecuteClaimed` 不读 `ExecutionMode` |
| 证据 | `DecisionConfirm` **允许** `PlanProposed`;确认后 HTTP 调用 `DispatchEligible`;`AllowedModes` 策略字段几乎未被执行路径使用。 |
| 影响 | shadow「安全」依赖「无人 Confirm」,而非执行器硬拒绝;U10/U11 live 已接线时可升级为真实写。 |
| 置信度 | verified · high(静态);未做动态 confirm 用例 |
#### FIND-QUAL-01 — docgov / 多意图多入口并行(职责扩散)
| 项 | 内容 |
|---|---|
| 类别 | 可维护性 / 双写路径 |
| 位置 | chat `docgov.*` PendingAction;`app/docgov_owner.go` `document.*`;`server/handlers_docgov.go`;intent vs intentflow 双套 flags |
| 证据 | 同一 `GovernanceEngine` 三入口;`intent.FeatureFlags` 与 `intentflow.FeatureFlags` 并存;Coordinator ~40 intent case + intentflow OwnerMux 平行。 |
| 影响 | 鉴权/确认/审计易漂移;回归矩阵笛卡尔积;开关关闭时 Mux→Query 静默降级(FIND-FLOW-02)。 |
| 置信度 | agent · high |
#### FIND-ARCH-03 — bizdev / Runtime / 万能 Engine 门面残留
| 项 | 内容 |
|---|---|
| 类别 | 架构债 |
| 位置 | `internal/bizdev/service.go`;`internal/app/app.go` Runtime;`docgov`/`coordinator` Engine |
| 证据 | bizdev 自开池并装配多引擎;Runtime 暴露 Pool+数十服务;Engine 方法面极大。arch-check allowlist 放行上帝包,PASS ≠ 模块化健康。 |
| 影响 | 新功能默认堆 handler/Runtime;与解耦批次目标持续摩擦。 |
| 置信度 | agent · high |
### Medium
| ID | 摘要 | 关键位置 | 置信度 |
|---|---|---|---|
| FIND-SEC-04 | 授权拒绝 404/403 区分,泄露资源存在性 | `task_run_auth.go`、`auth_helpers.go` | agent |
| FIND-SEC-05 | Chat SSE:阶段拒绝在 Flush 之后;`user_role` 可写入会话上下文 | `sse.go` | agent |
| FIND-SEC-06 | 对话 `agent.NewBackend` 对未知名默认 stub;生产密钥校验不禁 stub | `agent/backend.go`、`config.go` | agent |
| FIND-SEC-07 | 未认证 `/api/v1/vault/status` 暴露 FAV 开关 | `auth_middleware.go`、`vault.go` | agent |
| FIND-SEC-08 | 会话 token 存 `localStorage`(XSS 放大) | `web/src/api/auth.ts` | agent |
| FIND-DOC-01 | docgov 省略 fencing token 仍可写;heartbeat persist / squad reclaim fail-open | `docgov/lease.go` | agent |
| FIND-DOC-02 | `CommitAgentVersion` 与 edit lease 解耦竞态面 | `docrevision/service_agent.go` | agent |
| FIND-FLOW-02 | `OwnerMux` 在 U10/U11/U12 关闭时静默降级到 Query | `intentflow/mux.go` | agent |
| FIND-ARCH-04 | notification handler 端口失败后回落 Pool SQL | `notification_handlers.go` | agent |
| FIND-ARCH-05 | 提案批准后 handler 裸 goroutine 副作用 | `handlers_docgov.go` | agent |
| FIND-ARCH-06 | 错误信封拼接 `err.Error()` | 多 handler | agent |
| FIND-QUAL-02 | 全局 flag/metrics 损害并行测试隔离 | `intent/flags.go`、`intentflow/*` | agent |
| FIND-QUAL-03 | 巨石文件逼近/超过规范阈值(见规模盘点) | squad/taskrun/server/web | verified |
### Low / 契约说明
| ID | 摘要 |
|---|---|
| FIND-JEV-01 | jevdecide assist 失败为 **fail-open 回规则**(不编造);若产品要求「jev 挂则拒答」则不满足——属契约澄清,非实现疏忽。 |
| FIND-DOC-03 | summarizer 注释仍写「REPLACE 不接线」,与已合入 `applySemanticReplace` 矛盾。 |
| FIND-EVT-01 | 事件 payload 密钥过滤面窄于 taskrun `StripSecrets`(子串级)。 |
## 同类问题与影响范围
| 关联场景 | 共用机制 | 检查与证据 | 判定 |
|---|---|---|---|
| chatflow 读会话 | 会话 owner 校验 | chatlog Adapter authorize | 主路径健全;**旁路** `GetUserContext` 缺校验 |
| 任务 SSE 鉴权 | Flush 前 RequireProjectAccess | gap-matrix AUTH-TASK-SSE PASS | 项目门健全;阶段拒绝在流后属中危差异 |
| FAV outbox | Enabled:false + Register/Claim 硬拒 | registry/dispatcher/eventsconsumer | **未见旁路打开** |
| swboot ApproveMerge | 恒拒 | repo_allowlist | 自身 API 健全;命令白名单是真边界 |
| 生产 ALLOW_IN_MEMORY | validateProductionSecrets | config.go | 非空 Env 的 prod 有防护;空 Env+内存组合仍危险 |
**未覆盖(明确边界)**:govulncheck/npm audit;MinerU/Embedding SSRF 动态验证;FAV degraded 跨项目读 E2E;Markdown XSS 系统化;全量 `BeginTx` 持锁外呼追踪。
## 方案与验收(仅建议,本轮不实施)
### 建议优先级
1. **P0**:FIND-SEC-01(IDOR)— 补会话归属;加回归(他用户 session_id → 403/空)。
2. **P0**:FIND-ARCH-01 — arch-check 未登记表 fail-closed;补登记 swboot/projects 等属主。
3. **P1**:FIND-SEC-02 — Authorizer `!enabled()` 改 fail-closed 或与 `failClosedAuthz` 对齐。
4. **P1**:FIND-SEC-03 / FIND-FLOW-01 — argv 化命令 + 收紧白名单;Confirm 拒绝 `validated_only`/`proposed` 或执行器硬读 mode。
5. **P2**:收敛 docgov/多意图单一写路径与单一 flag 面;收回 server Pool。
### 验收提示(未来修复任务)
按 [验证契约](../ops/2026-09-21-validation-contract.md)「问题修复的回归范围」:原例 + 同类旁路 + 正常授权路径;工程侧补 `archtest` 用例证明未登记表 block。
## 严重度
报告整体:`high`(存在已证实 IDOR + 门禁盲区;未做动态利用)。
## 关联整改
- 既有: [模块解耦分批](../remediation/2026-09-20-module-decoupling-batch-plan.md)、[对话办公扩展](../remediation/2026-09-25-dialogue-office-expansion-plan.md)、[gap-matrix](../remediation/gap-matrix.md)
- **本轮未新建 remediation 文件**(用户禁止实施;方案仅建议)。授权后建议拆:`remediation/2026-09-26-system-code-review-followups.md`。
## 证据
### 门禁与规模(本机)
```text
被审 SHA: f4c1b73f28580ad3df6db4f9ec0a80057006e516
arch-check --mode block → production gate passed
tracked table_owners ≈ 59;swboot_controlled_executions/projects/project_source_bindings/outbox_events = UNTRACKED
Go 生产文件 LOC 前列(非测试):
cmd/bizdev-cli/main.go 1017
internal/squad/workflow.go 963
internal/server/task_run_handlers.go 858
internal/taskrun/manager.go 813
…
Web:
web/src/App.tsx 1748
web/src/engine/docxRenderer.ts 1263
…
```
### 子代理
| 轴 | 类型 | 用途 |
|---|---|---|
| 架构边界 | architecture-critic | 模块规范对抗审 |
| 安全 | security-auditor | OWASP 向只读审(无 PoC) |
| 可维护性 | thermo-nuclear-code-quality-review | 上帝对象/双路径/开关丛林 |
| 关键路径 | code-explorer | intentflow/docgov/swboot/FAV/jev |
### 运行态(旁证,非本报告验收对象)
此前会话:no-docker `bin/agent-server` `vcs.revision` = tip;`/api/v1/health`+`/ready` ok,schema 75。
## 开放问题
1. FIND-FLOW-01:产品是否故意允许对 shadow `proposed` 计划一键 Confirm 升 live?若否,属缺陷;若是,应改文档/MATRIX 与执行器注释。
2. FIND-JEV-01:assist「失败 fail-closed」的产品定义是否等于「回退规则」?
3. 是否授权将 FIND-SEC-01/ARCH-01 升 ISSUES 并开 remediation?
## 修复经过与经验
- **本轮未实施任何代码修复**(用户硬约束)。
- 不新增 lesson:发现尚未经验证修复闭环。
- 复发提醒:旁路 HTTP(绕过 chatflow/Owner)是鉴权回归的高发点。
## 状态与交接
| 字段 | 值 |
|---|---|
| 任务状态 | `done`(研究产物可审) |
| review_state | pending(待人工审阅报告) |
| integration_state | pending(报告合入 local_dev 另走 integrate) |
| deployment | not_required |
| cleanup | pending |
| remote_sync | not_requested |
| 剩余工作 | 授权后开 P0 修复任务;本 worktree 合入/清理由独立维护者执行 |
| 禁止续作 | 在本任务下直接改业务代码冒充「顺便修」 |
## Positive observations
1. `arch-check` 对**已登记** import/sql/path/event 仍 enforced。
2. FAV outbox consumer `Enabled:false` 多层硬拒,未见旁路打开。
3. 任务 SSE 项目鉴权在 Flush 前;docgov 角色取 principal 不信任 body。
4. 语义摘要 shadow:lease 提交后再 Summarize,符合持锁不做外部 IO。
5. swboot/jevdecide 领域包 import allowlist 自身较窄;污染主要在接线层。
+25 -1
View File
@@ -13,6 +13,30 @@
## 核心文档(按阅读顺序推荐)
### 系统全面 Code Review(2026-09-26)
**文件**: [2026-09-26-system-code-review.md](./2026-09-26-system-code-review.md)
**结论**: tip `f4c1b73f` 上 `arch-check --mode block` PASS,但存在已证实会话上下文 IDOR、arch-check 未登记表静默跳过、Authorizer 无池 fail-open、swboot `sh -c` 前缀白名单、intentflow `proposed` 可 Confirm 升 dispatch 等 critical/high 项;FAV outbox 禁用路径未见旁路。**本轮不实施修复**。
**任务**: [short-term](../ops/short-term/2026-09-26-system-code-review.md) · mutex `docs-audit-review`
### 对话办公能力全景盘点(2026-09-25)
**文件**: [2026-09-25-dialogue-office-capability-research.md](./2026-09-25-dialogue-office-capability-research.md)
**结论**: 32 ActionKey 双轨脱节(主链假成功 vs intentflow 部分 live);HTTP 169 = A46/B66/C44+基线13;治理结构写永久 UI 专属。整改见 P0–P3 计划。
**整改**: [对话办公扩展计划](../remediation/2026-09-25-dialogue-office-expansion-plan.md) · task `dialogue-office-expansion-2026-09-25`
### 模块化重构方案审核检查清单(2026-09-23)
**文件**: [2026-09-23-modular-refactor-plan-review-checklist.md](./2026-09-23-modular-refactor-plan-review-checklist.md)
**结论**: 产物机器方案(`modular-contract-standard-2026-09-22`)本机不可见;本清单按已生效模块开发规范与 A–G/验证契约,覆盖阶段 1、阶段 2 与取消状态契约自查项,并留「22 条规范」映射回填。不实施业务代码。
**任务**: [short-term](../ops/short-term/2026-09-23-modular-refactor-review.md)
### 模块耦合现状(2026-09-20)
**文件**: [2026-09-20-module-coupling-audit.md](./2026-09-20-module-coupling-audit.md)
@@ -189,7 +213,7 @@
**结论**: 消息仍在数据库;文档任务与激活前消息缺阶段作用域,被刷新后的窗口过滤器剔除,而统计仍返回未过滤数量。
**整改**: [对话刷新恢复与阶段授权一致性整改方案](../remediation/2026-09-13-chat-history-refresh-remediation.md)
**整改**: [对话刷新恢复与阶段授权一致性整改方案](../remediation/2026-09-13-chat-history-refresh-remediation.md)(2026-09-22 口径裁定:gap `CHAT-HISTORY-REFRESH` = PASS;见 [reconcile](../ops/short-term/2026-09-22-chat-history-refresh-reconcile.md))
### 0️⃣ 当前状态(Live SSOT)
+34
View File
@@ -0,0 +1,34 @@
# 问题与修复台账
维护规则:[问题记录与开发经验闭环](../ops/2026-09-23-issue-learning-workflow.md)。每个问题一个稳定 ID;主记录是事实与状态来源,本表为可检索投影。新发现及时登记,修复后保留记录;发布 blocker 仍见 [gap-matrix](../remediation/gap-matrix.md)。
更新:2026-09-27。上传链路:登记并修复上传文档跨端不可访问(占位模板退化 + 元数据/正文不落服务端,fixing 待 dev 集成)。2026-09-26。docgov 批准链:登记并修复 review_snapshot_id 装载缺失与 uow 行锁自死锁(resolved);memDocs 持久化失败缓存投毒(investigating)。历史 resolved 不表示本日产品回归通过。系统 code review P0/P1 批次修复落账(5 resolved + 1 deferred + 1 open,主记录见 [整改文档](2026-09-26-system-code-review-fixes.md),来源 [审计](2026-09-26-system-code-review.md))。
| issue_id | 模块 / 检索词 | 问题 | 严重度 | issue_state | owner | 证据日期 / 范围 | 唯一主记录 | 经验 |
|---|---|---|---|---|---|---|---|---|
| ISSUE-20260927-upload-doc-cross-device | freedoc / upload / freeform / fileMeta / 占位模板 / 跨端 | 上传文档源文件元数据与正文不落服务端:换浏览器/清存储/共享他人查看时退化为注册占位模板,文本类连二进制都未存(伴生 <512B 显示 "0 KB") | high | resolved | pi | 2026-09-27;dev `86efba2c` 合入并在 dev 环境验证:FS-UPLOAD-01/02 真实浏览器 PASS(跨上下文可见真实正文),DB 核验元数据+asset 落库;存量无元数据旧文档不可恢复(重新上传即可) | [主记录](../ops/short-term/2026-09-27-upload-doc-access.md) | [LESSON-20260927-server-facts-and-iso-db-recipe](../ops/lessons/2026-09-27-server-facts-and-iso-db-recipe.md) |
| ISSUE-20260923-nullable-duty | docgov / nullable / 23503 / reviewer_id | 可选职责空值写 0 导致 FK 失败 | high | resolved | Codex(历史补录) | 2026-09-17;历史 PG / API 冒烟;当前未复测 | [主记录](2026-09-23-historical-issue-records.md#nullable-duty) | [LESSON-20260923-nullable-duty](../ops/lessons/2026-09-23-nullable-duty.md) |
| ISSUE-20260923-content-hash | docrevision / canonicalize / hard-break / 404 | 规范化破坏 Markdown 语义并造成正文哈希漂移 | critical | resolved | Codex(历史补录) | 2026-09-14;历史真实 UI / 重启;当前未复测 | [主记录](2026-09-23-historical-issue-records.md#content-hash) | [LESSON-20260923-content-hash](../ops/lessons/2026-09-23-content-hash.md) |
| ISSUE-20260923-coordination-authority | agentctl / claim / SQLite / CAS / CURRENT / FEATURE-MATRIX | 本地副本 CAS 与任务许可不能表达跨主机全局权威认领 | high | investigating | Codex(研究) | 2026-09-23;源码/只读状态,未复现具体丢写 | [主记录](../ops/short-term/2026-09-23-coordination-db-daemon-research.md#issue-20260923-coordination-authority) | 沿用 content-hash 投影经验;跨机结论待实施验证 |
| ISSUE-20260923-matrix-status-regression | FEATURE-MATRIX / module-batches-ag / merge / docs-apply | 矩阵行 done 被 closeout 合并冲突手解回退为 planned | high | resolved | Cursor | 2026-09-23;本机 tip 与 git 考古;docs apply 已恢复 | [主记录](2026-09-23-matrix-status-regression.md) | [LESSON-20260923-matrix-status-cas](../ops/lessons/2026-09-23-matrix-status-cas.md) |
| ISSUE-20260924-admin-reset-dead | auth / adminResetPassword / T20-F4 / chenwei | 管理台重置密码死按钮;验收口令不可知后无法恢复 | high | resolved | Cursor | 2026-09-24;test 库实查 + API 单测 | [主记录](2026-09-24-admin-password-reset-issues.md#issue-20260924-admin-reset-dead) | 待补 LESSON |
| ISSUE-20260924-login-error-envelope | auth / AUTHZ / 无权访问 / auth.ts | 登录失败展示裸 JSON / 「无权访问」误导 | medium | resolved | Cursor | 2026-09-24;wire 复现 + 前端单测 | [主记录](2026-09-24-admin-password-reset-issues.md#issue-20260924-login-error-envelope) | 待补 LESSON |
| ISSUE-20260924-zombie-credentials | auth / user_credentials / LEFT JOIN / CreateUser | 空哈希静默建号导致永久无法登录 | high | resolved | Cursor | 2026-09-24;三环境只读盘点;机制修复不含存量清理 | [主记录](2026-09-24-admin-password-reset-issues.md#issue-20260924-zombie-credentials) | 待补 LESSON |
| ISSUE-20260924-cursor-test-rule-drift | Cursor / test-reports / 固定模型 / 规则副本 | Cursor 测试规则与验证契约存在固定模型及范围冲突 | medium | verifying | Cursor | 2026-09-24;规则文本已缩为验证契约指针;客户端实际读取行为待实机 | [主记录](2026-09-24-subagent-workflow-research.md#4-issue-20260924-cursor-test-rule-drift) | [LESSON-20260924-cursor-hook-advisory-gates](../ops/lessons/2026-09-24-cursor-hook-advisory-gates.md) |
| ISSUE-20260924-pi-executor-boundaries | PI executor / 路径规范化 / MCP / 子进程 / 幂等 | 未发布初版只读边界与执行可靠性缺陷 | high | resolved | Cursor/Codex | 2026-09-24;173 工程回归与真实 Cursor CLI/MCP/PI | [主记录](2026-09-24-pi-executor-boundaries.md) | [工具路径与输入隔离](../ops/lessons/2026-09-24-pi-tool-boundaries.md) |
| ISSUE-20260924-cursor-cli-mcp-path | Cursor CLI / MCP / workspaceFolder / NDJSON | agentctl/jev MCP 加载失败(路径 + Content-Length 回包) | medium | verifying | Cursor | 2026-09-24;相对路径+NDJSON 已修;待 IDE 重载后 list-tools 实机 | [主记录](2026-09-24-pi-executor-boundaries.md#cursor-cli-mcp-path) | [LESSON-20260924-cursor-hook-advisory-gates](../ops/lessons/2026-09-24-cursor-hook-advisory-gates.md) |
| ISSUE-20260924-cursor-hook-event-contract | Cursor / hooks / beforeMCPExecution / probe | hook 事件 stdin 字段名与 matcher 官方未文档化 | medium | verifying | Cursor | 2026-09-24;IDE postToolUse tool_name=`MCP:pi_subagent_roles` 已采样;beforeMCP 全量 stdin 仍缺 | [主记录](2026-09-24-cursor-hook-event-contract.md) | [LESSON-20260924-cursor-hook-advisory-gates](../ops/lessons/2026-09-24-cursor-hook-advisory-gates.md) |
| ISSUE-20260924-non-author-400-duty | iam-authz / docgov / duty / 400 / 非编制 | 权限不足误报 400;run/edit 与编制职责绑死导致成员无法上传总结写草稿 | high | resolved | Cursor | 2026-09-24;真实 PI `TestNonAuthorMember_PiAgent_RunEditSubmitGates` PASS | [主记录](2026-09-24-non-author-member-access.md) | [LESSON-20260924-deny-only-submit](../ops/lessons/2026-09-24-deny-only-submit.md) |
| ISSUE-20260926-docgov-snapshot-load | docgov / loadDocumentFromDBLocked / review_snapshot_id / 跨重启批准 | 文档装载 SELECT 漏 review_snapshot_id,重启/缓存未命中后最终批准必失败 | high | resolved | pi | 2026-09-26;隔离库 PG 回归 + dev 真实批准 200/state=approved(dev `121b33f8`) | [主记录](../test-reports/2026-09-26-rdev-p3-rerun-test-report.md#5-2) | 待补 LESSON |
| ISSUE-20260926-docgov-uow-deadlock | docgov / persistApproveAndFAV / uow / FOR UPDATE / 57014 | docflow uow 行锁后 FAV 持久化自开第二连接更新同行,语句超时致死锁,所有最终批准失败 | critical | resolved | pi | 2026-09-26;生产形状 PG 回归(FOR UPDATE+FAV+Within)+ dev 真实批准转 200(dev `5d5cd5fd`) | [主记录](../test-reports/2026-09-26-rdev-p3-rerun-test-report.md#5-2) | 待补 LESSON |
| ISSUE-20260926-docgov-memdocs-poison | docgov / memDocs / 状态机 / 持久化失败 / 缓存投毒 | 状态机先改内存后落库;持久化失败不复原,memDocs 缓存与 DB 永久分叉并掩盖真实错误(表现为「approved 状态」误报) | high | investigating | pi | 2026-09-26;dev 两次复现(快照/死锁两根因均被投毒掩盖);修复方向:失败时回滚内存快照或失效缓存条目 | [主记录](../test-reports/2026-09-26-rdev-p3-rerun-test-report.md#5-2) | 待补 LESSON |
| ISSUE-20260926-ctx-idor | ctxmgr / GetUserContext / session_id / IDOR / handlers_context | GetUserContext 按 session_id 取消息无归属校验,登录用户可读他人会话正文(已证实) | critical | resolved | pi | 2026-09-26;handler 403 + SQL/内存双防线;内存 HTTP 与隔离 PG 回归 PASS | [主记录](../remediation/2026-09-26-system-code-review-fixes.md#1-find-sec-01-会话上下文-idorissue-20260926-ctx-idor) | [LESSON-20260926-failclosed-bypass-contract](../ops/lessons/2026-09-26-failclosed-bypass-contract.md) |
| ISSUE-20260926-archcheck-untracked | archtest / table_owners / untracked / sql_write / 门禁盲区 | arch-check 对未登记表 SQL 写静默跳过,含 swboot_controlled_executions 等 ~50 表;门禁形同关闭 | critical | resolved | pi | 2026-09-26;未登记表 fail-closed + 补登 50 表 + 噪音豁免清单;arch-check block PASS | [主记录](../remediation/2026-09-26-system-code-review-fixes.md#2-find-arch-01-arch-check-未登记表静默跳过issue-20260926-archcheck-untracked) | [LESSON-20260926-failclosed-bypass-contract](../ops/lessons/2026-09-26-failclosed-bypass-contract.md) |
| ISSUE-20260926-authz-failopen | authz / IsProjectMember / pool==nil / fail-open / NewInMemoryAuthorizer | Authorizer 无池时 IsProjectMember/IsProjectOwner 对任意登录用户返回 true,误配即全量放行 | high | resolved | pi | 2026-09-26;无池严格拒绝 + 显式内存授权接缝 + 组合根按 AllowInMemory 选择;隔离 PG authz 套件 PASS | [主记录](../remediation/2026-09-26-system-code-review-fixes.md#3-find-sec-02-authorizer-无池-fail-openissue-20260926-authz-failopen) | [LESSON-20260926-failclosed-bypass-contract](../ops/lessons/2026-09-26-failclosed-bypass-contract.md) |
| ISSUE-20260926-swboot-shell-prefix | swboot / executor / sh -c / 命令注入 / 前缀白名单 / commandAllowed | 受控命令经 sh -c 执行且白名单前缀匹配(go 放行 go-evil);元字符可求值 | high | resolved | pi | 2026-09-26;argv 化 + basename 精确匹配;前缀伪装/不求值回归 PASS | [主记录](../remediation/2026-09-26-system-code-review-fixes.md#4-find-sec-03-swboot-sh--c--前缀白名单issue-20260926-swboot-shell-prefix) | [LESSON-20260926-failclosed-bypass-contract](../ops/lessons/2026-09-26-failclosed-bypass-contract.md) |
| ISSUE-20260926-intentflow-validated-confirm | intentflow / DecisionConfirm / PlanProposed / validated_only / ExecuteClaimed | validated_only(shadow)计划可经 Confirm 进入 executing 并真实执行;执行器不读 ExecutionMode | high | resolved | pi | 2026-09-26;Confirm 拒 + 执行器硬拒双层 + 错误码/HTTP 映射;确认/派发双回归 PASS | [主记录](../remediation/2026-09-26-system-code-review-fixes.md#5-find-flow-01-validated_only-可-confirm-后-dispatchissue-20260926-intentflow-validated-confirm) | [LESSON-20260926-failclosed-bypass-contract](../ops/lessons/2026-09-26-failclosed-bypass-contract.md) |
| ISSUE-20260926-dual-flags-drift | intent / intentflow / FeatureFlags / PlanTier / MULTI_INTENT_ENABLED / 静默漂移 | 双套 flags 可配置出「intentflow 升档但 intent 关闭」的矛盾组合并静默降级 | high | resolved | pi | 2026-09-26;组合根经 intentflow.ValidateFlagConsistency 启动期 fail-fast + 单测;入口收敛残差另立 deferred | [主记录](../remediation/2026-09-26-system-code-review-fixes.md#6-find-qual-01-双套-flags-静默漂移issue-20260926-dual-flags-drift含残差) | [LESSON-20260926-failclosed-bypass-contract](../ops/lessons/2026-09-26-failclosed-bypass-contract.md) |
| ISSUE-20260926-governance-multi-entry | docgov / 多意图 / 多入口 / Coordinator / OwnerMux / GovernanceEngine | docgov 三入口 + Coordinator ~40 case 与 intentflow OwnerMux 平行,鉴权/确认/审计易漂移 | high | deferred | pi | 2026-09-26;flag 漂移面已修(dual-flags-drift);入口合并是多日级重构,需独立任务授权与回归矩阵 | [主记录](../remediation/2026-09-26-system-code-review-fixes.md#6-find-qual-01-双套-flags-静默漂移issue-20260926-dual-flags-drift含残差) | 沿用 failclosed-bypass-contract |
| ISSUE-20260926-server-pool-wiring | server / swboot_handlers / Runtime.Pool / 组合根越界 / FIND-ARCH-02 | server 持 Pool 直装 swboot repo/executor 并直查表,成为第二组合根(本轮未授权修复) | critical | open | pi | 2026-09-26;代码审证据齐(审计 FIND-ARCH-02),待修复授权 | [主记录](../audit/2026-09-26-system-code-review.md) | 待修复后补 |
| ISSUE-20260927-demo-fallback | web / App.tsx / sess-001 / projectId fallback / demo seeds 关闭 | demo seeds 关闭模式下前端硬编码 fallback(激活 sess-001、项目 1)对真实后端发假请求,新登录用户首屏 9 个 404/403(chat 窗口被迫回退本地缓存) | medium | resolved | pi | 2026-09-27;dev 真实浏览器修复前后对照(author+member 双账号:9 假请求→0) | [主记录](../ops/short-term/2026-09-27-frontend-demo-fallback.md) | [经验小结](../ops/short-term/2026-09-27-frontend-demo-fallback.md#经验小结)(独立 lesson 待后续任务补登) |
| ISSUE-20260927-active-session-residue | web / storage.ts / loadActiveSessionId / localStorage 残留 / sess-001 / demo-seed-purge 写回窗口 | 旧前端把 demo fallback 值写回 localStorage active_session;一次性 purge 已执行不再清,读取侧无 legacy 校验,老浏览器 + 无可见会话账号首屏 4×chat 404(ISSUE-20260927-demo-fallback 修复残留路径) | medium | resolved | pi | 2026-09-27;dev 主入口 :3100 复验 admin+残留 sess-001:phantom=0/4xx5xx=0,key 被清除(dev `36c5fb54`) | [主记录](../ops/short-term/2026-09-27-frontend-demo-fallback-localstorage-residue.md) | [经验小结](../ops/short-term/2026-09-27-frontend-demo-fallback-localstorage-residue.md#经验小结补充-issue-20260927-经验) |
+4 -1
View File
@@ -16,7 +16,10 @@
| GET /api/v1/tasks/runs/{id} | task_run | view | taskrun | 403 非 owner/非 owner 成员 |
| POST /api/v1/tasks/runs/{id}/cancel | task_run | cancel | taskrun | 403 取消他人 |
| POST /api/v1/chat/stream | chat | send | chat+stage | 403 无阶段权限 |
| GET /api/v1/docgov/* | document | * | docgov+duty | 403 非职责人 |
| GET /api/v1/docgov/* | document | * | docgov+duty | view:成员;run/edit:成员(deny_only_submit);submit/review/approve:对应职责,403 |
| POST /api/v1/docgov/content | document | edit | docgov+member | 403 非项目成员或锁定态 |
| POST /api/v1/docgov/submit-review | document | submit | docgov+author | 403 非编制职责人 |
| POST /api/v1/tasks/run | task | run | bizdev+member | 403 非成员 / 非活动阶段;不再要求编制职责 |
| GET /api/v1/admin/* | admin | * | authz RBAC | 403 非 admin/细粒度 perm |
| GET /health, /api/v1/health | system | health | server | 公开 |
+24 -3
View File
@@ -1,6 +1,6 @@
# Agent worktree 与 L1 操作规范
**修订**:`agent-governance-2026-09-21-r1`。来源:[AGENTS](../../AGENTS.md)、[规范登记](./2026-09-21-policy-registry.md)。工具为 `scripts/agentctl`(Python 标准库,Linux 本机),协议 v1;实际安装与验证见[实施任务](../archive/ops/2026-09-21-agent-governance-implementation.md)。
**修订**:`agent-governance-2026-09-21-r1`。来源:[AGENTS](../../AGENTS.md)、[规范登记](./2026-09-21-policy-registry.md)。工具为 `scripts/agentctl`(Python 标准库,macOS/Linux 双平台),协议 v1;实际安装与验证见[实施任务](../archive/ops/2026-09-21-agent-governance-implementation.md)。
本规范约束合作 Agent 的统一操作入口和 Git 提交/引用门禁。任意同 UID shell、修改管理器或跳过 hooks 仍可绕过;不把 L1 宣称为 OS 沙箱。共享服务配置与产品数据库不属于任务素材。
@@ -121,13 +121,34 @@ validate 要求干净树、记录精确 HEAD 与命令摘要;必要的实际
任务状态、集成、部署、远端同步和 cleanup 分别记录,见[收口清单](./templates/session-close-checklist.md)。命令结束不等于任务完成;task close 会拒绝仍有运行或待恢复 operation 的任务。
### 8.1 只读盘点(先盘点,再人工处置)
```bash
# 批量 worktree 清理就绪度;verdict=ready 才可考虑 remove。从不自动删除。
./scripts/agentctl cleanup report
# FEATURE-MATRIX 状态漂移:硬告警仅 done→非 done(ISSUE-20260923 工具化);
# open_capabilities 为人工判断候选。从不自动升 done / 写 MATRIX。
./scripts/agentctl docs drift
```
daemon 前台循环可按 `--audit-every N`(默认 30)周期跑上述盘点;**不在 daemon 内调用 `docs apply`**(主目录 cwd 必 `WORKTREE_MISMATCH`)。常驻 systemd/launchd 装载需独立授权,本规范默认不装载。
### 8.2 关闭与删除
```bash
./scripts/agentctl task close --id task-id --status done
./scripts/agent-worktree.sh remove feature/task-id --delete-branch
```
清理由目录外的维护者执行,核对实际 Git 映射、dev 祖先、所有证据、tracked/untracked/ignored 文件、未完成 Git 操作、registry、生命周期锁和使用目录的进程。只用普通 remove/-d,拒绝时保留 cleanup_pending 和复查责任,不换成强制删除。
清理由目录外的维护者执行,核对实际 Git 映射、dev 祖先、所有证据、tracked/untracked/ignored 文件、未完成 Git 操作、registry、生命周期锁和使用目录的进程。只用普通 remove/-d,拒绝时保留 cleanup_pending 和复查责任,不换成强制删除。盘点只读;删除仍人工;拒绝即保留 cleanup_pending。
**本机限制**:无法读取某些同 UID 进程 cwd 时,工具不能证明其未使用目录,故保留 cleanup_pending;只有明确识别的 OS 用户 systemd 管理进程有诊断性例外。测试中的 3 个删除正例仅替换 `/proc` 枚举以模拟可见主机,其余 Git/锁/文件条件为真实执行;可见占用、未知不可读、未合入、脏文件与活跃登记的拒绝另有真实/针对性测试。不要把这项限制转成跳过检查的通用开关。
**本机限制**:无法读取某些同 UID 进程 cwd 时,工具不能证明其未使用目录,故保留 cleanup_pending;明确识别的 OS 用户 launchd(macOS)/systemd(Linux)管理进程有诊断性例外。进程 cwd 可见性走双路径:Darwin 用 `lsof`,Linux 用 `/proc`;测试中的删除正例可替换对应枚举以模拟可见主机,其余 Git/锁/文件条件为真实执行;可见占用、未知不可读、未合入、脏文件与活跃登记的拒绝另有真实/针对性测试。不要把这项限制转成跳过检查的通用开关。
保护任务、旧 detached 工作区和非本次产物不自动清理。用户未要求 push 时仅本地提交/合入;用户已要求时再按授权同步并核对远端引用。
### 8.3 CodeGraph(治理加速器)
- `agentctl init` 与 `agent-worktree.sh create` 会 best-effort 初始化/同步 `.codegraph/`(CLI 缺失则跳过,不阻断)。
- `hooks install` 安装 `post-merge` / `post-checkout` → `hooks codegraph-sync`(fail-open,永不阻断 integrate)。
- 会话启动执行 `codegraph sync -q`。索引是 tree-sitter **近似**:有假阴性;**grep 是完整性唯一权威**;重命名与穷举调用方必须 grep 确认。
+38
View File
@@ -27,3 +27,41 @@ CURRENT 是带时间的活跃协调快照;Git/机器状态用于核验实际
## Herdr v1.2 局部修订
用户已授权采纳经研究修正的资源分工与自动审批。Herdr roster 的角色/额度/客户端参数由 `herdr-v1.2` 取代旧路由,仅在明确使用 Herdr 时激活,不扩展通用会话工作流。具体来源、验证与生效集成见[本轮任务](../archive/ops/2026-09-21-herdr-orchestration-v12.md)。已通过 dev 合并提交 `8c5e3477585fe27a485343dac97a670d95cf8905` 生效;profile/dry-run、入口保护和 Kimi 原子计数有隔离验收,真实 Herdr pane 启动未在本轮执行,不将其记为已实测。
## 系统问题分析局部修订
修订 ID:`systemic-issue-analysis-2026-09-23-r1`;owner:`Codex`;state:`active`(已通过 `958dd44fee8bbea8d19129457fc0ad749fdebdbe` 合入 dev);工具能力:`manual`。用户明确要求将“由个案追查同类根因、潜在问题,研究并提出方案”加入规范,授权与验证见 [任务记录](./short-term/2026-09-23-systemic-issue-analysis.md)。
核心行为唯一来源为 [AGENTS 分析要求](../../AGENTS.md#bug-与系统问题的分析要求),验证范围由 [验证契约](./2026-09-21-validation-contract.md#问题修复的回归范围) 定义,[分析模板](./templates/audit-note.md) 承载证据。客户端继续引用统一入口。生效提交为 `958dd44fee8bbea8d19129457fc0ad749fdebdbe`,候选验证与受控集成收据见任务记录;不新增业务实施或环境操作授权。
## 问题记录与经验复用局部修订
修订 ID:`issue-learning-2026-09-23-r1`;owner:Codex;state:`active`(已通过 `7bbd7a407f857515005c0324d90339017ea5f3e8` 合入 dev);执行能力:`manual`。用户要求同时管理出现的问题、修复记录和思路,并及时总结为开发注意事项,授权与验证见 [任务](short-term/2026-09-23-issue-learning.md)。
[闭环规范](2026-09-23-issue-learning-workflow.md) 为本流程唯一来源;AGENTS 增加按任务触发的读取/更新入口,模板承载证据,问题台账和经验索引提供检索。生效提交为包含本修订的首个受控 dev 集成提交,以任务收据与 Git 父链核实;未合入不能声称全仓生效。此修订不新增产品功能、自动门禁或运行权限。
## CodeGraph 与只读盘点局部修订
修订 ID:`codegraph-governance-2026-09-24-r1`;owner:`Cursor`;state:`active`(生效 tip `19eb56e3744d3c7d4b69b065c87e27689e8caa53` / fixup `0c676afe1faf831020c7c3201509d7cec0328d53`);工具能力:盘点命令与 hooks sync 为 `enforced`(脚本已落地);常驻 daemon 装载仍为 `manual`(本机默认不装载)。用户授权:将 CodeGraph 纳入治理启动/建场/sync,并对 worktree 清理与 FEATURE-MATRIX 做只读盘点提醒(不自动删除、不自动升 done)。
唯一来源增补:[AGENTS §1/§4](../../AGENTS.md)、[worktree 操作规范 §8](./2026-09-21-agent-worktree-workflow.md)、[收口清单](./templates/session-close-checklist.md)。命令入口:`agentctl cleanup report`、`agentctl docs drift`、`agentctl hooks codegraph-sync`、建场 `agent-worktree.sh create` 的 best-effort `codegraph init`。不改产品 SWBOOT-10 stub,不装载 systemd coordinator(需另授)。
## Subagent 工作流拟议修订
修订 ID:`subagent-workflow-2026-09-24-r2`;owner:Codex;state:`proposed`;能力:`manual`;effective_commit:无。
用户要求研究 Cursor Auto 下的 subagent 分工、阶段流程及报告,授权与本次验收见[任务](short-term/2026-09-24-subagent-workflow-standard.md)。[规范草案](2026-09-24-subagent-workflow-standard.md)为拟议行为的唯一来源,[研究报告](../audit/2026-09-24-subagent-workflow-research.md)给出事实和待修冲突,[模板](templates/subagent-stage-record.md)承载交接。
用户后续明确采用 Cursor Auto 实施 + gmktec 本机 PI 子任务,并批准默认模型分工及可调整文档。[模型配置](2026-09-24-subagent-model-config.md)为模型路由唯一来源,decision_state=approved;流程整体仍 proposed;已批准的模型配置与执行器已合入本地 dev。原 Cursor 原生角色/inherit 方案被替代。执行器已在任务分支实现并验证 Cursor CLI→MCP→PI,代码 69ffaa677e23a1dd9aa0528bb09b3acfcd38b119;[运行说明](2026-09-24-pi-subagent-executor.md)与[验证报告](../test-reports/2026-09-24-pi-executor-test-report.md)限定已验证的机器边界。dev 集成/完整流程审批仍独立记录;不以派发器可用宣称全阶段自动门禁。
## Cursor 治理层局部修订
修订 ID:`cursor-governance-2026-09-24-r1`;owner:`Cursor`;state:合入 local_dev 后 `active`(effective_commit 以集成收据为准);工具能力分层:
- 规则/skill 文本:`manual`(Agent 读取执行)
- hook 脚本 stdin→stdout 行为:`enforced`(`scripts/tests/test_cursor_hooks.py`)
- hook ↔ Cursor IDE 接线:`advisory`/`manual`(事件字段待 probe 采样;见 ISSUE-20260924-cursor-hook-event-contract)
用户授权:在 PI 执行器合入后补齐 skills/rules/hooks;范围与验收见[任务](short-term/2026-09-24-cursor-governance-hooks.md)。客户端入口:`.cursor/rules/cursor-hooks.mdc`、`pi-subagents.mdc`、`test-reports-standard.mdc`(缩为验证契约指针);skills `pi-subagent-dispatch` / `subagent-stage-record`;hooks 见 `.cursor/hooks.json`。不改变产品 Runner、不扩大执行器硬门禁语义。
## 治理目录库与需求重叠检测拟议修订
修订 ID:`governance-catalog-2026-09-24-r1`;owner:`Cursor`;state:`proposed`;能力:schema/门禁落地后为 `enforced`,向量层 `fail-open`;effective_commit:无(随受控合入记录)。
用户授权实施跨对话需求重叠检测与治理目录(扩展既有 `.locks/state.sqlite`,不碰业务 PG)。唯一来源:[方案](./2026-09-24-governance-catalog-plan.md);任务:[short-term](./short-term/2026-09-24-governance-catalog.md)。策略键 `catalog_gate`/`catalog_vector` 为可选,不得破坏 `shared_docs` 等集合相等校验。
+13 -4
View File
@@ -15,6 +15,12 @@
多类变更取并集。按 [模块开发标准](../system-design/2026-09-20-module-development-standards.md) 追加边界与 registry parity 等范围门禁。开发阶段可用 stub;交付验收不能冒充真实执行。纯文档无需产品 PI 或全量 Go,也不为形式重建服务。
## 问题修复的回归范围
Bug/系统问题修复先按 [AGENTS 分析要求](../../AGENTS.md#bug-与系统问题的分析要求) 确定问题类别和影响范围,再从上表选择验证层级。验收须包含:原始复现案例;通过同一机制的其他输入、措辞或入口;相关边界/异常路径;应保持不变的正常行为。场景按实际因果链选择,不机械穷举;不适用或未覆盖的项记录理由与风险。
验证机制和预期行为,不以硬编码原句、固定回复文本或单个样例通过代替回归。能在修复前复现失败的场景记录修复前后对照;不能复现时说明证据限制。报告逐项区分通过、失败、未运行与待验证;只提供分析/方案时列出验收设计,不声称已经运行或修复。
## 产品 PI 基线与精确追加
优先入口:`./scripts/run-nightly-real-pi.sh`。调用前核验并从获授权配置提供(不在命令/报告贴凭证值):
@@ -25,14 +31,17 @@
- 目标环境批准的实际模型、协议及制品;通过 `PI_AGENT_MODEL` 传入批准值并比对 Runner 实际配置。脚本默认值不构成批准,也不证明实际模型。
- 脚本可能构建候选镜像、写 promotion receipt;须满足构建身份/授权条件。`NIGHTLY_SKIP_IMAGE_BUILD=1` 不能补足缺失的制品摘要证据。
脚本当前筛选 **仅两项**:
脚本当前筛选 **五项**(U8 + 四条工作流治理链):
```text
TestMultiIntentU8_RealPI_ConfirmGenerate_PG
TestWorkflowGovernance_PiAgent_PG_FullChain
TestWorkflowGovernance_PiAgent_PG_ProductManager_FullChain
TestWorkflowGovernance_PiAgent_PG_TestManager_FullChain
TestWorkflowGovernance_PiAgent_PG_FullNoneMixedChain
```
它不是“全部工作流通过”。按变更范围追加精确名称,例如(前提条件已核验,且已处于相应环境执行租约/独立环境):
它覆盖 main / product_manager / test_manager / FullNone 四条工作流治理链,但**不是**「全部工作流通过」,也不含 rdev P3 Go 顶层(rdev 仍用 Python 三样本 harness)。按变更范围追加精确名称,例如(前提条件已核验,且已处于相应环境执行租约/独立环境):
```bash
go test -count=1 -timeout 2h -v ./internal/server/ -run '^TestPiAgent_FullLifecycle_MultiRole_RealWorld_E2E$'
@@ -43,7 +52,7 @@ go test -count=1 -timeout 90m -v ./internal/server/ -run '^TestWorkflowGovernanc
测试筛选区分大小写;`-run 'PI'` 不能选择名称中的 `PiAgent`。追加用例先读其环境前提;FullLifecycle 中 `RUN_FULL_ADHOC_WBS` 与 `RUN_HEAVY_STAGES` 控制额外段,不能把默认未跑段报为已覆盖。普通 PG 用例同样以源码中的精确名称/前提为准。
运行前列 `expected_tests`(含必须子场景),运行后逐项对照执行、PASS、FAIL、SKIP、未匹配及重试。退出码 0 或 nightly receipt `pass` 不能替代该对照:基线脚本逐项核对两个预期顶层测试;额外子场景/用例仍须逐项核验。缺项不记 PASS,基础设施问题记录 blocker/infra_fail。保留首轮与重试关系,不隐藏失败。
运行前列 `expected_tests`(含必须子场景),运行后逐项对照执行、PASS、FAIL、SKIP、未匹配及重试。退出码 0 或 nightly receipt `pass` 不能替代该对照:基线脚本逐项核对五个预期顶层测试;额外子场景/用例仍须逐项核验。缺项不记 PASS,基础设施问题记录 blocker/infra_fail。保留首轮与重试关系,不隐藏失败。
## 模型与环境证据
@@ -59,4 +68,4 @@ go test -count=1 -timeout 90m -v ./internal/server/ -run '^TestWorkflowGovernanc
## 工程工具验收补充
本地协调与运维守卫使用 `python3 -B -m unittest discover -s scripts/tests -p 'test_*.py' -v`,在临时真实 Git/SQLite/进程环境执行;Docker 守卫测试使用受控目标记录调用,不重建共享服务。nightly 入口现在核对最终尝试日志中两个预期顶层测试均恰好执行且 PASS;零用例、部分 SKIP 或重复拼接证据均不能生成 PASS 收据。该日志核验不是本轮执行了产品 PI 的声明。
本地协调与运维守卫使用 `python3 -B -m unittest discover -s scripts/tests -p 'test_*.py' -v`,在临时真实 Git/SQLite/进程环境执行;Docker 守卫测试使用受控目标记录调用,不重建共享服务。nightly 入口现在核对最终尝试日志中五个预期顶层测试均恰好执行且 PASS;零用例、部分 SKIP 或重复拼接证据均不能生成 PASS 收据。该日志核验不是本轮执行了产品 PI 的声明。
@@ -0,0 +1,38 @@
---
title: "agentctl Cursor 能力层(skills / MCP / rules / hooks)"
status: active
created: 2026-09-23
updated: 2026-09-23
owner: Cursor
task_id: agentctl-cursor-integration-2026-09-23
---
# agentctl Cursor 能力层
把已上线的 agentctl 管理面包装为 Cursor 原生能力,使 agent 默认走租约 / docs 收据 / 候选合入。
## 能力清单
| 层 | 路径 | 作用 |
|---|---|---|
| MCP | [`.cursor/mcp.json`](../../.cursor/mcp.json) → [`scripts/mcp/agentctl-mcp.mjs`](../../scripts/mcp/agentctl-mcp.mjs) | `status` / `task_*` / `lease_run` / `docs_*` / `validate` / `queue_enqueue` / `quarantine_status` |
| Skills | [`.cursor/skills/agentctl-*`](../../.cursor/skills/) | 会话启动、建场、租约写、集成收口 |
| Rule | [`.cursor/rules/agentctl-mandatory.mdc`](../../.cursor/rules/agentctl-mandatory.mdc) | alwaysApply:强制走 agentctl |
| Hooks | [`.cursor/hooks.json`](../../.cursor/hooks.json) + `guard-git.sh` | `git push` / 破坏性 git → `permission: ask` |
权威规则仍是 [AGENTS.md](../../AGENTS.md) 与 [操作规范](./2026-09-21-agent-worktree-workflow.md);本目录不复制全文。
## 启用
1. 合入 local `dev` 后,在 Cursor 中 **Reload Window** 或重载 MCP。
2. 确认 MCP 服务器 `agentctl` 出现在工具列表;hooks 出现在 Cursor Hooks 设置页。
3. 会话开始跟 skill `agentctl-session-start`(核对 `daemon status`)。
## 与管理面关系
- launchd `com.agentctl.coordinator` 持续 `queue schedule`;本能力层只封装 CLI,不替代 daemon。
- git hooks(pre-commit / pre-merge / reference-transaction)仍由 `agentctl hooks` 管理,与 Cursor `beforeShellExecution` 互补:前者执行租约/候选门禁,后者拦未授权 push/强推。
## 非目标
不 push;不晋升 test/main;不改 gap-matrix;不卸载 daemon。
@@ -0,0 +1,61 @@
# 问题记录与开发经验闭环
修订:`issue-learning-2026-09-23-r1`;owner:Codex;生效条件见 [规范登记](2026-09-21-policy-registry.md)。执行能力为 `manual`:依靠 Agent 读取、任务记录与审查;本轮没有增加自动检索、CI 阻断或模型训练。
## 入口与职责
| 入口 | 回答的问题 | 权威边界 |
|---|---|---|
| [问题台账](../audit/ISSUES.md) | 出现过什么问题,目前处理到哪一步? | 索引和状态投影;事实、修复经过以链接的唯一问题主记录为准 |
| 问题主记录 | 为什么发生、考虑过哪些方案、改了什么、如何验证? | 放 audit,或沿用已有任务/审计中的明确章节;使用 [问题模板](templates/issue-record.md) |
| [开发经验](lessons/INDEX.md) | 遇到类似工作应先检查什么? | 按机制提炼的注意事项;使用 [经验模板](templates/development-lesson.md),不替代现行规范 |
| CURRENT / FEATURE-MATRIX / gap-matrix | 当前协调 / 能力 / 发布门禁 | 维持原职责;只有对应状态改变才更新 |
修复方案、任务、提交、验收报告通过链接串联,已有材料直接复用。一个 task 可处理多个 issue,一个 issue 可跨分析/实施任务;研究任务 done 不等于问题 resolved。一个 lesson 可覆盖多个同根因 issue。短问题可在任务主文档内记录,无需机械创建一套文件。
## 何时记录、检索和总结
1. **设计、编码、排障或运维前**:按模块、路径、错误码、症状和共用机制检索问题台账及经验索引。先查索引、再读命中条目的来源;核对当前源码/规范是否仍适用。在任务记录填写检索词、命中 ID、采纳的检查;无命中明确记录。简单信息答复不要求建任务或检索整库。
2. **首次发现问题时**:在当前任务 worktree 建立或补充问题主记录和台账行,记录预期/实际、影响、环境/版本、owner、下一步及证据缺口;尚未定位也可以登记。ID 使用 `ISSUE-YYYYMMDD-<slug>`,日期为登记日;发生日期另列,跨 worktree 以语义 slug 避免抢序号。
3. **定位、改方案、完成修复或发现验收失败时**:在同一主记录追加时间线和尝试结果;保留被否定假设、失败方案及不适用条件,区分观察、推测和已证实根因。按 [问题分析要求](../../AGENTS.md#bug-与系统问题的分析要求) 检查共用机制和同类入口。
4. **根因与修复得到验证后、任务收口前**:提炼经验或更新已有同机制经验,并链接回问题。若尚无验证证据,只能建 `candidate`;若没有新增可复用结论,记“不新增经验”及理由,仍保留问题记录。分析-only、未修复或验收失败的问题继续留在台账。
5. **经验落到开发动作**:写清触发条件、机制、应做检查、错误做法及原因、验证方法、适用边界。优先链接现有测试/约束;需要新增回归、lint、架构门禁或规范时,在当前授权内实施,超出授权则记录 owner/后续任务。仅提出自动化建议不能标为已落实。
6. **复发或规则变化时**:同一故障未解决的复现追加原 issue;已关闭问题再次出现,重开原 issue 为 `investigating`,递增 `recurrence_count` 并保留原关闭证据。不同根因建立新 issue 并互相链接。复盘为何已有经验/测试未生效:未检索、范围不适用、遗漏入口、检查未执行或实现回退,并更新防护。模块/接口/规范变化时复核命中经验;确认过时标 `superseded` 并链接替代条目,无替代则 `retired`,保留历史。
检索示例(在任务工作区执行,替换为本任务关键词):
```bash
rg -n -i 'docgov|nullable|23503|职责' .doc/audit/ISSUES.md .doc/ops/lessons
```
owner 在上述里程碑及时更新,最迟在会话交接前保存事实和未完成项;不依赖定时服务。经验不会自动改变模型参数,作用是让后续 Agent 能检索、有证据地复用,并逐步把重复风险转换为可执行检查。
## 问题状态与关闭条件
问题的 `issue_state` 与任务 `status` 分开;台账保留当前投影,主记录保留变迁历史。
| issue_state | 含义 / 转移要求 |
|---|---|
| open | 已登记,等待定位 |
| investigating | 正在复现、验证假设和范围 |
| fixing | 修复方案明确且已获实施授权 |
| verifying | 修复待验收,或必要证据尚缺 |
| resolved | 约定范围的修复、必要环境验收均有证据,经验已总结或有不新增理由 |
| deferred | 暂缓处理;保留风险、责任人、复查触发和授权/决策依据,不冒充修复 |
| duplicate | 指向唯一主 issue,保留原报告和去重理由 |
定位失败可保留 investigating;临时止血不代表 resolved,必须标清剩余根治项。验证失败回到 investigating/fixing,不能覆盖失败记录。关闭至少能追溯:根因、同类范围、修复提交或获授权的处理动作、原例/变体/正常行为验收及缺项、实际部署状态、lesson 或不新增理由。业务改动待部署时不能把目标环境问题关闭;无需部署写 not_required。
**历史补录**:发生日、修复日和补录日分开。只按旧报告已证明的范围记录 `resolved`,同时标 `evidence_basis=historical` 和当前运行未复测;缺乏关闭证据用 `verifying` 并说明原因,不从旧任务 done 推导修复完成。历史条目不能用于宣布当前系统就绪。本轮仅补录两个有来源案例,不代表穷尽全部历史问题。
## 经验质量与维护
`lesson_state`:`candidate | validated | superseded | retired`。validated 表示注意事项有可核对的因果证据且已复核适用边界,不表示所有模块或当前线上均测试通过。需记录 reviewer、last_reviewed、reviewed_revision、来源 issue、证据日期、关键词、关联测试、适用/不适用范围及仍缺的防护。
同机制优先更新已有 lesson,保留修订记录;新机制才新增 `LESSON-YYYYMMDD-<slug>`。将通用经验升级成强制规范时,只在对应规范的唯一来源修改并登记生效条件,经验条目保留理由与链接。经验与现行规范冲突时先按有效规范执行,登记冲突与复核项;历史经验不能授予数据修复、部署或扩大范围的权限。
## 并发、验收与敏感信息
所有写入沿用 [worktree 操作规范](2026-09-21-agent-worktree-workflow.md)。问题/经验索引使用各自 `path:` 短租约;当前 `agentctl docs apply` 仅覆盖 CURRENT/FEATURE-MATRIX,不宣称新索引有行级 CAS。写入前读最新内容、只改自己的条目;从旧 dev 分出的工作区在集成前合并最新 dev 并处理索引冲突,保留他人条目。索引和主记录在同一逻辑提交同步,避免状态分叉。
文档验收包括链接/锚点、ID 唯一、主记录与索引状态一致、来源及日期、入口/模板可达和情景检查。运行回归按 [验证契约](2026-09-21-validation-contract.md);未运行、缺项与历史证据单独标明。只保留足够判断的脱敏证据,业务正文、凭证和个人数据不复制进经验库。
@@ -0,0 +1,46 @@
# 治理目录库与跨对话需求重叠检测(方案)
**修订 ID**:`governance-catalog-2026-09-24-r1`
**state**:`proposed` → 实施后随合入升 `active`
**owner**:Cursor
**工具能力**:schema/CRUD/门禁 `enforced`(落地后);向量层 `fail-open`
**任务**:[short-term](./short-term/2026-09-24-governance-catalog.md)
## 问题
跨对话新设计与既有功能/需求重叠时,现有 agentctl 仅做路径级 `overlaps()` 互斥,无需求语义比对。CURRENT/ISSUES/test-reports 为 Markdown 台账,机器无法强制开工前探测。
## 方案摘要
在既有 `.locks/state.sqlite`(与业务 PG 物理隔离)上 additive 扩展 Catalog 表:
| 表 | 用途 |
|---|---|
| `catalog_requirements` | R-ID 需求条目 |
| `catalog_features` | 对齐 FEATURE-MATRIX record_id |
| `catalog_req_text` | FTS5 CJK 逐字索引(禁用 trigram) |
| `catalog_overlaps` / `catalog_decisions` | 检测结果与裁决留痕 |
| `catalog_issues` / `catalog_tests` / `catalog_releases` | 缺陷/测试/发布投影 |
| `catalog_embeddings` | 可降级向量增强 |
### 分级门禁
1. **L1 结构化**:`same_mutex` / `same_feature` / `same_scope` / `same_req_id` → hard deny
2. **L2 语义**:FTS5 bm25 软门,须 `catalog overlap ack` 显式裁决后才可编码
3. **L3 向量**:读 `EMBEDDING_*`;401/超时/缺钥 → `vector_layer=degraded`,不阻断
### 策略
`catalog_gate` / `catalog_vector` 为**可选键**(不得加入 `shared_docs` 等集合相等校验字段)。
### 权威关系
`.doc` Markdown 仍为事实来源;Catalog 为可检索投影 + 门禁依据;冲突时 `catalog drift` 告警,不自动改文档。
## 边界
不新建第二库/容器;不读写业务 PostgreSQL;不改 `overlaps()` 既有语义;不做跨机权威。
## CLI / MCP
`agentctl catalog {add,list,show,search,overlap,ack,status,drift}`;MCP:`catalog_requirement_add` / `catalog_overlap_probe` / `catalog_overlap_ack` / `catalog_search` / `catalog_status`。
@@ -0,0 +1,47 @@
# 本机 PI Subagent 执行器接入方案与实施记录
task_id:subagent-workflow-standard-2026-09-24;operation_task_id:subagent-workflow-standard-2026-09-24-executor。
用户授权:“接入自动调用 pi 的执行器”;既有约束:Cursor Auto 实施,PI 模型限[配置](2026-09-24-subagent-model-config.md),M3 默认停用。本次是同任务的实现续作。
## 目标与边界
Cursor 能通过项目 MCP 自动按角色调用 gmktec 本机 PI,读取配置,提供冻结输入,获得持久报告和可核验状态。CLI 同步提供可复现入口。
不修改产品服务/Runner、不操作真实业务数据、不安装 daemon、不 push。代码只在原登记 worktree 修改,当前 main 有其他任务的未跟踪 promotion receipt,保留不动。
本次复核 local dev=6858e21d477571696a8458032e2c884449e773fd;原任务 HEAD=52462b45e985f596b2a503fc70ac12c3bd5fe571;新增 dev 差异为 internal/squad,与本次脚本无交叉。没有重新建场或切换主目录分支。
## 分工与执行方式
- Cursor Auto:编写执行器、MCP 接口、权限限制与测试。host Codex:需求/契约、文档、证据核验、审查与受控提交。
- Cursor CLI 在已登记原任务 worktree、agentctl with 监督和精确路径租约内执行;不授予提交/合并/推送/环境操作权限。模型请求 Auto;实际底层模型不可见时记录 unknown。
- 本次使用 ce-work 的执行/验证思路、CodeGraph 定位、test-driven-development 和 writing-for-agents。仓库 AGENTS 的原任务 worktree/agentctl 规则优先于技能中 detached 临时工作区机制;使用仓库 supervisor 派发 Cursor,代码路径单写者,外层核对差异。该隔离不是 OS 沙箱。
- 范围:scripts/pi_subagents.py、scripts/pi-subagent-readonly.ts、scripts/mcp/pi-subagents-mcp.mjs、scripts/tests/test_pi_subagents.py、scripts/mcp/README.md、.cursor/mcp.json、.cursor/rules/pi-subagents.mdc,以及本任务相关 .doc 文档。
- 认领能力仅 docs:publish;不注册 env:* 或 git:dev。后续集成另按受控候选流程处理。
## 设计契约
1. 配置文档是唯一模型来源,每次派发解析严格表格,记录 revision/hash 和实际 provider/model。禁用、未知、循环、M3 关键职责路由失败关闭;没有静默备用。
2. 新鲜 PI 会话;冻结 source SHA 与显式 tracked 输入文件(拒绝秘密/业务 data/路径穿越/符号链接),上限限制。模型只得到选定输入与允许的只读工具,无任意 shell、源码写入或递归派发。
3. 测试角色仅运行主 Agent 显式提供、带来源的 argv 计划;独立源码副本、净化环境、超时和输出限制,模型不生成可执行命令。共享业务环境本版不接入,返回明确限制。
4. MCP 提供角色预览、运行、结果查询;跨 worktree 调用核对同仓与 task 注册;运行由权威 agentctl with 包裹,并由执行器校验继承租约。
5. 每个 request_id 绑定输入摘要;同请求重放只查询,变更载荷拒绝,running/unknown 不重派。每请求独立短范围 report 路径锁,跨调用者统一并发上限。
6. 运行前保存 running;完成保存 receipt.json/report.md,含命令、版本、输入摘要、配置摘要、状态/结论、报告来源。结果未知/失败不冒充通过,进程退出0不替代模型最终事件和必需测试结果。
7. timeout/cancel 处理进程组并回收;未知副作用保留现场。凭证仅由 PI 客户端读取,绝不进入模型输入/报告;测试子进程不继承模型密钥或租约身份。
8. MCP 用标准 stdio JSON-RPC,查询不被运行调用阻塞。项目规则告诉 Cursor 何时选择哪种 role_id,具体模型仍从配置读取。
9. 实施与修复始终交给 Cursor;PI 负责分析/审查/验证。模型结论和 acceptance_owner 的最终验收分开。
## 验证计划
- 隔离真实 Git/agentctl:注册/租约负例、路径范围、报告落盘、请求幂等、并发与异常退出。
- 本地假 PI 仅作为协议传输夹具:模型参数、权限开关、JSON 事件、错误/空响应/超时/子进程清理;不得当作真实模型能力验收。
- MCP 实进程:initialize、tools/list、roles、run、result;错误必须 isError。
- 实际本机 PI:至少一条真实分析请求与独立代码审查;模型/权限/配置/源码身份可追溯。不得把 CLI/MCP 接口实测写成 Cursor IDE 页面已实测。
- 主机核验聚焦测试与工程脚本套件,按失败证据补回归;无需运行无关产品全量 Go、重建服务或产品 PI。
- 收口保留运行结果和剩余条件,分别记录 local commit / integration / deployment / remote_sync / cleanup。
## 当前进度
2026-09-24:Cursor Auto 已在 agentctl supervisor 内启动;本轮尚未宣称实现完成。机器租约身份和终端输出由 host 核验,待实施结果后补测试与审查。
## 已验证结果
执行器代码已提交为 69ffaa677e23a1dd9aa0528bb09b3acfcd38b119。完整工程回归 173 项、提交后专项 34 项、真实 Cursor CLI→MCP→PI 自动路由与最终 ls/read 均通过,详见[报告](../test-reports/2026-09-24-pi-executor-test-report.md)。文档配置已改为程序读取;完整审批状态机仍人工/Agent 遵约。已受控合入本地 dev,集成提交 5a8540804ee2d142a0894c1482a2a16e8f843915,未推送;Cursor IDE 页面仍未实测。
@@ -0,0 +1,80 @@
# 本机 PI Subagent 执行器使用说明
范围:Cursor Auto 主协调/代码实施,gmktec 本机 PI 子任务。模型分工唯一来源为[模型配置](2026-09-24-subagent-model-config.md),阶段定义见[流程规范](2026-09-24-subagent-workflow-standard.md)。本说明与代码已合入本地 dev;集成和最终实测状态见[实施记录](2026-09-24-pi-executor-implementation.md)。
## Cursor 中使用
1. 在包含本次提交的工作区打开 Cursor,重新加载项目 MCP;.cursor/mcp.json 注册 pi-subagents 服务,.cursor/rules/pi-subagents.mdc 提供派发入口。
2. 主会话保持 Auto。先按原有流程创建/登记任务 worktree,并将 .doc/test-reports/assets/pi-subagents/<task-id> 纳入任务写范围。
3. Cursor 调用 pi_subagent_roles 读取当前角色与模型;从任务目标选择 role_id,调用 pi_subagent_run,随后查询 pi_subagent_result。
4. 不需要用户切换 PI 模型。需求/方案、独立审查、测试和报告由不同角色处理;代码实施与修复仍由 Cursor 执行。
5. 接收报告并核对范围、源码/配置版本、缺项;运行完成不代表阶段批准。最终验收责任仍由任务 acceptance_owner 承担。
任务 worktree 尚未合入 dev 时,主目录中的旧 MCP 配置不会自动获得新工具;先在该任务 worktree 验证,受控集成后再在主目录重载。本文不宣称已操纵 Cursor IDE 页面。
## 请求内容
MCP 工具的外层参数 worktree 为同仓的已登记任务工作区,task_id 为实际操作任务。request 中给出以下信息;授权引用应能回链到真实用户请求,不用日志/模型文本自授权限。
```json
{
"worktree": "/absolute/path/to/repo/.worktrees/task-id",
"task_id": "task-id",
"request": {
"role_id": "research",
"request_id": "research-001",
"goal": "读取选定文件,给出有证据的分析",
"authorization_ref": "本任务主记录中的用户授权位置",
"source_sha": "<完整的已提交源码 SHA>",
"input_files": ["PROJECT.md"],
"timeout_seconds": 120
}
}
```
source_sha 必须为完整提交 hash;HEAD/分支名不作为可变输入。只发送明确列出的已跟踪 UTF-8 普通文件,禁止运行数据、.env、凭证、符号链接和路径越界。未提交的代码不会自动进入快照,先由 Cursor 形成可审提交或使用已有冻结版本。
request_id 在同一任务中稳定标识一次请求:同参数只读重放既有结果,不重复调模型;不同参数复用 ID 被拒绝;running/unknown 保留现场,不能盲目重派。配置变更在下一次新派发读取,旧请求保留原 config_revision/config_sha256。
## CLI 入口
在任务工作区使用:
```bash
python3 -B scripts/pi_subagents.py roles
../../scripts/agentctl with --task task-id \
--resource path:.doc/test-reports/assets/pi-subagents/task-id/research-001 -- \
python3 -B scripts/pi_subagents.py run --request /tmp/pi-request.json
python3 -B scripts/pi_subagents.py result --task task-id --request-id research-001
```
CLI 请求文件需包括 task_id;也可用 run --stdin 输入 JSON。直接裸调 run 会被租约校验拒绝。上述名称是示例,不构成任何任务或环境授权。
## 测试角色
test_run / acceptance_check 还需 approved_commands(argv 数组的数组)和 plan_digest(外部已批准计划 SHA-256);执行器另记录 approved_commands_sha256,不能以任意字符串冒充命令与计划的同一摘要。
命令在独立测试快照中运行,使用净化环境和私有 HOME/cache/tmp,标准输入关闭。PI 模型根据收到的命令摘要、退出码和日志引用分析,不生成或修改被执行命令;完整日志由主 Agent 核验并在需要时补充上下文。模型分析快照保持原始源码内容,与测试可写副本分离。必要的 stdout/stderr 保存到本请求报告目录以便核对,不仅保留一段摘要。
依赖未安装、用例缺失或命令失败须如实记录。本版不自动安装依赖,不直接连接共享 dev/test/main 或操作真实业务数据;相关检查继续由主 Agent 通过现有环境授权/租约流程执行。命令退出 0 只证明命令层执行成功;必需用例是否执行、SKIP、持久性/UI 和业务验收仍按验证契约核对。
## 证据与状态
输出位置:.doc/test-reports/assets/pi-subagents/<task-id>/<request-id>/。
- receipt.json:请求摘要、配置摘要、源码/输入文件摘要、配置与观察到的模型、运行状态、命令结果、工具调用摘要。
- report.md:可读报告;模型分析是审查输入,主 Agent 核对后再推进阶段。
- 命令日志:按收据记录的位置查询;报告目录受对应 path 租约保护。
- 模型私有 thinking 不作为归档材料。错误输出与日志按敏感信息规则处理;不保存凭证。
run_status 与 verdict 分开:模型正常结束可以是 succeeded,但非测试报告仍为 review_state=pending / verdict=not_applicable。测试报告的 commands_passed/pass 只针对提交的命令,不能直接赋值到任务的 review_state 或 acceptance。失败、取消、结果未知不能换成 PASS。
超时、取消和输出超限处理整个受控进程组。只读结果查询可推断 orphan 为 unknown,但不能通过查询无租约改写收据。错误前置检查未形成业务收据时,MCP 返回可核对的执行拒绝,不能让主 Agent 一直等待不存在的结果。
## 调整与边界
角色默认模型、enabled、升级角色和并发上限在模型配置文档维护。禁用角色前同步处理指向它的升级关系。程序仅接受当前明确批准的五个 provider/model 组合;扩大模型池还需用户授权并更新硬边界校验,不是任意改一行即放宽权限。
本工具提供配置解析、模型启动、有限工具/输入范围、租约、进程监督和证据保存;没有把全部 S0–S9 的审批实现成不可跳过的状态机。Cursor 通过规则决定何时调用;模型失败不会触发隐式换 provider 或降级到 M3。
进程组和工具权限限制不是 OS 沙箱。批准的测试代码与本机工程工具属于可信执行面;外部不可信项目/代码不能因使用本工具就获得运行授权。普通 Cursor/PI 配置与 Herdr、产品 PI Runner 各自独立。
@@ -0,0 +1,88 @@
# Subagent 模型分配配置
config_revision:`subagent-models-2026-09-24-r1`
owner:用户;维护执行者:当前任务主 Agent。
decision_state:`approved`(本会话确认);integration_state:`merged`;execution:`enforced`(本执行器已验证的配置/租约/工具/进程边界);阶段审批仍为 manual。
**这是模型分配的唯一配置文档。** 用户调整下列表格;主 Agent 每次派发前读取,并把解析结果写入[派发记录](templates/subagent-stage-record.md)。`scripts/pi_subagents.py` 已直接解析本文件,Cursor MCP 提供角色预览、派发与结果查询;每次新派发读取配置,旧请求保留旧摘要。实测与边界见[运行说明](2026-09-24-pi-subagent-executor.md)和[报告](../test-reports/2026-09-24-pi-executor-test-report.md)。完整流程见[协作规范](2026-09-24-subagent-workflow-standard.md)。
## 1. 日常调整入口
| 想调整什么 | 修改位置 | 生效方式 |
|---|---|---|
| 某角色的默认模型 | §3 对应角色的“默认模型”列 | 修改后递增 config_revision;下一次派发读取 |
| 复杂任务的升级去向 | §3 “升级角色”列 | 升级时保留原报告与原因;以目标角色重新派发 |
| 启停某角色 | §3 enabled 列 | false 时不自动派发;引用该角色的升级关系须同时调整;必需职责暂停或显式重新分配,不能跳过门禁 |
| 允许使用的 provider/model | §2 模型池 | 使用本机精确 ID;新增模型需用户明确调整授权范围并更新程序硬边界校验 |
| 并发量、失败处理 | §4 | 主 Agent 按配置与任务实际资源取更严格边界 |
| 只改本次任务 | 在任务主记录写 override | 记录用户指令、角色、原值/新值、期限;不改全局默认 |
文档中表格值为配置;其他文件只引用本文件,不重复维护模型名。用户可以直接编辑,也可以说“把本任务 code_review 改用 qwen_max”或“以后 report 都用 glm_full”。后者需按仓库 worktree/受控集成流程保存。
字段规则:enabled 只取 true/false;默认模型引用 §2 的 alias;升级角色引用 §3 的 role_id,或 none;缺字段、未知 alias、循环升级、角色越权时停止该派发并报告错误,不自行猜测模型。
## 2. 允许的模型池
主会话:**Cursor,模型选择 Auto**;工程子任务:**gmktec 本机 PI CLI**。这份配置不改变 Cursor UI 模型开关、PI 全局默认设置或产品 PI Agent Runner。
| alias | provider | model(精确 ID) | 使用限制 |
|---|---|---|---|
| qwen_max | qwen-token-plan-cn | qwen3.8-max | 可分配分析、规划、报告与复核 |
| qwen_flash | qwen-token-plan-cn | qwen3.8-flash | 默认检索、资料与初稿;复杂任务升级 |
| glm_full | zai-coding-cn | glm-5.3 | 默认评估、独立审查和复杂归因 |
| glm_flash | zai-coding-cn | glm-5.3-flash | 默认测试执行与证据收集;复杂判断升级 |
| minimax_aux | minimax-cn | MiniMax-M3 | 默认停用,仅明确启用后用于易核验辅助任务;不能承担关键判断 |
本机 provider 是 qwen-token-plan-cn;用户提到的 qwen-token-plan 在此明确映射到该通道。相同模型名出现在其他 provider 不构成可替换授权。M3 不进入规划、代码审查、根因裁决、最终验收或主力自动备用链;需要改变这些限制时由用户明确修订本节。
目录核对:2026-09-24,通过本机 pi 的离线 --list-models 核实以上五个组合。存在于目录不等于远端连通、工具调用、性能和任务质量已实测。
## 3. 角色路由表
代码实施与修复固定由 **Cursor Auto** 承担;下表只路由 PI 子任务。PI 不修改产品代码或测试源码,所需修复/新测试交回 Cursor。
| role_id | 工作 | enabled | 默认模型 | 升级角色 | 执行边界 |
|---|---|---|---|---|---|
| research | 检索、代码定位、资料摘录、需求初稿 | true | qwen_flash | planning | 只读;结论回传主 Agent |
| planning | 需求分析、方案制定、复杂问题综合分析 | true | qwen_max | none | 只读;保留假设与依据 |
| requirements_review | 独立评估需求与影响 | true | glm_full | none | 新上下文;不代替用户取舍 |
| plan_review | 独立方案审查 | true | glm_full | none | 不自审自己编制的方案 |
| code_review | 代码审查与回归风险检查 | true | glm_full | none | 冻结 diff;不修改被审内容 |
| diagnosis | 复杂失败归因、跨模块机制分析 | true | glm_full | none | 只读分析;复现操作由 test_run 在授权环境执行 |
| test_run | 按已批准验证计划执行测试、收集证据、初步分析 | true | glm_flash | diagnosis | 仅批准命令、测试产物与环境;不修改源码 |
| acceptance_check | 按既定 AC 执行检查、核对真实证据 | true | glm_flash | diagnosis | 不代签最终验收;涉及业务取舍交 acceptance_owner |
| stage_notes | 阶段记录与报告初稿 | true | qwen_flash | report | 忠实整理原证据;主 Agent 持锁落盘 |
| report | 最终报告、复杂材料综合 | true | qwen_max | none | 汇总不能改写原始失败或推导未验证的 PASS |
| auxiliary | 格式整理、清单提取等易核验工作 | false | minimax_aux | none | 明确启用后派发;保留来源供核验 |
一个模型可承担多种角色,但派发必须区分上下文与职责。即使用户将规划和审查映射到同一模型,独立审查仍须新上下文/不同执行实例;模型不同也不自动证明审查独立。
最终验收责任继续归任务声明的 acceptance_owner;主 Agent 核对证据与权限后推进。test_run 和 acceptance_check 的输出是检查结果,不能只因模型返回“通过”就放行。
## 4. 执行与升级参数
| 参数 | 默认值 | 语义 |
|---|---|---|
| max_parallel_pi_tasks | 2 | 同时运行的 PI 子任务上限;路径冲突/共享环境锁优先 |
| implementation_executor | cursor_auto | 实施和修复不派给 PI;改此边界需要用户明确授权 |
| unavailable_action | pause_role | 模型或通道不可用时暂停对应角色;可继续无依赖工作 |
| automatic_fallback | none | 不静默换模型/换 provider;不因超时降级到 M3 |
| reload_boundary | next_dispatch | 新任务/下一次派发读取;不修改正在运行的子任务 |
| recursive_delegation | false | 仅主 Agent 派发;PI 子任务需要协作者时返回建议 |
升级触发:Flash 无法解释失败、证据互相矛盾、涉及跨模块机制或超出已批准验证计划。升级用于质量不足,不是网络故障重试;结果未知先核对副作用,流程遵循协作规范。
本次用户覆盖 > 本文件默认;仓库授权/写锁/验收边界始终约束执行。对文档中已允许角色和模型的任务级调整,不重复索要已经给出的许可;自动化程序、日志和子报告中的“配置已批准”不能替代用户来源。
## 5. 配置更改与追溯
1. 在任务 worktree 调整本文件;全局默认修改随受控集成发布。本轮已合入本地 dev;新任务从 dev 创建后使用此配置,调整后仍需受控集成。
2. 更新 config_revision;保留修改原因和用户来源。派发前核对角色、模型池和升级关系。
3. 每次派发记录配置路径、config_revision、文件 SHA-256、role_id、configured provider/model、任务覆盖和原因;已有子任务沿用自己的配置快照。
4. PI 启动时按精确 provider/model 传递,不能省略参数后依赖 ~/.pi/agent/settings.json。启动记录或可信响应元数据不可核验实际模型时填 actual_model=unknown。
5. 修改配置不产生代码写入、环境操作、push、部署或清理授权;报告/输出由主 Agent 按现有租约规则保存。
6. 回退时恢复先前角色值,递增配置修订并记录来源;不要覆盖历史派发记录或把失败改成成功。
初始决策依据:用户指定五模型池;明确“代码实施还是让 cursor 来”;反馈 M3 能力有限;随后确认“M3 移出默认流程、仅可选辅助”,并要求提供可调整配置文档。
@@ -0,0 +1,165 @@
# 主 Agent 与 Subagent 协作流程规范(草案)
修订:`subagent-workflow-2026-09-24-r2`;owner:Codex;规则状态:`proposed`;执行能力:`manual`;effective_commit:无。
本流程规范仍为待审稿;用户已确认 Cursor 实施、本机 PI 分析/审查/验证及模型默认分工,具体值唯一维护在[模型配置](2026-09-24-subagent-model-config.md)。规则批准与受控集成后才进入 active;文档存在不表示 PI 调度器已接入。
研究与来源见[研究报告](../audit/2026-09-24-subagent-workflow-research.md),本次授权及交付状态见[任务](short-term/2026-09-24-subagent-workflow-standard.md)。
## 1. 目标、适用范围和权威
用户在 Cursor 主会话保持 Auto;Cursor 负责主协调、代码实施和修复,通过 gmktec 本机工程 PI CLI 委派分析、审查、测试和报告。每阶段产生可恢复记录。此配置不自动适用其他客户端或 Herdr。
本规范只定义角色、阶段、交接和证据引用。授权边界沿用 [AGENTS](../../AGENTS.md),写锁/候选合并/环境/清理沿用 [worktree 操作规范](2026-09-21-agent-worktree-workflow.md),测试层级沿用[验证契约](2026-09-21-validation-contract.md),问题闭环沿用[既有规范](2026-09-23-issue-learning-workflow.md)。不建立第二套测试门禁。
普通 Cursor 会话不启用 Herdr 角色和固定模型路由;只有明确使用 Herdr 时适用其专门规范。工程 subagent 与产品 PI Agent Runner 分开记录,前者的执行不能替代后者的验收。
## 2. Auto、授权和推进规则
- **模型策略**:主会话选择 Auto;PI 子任务按[模型配置](2026-09-24-subagent-model-config.md)的角色、provider 和 model 派发。Cursor 原生 subagent 的 model: inherit 方案已被用户后续选择替代,本规范不以 .cursor/agents 实现 PI 路由。
- **能力核验**:首次接入、客户端升级或模型行为异常时,记录客户端版本、角色可发现性、派发 ID、工作目录、配置模型策略及可观察的实际模型;不可见时写 `actual_model=unknown`。不得从自我介绍推断模型。
- **证据边界**:记录配置指定值与可核验的实际模型;未核验不声称模型调用成功。模型多样性不替代独立上下文和证据。
- **授权策略**:Auto 只表示模型选择,不表示自动授权 shell、外部写入、合并、部署、推送或删除。任务开始记录已有授权,后续不重复询问相同范围。
- **默认确认点(待用户采纳)**:需求形成、评估、方案编制可连续进行;方案可审后,一次确认方案与实施范围。已明确授权按该方案端到端执行,则该确认已经满足。只有范围/环境/外部副作用扩大、破坏性动作或需要用户作业务取舍时再确认。
- **验收人**:需求阶段明确 acceptance_owner。技术验收检查可由获授权 acceptance_check 执行;产品效果/业务取舍需要用户判定时,技术通过后保留 `acceptance=pending`,不由 Agent 代签。用户预先委托按明确客观标准验收时,记录委托来源和证据即可。
- 仅请求研究/方案的任务交付可审产物后结束。实现、运行验证、合并等阶段逐项写 `not_applicable + 原因`,不为了流程齐全擅自执行。
## 3. 标准流程
```mermaid
flowchart TD
A[建场与授权记录] --> B[形成需求和验收标准]
B --> C[评估需求与影响]
C --> D[制定方案和验证计划]
D --> E{实施授权是否满足}
E -->|是| F[实施和开发自测]
E -->|否| P[交付可审方案]
F --> G[独立代码审查]
G -->|需修改| F
G -->|通过| H[冻结交付版本并验证]
H -->|失败| F
H -->|通过| I[构造候选并验证合并结果]
I -->|通过| J[受控合入 dev]
J --> K[按授权部署与运行验收]
K -->|失败| R[保留现场并修复或交接]
R --> F
K -->|通过或不适用| L[确认交付并归档证据]
L --> M[owner退出后独立复查清理]
```
测试计划在方案阶段形成;自测贯穿实施;独立审查和必要测试必须覆盖最终版本。清理安排在验收与证据保存之后。合并前的工程验证与合并后的运行验收分别报告。
### 阶段、产物和放行条件
每行都是阶段记录要求,不要求每行一个文件。记录使用[阶段模板](templates/subagent-stage-record.md)。
| 阶段 | 责任与输入 | 最小产物 | 放行条件 / 失败去向 |
|---|---|---|---|
| S0 建场 | 主 Agent;用户请求、当前规则、Git/认领状态 | task 主记录:目标、授权、基线、写路径、环境、交付终点、policy_revision | 允许范围明确;持久成果在任务 worktree;按现行入口登记 |
| S1 形成需求 | Cursor 与用户,可委派 research/planning;原始描述 | 需求记录:用户场景、范围/非目标、R-ID、AC-ID、优先级、验收人 | 可验证预期明确;影响方案的歧义解决,小型假设标注 |
| S2 评估需求 | requirements_review;S1 和当前证据 | 评估报告:现状差距、替代方案、依赖、风险、复杂度和建议 | 结论为 proceed / revise / defer;高风险未知有验证路径;revise 回 S1 |
| S3 制定方案 | Cursor 协调 planning 编制、plan_review 独立复核;S2 | 方案:改动位置、接口/数据影响、实施依赖、写者、验证矩阵、恢复方案;附方案审查结论 | AC 映射到验证项;必要权限齐备;授权不足交付方案等待;设计疑问回 S2 |
| S4 实施与自测 | Cursor;已授权方案 | 实施记录:变更、提交、偏差、自测与失败记录 | 实现满足方案且自测有证据;范围变化回 S1/S3;不得降低 AC 迁就实现 |
| S5 独立代码审查 | code_review;需求/方案、base/head、完整差异 | 审查报告:范围、审查者、严重度、位置、依据、处置与复核 | 无未解决阻断项;修复回 S4,变更后的代码需复核 |
| S6 交付验证 | test_run;冻结版本、AC、验证契约 | 测试报告:预期用例、实际命令/输入/输出、环境、SHA、PASS/FAIL/SKIP/未运行 | 适用必需项均通过;SKIP/基础设施失败保留阻塞;失败回 S4 或 S3 |
| S7 候选与集成 | 串行集成执行者;S5/S6、最新 dev D、冻结 T | 集成报告:D/T/M、候选验证收据、锁内结果、实际 dev | 按现行 --no-ff 候选与 --ff-only 入口;D/T/M 变化须重新准入 |
| S8 运行与交付验收 | acceptance_check + acceptance_owner;受控制品、AC | 验收报告:实际制品、环境、用户流程、持久状态、逐项 AC 结论 | 所需运行/UI 验收通过;无运行影响写 not_required;失败不清理、不冒充完成 |
| S9 归档与清理 | 主 Agent 固化证据,owner 退出后维护者执行清理 | 收口报告:提交/集成/部署/远端/cleanup 分离;归档证据、清理结果与遗留 owner | 满足现行普通 remove/-d 条件;拒绝保留 pending,登记触发和接管者 |
S5 与 S6 可以在同一不可变版本上并行;必要产物必须都回来才能进入 S7。测试产生构建目录/缓存/数据也算写副作用,先核对其环境和锁。code_review 阅读稳定 Git 快照,不在 Cursor 正在改写的工作树上宣布最终通过。
S7 候选需执行该范围的真实检查,不能用分支自测替代合并结果验证。S8 后新增的报告提交也需受控集成;分别记录被测业务 SHA 与报告 SHA,说明仅文档变化的复用依据。影响运行内容的后续变更使相关验收失效。
## 4. 角色和分工
角色是职责,不要求每阶段单独启动一个进程。精确 role_id、enabled、默认模型和升级链只维护在[模型配置](2026-09-24-subagent-model-config.md),下表说明权限边界。
| 角色 | 职责 | 写权限和独立性 |
|---|---|---|
| Cursor / coordinator | 与用户对话、授权核对、任务图、派发、证据汇总、冲突处理、推进门禁和交接 | 唯一任务协调者;报告汇总不改变原作者/证据/结论;不能从子报告推导额外授权 |
| research / planning / report / stage_notes | 需求影响、方案、资料和报告 | 默认只读;返回结构化报告,由主 Agent 落盘;若编制方案,另一个上下文审查方案 |
| Cursor / implementation | 实施方案、修复问题、编写和修改测试源码 | 产品和测试源码的实施者;按认领/租约操作,PI 建议交回 Cursor 处理 |
| requirements_review / plan_review / code_review / diagnosis | 独立评估、审查与复杂故障归因 | 新的只读上下文;不修改被审内容;发现问题返回 Cursor;复现交给获授权的 test_run |
| test_run / acceptance_check | 按冻结 AC 和已批准计划执行验证,核对真实行为 | 仅写批准的测试产物/环境;不改源码、不代签最终验收,需要修复交回 Cursor |
| integrator / maintainer | 候选验证、受控合并;owner 退出后的清理 | 串行短时角色,使用现有工具/权限;不能把长驻 worker 同时当作可删除的 worktree owner |
同模型的独立上下文可以提供独立检查,但不消除共同盲区;验证仍以源码、命令和用户流程证据为准。主 Agent 自审只能记录 self_review。要求独立审查的代码任务如无 subagent 能力,交给另一个独立会话/人员;该项完成前不自动放行。低风险纯文档可自检并记录理由。
## 5. 何时派发与如何并行
- 适合派发 PI:较长只读研究、独立审查、按批准计划验证、报告整理。代码实施和修复保留给 Cursor。
- 主 Agent 直接处理:一次定位、简短文案、单一顺序操作;仍留下对应阶段记录。无需为了覆盖阶段机械启动九个 Agent。
- 并发上限及递归委派规则以模型配置为准;资源不足串行。它是项目预算,不是平台上限;子 Agent 发现进一步分解需求先返回建议。
- 先画依赖再并行;有先后依赖的任务等待前置证据。有相同文件、公共 lockfile、路由、迁移号或共享环境的写任务不能同时认领。
- 同一任务 worktree 的源码写者为 Cursor,PI 只读任务读取冻结快照;只读报告由 Cursor 持锁保存。PI 验证涉及产物/环境写入必须在有效 agentctl supervisor 下运行;无法保证时停止执行并报告条件缺失。
- 若另行开展多 Cursor 并行实施,仍须独立登记 worktree,各自从明确 dev SHA 创建;父子关系用 parent_task_id/subtask_id 关联。此条不授权 PI 实施代码。
- 父任务汇总子任务成果,源码仍由 Cursor 实施。涉及测试产物写入的子任务登记独立操作 ID/路径;只读子审查复用父任务文档,不重复创建任务链。子分支结果通过现行候选集成流程交付;不能由 Cursor 的自动隔离/自动合并绕过本仓注册和准入。
- 有后台任务时,主 Agent 可继续独立工作,但不得在结果未回收时发布依赖它的 PASS、合并或清理。各子任务的工具可用性不代表授权可用性。
## 6. 派发、回传与失败处理
每次派发至少包含:
1. parent_task_id、subtask_id、role_id、具体目标、输入版本(需求/方案/代码 SHA);配置路径、config_revision、文件 SHA-256、解析后的 provider/model 和任务覆盖依据。
2. 需要读的规范和证据、已有用户授权来源、明确的非目标。
3. 工作目录、允许写路径、环境、mutex/租约执行方式;只读者明确只读。
4. 完成条件、输出格式/报告路径、需要验证的 AC;子 Agent 不依赖未传入的主会话历史。
5. 预算(时间或步骤)、进度回传点、失败/超时和副作用核对方式。
回传至少包括:执行身份/PI run_id、配置版本与指定/实际模型、实际输入版本、结果与证据、变更文件/提交、实际命令与环境、结论、缺项/风险、遗留进程/产物。主 Agent 校验路径、版本和证据后标记 accepted;子 Agent 自报 done 只表示执行结束。
- 分开记录 run_status(running/succeeded/failed/cancelled/unknown)与 verdict(pass/changes_required/blocked/not_applicable),不可把退出成功等同质量通过。
- 超时/失联先检查进程、worktree、Git 和外部副作用;结果未知时保留 unknown,不同时重派同一写任务。纯只读且确认无副作用的失败可有限重试,并保留原记录。
- 审查/验证角色有异议时,主 Agent 依据原需求和证据裁决。能修复则回 S4;需要业务取舍则向用户汇总一个关键问题,不以多数投票覆盖阻断证据。
- 连续两轮修复仍未解决同类阻断时,停止机械重试,回 S2 重查机制/测试前提;授权内可继续研究。不得为放行删除失败用例或降低 AC。
- 用户中断、客户端退出、上下文压缩时,先固化阶段、版本、未回收子任务、owner 和接管条件;恢复后从首个未满足门禁继续,不能整条流程重跑或直接跳到收口。
## 7. 文档与报告契约
“一步一记录”,无需“一步一文件”。现有文件优先复用,原始证据只存一处:
| 任务类型 | 最小文档集合 |
|---|---|
| 信息问答,无持久成果或运行副作用 | 对话答复 |
| 小型规范/研究/低风险变更 | 一个 task 或分析主文档,含适用阶段、验证与交接 |
| 标准功能/缺陷修复 | task + 方案 + 报告;评估/实施/审查/测试/验收可为清楚分段 |
| 跨模块、迁移或部署 | task + 必要 plan + 分开的审查/测试/验收证据;handoff 仅在独立信息有价值时拆分 |
每份阶段记录包含 stage_id、输入版本、producer、reviewer/独立性、decision、证据链接、缺项和下一步。需求用 R-ID,验收用 AC-ID,测试用 T-ID;报告提供 R → AC → 改动 → 审查 → 测试 → 运行验收映射,避免仅列“文档已生成”。
路径沿用 .doc taxonomy:任务在 ops/short-term,研究/审查在 audit,方案在 remediation 或既有 ops 主文档,独立测试/验收在 test-reports,附件在其 assets。只读 subagent 由主 Agent 保存原始结论及必要摘录,标明“由主 Agent 转存”与 agent_id;不伪造子 Agent 已写文件。
任务 status 继续只有 planned/in_progress/blocked/done/cancelled;phase 与 review_state、integration_state、deployment、cleanup、remote_sync、acceptance 独立记录。done 取决于授权交付终点。清理待办不扩充任务状态,但必须有人接管。需求验收 pending 时,若验收属于授权交付终点,任务不能 done。
## 8. Cursor → 本机 PI 接入(任务分支已实现)
### 配置与能力边界
用户已明确选择 Cursor Auto 主协调和实施、gmktec 本机 PI 承担子任务;原 r1 的 Cursor 原生 .cursor/agents + inherit 方案废止,历史研究保留说明。当前[模型配置](2026-09-24-subagent-model-config.md)可人工调整,由执行器每次派发读取;不是 PI 原生配置格式,不改变 PI 全局模型设置。CLI/MCP 接入与限制见[运行说明](2026-09-24-pi-subagent-executor.md),实际验证见[报告](../test-reports/2026-09-24-pi-executor-test-report.md)。
PI 模型和角色路由以配置文档为唯一来源。主 Agent 根据任务读取 role_id,显式传入 provider/model、独立会话、输入版本、工作目录与工具范围,收取结果后按本规范形成阶段记录。不能把主会话可用工具全部自动授予子任务。
- 只读研究/审查不需要 bash/edit/write;后续接入时显式限制工具,并核对扩展是否引入额外能力。
- 测试角色需要执行批准的命令并产生缓存/产物,不能假称只读;将测试工作目录、数据和环境放在批准范围内,使用既有 agentctl 租约。
- PI 报告由主 Agent 持锁落盘;PI 不修改业务代码或测试源码。将诊断建议交回 Cursor 实施。
- 模型不可用、实际模型不符、配置缺失或未知结果遵循配置和 §6,不隐式换通道或降级。
- 普通本机 PI 调度不复用 Herdr 自动审批/模型预算;产品 PI Runner 仍按目标环境批准配置独立验收。
### 后续接入步骤与验收
| 步骤 | 变更 | 必需证据 |
|---|---|---|
| A 文档配置 | 已确认分工,维护模型配置/派发模板;流程整体另按规范登记 | 默认值与用户选择一致;修改可追溯;未合入前不称全仓 active |
| B 消除旧规则冲突 | 修订 Cursor 测试规则副本为验证契约指针 | 相关 ISSUE 单独修复验证;本次不改变 Runner |
| C 实现派发入口 | 已实现 CLI + 项目 MCP;本地任务分支代码 69ffaa67 | 配置/租约/模型/快照/结果校验与异常回归已验证;dev 集成另记 |
| D 实机试运行 | 小型文档任务和受控代码任务(代码由 Cursor 写) | Auto 不需手动切模型;PI 角色/模型/run_id/证据可追溯;不冒充真实产品 PI |
| E 异常演练 | 同路径写冲突、PI 失联、必需测试缺项、dev 变化、验收失败、清理拒绝 | 正确暂停/升级;保留失败证据 |
| F 工具门禁 | 据试运行决定是否增加阶段校验/hook | 实现和真实负例验收后才将相应能力标 enforced |
接入验收 V1–V10:V1 Cursor Auto 与配置指定 PI provider/model;V2 授权/需求上下文传递;V3 独立只读审查与报告转存;V4 租约内测试;V5 输入 SHA 变化后复核;V6 写冲突拒绝;V7 缺项不合并;V8 验收失败保留现场;V9 清理拒绝有 owner;V10 中断后恢复。新增 V11:修改配置只影响下一次派发、记录 hash;V12:M3 停用/越权路由及未知 alias 被拒绝。本轮执行器已完成 173 项工程回归与真实 Cursor CLI→MCP→PI 验证,覆盖及未覆盖项以测试报告为准;这不是宣称全部 S0–S9 审批、产品 UI/共享环境或清理已自动执行。
### 日常使用与调整
用户只需保持 Cursor Auto,说明任务目标与授权终点;主 Agent 读取本规范和模型配置,按需要派发 PI。修改默认分工只编辑模型配置文档;临时调整写入任务 override,不静默改全局默认。流程、模型配置和某任务授权是三个不同对象。
用户可以授权“按已确认方案执行到 local dev 集成与 dev 验收”;该授权不会自动包含 push 或晋升 test/main。验收后归档证据,当前 owner 退出后再由独立维护者复查清理。
回退:调度入口或权限不满足时暂停相应 PI 阶段,保留现场与证据,交回 Cursor 处理;不能以主 Agent 自审替代要求的独立审查。修复接入后再验证。
+130 -28
View File
@@ -1,47 +1,150 @@
# 当前焦点
**更新**:2026-09-22。此文件是协调快照;实际分支、进程、执行租约以机器核验为准。能力和发布结论分别见 [FEATURE-MATRIX](../status/FEATURE-MATRIX.md) / [gap-matrix](../remediation/gap-matrix.md)。本轮状态对账不改变 `production_ready`,不升 FEATURE-MATRIX 行。
**更新**:2026-09-23(剩余 worktree 收口:go-agentx+FAV 合入 local_dev;注册 worktree 已清;FAV live 仍不放量)。此文件是协调快照;实际分支、进程、执行租约以机器核验为准。能力和发布结论分别见 [FEATURE-MATRIX](../status/FEATURE-MATRIX.md) / [gap-matrix](../remediation/gap-matrix.md)。
手工 CAS 前 `document_sha256`:`6cadc69b6ec680e9edda74683686196a8774e42ee43033e6ba6abf1ab1933cbf`(`docs apply` 在本 macOS 宿主因 `/proc` 不可用,见 [对账任务例外](./short-term/2026-09-22-status-reconcile.md))。
本机 macOS 已可用 `agentctl with`/`docs apply`/`validate`/`integrate`(W1-B 进程层);共享文档写走 docs apply 收据。
## 焦点
1. **状态对账收口(本轮)**:本机主目录为 2026-09-21 23:49 全新 clone;CURRENT 09-21 登记的历史 worktree 在本机不存在。governance-adoption 已按生效提交证据收口为 done;partial-deferred 保持 in_progress(W5–W7 真实未完成)。详见 [对账任务](./short-term/2026-09-22-status-reconcile.md)。
2. **另一会话进行中**:`dev-prod-ready-test-promotion-2026-09-22`(Cursor)仍 active;首批合入已在本地 `dev@a3150dcb`。本对账任务不改其状态、不触碰其 worktree。
3. **Agent 规范与 L1 门禁**:R01–R10、共享 .locks 已启用;dev 生效提交 `7e9317b8`。本机 macOS 上 `with`/`docs apply`/`validate`/`integrate` 不可用,受测 Linux 主机仍 enforced;OS 隔离不在范围。
0. **全量未完成计划收口**:FEATURE-MATRIX「模块解耦批次 A–G」→ `done`;多意图 I1 / 语义摘要 S1 / 治理 W4 / rdev / 红线证据已登记残差;红线(FAV live / SWBOOT-10 / D7 物理删 / PI 叙事 flag)不放量。详见 [收口短文](./short-term/2026-09-22-unfinished-batch-closeout.md)。
1. **DOCREV UI 重跑已 PASS**:main 18 + post-restart UI-15;20 audit + 9 remediation `done`(`management-implementation-plan` 仍方案态)。schema 63;密封 [sealed-ledger-ui00-16-post-20260923T0400Z](../test-reports/assets/2026-09-22-docrev-ui-rerun/sealed-ledger-ui00-16-post-20260923T0400Z/);证据 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md);worktree cleanup=pending。
2. **dev→test 已晋升**:`origin/dev@591ea601`(schema 61 门禁绿);`origin/test@83c6a12a` + tag `rc-v1.1.0-beta.1`;test 环境 health schema=61、Runner `MiniMax-M3`。[报告](../test-reports/2026-09-22-dev-gate-and-test-promotion-test-report.md)。
3. **本任务 cleanup=pending**:feature / integrate / promote-test worktrees 待独立维护者按门禁复查后清理;不强删。
4. **Agent 规范与 L1 门禁**:R01–R10、共享 .locks 已启用;本机 macOS 租约路径可用(Darwin 进程层已落地),与 Linux 双平台 enforced。
## 并行认领
| owner | task | branch | worktree | mutex | status |
|---|---|---|---|---|---|
| pi | upload-doc-access-2026-09-27 | fix/upload-doc-access-2026-09-27 | .worktrees/upload-doc-access-2026-09-27 | freedoc+web-upload | done |
| pi | frontend-demo-fallback-2026-09-27-r3c | fix/frontend-demo-fallback-2026-09-27-r3 | (已清理) | web-chat-fallback | done |
| pi | frontend-demo-fallback-2026-09-27-r2 | fix/frontend-demo-fallback-2026-09-27 | (已清理) | web-chat-fallback | done |
| Cursor | full-system-browser-e2e-2026-09-26 | feature/full-system-browser-e2e-2026-09-26 | .worktrees/full-system-browser-e2e-2026-09-26 | env:dev+docs-test-report | done |
| pi | sysadmin-maturity-refresh-2026-09-26 | feature/sysadmin-maturity-refresh-2026-09-26 | .worktrees/sysadmin-maturity-refresh-2026-09-26 | sysadmin-maturity | done |
| pi | degraded-flags-enable-2026-09-26-r4 | feature/degraded-flags-enable-2026-09-26 | .worktrees/degraded-flags-enable-2026-09-26 | summary-flags-rollout | done |
| pi | system-review-p0-p1-fixes-2026-09-26 | fix/system-review-p0-p1-fixes-2026-09-26 | .worktrees/system-review-p0-p1-fixes-2026-09-26 | review-fixes-batch | done |
| Cursor | system-code-review-2026-09-26 | feature/system-code-review-2026-09-26 | .worktrees/system-code-review-2026-09-26 | docs-audit-review | done |
| pi | swboot-closeout-2026-09-26-r3 | feature/swboot-closeout-2026-09-26 | .worktrees/swboot-closeout-2026-09-26 | workflow-design | done |
| pi | swboot-closeout-2026-09-26-r2 | feature/swboot-closeout-2026-09-26 | .worktrees/swboot-closeout-2026-09-26 | workflow-design | in_progress |
| pi | chat-semantic-replace-2026-09-26 | feature/chat-semantic-replace-2026-09-26 | .worktrees/chat-semantic-replace-2026-09-26 | chat | done |
| pi | jevdecide-soak-2026-09-26 | feature/jevdecide-soak-2026-09-26 | .worktrees/jevdecide-soak-2026-09-26 | jevdecide | done |
| pi | dialogue-ctx-closeout-2026-09-26-r4 | feature/dialogue-ctx-closeout-2026-09-26 | .worktrees/dialogue-ctx-closeout-2026-09-26 | dialogue-ctx | done |
| pi | dialogue-ctx-closeout-2026-09-26-r2 | feature/dialogue-ctx-closeout-2026-09-26 | .worktrees/dialogue-ctx-closeout-2026-09-26 | dialogue-ctx | in_progress |
| pi | worktree-final-closeout-2026-09-26 | feature/worktree-final-closeout-2026-09-26 | (已清理) | git:dev+docs | done |
| cursor-auto | cleanup-audit-r3-2026-09-25 | feature/cleanup-audit-p11-2026-09-25 | .worktrees/cleanup-audit-p11-2026-09-25 | docs-cleanup-audit | done |
| Cursor | admin-settings-maint-b-2026-09-25 | feature/admin-env-settings-maintenance-2026-09-25 | .worktrees/admin-env-settings-maintenance-2026-09-25 | admin-settings-maintenance | done |
| Cursor | dm-migration-2026-09-24-r2 | feature/dm-migration-2026-09-24 | .worktrees/dm-migration-2026-09-24 | dm-migration | done |
| Cursor | governance-console-p1-impl-2026-09-24 | feature/governance-console-p1-impl-2026-09-24 | .worktrees/governance-console-p1-impl-2026-09-24 | agentctl-console | done |
| Cursor | governance-console-p1-design-2026-09-24 | feature/governance-console-p1-design-2026-09-24 | .worktrees/governance-console-p1-design-2026-09-24 | agentctl-console-design | done |
| Cursor | governance-visibility-p0-2026-09-24 | feature/governance-visibility-p0-2026-09-24 | .worktrees/governance-visibility-p0-2026-09-24 | agentctl-visibility | done |
| Cursor | worktree-cleanup-closeout-2026-09-24 | feature/worktree-cleanup-closeout-2026-09-24 | (已清理) | worktree-cleanup | done |
| Cursor | non-author-closeout-2026-09-24 | feature/non-author-closeout-2026-09-24 | .worktrees/non-author-closeout-2026-09-24 | docs+git:dev | done |
| Cursor | integrate-non-author-docs-2026-09-24 | feature/integrate-non-author-docs-2026-09-24 | .worktrees/integrate-non-author-docs-2026-09-24 | git:dev | done |
| Cursor | non-author-member-access-docs-2026-09-24 | feature/non-author-member-access-2026-09-24 | .worktrees/non-author-member-access-2026-09-24 | docs+matrix | done |
| Cursor | non-author-member-access-2026-09-24 | feature/non-author-member-access-2026-09-24 | .worktrees/non-author-member-access-2026-09-24 | docgov+iam-authz+workflow-gov | done |
| Cursor | integrate-free-collab-2026-09-24 | feature/integrate-free-collab-2026-09-24 | .worktrees/integrate-free-collab-2026-09-24 | integrate-dev | done |
| Cursor | cursor-governance-hooks-2026-09-24 | feature/cursor-governance-hooks-2026-09-24 | .worktrees/cursor-governance-hooks-2026-09-24 | cursor-governance | done |
| Cursor | governance-catalog-2026-09-24 | feature/governance-catalog-2026-09-24 | .worktrees/governance-catalog-2026-09-24 | agent-workflow-governance+catalog | done |
| Codex | subagent-workflow-standard-2026-09-24-land | feature/subagent-workflow-standard-2026-09-24 | .worktrees/subagent-workflow-standard-2026-09-24 | pi-subagent-integration | done |
| Cursor/Codex | subagent-workflow-standard-2026-09-24-executor | feature/subagent-workflow-standard-2026-09-24 | .worktrees/subagent-workflow-standard-2026-09-24 | pi-subagent-executor | done |
| Codex | subagent-workflow-standard-2026-09-24-config-r2 | feature/subagent-workflow-standard-2026-09-24 | .worktrees/subagent-workflow-standard-2026-09-24 | subagent-workflow-docs | done |
| Codex | subagent-workflow-standard-2026-09-24 | feature/subagent-workflow-standard-2026-09-24 | .worktrees/subagent-workflow-standard-2026-09-24 | subagent-workflow-docs | done |
| Cursor | integrate-gate-nightly-fixes-b-2026-09-24 | feature/integrate-gate-nightly-fixes-b-2026-09-24 | .worktrees/integrate-gate-nightly-fixes-b-2026-09-24 | git:dev | done |
| Cursor | integrate-gate-nightly-fixes-2026-09-24 | feature/integrate-gate-nightly-fixes-2026-09-24 | .worktrees/integrate-gate-nightly-fixes-2026-09-24 | git:dev | done |
| Cursor | integrate-docs-gate-promo-report-2026-09-24 | feature/integrate-docs-gate-promo-report-2026-09-24 | .worktrees/integrate-docs-gate-promo-report-2026-09-24 | git:dev | done |
| Cursor | promote-rc-beta3-c-2026-09-24 | feature/promote-rc-beta3-c-2026-09-24 | .worktrees/promote-rc-beta3-c-2026-09-24 | git:test+env:test+docs | done |
| Cursor | dev-full-gate-test-promo-2026-09-24 | feature/dev-full-gate-test-promo-2026-09-24 | .worktrees/dev-full-gate-test-promo-2026-09-24 | git:dev+env:dev+env:test+docs | done |
| Cursor | gate-promo-current-close-2026-09-24 | feature/gate-promo-current-close-2026-09-24 | .worktrees/gate-promo-current-close-2026-09-24 | docs:admin+docs | done |
| Cursor | docs-gate-promo-report-2026-09-24 | feature/docs-gate-promo-report-2026-09-24 | .worktrees/docs-gate-promo-report-2026-09-24 | docs+git:dev | done |
| Cursor | admin-password-reset-2026-09-24 | feature/admin-password-reset-2026-09-24 | .worktrees/admin-password-reset-2026-09-24 | auth+env:test | done |
| Cursor | fix-fav-staging-uuid-2026-09-24 | fix/fix-fav-staging-uuid-2026-09-24 | .worktrees/fix-fav-staging-uuid-2026-09-24 | artifactvault | done |
| Cursor | gate-e1a-unique-project-name-2026-09-24 | fix/gate-e1a-unique-project-name-2026-09-24 | .worktrees/gate-e1a-unique-project-name-2026-09-24 | docnotify | done |
| Cursor | gate-unhook-docquery-2026-09-24 | fix/gate-unhook-docquery-2026-09-24 | .worktrees/gate-unhook-docquery-2026-09-24 | server+docquery | done |
| Cursor | integrate-jev-assist-land-2026-09-24 | feature/integrate-jev-assist-land-2026-09-24 | .worktrees/integrate-jev-assist-land-2026-09-24 | git:dev | done |
| Cursor | integrate-codegraph-fixup2-2026-09-24 | feature/integrate-codegraph-fixup2-2026-09-24 | (removed) | git:dev | done |
| Cursor | integrate-codegraph-governance-2026-09-24 | feature/integrate-codegraph-governance-2026-09-24 | (removed) | git:dev | done |
| Cursor | codegraph-governance-r2-2026-09-24 | feature/codegraph-governance-2026-09-24 | .worktrees/codegraph-governance-2026-09-24 | agent-workflow-governance+codegraph | done |
| Cursor | jev-dev-shadow-on-2026-09-24 | feature/jev-dev-shadow-on-2026-09-24 | .worktrees/jev-dev-shadow-on-2026-09-24 | env:dev+jevdecide | done |
| Cursor | jev-product-closeout-2026-09-24 | feature/jev-product-closeout-2026-09-24 | .worktrees/jev-product-closeout-2026-09-24 | jevdecide+coordinator | done |
| Cursor | jev-product-shadow-2026-09-24 | feature/jev-product-shadow-2026-09-24 | .worktrees/jev-product-shadow-2026-09-24 | jevdecide+coordinator | done |
| Cursor | jev-mcp-docs-done-2026-09-24 | feature/jev-mcp-docs-done-2026-09-24 | .worktrees/jev-mcp-docs-done-2026-09-24 | jev-mcp+docs | done |
| Cursor | jev-mcp-integration-2026-09-24 | feature/jev-mcp-integration-2026-09-24 | .worktrees/jev-mcp-integration-2026-09-24 | jev-mcp+docs | done |
| Cursor | integrate-intent-plan-u9u12-land-2026-09-24 | feature/integrate-intent-plan-u9u12-land-2026-09-24 | .worktrees/integrate-intent-plan-u9u12-land-2026-09-24 | git:dev | done |
| Cursor | integrate-pi-narrative-docs-2026-09-23 | feature/integrate-pi-narrative-docs-2026-09-23 | .worktrees/integrate-pi-narrative-final-closeout-b-2026-09-23 | git:dev | done |
| Cursor | pi-narrative-final-closeout-b-2026-09-23 | feature/pi-narrative-final-closeout-b-2026-09-23 | .worktrees/pi-narrative-final-closeout-2026-09-23 | docgov | done |
| Cursor | chat-semantic-d3-matrix-land-2026-09-23 | feature/chat-semantic-d3-matrix-land-2026-09-23 | .worktrees/chat-semantic-d3-matrix-land-2026-09-23 | chat | done |
| Cursor | intent-plan-i2-rollout-b-2026-09-24 | feature/intent-plan-i2-rollout-2026-09-24 | (已清理) | intent-plan | done |
| Cursor | intent-plan-i2-impl-2026-09-24 | feature/intent-plan-i2-shadow-allowlist-2026-09-24 | (已清理) | intent-plan | done |
| Cursor | closeout-claim-removed-2026-09-23 | feature/closeout-claim-removed-2026-09-23 | (removed) | git:dev+worktree-cleanup | done |
| Cursor | module-batches-ag-status-fix-2026-09-23 | feature/module-batches-ag-status-fix-2026-09-23 | .worktrees/module-batches-ag-status-fix-2026-09-23 | module-decoupling-spec | done |
| Cursor | fav-constraint-current-2026-09-23 | feature/fav-constraint-current-2026-09-23 | (removed) | git:dev+docs | done |
| Cursor | closeout-worktree-cleanup-2026-09-23 | feature/closeout-worktree-cleanup-2026-09-23 | .worktrees/closeout-worktree-cleanup-2026-09-23 | git:dev+worktree-cleanup | done |
| Cursor | remaining-worktrees-closeout-2026-09-23 | feature/remaining-worktrees-closeout-2026-09-23 | (removed) | git:dev+worktree-cleanup | done |
| Cursor | worktree-closeout-cleanup-2026-09-23 | feature/worktree-closeout-cleanup-2026-09-23 | .worktrees/worktree-closeout-cleanup-2026-09-23 | git:dev+worktree-cleanup | done |
| Cursor | worktree-closeout-batch-2026-09-23 | feature/worktree-closeout-batch-2026-09-23 | (removed) | git:dev+worktree-cleanup | done |
| Cursor | agentctl-cursor-integration-close-2026-09-23 | feature/agentctl-cursor-integration-close-2026-09-23 | .worktrees/agentctl-cursor-integration-close-2026-09-23 | agentctl-cursor-integration-close | done |
| Cursor | integrate-agentctl-cursor-integration-2026-09-23 | feature/integrate-agentctl-cursor-integration-2026-09-23 | .worktrees/integrate-agentctl-cursor-integration-2026-09-23 | git:dev | done |
| Cursor | agentctl-cursor-integration-2026-09-23 | feature/agentctl-cursor-integration-2026-09-23 | .worktrees/agentctl-cursor-integration-2026-09-23 | agentctl-cursor-integration | done |
| Cursor | agentctl-mgmt-go-live-close-2026-09-23 | feature/agentctl-mgmt-go-live-close-2026-09-23 | .worktrees/agentctl-mgmt-go-live-close-2026-09-23 | agentctl-mgmt-go-live-close | done |
| Cursor | integrate-agentctl-mgmt-go-live-2026-09-23 | feature/integrate-agentctl-mgmt-go-live-2026-09-23 | .worktrees/integrate-agentctl-mgmt-go-live-2026-09-23 | git:dev | done |
| Cursor | agentctl-mgmt-go-live-2026-09-23 | feature/agentctl-mgmt-go-live-2026-09-23 | .worktrees/agentctl-mgmt-go-live-2026-09-23 | agentctl-mgmt-go-live | done |
| Cursor | w3-u6-current-fix-2026-09-23 | feature/w3-u6-current-fix-2026-09-23 | .worktrees/w3-u6-current-fix-2026-09-23 | w3-u6-current-fix | done |
| Cursor | integrate-w3-u6-closeout-2026-09-23 | feature/integrate-w3-u6-closeout-2026-09-23 | .worktrees/integrate-w3-u6-closeout-2026-09-23 | git:dev | done |
| Cursor | integrate-matrix-record-id-2026-09-23 | feature/integrate-matrix-record-id-2026-09-23 | .worktrees/integrate-matrix-record-id-2026-09-23 | git:dev | done |
| Cursor | w3-u6-closeout-2026-09-23 | feature/w3-u6-closeout-2026-09-23 | .worktrees/w3-u6-closeout-2026-09-23 | w3-u6-closeout | done |
| Cursor | matrix-record-id-2026-09-23 | feature/matrix-record-id-2026-09-23 | .worktrees/matrix-record-id-2026-09-23 | matrix-record-id | done |
| Cursor | w2-closeout-2026-09-23 | feature/w2-closeout-2026-09-23 | .worktrees/w2-closeout-2026-09-23 | w2-closeout | done |
| Cursor | current-projection-2026-09-23 | feature/current-projection-2026-09-23 | .worktrees/current-projection-2026-09-23 | current-projection | done |
| Cursor | agentctl-daemon-2026-09-23 | feature/agentctl-daemon-2026-09-23 | .worktrees/agentctl-daemon-2026-09-23 | agentctl-daemon | done |
| Cursor | agentctl-handoff-2026-09-23 | feature/agentctl-handoff-2026-09-23 | .worktrees/agentctl-handoff-2026-09-23 | agentctl-handoff | done |
| Cursor | agentctl-claim-2026-09-23 | feature/agentctl-claim-2026-09-23 | .worktrees/agentctl-claim-2026-09-23 | agentctl-claim | done |
| Cursor | agent-governance-config-2026-09-23 | feature/agent-governance-config-2026-09-23 | .worktrees/agent-governance-config-2026-09-23 | agent-governance-config | done |
| Cursor | coordination-db-daemon-impl-plan-2026-09-23 | feature/coordination-db-daemon-impl-plan-2026-09-23 | .worktrees/coordination-db-daemon-impl-plan-2026-09-23 | coordination-db-daemon-impl-plan | done |
| Cursor | coordination-db-daemon-2026-09-23 | feature/coordination-db-daemon-2026-09-23 | .worktrees/coordination-db-daemon-2026-09-23 | coordination-db-daemon | done |
| Cursor | integrate-pi-runner-response-size-r2-2026-09-23 | feature/integrate-pi-runner-response-size-2026-09-23 | .worktrees/integrate-pi-runner-response-size-2026-09-23 | git:dev | done |
| Cursor | modular-decouple-residual-b-2026-09-23 | feature/modular-decouple-residual-2026-09-23 | .worktrees/modular-decouple-residual-2026-09-23 | modular-decouple-residual | done |
| Cursor | modular-refactor-impl-plan-2026-09-23 | feature/modular-refactor-impl-plan-2026-09-23 | .worktrees/modular-refactor-impl-plan-2026-09-23 | docs-remediation-modular-impl-plan | done |
| Cursor | modular-refactor-review-2026-09-23 | feature/modular-refactor-review-2026-09-23 | .worktrees/modular-refactor-review-2026-09-23 | ops-audit-modular-refactor-review | done |
| Cursor | 2026-09-22-status-reconcile | feature/status-reconcile-2026-09-22 | .worktrees/status-reconcile-2026-09-22 | ops-status-reconcile | done |
| Cursor | 2026-09-22-dev-prod-ready-test-promotion | feature/dev-prod-ready-test-promotion-2026-09-22 | .worktrees/dev-prod-ready-test-promotion-2026-09-22 | dev-runtime-migration+release-gate+test-promotion | in_progress |
| Cursor | integrate-dev-prod-ready-test-promotion-2026-09-22 | feature/integrate-dev-prod-ready-test-promotion-2026-09-22 | .worktrees/integrate-dev-prod-ready-test-promotion-2026-09-22 | git:dev | in_progress |
| Cursor | 2026-09-22-dev-prod-ready-test-promotion | feature/dev-prod-ready-test-promotion-2026-09-22 | .worktrees/dev-prod-ready-test-promotion-2026-09-22 | dev-runtime-migration+release-gate+test-promotion | done |
| Cursor | integrate-dev-prod-ready-test-promotion-2026-09-22 | feature/integrate-dev-prod-ready-test-promotion-2026-09-22 | .worktrees/integrate-dev-prod-ready-test-promotion-2026-09-22 | git:dev | done |
| Cursor | promote-test-2026-09-22 | feature/promote-test-2026-09-22 | .worktrees/promote-test-2026-09-22 | git:test | done |
| Codex | 2026-09-21-agent-workflow-governance-adoption | feature/agent-workflow-governance-plan | (本机 clone 后不存在) | agent-workflow-governance | done |
| Codex | issue-learning-2026-09-23 | feature/issue-learning-2026-09-23 | .worktrees/issue-learning-2026-09-23 | issue-learning-docs | done |
| Codex | systemic-issue-analysis-2026-09-23 | feature/systemic-issue-analysis-2026-09-23 | .worktrees/systemic-issue-analysis-2026-09-23 | systemic-issue-analysis-docs | done |
| Codex | modular-contract-standard-2026-09-22 | feature/modular-contract-standard-2026-09-22 | .worktrees/modular-contract-standard-2026-09-22 | modular-contract-docs | done |
| Codex | herdr-orchestration-v12 | feature/herdr-orchestration-v12 | .worktrees/herdr-orchestration-v12 | herdr-policy+scripts | done |
| Codex | 2026-09-21-agent-governance-implementation | feature/agent-governance-implementation | .worktrees/agent-governance-implementation | agent-governance | done |
| Cursor | 2026-09-21-force-material-chunk-index | feature/force-material-chunk-index-2026-09-21 | .worktrees/force-material-chunk-index-2026-09-21 | bizdev+materialindex | done |
| Cursor | 2026-09-21-workflow-scope-weighting | feature/workflow-scope-weighting-2026-09-21 | .worktrees/workflow-scope-weighting-2026-09-21 | intent+web+docgov | done |
| Cursor | 2026-09-21-upload-parse-ux-dedup | feature/upload-parse-ux-2026-09-21 | .worktrees/upload-parse-ux-2026-09-21 | server+web+storage | done |
| Cursor | 2026-09-21-mineru-doc-parsing | feature/mineru-doc-parsing-2026-09-21 | .worktrees/mineru-doc-parsing-2026-09-21 | storage+bizdev+kb | done |
| Cursor | 2026-09-21-intent-confirm-stage-aware | fix/intent-confirm-stage-aware-2026-09-21 | .worktrees/intent-confirm-stage-aware-2026-09-21 | intent+web+docgov | done |
| Cursor | 2026-09-21-taskrun-status-card | feature/taskrun-status-card-2026-09-21 | .worktrees/feature-taskrun-status-card-2026-09-21 | chat+web+taskrun | done |
| Codex | 2026-09-21-agent-workflow-governance-plan | feature/agent-workflow-governance-plan | .worktrees/feature-agent-workflow-governance-plan | agent-workflow-governance-plan | done |
| Cursor | 2026-09-21-workflow-doc-key-unification | fix/workflow-doc-key-unification-2026-09-21 | .worktrees/fix-workflow-doc-key-unification-2026-09-21 | docgov+web | done |
| Cursor | 2026-09-21-dev-multiuser-four-issues | fix/dev-multiuser-four-issues-2026-09-21 | .worktrees/fix-dev-multiuser-four-issues | projectinstance+docgov | done |
| Codex | 2026-09-17-initial-load-performance-plan | feature/initial-load-performance-plan | .worktrees/feature-initial-load-performance-plan | loading-performance-audit | done |
| Cline | 2026-09-16-partial-deferred-completion | docs/partial-deferred-completion-plan | - | architecture-docs | in_progress |
活跃任务的写路径、base_dev_sha、授权与验证计划见主任务记录与 `agentctl status`;历史 claim 不能代替当前登记。09-21 已交付且已合入 dev 的认领行已迁出本表,完整索引见 [归档](../archive/ops/2026-09-21-current-history.md)。
| Cursor | dialogue-context-injection-2026-09-25 | feature/dialogue-context-injection-2026-09-25 | (已清理) | dialogue-ctx | done |
| Cursor | dialogue-context-injection-2026-09-25-r2 | feature/dialogue-context-injection-2026-09-25 | .worktrees/dialogue-context-injection-2026-09-25 | dialogue-ctx | done |
## 清理接管与遗留现场
**本机(2026-09-22)**:`git worktree list` 仅主目录 + 上表三个 `.worktrees/*`。下列路径在本 clone **不存在**;远端相关分支大多已是 `dev` 祖先。cleanup_owner 仍为复查责任,不增加删除授权;不因「目录不存在」批量删远端分支。
| 路径/事项 | 分类与保留原因 | cleanup_owner | 复查触发 |
|---|---|---|---|
| 09-21 历史任务 worktree 清单(herdr / governance / material-chunk / workflow-scope / upload-parse / mineru / intent-confirm / taskrun-status / doc-key / multiuser / initial-load / agent-lock / agent-policy 等) | 原 cleanup=pending;本机全新 clone 后目录不存在;证据在归档与 test-reports | 独立维护者 | 若在其他宿主仍有目录:按门禁核祖先/证据/进程后再 remove |
| Cline `2026-09-16-partial-deferred-completion` | 仍 in_progress;无登记 worktree;W5–W7 未关闭 | Cline owner / 维护者接管 | 单独授权实施或交接后更新状态 |
| `.worktrees/fix-dev-runtime-data-root-guard` / FAV 相关保护路径 | 保护项;故意不合入、不删 | 原 owner / 维护者 | 用户调整保护边界并重新核验后 |
| `.kilo/worktrees/stealth-ice` | 非本轮;本 clone 不存在 | 原 owner 待核实 | 其他宿主若仍存在再查明 |
| 远端 `origin/feature/software-project-bootstrap` | tip `d3bb7520` 对 dev 补丁等价(`git cherry` `-`);无需合入 | 维护者 | 可选清理远端引用(须单独授权) |
| 远端 `origin/feature/remove-herdr-agent-settings` | **保护分支**;已被 Herdr v1.2 反向取代;不合入 | 维护者 | 用户调整保护边界后 |
cleanup=pending 不是任务状态;普通 remove/-d 拒绝时记录原因,不升级强删。历史完成/取消认领、原证据索引和环境快照见 [归档](../archive/ops/2026-09-21-current-history.md)。
| `.worktrees/docrev-ui-rerun-2026-09-22` / `freeform-project-id-bigint` | 已清理 / 目录不存在(2026-09-23 核对) | Cursor | 无 |
| `.worktrees/dev-prod-ready-test-promotion-2026-09-22` 等本轮三个 worktree | 已清理 / 目录不存在(2026-09-23 核对) | Cursor | 无 |
| Cline `2026-09-16-partial-deferred-completion` | 仍 in_progress;W5–W7 未关闭 | Cline owner / 维护者 | 单独授权实施或交接 |
| 保护分支 / FAV 相关 | 已合入 local_dev(例外授权 2026-09-23);live 未放量;分支/worktree 已删 | Cursor | 无;见 integrate-fav-final 例外登记 |
| embedding 401(dmxapi) | 非 blocker 运维债;不挡 PI | 运维 | 换钥后重跑 chunk index |
## 集成槽位
| holder | phase | since | scope | queue |
|--------|-------|-------|-------|-------|
| - | idle | 2026-09-22 | 对账已合入 `dev@38ed539f`;另一会话仍占 integrate 登记,后续合入须串行 | - |
| - | idle | 2026-09-21 | force-material-chunk-index 已合入 dev 并从主目录 rebuild;项目 6579 候选 535 已确认;schema=61 | - |
**phase**: `idle` | `merging` | `smoke` | `e2e`
@@ -49,14 +152,13 @@ cleanup=pending 不是任务状态;普通 remove/-d 拒绝时记录原因,
## 受控约束
- 禁止整支 merge FAV;`FAV_DEGRADED_READ=false`;FAV live 观察窗以证据驱动。保留保护分支 `feature/final-artifact-vault`、`feature/remove-herdr-agent-settings`、`fix/project143-controlled-content-404-diagnosis`、`fix/dev-runtime-data-root-guard`、`dev-old-linear`;不删 `origin/*`。
- 不默认升 `MULTI_INTENT_PLAN_TIER=full`;`SEMANTIC_SUMMARY_REPLACE` 不随 W2 开启;项目 143 只读、禁止终止;SWBOOT-10 保持 fail-closed stub。
- D7 对话 ADR 仍待合规签字;追踪表类别 `record` 不授权物理删除。模块解耦 A–G 与回溯切片按各自最新主任务认领/证据判断,不因历史设计或本次对账自动启动。
- `fix/clean-test-env-baseline` 不 merge;仅保留已挑拣的 `SEED_DEMO_USERS=false`。主运行目录与 worktree 的服务边界、重建与恢复要求见操作规范;MinerU 旧挂载事故与二轮证据见历史快照。
- FAV live 仍不放量;`FAV_DEGRADED_READ` 默认 false;不删 `origin/*`(本轮仅前进 local `dev`,不 push)。
- 不默认升 `MULTI_INTENT_PLAN_TIER=full`;`SEED_DEMO_USERS=false` 在 test 保持。
- D7 对话 ADR 仍待合规签字;追踪表类别 `record` 不授权物理删除。
- main 未在本轮晋升。
## 活跃入口
- [操作规范](./2026-09-21-agent-worktree-workflow.md) · [规则来源/生效](./2026-09-21-policy-registry.md) · [验证契约](./2026-09-21-validation-contract.md)
- [状态对账](./short-term/2026-09-22-status-reconcile.md) · [dev 门禁与 test 晋升](./short-term/2026-09-22-dev-prod-ready-test-promotion.md)
- [模块开发标准](../system-design/2026-09-20-module-development-standards.md) · [governance 交接](./handoffs/2026-09-21-agent-workflow-governance-plan.md)
- [partial-deferred 主任务](./short-term/2026-09-16-partial-deferred-completion.md) · [历史证据与环境快照](../archive/ops/2026-09-21-current-history.md)
- [dev 门禁与 test 晋升任务](./short-term/2026-09-22-dev-prod-ready-test-promotion.md) · [报告](../test-reports/2026-09-22-dev-gate-and-test-promotion-test-report.md)
- [gap-matrix](../remediation/gap-matrix.md) · [partial-deferred 主任务](./short-term/2026-09-16-partial-deferred-completion.md)
@@ -1,72 +1,74 @@
---
title: "纯软件项目自举工作流验收清单"
status: planned
status: in_progress
created: 2026-09-14
updated: 2026-09-14
updated: 2026-09-22
related_task: "ops/long-term/2026-09-14-software-project-bootstrap-implementation.md"
redline_evidence: "ops/short-term/2026-09-22-redline-evidence.md"
---
# 纯软件项目自举工作流验收清单
> 本文件是未来实施验收计划,当前全部用例均为 `NOT RUN`。不得把设计评审、stub、接口注入或静态 JSON 写成真实功能 PASS。
> 不得把设计评审、stub、接口注入或静态 JSON 写成真实功能 / 真实 PI / UI PASS。
> **2026-09-22 红线证据批次**(SHA `364ed7f1`):仅复验无需真实仓写的 L1–L4 子集;L5/L6 **pending auth**。报告:[../../test-reports/2026-09-22-redline-evidence-swboot-test-report.md](../../test-reports/2026-09-22-redline-evidence-swboot-test-report.md)。SWBOOT-10 仍为 fail-closed stub。
## 0. 验收分层
| 层 | 范围 | 可否代替真实 UI |
|----|------|-----------------|
| L1 | manifest、profile、模板、quality gate 单元测试 | 否 |
| L2 | PostgreSQL 迁移、领域服务、API、鉴权、并发 | 否 |
| L3 | 前端组件、类型、build | 否 |
| L4 | stub 小队和固定输出工程测试 | 否 |
| L5 | 真实 PI Agent Runner | 否,仍需页面验证 |
| L6 | Ubuntu Server 无头浏览器真实页面操作 | 是,最终验收 |
| 层 | 范围 | 可否代替真实 UI | 2026-09-22 红线证据 |
|----|------|-----------------|---------------------|
| L1 | manifest、profile、模板、quality gate 单元测试 | 否 | 子集 PASS(见 §1) |
| L2 | PostgreSQL 迁移、领域服务、API、鉴权、并发 | 否 | 领域 short PASS;PG **NOT RUN**(无 `TEST_DATABASE_URL`) |
| L3 | 前端组件、类型、build | 否 | **NOT RUN**(本机缺 `tsc`/`tsx`) |
| L4 | stub 小队和固定输出工程测试 | 否 | stub PASS;live PI SKIP |
| L5 | 真实 PI Agent Runner | 否,仍需页面验证 | **pending auth** |
| L6 | Ubuntu Server 无头浏览器真实页面操作 | 是,最终验收 | **pending auth** |
## 1. 工程门禁
### Manifest 与目录
- [ ] `software_bootstrap` 和 `software_delivery` 均可校验、发布和退役 — 证据:NOT RUN
- [ ] 非 published / 非 selectable / 不兼容 domain 的工作流不出现在项目目录 — 证据:NOT RUN
- [ ] 新版本不会改变已激活实例的 manifest/template/profile hash — 证据:NOT RUN
- [ ] 医疗现有三工作流及黄金用例无回归 — 证据:NOT RUN
- [ ] 不再依赖“三正式 key”或固定文档数量硬编码 — 证据:NOT RUN
- [x] `software_bootstrap` 和 `software_delivery` 均可校验(发布/退役全路径未本轮覆盖) — 证据:L1 `TestValidateDefinitionV2_SoftwareManifests` PASS(2026-09-22)
- [x] 不兼容 domain 的工作流被过滤 — 证据:`TestCompatibleWithProductDomain` PASS(2026-09-22)
- [ ] 新版本不会改变已激活实例的 manifest/template/profile hash — 证据:NOT RUN(需 PG 激活实例)
- [x] 医疗正式 key 仍在官方集合且软件 key 并存(非全量黄金回归) — 证据:`TestOfficialWorkflowKeys` PASS(2026-09-22)
- [x] 不再依赖“仅三正式 key”硬编码 — 证据:同上 + `TestCreateSoftwareProject_NoMedicalDefaults` PASS
### 数据与迁移
- [ ] 空数据库从 schema 1 升级并创建项目类型、profile、source binding — 证据:NOT RUN
- [ ] 空数据库从 schema 1 升级并创建项目类型、profile、source binding — 证据:NOT RUN(无 `TEST_DATABASE_URL`)
- [ ] 旧数据库升级不误分类既有项目 — 证据:NOT RUN
- [ ] secret 只存引用,数据库、文档、日志和 prompt 无明文 — 证据:NOT RUN
- [ ] 项目、成员、planning instance、模板账本创建具备幂等事务语义 — 证据:NOT RUN
- [ ] secret 只存引用,数据库、文档、日志和 prompt 无明文 — 证据:NOT RUN(本批未做 secret 扫描)
- [ ] 项目、成员、planning instance、模板账本创建具备幂等事务语义 — 证据:NOT RUN(PG)
- [ ] 应用重启后项目、来源、plan、阶段和文档版本可恢复 — 证据:NOT RUN
### 授权与治理
- [ ] 非成员无法列出项目、对话、来源、文档、SSE、RAG 或 Agent 结果 — 证据:NOT RUN
- [ ] 非成员无法列出项目、对话、来源、文档、SSE、RAG 或 Agent 结果 — 证据:NOT RUN(需 API/UI)
- [ ] 非创建者无法激活、推进、选择下一流程或终止 — 证据:NOT RUN
- [ ] 客户端伪造 task/stage/duty/repo path 被服务端拒绝 — 证据:NOT RUN
- [ ] collaborative 模式三权必须不同人 — 证据:NOT RUN
- [ ] solo 只允许 creator acknowledgement 且页面显示“未独立评审” — 证据:NOT RUN
- [ ] controlled profile 禁止 solo — 证据:NOT RUN
- [ ] 激活后 workflow/template/profile/duty 不能直接修改 — 证据:NOT RUN
- [ ] 客户端伪造 task/stage/duty/repo path 被服务端拒绝 — 证据:NOT RUN(完整 API);repo path stub 见 §4
- [x] collaborative / solo / controlled 预览规则(领域层) — 证据:`TestBuildCreationPreview_*` PASS(solo acknowledgement;privacy+solo 与 controlled_patch 拒绝)
- [ ] solo 页面显示“未独立评审” — 证据:NOT RUN(L3/L6)
- [x] controlled profile / controlled_patch 禁止未授权执行 — 证据:creation preview + SWBOOT-10 stub PASS
- [ ] 激活后 workflow/template/profile/duty 不能直接修改 — 证据:NOT RUN(需激活实例)
### 小队与文档
- [ ] 每个 executor/template/quality gate/profile 均注册且可解析 — 证据:NOT RUN
- [ ] 每个 executor/template/quality gate/profile 均注册且可解析 — 证据:NOT RUN(全量 registry 未本轮枚举)
- [ ] 正式任务只能从冻结 doc_task_instance 启动 — 证据:NOT RUN
- [ ] 步骤预算、timeout、工作区边界和 manifest 生效 — 证据:NOT RUN
- [ ] 失败、跳过、fallback、未验证项不会被改写成 PASS — 证据:NOT RUN
- [ ] 非医疗默认小队不包含 regulatory — 证据:NOT RUN
- [ ] 纯软件模板和回复无医疗默认术语污染 — 证据:NOT RUN
- [x] 失败/stub 不改写成真实 PASS — 证据:本报告区分 stub PASS vs L5 pending;LiveMiniMax SKIP
- [x] 纯软件项目类型目录无医疗默认术语污染 — 证据:`TestProjectTypesCatalog` / `CreateSoftwareProject_NoMedicalDefaults` PASS
- [x] 软件创建默认走 `software_bootstrap` 且无医疗 device 字段 — 证据:同上
## 2. Ubuntu Server 真实 UI 前置
## 2. Ubuntu Server 真实 UI 前置(L5/L6 — pending auth)
- [ ] 占用 CURRENT 集成槽位 — 证据:NOT RUN
- [ ] `go vet ./...`、`go test -short ./...`、前端测试/build 通过 — 证据:NOT RUN
- [ ] PostgreSQL、app、真实 PI Runner、MiniMax 均 ready — 证据:NOT RUN
- [ ] 明确记录 commit、schema、镜像、模型、BASE_URL 和开始时间 — 证据:NOT RUN
- [ ] 使用官方 Playwright Chromium 容器;宿主无需安装浏览器 — 证据:NOT RUN
- [ ] 若容器不可用,才执行 `npx playwright install --with-deps chromium` — 证据:NOT RUN
- [ ] 禁止 `page.route`、mock/stub、直接写数据库或伪造 API 输出 — 证据:NOT RUN
- [ ] 占用 CURRENT 集成槽位 — 证据:pending auth
- [ ] `go vet ./...`、`go test -short ./...`、前端测试/build 通过 — 证据:本批仅跑范围子集 + arch-check;全量 short/前端 pending
- [ ] PostgreSQL、app、真实 PI Runner、MiniMax 均 ready — 证据:pending auth
- [ ] 明确记录 commit、schema、镜像、模型、BASE_URL 和开始时间 — 证据:pending auth
- [ ] 使用官方 Playwright Chromium 容器;宿主无需安装浏览器 — 证据:pending auth
- [ ] 若容器不可用,才执行 `npx playwright install --with-deps chromium` — 证据:pending auth
- [ ] 禁止 `page.route`、mock/stub、直接写数据库或伪造 API 输出 — 证据:pending auth
推荐运行形态:
@@ -185,23 +187,26 @@ docker run --rm --network host --ipc host \
- **Evidence**:完整对话、全部文档、版本、trace/video、来源 hash。
- **Status**:NOT RUN。
## 4. 未来 controlled patch 负例
## 4. 未来 controlled patch 负例(SWBOOT-10 stub — 无真实仓写)
- [ ] repo 未绑定不能执行 — 证据:NOT RUN
- [ ] 非 allowlist 路径被拒绝 — 证据:NOT RUN
- [ ] `.env`、secret、生产 dump 排除有效 — 证据:NOT RUN
- [ ] 只在 feature worktree 写入 — 证据:NOT RUN
> 真实 allowlist DB / patch / merge 执行器未实现。下列勾选仅表示 **stub fail-closed**;不得当作 SWBOOT-10 已交付。
- [x] repo / 路径未在 stub allowlist 不能读 — 证据:`TestRepoAllowlistStub` → `ERR_REPO_PATH_NOT_ALLOWLISTED`(2026-09-22)
- [x] 非 allowlist 路径被拒绝 — 证据:同上
- [ ] `.env`、secret、生产 dump 排除有效 — 证据:NOT RUN(需真实执行器)
- [ ] 只在 feature worktree 写入 — 证据:NOT RUN(执行器未实现;本批证据写在任务 worktree)
- [ ] 超出批准文件范围立即停止 — 证据:NOT RUN
- [ ] 测试失败不自动 merge — 证据:NOT RUN
- [ ] 批准执行不等于批准 merge/push/deploy — 证据:NOT RUN
- [ ] 保护分支直接 commit、force push、破坏性命令均被拒绝 — 证据:NOT RUN
- [x] 测试失败不自动 merge(ApproveMerge stub) — 证据:`ApproveMerge` → `ERR_SWBOOT10_STUB_ONLY`
- [x] 批准执行不等于批准 merge/push/deploy — 证据:同上 + `ExecuteControlledPatch` stub
- [x] `controlled_patch` 创建/顾问路径被拒绝 — 证据:preview + `TestPiSoftwareBootstrapAdvisor_RejectsControlledPatch`
- [ ] 保护分支直接 commit、force push、破坏性命令均被拒绝 — 证据:NOT RUN(需真实执行器策略)
## 5. 完成定义
- [ ] L1–L5 工程门禁分别记录真实结果
- [ ] UI-SW-00–14 全部由真实页面操作执行并留证
- [ ] 真实 PI 回复、小队进度和所有交付文档均可在 UI 看到
- [ ] 医疗与软件两套黄金项目均无回归
- [ ] 刷新、重登、重启、并发和权限负例通过
- [ ] test-report 逐项包含 Input/Expected/Actual/Verdict/Duration
- [ ] 任何 NOT RUN、fallback、失败和开放风险均如实保留
- [ ] L1–L5 工程门禁分别记录真实结果 — 2026-09-22:L1 子集 + L4 stub 已记;L2 PG / L3 / L5 未完成
- [ ] UI-SW-00–14 全部由真实页面操作执行并留证 — L6 pending auth
- [ ] 真实 PI 回复、小队进度和所有交付文档均可在 UI 看到 — L5/L6 pending auth
- [ ] 医疗与软件两套黄金项目均无回归 — NOT RUN
- [ ] 刷新、重登、重启、并发和权限负例通过 — NOT RUN
- [x] test-report 逐项包含 Input/Expected/Actual/Verdict/Duration — 红线 SWBOOT 报告已遵循
- [x] 任何 NOT RUN、fallback、失败和开放风险均如实保留 — 见 2026-09-22 报告
@@ -0,0 +1,65 @@
---
title: "D7 Track E ID-only 合规清单(红线证据)"
status: done
created: 2026-09-22
updated: 2026-09-22
related_task: "ops/short-term/2026-09-22-redline-evidence.md"
related_adr: "adr/2026-09-17-d7-chat-data-retention.md"
compliance: pending-compliance-signoff
---
# D7 Track E ID-only 合规清单
> 本清单只做静态/契约复验。ADR 数字仍 `pending-compliance-signoff`。**禁止**物理删除、备份清除或把 stub/SKIP 写成 retention PASS。
## 范围
| 表面 | 允许 | 禁止 |
|------|------|------|
| 事件 envelope / DLQ / reconciliation | ID、digest、typed error code、allowlist 摘要(含 `summary_ref`) | 聊天正文、prompt、markdown、原始 payload dump |
| 应用日志 | 脱敏 DSN、run/plan/doc ID | 消息 `content` |
| 备份 | 整库 dump 作为运维能力存在 | 本轮执行 dump / 按 365 天清备份 |
| 热库 chat_* | 只读盘点 / 内容编辑 UPDATE | `DELETE FROM chat_*`、retention `SET deleted_at` |
## 勾选(2026-09-22 / SHA `364ed7f1`)
### A. StaticContracts payload
- [x] 全部事件 `PayloadFields` 已枚举 — 证据:`assets/2026-09-22-redline-evidence/d7-track-e-payload-fields.txt`
- [x] 无 `content` / `body` / `message` / `prompt` / `text` / `markdown` — `forbidden_hits=NONE`
- [x] intent.plan.* 含 `summary_ref` 而非正文 — `TestIntentPlanContractsOmitSensitivePayload` PASS
- [x] YAML ↔ `StaticContracts` 对等 — `TestRegistryParityWithYAML` PASS
- [x] `SanitizeSummary` 丢弃非 allowlist 键 — `TestSanitizeSummaryDropsPayload` PASS
### B. 热库 / 删除路径
- [x] Go 检索无 `DELETE FROM chat_*` — `d7-no-physical-delete.txt`
- [x] Go 检索无 chat retention `SET deleted_at` — 同上
- [x] 存在的 `UPDATE chat_messages` 为内容编辑路径,非 soft-delete 作业 — 已注明
- [x] 本轮未对共享/本地业务库执行 DELETE/UPDATE retention — 操作边界
### C. 备份 / 日志 / workspace
- [x] `scripts/backup-system-db.sh` 使用 `pg_dump -Fc` 整库(含 chat 明文)— 静态阅读
- [x] 本轮**未**执行 dump、**未**清除备份目录
- [x] Agent workspace 30 天清理作业仍未实现(待 ADR 签字)— 记为缺口非违规
- [x] FAV `final_artifacts.retention_class` 与聊天口径解耦;consumer off
### D. ADR / 矩阵边界
- [x] ADR `compliance: pending-compliance-signoff` 未改
- [x] FEATURE-MATRIX D7 保持 `deferred`(本批不升)
- [x] 未发现已确认安全/合规基线违反 → **不写** gap-matrix blocker
- [x] 报告:[../../test-reports/2026-09-22-redline-evidence-d7-test-report.md](../../test-reports/2026-09-22-redline-evidence-d7-test-report.md)
## 未做(明确排除)
- 共享 PG 实时 COUNT(无本轮 DB 只读授权会话;沿用 2026-09-17 W7 计数作历史参考)
- 按 365/180/30 物理删除或备份二次清除
- soft-delete 写路径实现
## 下一步(需另授权)
1. 合规签字或改数 → ADR `accepted`/`signed`
2. soft-delete 写路径 → 观察窗 → 物理清理
3. 备份清除:二次批准 + delete manifest(R22)
@@ -0,0 +1,6 @@
OK status -> allow
OK push -> ask
OK reset -> ask
OK clean -> ask
OK force-wt -> ask
hooks OK
@@ -0,0 +1,20 @@
{
"initialize": {
"name": "agentctl",
"version": "1.0.0"
},
"tools": [
"status",
"task_register",
"task_close",
"lease_run",
"docs_snapshot",
"docs_apply",
"validate",
"queue_enqueue",
"quarantine_status"
],
"status_ok": true,
"daemon_ok": true,
"daemon_held": true
}
@@ -0,0 +1 @@
queue retry after parking untracked promotion receipts (DIRTY_TREE) at /tmp/ci-hold-receipts
@@ -0,0 +1,5 @@
OK agentctl-session-start lines 30
OK agentctl-worktree-setup lines 48
OK agentctl-lease-write lines 45
OK agentctl-integrate-closeout lines 53
skills OK
@@ -0,0 +1,2 @@
146:Ran 134 tests in 122.988s
148:OK (skipped=3)
@@ -0,0 +1 @@
bootstrap: ok
@@ -0,0 +1,5 @@
{"interval": 1.0, "max_cycles": 3, "pid": 63316, "status": "daemon_started"}
{"processed": 0, "results": [], "status": "ok"}
{"processed": 0, "results": [], "status": "ok"}
{"processed": 0, "results": [], "status": "ok"}
{"cycles": 3, "pid": 63316, "reason": "max_cycles", "status": "daemon_stopped"}
@@ -0,0 +1 @@
{"epoch": "7fa35ad9-518f-4a0d-a446-49baf12c666c", "heartbeat": {"cycle": 99, "pid": 63557, "updated": 1790158027.962433}, "heartbeat_age_seconds": 0.2736787796020508, "lock_root": "/private/tmp/Agent-System/.locks", "manager_lock": {"held": true, "holder_pid": 63557, "path": "/private/tmp/Agent-System/.locks/os/manager.lock"}, "queue": {"claimed": 0, "pending": 0}, "status": "ok"}
@@ -0,0 +1 @@
{"epoch": "7fa35ad9-518f-4a0d-a446-49baf12c666c", "heartbeat": {"cycle": 2, "pid": 63557, "updated": 1790157919.612233}, "heartbeat_age_seconds": 0.8667151927947998, "lock_root": "/private/tmp/Agent-System/.locks", "manager_lock": {"held": true, "holder_pid": 63557, "path": "/private/tmp/Agent-System/.locks/os/manager.lock"}, "queue": {"claimed": 0, "pending": 0}, "status": "ok"}
@@ -0,0 +1 @@
f1b4fdca-0209-466d-9aba-fcd8f90bb3be completed; tip 5e11db50
@@ -0,0 +1 @@
Darwin WeiCHENdeMac-mini.local 25.6.0 Darwin Kernel Version 25.6.0: Fri Jul 31 19:17:26 PDT 2026; root:xnu-12377.161.14~5/RELEASE_ARM64_T6041 arm64
@@ -0,0 +1,6 @@
5: state = running
38: runs = 1
39: pid = 63557
50: last exit code = (never exited)
55: state = active
63: state = active
@@ -0,0 +1,13 @@
2: active count = 1
3: path = /Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist
5: state = running
7: program = /usr/bin/python3
17: working directory = /private/tmp/Agent-System
19: stdout path = /tmp/agentctl-coordinator.out.log
20: stderr path = /tmp/agentctl-coordinator.err.log
38: runs = 1
39: pid = 63557
55: state = active
56: active count = 1
63: state = active
64: active count = 1
@@ -0,0 +1,3 @@
domain=gui/501
dest=/Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist
cmd: launchctl bootstrap gui/501 /Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.agentctl.coordinator</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python3</string>
<string>/private/tmp/Agent-System/scripts/agentctl.py</string>
<string>daemon</string>
<string>run</string>
<string>--interval</string>
<string>1.0</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/tmp/agentctl-coordinator.err.log</string>
<key>StandardOutPath</key>
<string>/tmp/agentctl-coordinator.out.log</string>
<key>WorkingDirectory</key>
<string>/private/tmp/Agent-System</string>
</dict>
</plist>
@@ -0,0 +1 @@
2026-09-23T10:05:09Z
@@ -0,0 +1,3 @@
1:{"interval": 1.0, "max_cycles": null, "pid": 63557, "status": "daemon_started"}
126:{"run_id": "queue-f1b4fdca-0209-466d-9aba-fcd8f90bb3be", "sha": "5e11db50ce6f8905890993cef1d4a64bbb6f53d9", "status": "merged"}
127:{"processed": 1, "results": [{"id": "f1b4fdca-0209-466d-9aba-fcd8f90bb3be", "run_id": "queue-f1b4fdca-0209-466d-9aba-fcd8f90bb3be", "status": "completed"}], "status": "ok"}
@@ -0,0 +1 @@
weichen
@@ -0,0 +1 @@
/Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist: OK
@@ -0,0 +1 @@
{"items": [], "status": "ok"}
@@ -0,0 +1,6 @@
# Rollback (fail-closed)
launchctl bootout gui/501/com.agentctl.coordinator
rm -f /Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist
# verify:
launchctl print gui/501/com.agentctl.coordinator # expect not found
python3 /private/tmp/Agent-System/scripts/agentctl.py daemon status

Some files were not shown because too many files have changed in this diff Show More