Compare commits

...
Author SHA1 Message Date
weichen cb22135144 release-candidate: 汇集 dev@b9339cd2 至 test(docgov 共享 map 竞态修复、任务刷新恢复、商务叙事阶段门控),准备长期实测 [Tag: rc-v1.1.0-beta.7] 2026-09-28 09:53:47 +00:00
weichen b9339cd272 merge: candidate docgov-shared-map-race-2026-09-28-r2 into dev 2026-09-28 09:06:52 +00:00
weichen 792c216c96 docs(docgov): 登记共享 map 并发崩溃的问题、经验与竞态回归
登录 500 来自进程被 concurrent map 打崩,不是登录逻辑。单测 -race 已通过,dev 重建仍待合入后复验。
2026-09-28 09:06:06 +00:00
weichen a90cce73b9 fix(docgov): 保护共享内存 map,避免并发读写把进程打崩
per-doc 锁只串行同一文档,不同 docID 仍裸读写 memDocs 等 map。GetDocument 与另一文档写入撞上时运行时 fatal,代理把全部 API 变成 500。
2026-09-28 08:52:44 +00:00
weichen a3db288a7a merge: candidate bizdev-stage-gating-narrative-2026-09-28 into dev 2026-09-28 07:31:48 +00:00
weichen f46480a987 feat(workflow): 商务叙事阶段允许编制任意已启用文档 2026-09-28 07:29:59 +00:00
weichen e5c2519fea merge: candidate refresh-task-state-recovery-2026-09-28 into dev 2026-09-28 06:18:08 +00:00
weichen 5bc88faf4f docs(test): 记录刷新恢复的短测与前端构建
短测、前端测试和构建已通过。架构边界失败来自基线上的 coordinator 导入,浏览器与真实 PI 链路尚未在新代码上复验。
2026-09-28 06:14:35 +00:00
weichen b820e0070d fix(taskrun): 刷新后恢复进行中任务并纠正进度问询
进行中的 run 提前写下消息锚点,并按会话列出活跃任务;进度疑问句改为查询真实状态,交付物已落盘且不是传输失败时不再被空结果否决。
2026-09-28 06:09:42 +00:00
weichen 8d5e782079 merge: candidate promote-rc-beta6-closeout-2026-09-28 into dev 2026-09-28 06:05:54 +00:00
weichen 5679c79011 docs(ops): record rc-v1.1.0-beta.6 promotion and cleanup 2026-09-28 06:05:32 +00:00
weichen 0664abe57d release-candidate: 汇集 dev@714732df5a37 至 test(助手回复叙述、test 文档问题、质量门禁标题归一化),准备长期实测 [Tag: rc-v1.1.0-beta.6] 2026-09-28 06:01:36 +00:00
weichen 714732df5a merge: candidate land-promote-rc-beta5-record-2026-09-28 into dev 2026-09-28 05:56:49 +00:00
weichen a3f8afbe63 docs(ops): land rc-v1.1.0-beta.5 promotion record on dev 2026-09-28 05:52:18 +00:00
weichen 650703c5c2 merge: candidate quality-gate-heading-mismatch-2026-09-28-r3 into dev 2026-09-28 05:38:01 +00:00
weichen d86b4d51ef docs(task): 加回质量门禁修复的 CURRENT 认领行 2026-09-28 05:31:03 +00:00
weichen 4bb265b431 merge: dev into quality-gate-heading-mismatch 2026-09-28 05:30:54 +00:00
weichen d6ce9abef7 docs(task): 让 CURRENT 认领行与 dev 对齐以便合入
暂时去掉本任务行,合入代码后再用 docs apply 加回。
2026-09-28 05:30:31 +00:00
weichen d3fda0e834 docs(task): 链到质量门禁标题漂移测试报告 2026-09-28 05:16:33 +00:00
weichen 44435691c0 docs(test): 记录质量门禁标题归一化的工程验收 2026-09-28 05:16:25 +00:00
weichen 87888213da chore(arch): 补记 coordinator 对 projectworkflow 的既有依赖
block 模式基线为 0,该 import 在本修复之前已在 engine_task.go。
2026-09-28 05:15:10 +00:00
weichen 4c42d1bf74 merge: candidate agent-reply-llm-narrative-2026-09-28 into dev 2026-09-28 05:13:29 +00:00
weichen aea19f70ef fix(squad): 章节标题归一化后不再把空格和层级漂移判成缺章
聊天触发的任务同时打开质量自动修复,避免格式误报直接阻断受控投影。
2026-09-28 05:12:51 +00:00
weichen 434d542c3c merge: candidate test-user-doc-issues-2026-09-28 into dev 2026-09-28 04:20:02 +00:00
weichen fa5d17a403 docs(task): 补记五态收口
说明这次合入后 test 制品还没有重放。
2026-09-28 04:19:49 +00:00
weichen 2952aa5a64 docs(task): 收口第三方 test 文档问题
CURRENT 记下任务已完成。test 制品尚未按这次 dev 重放。
2026-09-28 04:19:26 +00:00
weichen 6e1d5830b5 merge: candidate test-user-doc-issues-2026-09-28 into dev 2026-09-28 04:15:18 +00:00
weichen c46a9c35dc docs(test): 记录任务写动词与可见拒绝的验收
第三方 test 问题的单测与 runner 接线核对需要可追溯报告,嵌入超限保持开放。
2026-09-28 04:10:18 +00:00
weichen 73836962a0 release-candidate: 汇集 dev@193a752f1a54 至 test(含 PI runner 工作区校验),准备长期实测 [Tag: rc-v1.1.0-beta.5] 2026-09-28 04:03:45 +00:00
weichen db859e185e fix(intent): 让「帮我定任务书」进入任务并说清失败
写动词补上制定/拟定与祈使「帮我定」,避免落到阶段对照模板。质量未通过不再声称正文已保存到宿主机路径;研发前置未满足时把中文原因直接回复给用户。
2026-09-28 04:01:02 +00:00
weichen 193a752f1a merge: candidate pi-runner-env-mismatch-2026-09-28 into dev 2026-09-28 03:52:33 +00:00
weichen 3eac19cf44 docs(test): 将验收日志摘录改为可跟踪的 txt
*.log 被 gitignore,sidecar 与 data_dir 核对摘录需随报告入库。
2026-09-28 03:45:30 +00:00
weichen d724982acc docs(test): 记录 PI runner 环境错配的真实验收
test 进程已改接 18866,bd_research 在 data/test 工作区完成,原先的 MISSING_TARGET 未再现。
2026-09-28 03:44:57 +00:00
weichen dfd9f6efb3 docs(test): 记录助手回复智能体叙述的验收
附带任务记录与 CURRENT 认领行。真实 Runner 三轮 reply_source=pi-agent。
2026-09-28 03:25:18 +00:00
weichen d55488ae37 feat(coordinator): 用智能体叙述查询、帮助与操作回执
确定性事实仍由代码生成;PI Agent 只组织语言,失败或关闭开关时回退原模板。安全拦截与确认提问保持模板。
2026-09-28 03:25:06 +00:00
weichen 3ba15df875 fix(agent): 记录 PI runner 数据目录核对结果
启动后第一次核对通过时打一条不含路径的日志,便于确认 test 没有再打到 dev sidecar。
2026-09-28 03:17:26 +00:00
weichen 4f581306d7 fix(agent): 拒绝把工作区发给数据目录不一致的 PI runner
test 启动时根 .env 的 dev runner URL 盖过了 18866,sidecar 把 test 工作区重写到 dev 空目录,模型因读不到材料报 MISSING_TARGET。端口约定优先,并在调用前核对 runner data_dir。
2026-09-28 03:16:27 +00:00
weichen 8f77053f51 merge: candidate error-events-pg-roundtrip-2026-09-28 into dev 2026-09-28 02:45:42 +00:00
weichen 0e05eedade docs(task): 更正补记任务的 dev 基线 SHA 2026-09-28 02:45:25 +00:00
weichen 4bceb2b4ba docs(test): 补记错误审计表隔离库往返通过
一次性 pgvector 库迁到 78 后,TestStoreRoundTrip 写入并按 request_id 读回。
2026-09-28 02:45:10 +00:00
weichen 655fb4f149 merge: candidate error-code-observability-2026-09-28 into dev 2026-09-28 02:39:23 +00:00
weichen ef3c770451 docs(task): 记录错误码体系已合入 local dev
认领改为 done。实现提交已在 dev,部署与远端同步不在本次授权内。
2026-09-28 02:39:12 +00:00
weichen dddd3fe8c8 merge: candidate error-code-observability-2026-09-28 into dev 2026-09-28 02:37:48 +00:00
weichen e4da425b23 merge: candidate attachment-only-turn-2026-09-28 into dev 2026-09-28 02:32:38 +00:00
weichen 8f72b6a97c docs(test): 记录附件回合在重载后的 dev 上复验通过
:8080 已换成含本修复的二进制。仅附件得到梳理或解析引导,无关文字先回答再追问。
2026-09-28 02:32:31 +00:00
weichen 73a3aa9286 docs(errcode): 登记错误码目录、任务和验证报告
目录按注册表列出稳定码,测试报告记录工程门禁与无测试库时的审计跳过。
2026-09-28 02:27:29 +00:00
weichen 7435f48389 feat(web): 增加错误审计查询和失败排查指引
管理台可按错误码或 request id 检索审计记录,聊天失败气泡展示对应排查短句。
2026-09-28 02:27:23 +00:00
weichen f3f23a3018 feat(errcode): 用稳定错误码记录 HTTP 与异步失败
失败响应此前不写日志,request_id 无法对照原因。注册表不覆盖处理器已经给出的 HTTP 状态。
2026-09-28 02:27:16 +00:00
weichen c87d28b343 merge: candidate attachment-only-turn-2026-09-28 into dev 2026-09-28 02:16:18 +00:00
weichen 42a9a4be5d docs(test): 记录附件回合修复已合入 local dev
候选已 ff-only 进入 dev。浏览器和产品 PI 仍未跑,运行中的 dev 进程还没加载新二进制。
2026-09-28 02:16:09 +00:00
weichen cb4d2af8d3 merge: candidate attachment-only-turn-2026-09-28 into dev 2026-09-28 02:13:37 +00:00
weichen 457e870330 fix(chat): 只上传文档时给出梳理或追问,不再裸报 HTTP 400
空消息加附件可以进入回合。无文字时按解析状态引导或回退审阅,有文字但未处理文档时先回答再追问。4xx 信封不再被前端丢弃。
2026-09-28 02:00:24 +00:00
weichen 6314406701 merge: candidate activation-preview-precheck-2026-09-28 into dev 2026-09-28 01:50:48 +00:00
weichen 8a9614d19e docs(test): 归档激活预览预检复验并关闭问题
dev 浏览器已确认未纳入审批时不再请求 activation-preview,兼任后预览 200,密钥框均在 form 内。
2026-09-28 01:50:26 +00:00
weichen 3e534bbb39 merge: candidate activation-preview-precheck-2026-09-28 into dev 2026-09-28 01:40:39 +00:00
weichen e7d4743cba docs(task): 登记激活预览预检与密钥框警告
记录 dev 项目 6022 的 400 时间线,以及管理台五个密钥输入不在表单内的 DOM 警告。
2026-09-28 01:38:39 +00:00
weichen 7f9d01a3b6 fix(web): 激活前预检人工审批并消除密钥框密码警告
未纳入人工审批的计划会被服务端拒绝为 400。配置页在请求前拦截并提示;管理台密钥输入放入表单,避免浏览器把密码框当成未托管字段。
2026-09-28 01:35:46 +00:00
weichen b1ed8ecfe9 merge: candidate squad-commit-authority-2026-09-28 into dev 2026-09-28 01:25:28 +00:00
weichen 56538221f3 docs(task): record non-author squad commit denial 2026-09-28 01:24:26 +00:00
weichen c713834954 fix(bizdev): commit squad ledger as the document author
Non-author triggers were denied by dutyAuthorizer because AutoCommitUserID was the triggering user. Record that user on OnBehalfOf and surface the duty mismatch in the task error.
2026-09-28 01:24:25 +00:00
weichen 774df05998 merge: candidate auth-register-internal-2026-09-28 into dev 2026-09-28 01:16:32 +00:00
weichen dbe1401455 docs(task): mark auth register fix resolved after test goose 77 2026-09-28 01:16:22 +00:00
weichen 9141741b78 merge: candidate auth-register-internal-2026-09-28 into dev 2026-09-28 01:12:57 +00:00
weichen e1d6a2c192 docs(task): record auth register INTERNAL fix and test evidence 2026-09-28 01:12:14 +00:00
weichen 88b7c11a23 fix(auth): reseed standard roles and reject duplicate usernames as 400
Registration always writes role-guest; a deleted standard role became a masked INTERNAL. Username unique violations are now a 400 instead of an infrastructure 500.
2026-09-28 01:12:07 +00:00
weichen 4ba60c2c9d merge: candidate restore-admin-password-reset-2026-09-28 into dev 2026-09-28 00:57:01 +00:00
weichen e1f2c9c57f docs(current): mark password-reset restore done
The UI candidate is already on local dev; record the five-state closeout.
2026-09-28 00:56:49 +00:00
weichen 04d7fec493 merge: candidate restore-admin-password-reset-2026-09-28 into dev 2026-09-28 00:51:41 +00:00
weichen 90e146e424 docs(task): record admin password reset UI restore
Capture the F4-A mis-delete, the dev UI probe, and the CURRENT claim.
2026-09-28 00:51:25 +00:00
weichen f0ecc4c996 fix(web): restore admin password reset in user governance
T20-F4-A removed the working reset button after the F4-B endpoint was already live. Restore the entry so admins can issue a one-time random temp password.
2026-09-28 00:44:41 +00:00
weichen 912957c44e merge: candidate docker-context-gitkeep closeout into dev 2026-09-27 21:13:13 +00:00
weichen ec7148175b docs(task): close docker-context-gitkeep (e40a9989 verified by real image build, merged as 5e409c1e) 2026-09-27 21:13:04 +00:00
weichen b35ea39a95 merge: candidate promote-rc-beta4-2026-09-27 receipts into dev 2026-09-27 21:12:44 +00:00
weichen a6acdcb30b merge: candidate test-single-binary-2026-09-27 closeout into dev 2026-09-27 21:12:12 +00:00
weichen c20c8aa7ab docs(current): mark test-single-binary-2026-09-27 done (receipt test-single-binary-2026-09-27-state-2) 2026-09-27 21:11:22 +00:00
weichen 8b3da0d297 docs(promote): rc-v1.1.0-beta.4 receipts, evidence and promote record
- PASS receipt 5e409c1e + images manifest + nightly evidence (five real-PI chains)
- recovered archive of nightly6 @94c215d3 process evidence (original dir lost in
  staging move; full original log preserved, README documents the loss)
- task record for the promotion (candidate 2fe1e055, tag, images apply)
2026-09-27 21:11:07 +00:00
weichen 912342ae0a docs(test): rc-v1.1.0-beta.4 promotion + test single-binary report; fix launcher env mapping
- migrate-test-db.sh: export DEV_PG_CONTAINER (inner script reads it, not CONTAINER)
- launch-single.sh: SYSTEM_DB_* must override root-.env CONTEXT_DB_* (set -a
  re-source clobbers both external exports and :- fallbacks; two misdirected
  launches audited, dev DB unchanged - report §5.8-3)
- task record done; full test report (nightly five chains PASS @5e409c1e,
  migration S0-verified, deployment acceptance, rollback paths, follow-ups)
2026-09-27 21:10:16 +00:00
weichen 2fe1e05591 release-candidate: 汇集 dev 功能至 test(test 单二进制化配套脚本 + docker 上下文修复),准备长期实测 [Tag: rc-v1.1.0-beta.4] 2026-09-27 20:59:11 +00:00
weichen 22f7e7f3f7 docs(current): claim test-single-binary-2026-09-27 (docs apply receipt test-single-binary-2026-09-27-state-1) 2026-09-27 20:57:57 +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 83c6a12aaf merge: promote local dev to test (rc-v1.1.0-beta.1, schema 61)
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-22 20:57:28 +08:00
WeiCHEN 591ea60174 merge: feature/dev-prod-ready-test-promotion-2026-09-22 (PI DATA_DIR mount fix)
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 19:40:48 +08:00
WeiCHEN 63f8cfebe7 fix(test): pin real-PI DATA_DIR to runner-mounted data/dev
go test under internal/server previously preferred package-local
data/test, so materials never reached the pi-agent bind mount and
intake quality gates failed closed on empty sandboxes.
2026-09-22 19:40:28 +08:00
weichenandCursor 3df99cf509 merge: feature/dev-prod-ready-test-promotion-2026-09-22 (FullNone bd_intake)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 19:20:13 +08:00
weichenandCursor c67c10acc5 test: use official bd_intake key in FullNone real-PI fixture
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 19:20:11 +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
weichenandCursor 8ae45a0ce0 merge: feature/dev-prod-ready-test-promotion-2026-09-22 (ABAC + gate fixtures)
Close project-context membership gap, register arch SSOT edges, and repair
CI PG fixtures so release short/vet/arch gates pass on schema 61.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 18:23:50 +08:00
weichenandCursor 0ebcabf7df fix(auth): tolerate concurrent demo-user seed unique conflicts
Parallel NewServer bootstrap raced with goose fixed-id user rows and
sequence drift, panicking the server package on wangzong insert. Treat
unique violations as success when the demo username exists (or retry once).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 18:18:33 +08:00
weichenandCursor 675b00e06d test: align official bd_intake task key and scoped task-run fixtures
Official main.v2 uses bd_intake (not intake); stage gates stayed closed when
fixtures approved the wrong task key. Task-run finalizers also require a real
project_id for outbox event scope—seed scoped projects in PG fixtures.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 18:15:29 +08:00
weichenandCursor c767a99807 fix(authz): close project-context ABAC gap and repair CI PG fixtures
enforceChatProjectAccess before allowAnyStageAccess on GET /context/project
so activated projects are no longer readable by arbitrary authenticated users.

Align failing gate fixtures with official workflow keys, isolated TEST_DATABASE_URL,
unique project names (00057), duty membership, and in-memory bizdev-cli envs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 18:12:26 +08:00
weichenandCursor 3c2c7f9ccc test+arch: unblock production gate (import SSOT + isolated test DSN)
arch-check --mode block failed on frozen dev (23 NEW import findings):
modules materialindex/mineru/workflowscope and edges shipped via their
own accepted tasks were never registered in module-boundaries.yaml.
Register the intentional allowlist edges (precedent 97b868a9); no new
exceptions are added.

7 PG tests fell back to a hardcoded dev DB (127.0.0.1:5433) when
TEST_DATABASE_URL/CONTEXT_DB_DSN were unset, contradicting the isolated
test-DB contract (BUG-08) and polluting dev on a bare 'go test -short'.
Change the fallback to skip when no isolated DB env is provided.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 18:04:02 +08:00
WeiCHEN 063ee1630f merge: feature/status-reconcile-2026-09-22 (task closeout) 2026-09-22 15:00:17 +08:00
WeiCHEN 525a9ad450 docs(ops): close status-reconcile task after local dev merge 2026-09-22 15:00:06 +08:00
WeiCHEN 38ed539f10 merge: feature/status-reconcile-2026-09-22 (legacy registry reconcile) 2026-09-22 14:58:30 +08:00
WeiCHEN 068ad5df60 docs(ops): reconcile legacy task registry with fresh-clone reality 2026-09-22 14:57:44 +08:00
weichen a3150dcb11 merge: feature/dev-prod-ready-test-promotion-2026-09-22 (GOPROXY build fix + task record) 2026-09-22 12:29:40 +08:00
weichenandCursor 517b9646bf fix(build): make Go GOPROXY a compose build arg for restricted networks
Default GOPROXY stays proxy.golang.org to preserve upstream behavior;
hosts that cannot reach it pass GO_PROXY (e.g. goproxy.cn) via the env
file. Wires app+events build args across dev/test/main compose.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 12:26:05 +08:00
weichenandCursor b885505d68 docs(ops): register dev prod-ready gate and test promotion task
macOS host exception recorded in task doc: agentctl lease path is
Linux-only (/proc); commits under this task use --no-verify with the
manual equivalent gates listed in the exception section.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 11:59:09 +08: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 3f2534646d merge: close Herdr v1.2 governance task
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-21 15:20:20 +00:00
weichen 70f3c73d84 docs(herdr): record v1.2 validation and cleanup ownership 2026-09-21 15:20:12 +00:00
weichen 8c5e347758 merge: adopt Herdr v1.2 resource governance 2026-09-21 15:17:44 +00:00
weichen 8bc7940ee0 fix(herdr): scope v1.2 routing and protect shared Kimi quota
Align prepared clients with role budgets and automatic approvals. Keep uncertain delivery from triggering duplicate work and preserve task worktree gates.
2026-09-21 15:17:20 +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
weichen d919e06a73 merge: close verified governance implementation 2026-09-21 14:47:01 +00:00
weichen 7f80e72ab9 docs(governance): record live gates and verified local integration
Archive the completed implementation and preserve cleanup ownership, runtime identity and review evidence.
2026-09-21 14:46:55 +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
weichen 7e9317b849 merge: activate agent governance and local operation gates 2026-09-21 14:42:53 +00:00
weichen 578a96440d merge: reconcile governance with current dev
# Conflicts:
#	.doc/ops/CURRENT.md
2026-09-21 14:42:13 +00:00
weichen fed87ad14b feat(governance): enforce managed worktrees and scoped agent operations
Consolidate approved policies and add local lease, document CAS, commit, candidate and environment gates. Preserve conservative recovery and cleanup limits.
2026-09-21 14:41:40 +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
weichen a5ea469ca4 merge: feature/force-material-chunk-index-2026-09-21 (confirm 535 and chunk index docs) 2026-09-21 13:57:10 +00:00
weichenandCursor 06b9278996 docs(test): 记录候选 535 确认与全量切块验收
项目 6579 的正式正文已换成真实解析内容,冲击波 PDF 写入 90 条带向量的切块,小文档仍全文注入。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 13:56:57 +00:00
weichen a16a661968 merge: feature/force-material-chunk-index-2026-09-21 2026-09-21 13:47:21 +00:00
weichenandCursor 1fb59e12ef feat(bizdev): 成功解析的材料一律写入 material_chunks
大小阈值只决定全文注入还是目录加检索片段,不再决定是否切块。上传后的异步解析同样跳过 60KB 门槛。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 13:40:39 +00:00
weichen eb4dbdca5b docs(workflow): register approved governance implementation scope 2026-09-21 13:03:34 +00:00
weichenandCursor a241e83815 docs(ops): 状态卡二轮任务收口记录(已合入 dev + cleanup_pending)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 12:04:01 +00:00
weichen ab45cad414 Merge commit 'a3f05346' into feature/taskrun-status-card-2026-09-21
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	.doc/ops/CURRENT.md
2026-09-21 11:56:09 +00:00
weichenandCursor 82e912986e docs(test): 状态卡 label 冻结二轮修复真实 PI 验收报告与证据
- test-report 追加 §8:根因取证、三层修复、dev 回填实测(4424/4508)、
  真实 PI 前向路径验收(消息 4548 免回填直接落归一化 label)、
  刷新窗口恢复断言、部署制品核验;一次性会话已撤销
- assets 归档 round2 证据:real-task / message-4548-snapshot /
  window-round2 / bundle-markers-round2 / forward-verify
- CURRENT 集成槽位释放为 idle(taskrun-status-card label 修复已合入 dev)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 11:48:33 +00:00
weichenandCursor a3f05346e8 merge: feature/mineru-doc-parsing-2026-09-21 (second-round docs)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 11:46:00 +00:00
weichenandCursor 888f41090e docs(test): second-round root causes for real PDF failure
Record the dev data-mount drift (worktree env-service violation) and the
Agent API 20-page limit as the two combined root causes, with the
chunked real-28-page-PDF workspace evidence. Retract the first-round
acceptance verdict.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 11:36:49 +00:00
weichen 4b30324754 merge: dev@362b68a0 (mineru page_range) into feature/taskrun-status-card-2026-09-21 2026-09-21 11:13:40 +00:00
weichenandCursor c026ad7160 test(mineru): dump parsed markdown for live content proof
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 11:10:42 +00:00
weichenandCursor 362b68a0a7 merge: feature/mineru-doc-parsing-2026-09-21 (agent page_range chunking)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 11:09:52 +00:00
weichenandCursor 930776438a docs(ops): 占用集成槽位(taskrun-status-card label 修复合入 + dev 验收)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 11:02:12 +00:00
weichenandCursor b5b1e7798c docs(ops): 记录状态卡 label 冻结二轮修复与回填证据
- short-term 任务文追加"收口后 label 冻结"根因、三层修复与验收项
- assets 归档 dev 回填前/后取样与执行输出(backfill-before/after/run.txt)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 11:00:05 +00:00
weichen b68e1f6412 merge: dev@5c3261c6 into feature/taskrun-status-card-2026-09-21 2026-09-21 10:33:21 +00:00
weichenandCursor 837ac3e466 chore(ops): 历史 task_phase_snapshot 冻结 label 一次性回填脚本
扫描 chat_messages.metadata.task_phase_snapshot,对 completed 步骤复用
taskrun.NormalizeSettledStep 归一化 label(幂等,可重复执行)。
支持 -dry-run 与 -id 定位;仅面向当前环境 DB(默认 ContextDSN)。
dev 实测:4424/4508 两条修复,二次 dry-run 为 0。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 10:32:57 +00:00
weichenandCursor 725cad3d25 fix(web): 任务状态卡收口与渲染层归一化冻结进度文案
与后端 fix(taskrun) 对称:

- phaseEventMapper.settleStep:applyPhaseEvent 收口分支(CLOSE_PHASES、
  新 phase 结算前序、existing 条目刷新)把 completed 条目 label 归一化为
  短标签 + "已完成",保留"(第 x/y 步)"结构后缀;failed 有意保留原文案。
  导出 PHASE_META 供展示层复用。
- lib/taskRunCard.displayStepLabel:渲染层兜底清洗历史脏快照(如 #4424),
  回填失败/漏跑时前端仍正确展示。
- 更新 phaseEventMapper.test.ts 中两处此前把 bug 钉死为预期的断言;
  TaskRunCard.test.ts 新增复现 #4424 展示层兜底用例。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 10:32:57 +00:00
weichenandCursor 561709178a fix(taskrun): 收口 completed 步骤时归一化冻结的进度中 label
步骤从 running 收口为 completed 时,此前只翻转 Status,Label 永久冻结为
上游下发的"正在…(NN%)"进度中叙述,导致卡片即便步骤已完成仍读起来像还在跑
(缺陷见消息 #4424)。

新增导出函数 NormalizeSettledStep:completed 步骤改写为短标签 + "已完成",
保留"(第 x/y 步)"结构后缀以区分多步任务,原始叙述留在 Detail 供审计;
failed/pending/running 有意不改(失败细节由错误气泡承载)。
接入 applyPhasePayload 三处收口分支、existing-step 刷新分支,
以及 BuildPhaseSnapshot 终态收口 + 存量兜底全量归一化。

导出供回填脚本复用,避免逻辑漂移。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 10:32:38 +00:00
weichen 5c3261c6d8 docs(ops): summarize upload-parse-ux closeout in CURRENT focus 2026-09-21 10:22:51 +00:00
weichen a0464eb560 merge: upload-parse-ux task closeout docs 2026-09-21 10:17:43 +00:00
weichenandCursor fe76a9d683 docs(ops): close out upload parse ux task
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 10:17:16 +00:00
weichen 74587ccff3 merge: docs e2e evidence for upload-parse-ux 2026-09-21 10:12:22 +00:00
weichenandCursor 7d1f58b681 docs(test): record dev E2E for parse polling, dedup hint and CoW
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 10:11:15 +00:00
weichenandCursor db76a28689 feat(mineru): chunk Agent parse by page_range past 20-page cap
The free Agent lightweight API rejects files over 20 pages (-30003)
and the precision token is expired, so a real 28-page PDF could not
parse at all. On -30003, parse in 20-page windows and renumber chunk
anchors to global pages; report engine mode agent_chunked.

Also log skipped assets in ResolveMaterials and return a bool from
EnqueueAsync so parse_state is only set when a job is enqueued.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 10:11:08 +00:00
weichen 9990557145 merge: feature/upload-parse-ux-2026-09-21 2026-09-21 09:52:56 +00:00
weichenandCursor 97bf63348b docs(test): upload parse ux dedup acceptance report (unit+integration)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:50:24 +00:00
weichenandCursor e30db81b9d docs(audit): document storage CoW status and dedup visibility
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:48:32 +00:00
weichenandCursor 694f9b7ecf feat(web): poll parse state, surface dedup hint and reparse action
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:47:06 +00:00
weichenandCursor b867f4f19c test: cover dedup hint, reparse guard, store gate and CoW contract
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:47:06 +00:00
weichenandCursor 5f9fbb9923 fix(server): gate parse enqueue to store-backed pipeline
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:47:06 +00:00
weichen a57cdae697 merge: workflow-scope-weighting acceptance report 2026-09-21 09:45:13 +00:00
weichenandCursor 3bde2634ba docs(test): record workflow scope weighting acceptance
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:44:50 +00:00
weichen 7723a55159 merge: workflow-scope-weighting template read fix 2026-09-21 09:37:51 +00:00
weichenandCursor 0272d13574 fix(server): treat a template-only ledger as a readable in-scope document
A missing ledger body was reported as not found, so an in-scope view of a template document never reached the template reply.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:37:39 +00:00
weichen 14b5aace47 merge: feature/workflow-scope-weighting-2026-09-21 2026-09-21 09:31:12 +00:00
weichenandCursor 776e069e2f docs(ops): mark the integration slot for workflow scope weighting
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:30:31 +00:00
weichenandCursor 8b84ee4ecf chore(config): declare WORKFLOW_SCOPE_MODE with a strict default
The flag reaches all three compose app services and the sysadmin catalog, and unknown values stay on the existing hard block.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:26:03 +00:00
weichenandCursor 4af4a9de13 fix(intent): keep draft requests that end in 看看 on the write path
「出一版…看看」是写完给看,不是只读查看;查看和读取仍走只读作用域裁决。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:26:03 +00:00
weichenandCursor fd4b95030f feat(web): score write-path matches by workflow relation
The document list now reports WORKFLOW_SCOPE_MODE, and weighted mode only blocks a cross-workflow write when that title outscores the active workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:22:13 +00:00
weichenandCursor 63f94ff23b feat(server): expose dedup hint, parse error and reparse endpoint
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:18:20 +00:00
weichenandCursor 0972900215 feat(intent): score slot filling against the active workflow
Weighted mode keeps an in-scope document when a cross-workflow name is only mentioned beside it, while exact cross-workflow writes stay blocked and exact reads record the owning workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:15:51 +00:00
weichenandCursor 976f8d30b8 feat(server): allow weighted cross-workflow reads after a view check
Exact out-of-workflow documents can be summarized when WORKFLOW_SCOPE_MODE=weighted and the caller can still view the active instance; writes stay blocked.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:11:47 +00:00
weichenandCursor 31dde45b72 docs(ops): register upload parse ux dedup task
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:10:55 +00:00
weichenandCursor fac5704303 feat(workflowscope): score document hits by workflow relation weight
Keep WORKFLOW_SCOPE_MODE=strict as the default so cross-workflow mentions stay blocked until weighted mode is turned on.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:07:50 +00:00
weichenandCursor 0bf4977d27 docs(ops): claim workflow scope weighting on a feature branch
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 09:07:50 +00:00
weichenandCursor 10aee3feb4 merge: docs for intent-confirm real PI acceptance
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:48:28 +00:00
weichenandCursor e400909a3a docs(test): record real PI acceptance for intent confirm stage-aware
Capture 陈威 project 6579 chat evidence: weak-verb confirm card, affirm
execution (~3m), option-2 no task, and strong-path direct TRIGGER_TASK.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:47:26 +00:00
weichenandCursor fc82abb1bc docs(test): record soft-dev MinerU E2E acceptance evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:42:53 +00:00
weichenandCursor b90259b9fc docs(test): accept MinerU parsing on soft-dev with Agent fallback
Upload demo PDF reached parse_state=done; schema 61; release
integration slot. Precision token remains expired by design for this run.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:42:53 +00:00
weichenandCursor 7f150831bb merge: feature/mineru-doc-parsing-2026-09-21
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:37:12 +00:00
weichenandCursor 2c6b41a5ac feat(mineru): fall back to Agent lightweight API on token failure
When precision API key is missing or expired (A0202/A0211), parse
via the no-token Agent API so document understanding still works.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:36:24 +00:00
weichenandCursor 67574df45b docs(test): close out intent confirm stage-aware after deploy verify
Archive the short-term task, mark CURRENT done, and attach rebuild
evidence from the correct dev tree no-cache image.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:34:22 +00:00
weichenandCursor ca21d66b29 docs(ops): freeze mineru task head_sha
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:30:01 +00:00
weichenandCursor 29dfae6b40 docs(test): record MinerU parsing implementation and live blocker
Claim CURRENT mutex, archive short-term task, and document unit PASS
plus live A0211 token-expired blocker.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:29:10 +00:00
weichenandCursor 983b785cd6 feat(config): wire MinerU and material RAG settings
Add MINERU_* / MATERIAL_* to config loader, .env.example, and
compose env passthrough. Secrets stay in local .env only.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:29:10 +00:00
weichenandCursor 79c4c7c496 feat(api): enqueue material parse on upload and expose parse_state
Async-trigger MinerU after CAS store and surface parse status in
assets API plus a lightweight preview badge.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:29:10 +00:00
weichenandCursor 9ee890950a feat(bizdev): hybrid material injection and real CAS embedder
Prefer MinerU markdown, inject fulltext or toc+rag for large docs,
and wire kb.Embedder into CAS instead of nil.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:29:10 +00:00
weichenandCursor 18c727bb9f feat(materialindex): parse pipeline with chunk embed and RAG search
EnsureParsed waits or lazily triggers MinerU, indexes oversized
markdown into material_chunks, and supports reranked retrieval.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:29:10 +00:00
weichenandCursor 32cda4486c feat(mineru): add MinerU precision parse client
Implement signed batch upload, poll, zip extract, and real page
anchor rebuild from content_list.json.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:29:10 +00:00
weichenandCursor 1e482023b6 feat(db): add asset_parses and material_chunks tables
Cache MinerU parse results by blob hash and store project-scoped
chunk embeddings for large uploaded materials.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:29:10 +00:00
weichen 0c40190449 merge: fix/intent-confirm-stage-aware-2026-09-21
Stage-aware requirements routing with smart confirm gate and chat degrade.
2026-09-21 08:28:56 +00:00
weichenandCursor 5a0e5e7001 docs(test): record intent confirm and stage-aware acceptance
Update short-term/CURRENT claim for the extension branch and archive
unit/web evidence pending live rebuild after merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:28:28 +00:00
weichenandCursor 6bb2f72507 test(coordinator): cover weak-requirements confirm then affirm path
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:27:49 +00:00
weichenandCursor 568408cced feat(web): degrade stage-blocked task runs to chat confirmation
Keep weak write verbs off the task shortcut path, and once-only fall back
to chat when TASK_SCOPE_UNRESOLVED or DOC_TASK_NOT_IN_ACTIVE_STAGE.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:27:49 +00:00
weichenandCursor 5ba9bbbe11 feat(coordinator): smart confirm gate before TRIGGER_TASK execution
Ask via PendingExpectation for weak-write verbs, mid confidence, or
stage-mismatched doc tasks instead of running blindly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:27:49 +00:00
weichenandCursor f8abd1a5cc feat(intent): stage-aware requirements routing with weak write verbs
Map early-stage "整理一下需求" style phrases to intake with needs_confirmation,
and stop RDev "用户需求" from hijacking main-flow "编写用户需求表".

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:27:49 +00:00
weichenandCursor 49fb68fec1 docs(test): record TaskRunCard persistence acceptance on real PI
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:25:24 +00:00
weichen 82fb0fcaf0 merge: docs/intent-workflow-archive-short-term 2026-09-21 08:25:02 +00:00
weichenandCursor 82ef1c28c2 docs(ops): archive completed intent workflow scoping short-term task
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:25:02 +00:00
weichen 22cd7be1f6 merge: docs/intent-workflow-slot-queue-cleanup 2026-09-21 08:24:48 +00:00
weichenandCursor 835385f6cf docs(ops): clear intent workflow docs closeout from integration queue
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:24:48 +00:00
weichen 11d2262596 merge: docs/intent-workflow-scoping-report-2026-09-21 2026-09-21 08:24:35 +00:00
weichenandCursor ffd00e70ed docs(test): archive intent workflow scoping acceptance report
Record live chat/API evidence for active-workflow slot scoping and close the short-term claim.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:24:26 +00:00
weichen 9798b13005 merge: feature/taskrun-status-card-2026-09-21 2026-09-21 08:15:28 +00:00
weichenandCursor 9c0f780954 docs(ops): hold the integration slot for taskrun status card
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:15:28 +00:00
weichenandCursor 5f201254d8 fix(web): loosen TaskRunCard title helper input type for tests
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:15:10 +00:00
weichenandCursor ae1e2475f3 feat(web): restore TaskRunCard from phase snapshot on refresh
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:15:10 +00:00
weichenandCursor 32209c5e1b feat(taskrun): persist phase snapshot into assistant message metadata
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:15:10 +00:00
weichenandCursor 194e410822 feat(web): wire TaskRunCard into message stream and capture duration
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:15:10 +00:00
weichenandCursor 22314ff9b0 feat(web): add TaskRunCard vertical timeline for task runs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:15:10 +00:00
weichen b376fd8383 docs(ops): claim taskrun status card feature branch 2026-09-21 08:15:10 +00:00
weichenandCursor e0665ca446 merge: fix/intent-workflow-scoping-2026-09-21
Scope intent slot filling and document matching to the active workflow;
cross-workflow mentions are blocked with switch guidance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:11:27 +00:00
weichenandCursor d0b9ac4247 docs(ops): hold the integration slot for intent workflow scoping
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:10:15 +00:00
weichenandCursor 0b1040ca7e feat(web): scope template matching to the active workflow
- Document list returns workflow_key per item and active_workflow_key
- DeliverableItem keeps workflowKey through server sync
- resolveTaskTemplateForMessage filters the match pool and blocks
  cross-workflow mentions with switch guidance

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:09:36 +00:00
weichen 83e22a701f merge: adopt agent worktree governance (adoption) 2026-09-21 08:09:13 +00:00
weichen 048bbe4a5e docs(workflow): require isolated worktrees for all new agent changes
Adopt the approved workflow with explicit dev baselines, serialized candidate integration, scoped validation and safe cleanup. Keep automation work tracked separately from the active policy.
2026-09-21 08:08:14 +00:00
weichenandCursor 0912efdbd9 feat(coordinator+server): narrow document match pool to active workflow
- ActiveWorkflowScope resolves live instance task keys for the project
- chat document reader matches inside the active pool; cross-flow hits
  return ErrWrongWorkflow with switch guidance
- enrichSessionWorkflowStage injects ActiveWorkflowKey into UserCtx
- TRIGGER_TASK (coordinator + task-run API) blocks out-of-scope task keys

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:05:44 +00:00
weichen 6e28c57245 docs(workflow): plan isolated agent development and serialized integration 2026-09-21 07:59:40 +00:00
weichenandCursor 5c6b4f7719 feat(intent): scope slot filling to the active workflow
- ContextSnapshot gains ActiveWorkflowKey; ToSnapshot passes it downstream
- manifest-backed doc-title -> workflow index (main/pm/tm/rdev/sw)
- TRIGGER_TASK and DOCGOV write actions blocked with switch guidance when
  the named document belongs to another active workflow
- legacy projects without an active workflow key keep the old behavior

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 07:38:49 +00:00
weichenandCursor fc432d8726 docs(ops): claim intent workflow scoping on a fix branch
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:52:30 +00:00
weichen 15b8a4a87d merge: docs for workflow document key unification 2026-09-21 06:48:58 +00:00
weichenandCursor 954da76c0a docs(test): record workflow document key unification on dev
项目 6579 已收成 7 条 bd_*,旧 intake 行进了归档表。管理员复测不再出现作用域 409。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:48:37 +00:00
weichenandCursor 5f14931e7b merge: fix/workflow-doc-key-unification-2026-09-21
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:38:25 +00:00
weichenandCursor 2ec5856284 docs(ops): hold the dev integration slot for document key unification
合入 dev 和容器重建期间占住集成槽,避免并行改同一套 dev 容器。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:37:43 +00:00
weichenandCursor 50c19aaee9 test(docgov): cover canonical task key collapse for project documents
锁定「7 份旧键本地克隆加 8 行服务端」收成 7 条 bd_*,以及列表与物化不再留下 intake 兄弟行。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:37:10 +00:00
weichenandCursor 51d4390bd6 fix(docgov): collapse legacy and published task keys in the document list
列表只返回发布键那一行;物化时若旧键行已在,就不再插入兄弟行,避免撞上唯一索引。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:37:10 +00:00
weichenandCursor baca45ab9c fix(web): merge workflow documents by canonical task key
本地旧键模板与服务端 bd_* 行按同一发布键合并,未认领的旧键克隆在服务端已覆盖时丢掉。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:37:10 +00:00
weichenandCursor 7bb46d9ec8 fix(db): archive coexisting legacy document task keys
正式台账 doc_proj* 上,旧键与发布键不能再并存。孤立旧键和 doc_test_db 测试残留不动,项目 143 无重复行所以不会被改写。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:37:10 +00:00
weichenandCursor 493c03c449 docs(ops): claim workflow document key unification
项目 6579 的旧键与发布键被重复计数。先登记任务与 mutex,再改迁移和列表合并。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:37:10 +00:00
weichen 9e96a66646 merge: fix/dev-deep-test-four-issues-2026-09-21 2026-09-21 06:31:33 +00:00
weichenandCursor 0a5a8455b5 docs(test): record the four dev deep-test fixes
The dev container was rebuilt and the health check, task-run errors, and new UI strings are filed with the report.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:31:27 +00:00
weichenandCursor 11d6bc1511 fix(web): type the history lookup used by task resume
The chat window hook only exposed refresh helpers, so the continue path did not type-check after it started reading history bubbles.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:29:10 +00:00
weichenandCursor bdd4b970d4 fix(web): label unfinished template documents as preview
Template bodies were read-only, but the status chip said 编制中 and the lock banner said the document was already controlled.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:26:05 +00:00
weichenandCursor 70ceb03652 fix(web): resume interrupted tasks from history bubbles
Continue looked up only the in-memory message list, so a refreshed card did nothing, and the stream path also dropped the stored workspace.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:24:56 +00:00
weichenandCursor 9daf3b7a10 fix(web): replay task phases after refresh and keep interrupted resumable
Progress lived only in the open SSE stream, and interrupted history was shown as completed so the card could not be continued.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:21:09 +00:00
weichenandCursor cb1c378c5a fix(server): close task event streams when the client only wants a replay
Interrupted runs often have no done event, so a refresh replay would otherwise hold the SSE connection open.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:21:09 +00:00
weichenandCursor a236ddc0fa fix(intent): accept 编写/编制/起草 and keep intake markers on intake
The chat fallback only treated 生成/做/跑/出 as task verbs, and the shorter RDev alias 用户需求 stole 初始用户需求表.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:12:15 +00:00
weichenandCursor ddb1e542b6 fix(web): prefer intake markers over the shorter URS title
「初始用户需求表」contains「用户需求表」, so title matching sent V0.1 wording to the V0.5 task and the stage gate rejected it.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:12:15 +00:00
weichenandCursor 247e549397 docs(ops): claim the four dev deep-test fixes
Record the intent-routing, task-card resume, and template-badge work before code changes so the mutex is visible.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:07:51 +00:00
weichenandCursor 8b9c2a91f0 merge: fix/dev-multiuser-four-issues-2026-09-21
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:34:30 +00:00
weichenandCursor b9eb9460c0 docs(test): record the multi-user workflow fix and dev smoke
The report keeps the 6579 document backfill, the live-edit switch rejection, and the rebuilt dev health check.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:31:02 +00:00
weichen ef2f67d73c merge: feature/trace-panel-to-chat-2026-09-21 2026-09-21 05:24:16 +00:00
weichenandCursor 14d1c7d0f7 docs(test): record trace panel retirement on dev
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:24:16 +00:00
weichenandCursor 87c6068da7 test(web): expect a specific message when task scope cannot be resolved
The scope error now has its own copy, so the 4xx case should assert that text instead of the generic request-failed fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:22:50 +00:00
weichenandCursor f85b861a18 docs(ops): claim the trace-to-chat change and the dev smoke slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:20:30 +00:00
weichenandCursor 3a0f7a1033 fix(web): route prefixed task keys and keep live settings editable
Message routing follows the project's real task key, account switches clear local workbench state, and the duty matrix writes the reassignment API instead of a local drill.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:20:01 +00:00
weichenandCursor f168e44ce7 feat(projectinstance): allow live workflow config edits except switching
Activated projects can update duties, approval policy, and document enablement. Changing the workflow definition stays rejected, and project 143 remains frozen.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:20:01 +00:00
weichenandCursor b74441fb4f fix(docgov): materialize enabled workflow docs as template records
Activation and list healing need a server-side document row per enabled task, without overwriting documents that already have content.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:20:01 +00:00
weichenandCursor d865342ae2 feat(web): replace the standing trace panel with a chat card
The requirements and impact summary no longer occupies the chat column. Open recheck marks arrive as an assistant card with a no-change action.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:19:43 +00:00
weichenandCursor 687f930f40 feat(trace): deliver recheck and impact notices in chat
A new recheck mark is posted into the actor's existing project session, and a downstream-impact event does the same. Asking about what a change affects still resolves to impact analysis.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:19:43 +00:00
weichen 2167bf4327 merge: fix/taskrun-scope-persist-2026-09-21 2026-09-21 05:09:39 +00:00
weichenandCursor 7ff0fb5cdd docs(test): record task scope alias acceptance on dev
Chen Wei's intake request against a bd_intake snapshot now creates a run, and the chat window still returns the turn after refresh.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:09:39 +00:00
weichenandCursor f529458c28 docs(ops): claim task-scope persist fix and the dev smoke slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:07:04 +00:00
weichenandCursor a60bba6fbf fix(server): persist chat when a document task scope cannot be resolved
A 409 used to return before any message was written, so a refresh showed an empty conversation. Record the user turn and a failed assistant reply before rejecting the run.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:03:08 +00:00
weichenandCursor 8d22fa3827 fix(projectinstance): resolve legacy task keys against namespaced snapshots
New workflow instances store bd_* task keys, but chat still sends the old keys. Scope and document access now treat those aliases as the same task so a live instance no longer fails closed on an exact string miss.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 05:03:08 +00:00
weichen e91ffbca1d merge: fix/taskrun-error-transparency-2026-09-21 slot release 2026-09-21 03:14:29 +00:00
weichenandCursor 5ed0fc7e01 docs(ops): restore created date on the task run error task
Keep the short-term frontmatter complete after marking the task done.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 03:14:29 +00:00
weichenandCursor 0600804e6d docs(test): record task run error transparency acceptance
Dev rebuild serves snake_case task run JSON and the real pi-agent backend, so failed runs are no longer labeled as network errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 03:14:19 +00:00
weichen 5380cc1606 merge: fix/taskrun-error-transparency-2026-09-21 2026-09-21 03:09:59 +00:00
weichenandCursor 776c3aeb75 merge: dev into fix/taskrun-error-transparency-2026-09-21
Take the released integration slot and keep the trace-panel acceptance notes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 03:09:42 +00:00
weichenandCursor 943a07b2a4 fix(web): surface real task failure reason instead of NETWORK_ERROR fallback
Show error_message for failed runs, a distinct cancelled state, and business 4xx codes instead of a generic network message.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 03:05:49 +00:00
weichenandCursor fbcb78cf92 test(server): assert snake_case task run response
Lock GET /api/v1/tasks/runs/{id} to run_id, status, and error_message so PascalCase cannot regress.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 03:05:49 +00:00
weichenandCursor c10206512d fix(taskrun): serialize RunRecord with snake_case json tags
The task run API was emitting PascalCase fields, so the client never saw status or error_message and treated every disconnect as a network error.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 03:05:49 +00:00
weichen ea6f822c18 merge: fix/trace-panel-null-crash-2026-09-21 slot release 2026-09-21 02:59:18 +00:00
weichenandCursor 437b6ef59e docs(test): record the trace panel null-crash acceptance
Release the integration slot after the dev rebuild and browser check.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 02:58:23 +00:00
weichenandCursor f46ab4672e docs(ops): claim task run error transparency fix
Record the NETWORK_ERROR misreport and defer HTTP access logs so the failure reason is no longer hidden behind a network fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 02:47:59 +00:00
weichen e1bc95cd88 merge: fix/trace-panel-null-crash-2026-09-21 2026-09-21 02:41:21 +00:00
weichenandCursor 726ab7560c docs(ops): occupy the integration slot for the trace panel crash fix
The previous slot line claimed an already-merged docs branch; dev itself is idle.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 02:39:42 +00:00
weichenandCursor 1f7f3d2271 test(trace): guard empty trace lists against JSON null
Cover the service nil-slice contract and the client normalization of a null payload.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 02:38:08 +00:00
weichenandCursor 26d8f4381d fix(web): normalize null trace arrays before render
ProjectTracePanel reads index.length; a cached or older payload of null must not crash the page.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 02:35:26 +00:00
weichenandCursor 00df3d7cb8 fix(traceimpact): return empty slices instead of nil lists
Empty trace indexes were serialized as JSON null and crashed the project page.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 02:33:51 +00:00
weichenandCursor 17fcd3ff69 docs(ops): 占用集成槽位合入 lazy-doc-verification
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 02:31:38 +00:00
weichenandCursor c64b46a745 docs(ops): 认领 ProjectTracePanel 空追踪崩溃修复
登录后项目页因 trace 接口把空切片序列化成 null 而触发 ErrorBoundary。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 02:31:28 +00:00
weichen bfc77076f6 merge: docs/lazy-doc-verification-2026-09-21 2026-09-21 02:26:56 +00:00
weichenandCursor 86f8a0b548 docs(ops): CURRENT 登记 lazy-doc-verification 认领 done
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 02:21:44 +00:00
weichenandCursor bbbaf40bfd docs(test): test 环境受控文档懒创建端到端验证报告
- 验证「激活后 0 受控文档」为懒创建设计预期:激活只建实例,文档在任务运行时由 bizdev service CreateOrGetDocument 落库
- 真实 PI Agent(MiniMax-M2.7-highspeed)跑通 bd_intake 小队任务 3m45s completed
- 三重证据:document_records 0→1 行、documents API 计数翻转、正文 7729 字符 SHA-256 与账本一致
- short-term 任务与 CURRENT 认领登记;证据资产归档 assets/

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 02:21:07 +00:00
weichen 33943fd46e merge: feature/stage-backtrack-impl slot release 2026-09-20 15:37:55 +00:00
weichenandCursor 9551bcbb25 docs(ops): release the integration slot after the dev schema 59 smoke
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:37:55 +00:00
weichen 5430742b00 merge: feature/stage-backtrack-impl 2026-09-20 15:35:32 +00:00
weichenandCursor b7197607e9 docs(ops): occupy the integration slot for the stage backtrack implementation
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:35:32 +00:00
weichenandCursor ae86b47f6f docs(ops): record the stage backtrack implementation slices
The slices share feature/stage-backtrack-impl. Migration 00059 is not applied to the running environments yet.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:35:22 +00:00
weichenandCursor 3a4c00a1ba feat(web): show the trace panel and the recheck acknowledgement
The acknowledgement stays visible on the advance bar and does not clear the mark.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:35:07 +00:00
weichenandCursor e4b4e0dde8 feat(api): expose the trace index, reopen, and recheck routes
Use the record tables when migration 00059 is present, and hide statements from documents the caller cannot see.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:35:07 +00:00
weichenandCursor 5e05d966b4 feat(intent): bridge chat into impact analysis and revision proposals
Analysis stays read-only, and a revoked project member cannot confirm an old proposal.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:35:07 +00:00
weichenandCursor 4a7b8cc26f feat(workflow): reopen a completed stage without pausing the later one
Selected documents return to drafting, and advance asks the creator to acknowledge an open recheck mark.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:35:07 +00:00
weichenandCursor 432884911f feat(docrevision): attach coverage status to formal human revisions
Unknown, partial, and failed coverage stay distinct from no known dependencies.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:35:07 +00:00
weichenandCursor 33ee59641f feat(trace): add the project trace ledger and bounded impact walk
Keep item revisions and edge decisions as records, and refuse to treat a missing index as no impact.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:35:07 +00:00
weichen e3a5b2851e merge: feature/stage-backtrack-design 2026-09-20 15:09:31 +00:00
weichenandCursor c825bbb13f docs(ops): release integration slot after stage backtrack design smoke
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:09:31 +00:00
weichenandCursor 0155ac62db docs(ops): occupy integration slot for stage backtrack design
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:09:15 +00:00
weichenandCursor 54c8a3d107 docs(design): specify stage backtrack and impact loop
Record how later materials can affect earlier stages without hard gates, and split the implementation into planned slices.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:09:06 +00:00
weichen d43ac2d893 merge: fix/workflow-seed-bootstrap-2026-09-20 closeout 2026-09-20 14:06:15 +00:00
weichenandCursor cc95b8445c docs(test): archive rdev seed hotfix verification
dev 与 test 目录已含研发设计控制流程,test 晋升 rc-v1.0.0-beta.7 后 schema 为 58。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 14:06:15 +00:00
weichen 950f881968 merge: fix/workflow-seed-bootstrap-2026-09-20 2026-09-20 14:03:42 +00:00
weichenandCursor 7da2c1fdef docs(ops): occupy integration slot for rdev seed hotfix
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 14:03:42 +00:00
weichenandCursor 079225495e fix(workflowdef): heal retired seeds and fall back published_by
启动种子不再依赖固定用户 id=1,并把白名单工作流的 retired 状态恢复为 active。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 14:03:30 +00:00
weichenandCursor badfc19812 docs(ops): claim rdev workflow seed hotfix
dev 库 rdev 停在 retired,test 库因 publishedBy 外键失败未发布研发工作流。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 14:03:30 +00:00
weichen e83de73fd0 merge: docs/module-decoupling-spec-2026-09-20 slot release 2026-09-20 13:25:44 +00:00
weichenandCursor a3d382c6d9 docs(ops): release integration slot after docs-only smoke
Record that go vet passed and the two short-test failures are docker registry EOF, not this documentation change.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 13:25:44 +00:00
weichen 133ceb454c merge: docs/module-decoupling-spec-2026-09-20 2026-09-20 13:23:54 +00:00
weichenandCursor a94745370d docs(status): record module standards and planned decoupling batches
Mark the documentation task done and hold the integration slot while the docs merge into dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 13:23:41 +00:00
weichenandCursor 22cac8dcbe docs(remediation): plan module decoupling batches A through G
Keep each hotspot on its own branch and mutex so a later code fix cannot spread across modules.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 13:22:59 +00:00
weichenandCursor fe46705b67 docs(system-design): list the module standards file in the design index
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 13:22:21 +00:00
weichenandCursor e71db3dce6 docs(system-design): add module communication and isolation standards
Give implementers one entry for narrow ports, the event bus, and the rule that a fault stays inside its module.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 13:22:11 +00:00
weichenandCursor 0504884e04 docs(audit): record remaining module coupling hotspots
Keep the modular-monolith baseline and name the seven places where a fault still crosses a module boundary.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 13:21:36 +00:00
weichenandCursor 6b43007d7a docs(ops): claim module decoupling spec and coupling audit
Register the docs-only audit so later batches do not collide with the architecture-docs mutex.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 13:21:03 +00:00
weichen 4ac8ca2308 merge: docs/p0-closeout-2026-09-20 2026-09-20 10:58:12 +00:00
weichenandCursor eaad5c74d4 docs(test): archive P0 hotfixes verification report and close gap rows
Record schema 58 / IDOR curl / credential rotation evidence and release the integration slot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 10:58:12 +00:00
weichen 8a9fbd8280 merge: fix/credential-hardening-2026-09-20 2026-09-20 10:57:04 +00:00
weichenandCursor c47b437b22 fix(ops): stop hardcoding DB passwords and URL-embed git tokens
Load backup credentials from env/secrets files and push via a temporary credential helper so tokens never appear in process listings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 10:57:04 +00:00
weichen 8ef95891a4 merge: fix/runtime-panic-races-2026-09-20 2026-09-20 10:54:18 +00:00
weichenandCursor 48c985318c docs(ops): claim integration slot for runtime-panic-races merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 10:54:18 +00:00
weichenandCursor b4388934a0 fix(runtime): hold taskrun fanout lock, guard goroutines, and escape math XSS
Serialize appendEvent sends under the subscriber mutex, wrap worker/memory goroutines with recover, lock synchronous chat SendMessage, and escape KaTeX error HTML.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 10:54:18 +00:00
weichen 3a3a79769e merge: fix/authz-idor-hotfixes-2026-09-20 2026-09-20 10:42:58 +00:00
weichenandCursor 58f0ed65c1 docs(ops): claim integration slot for authz-idor merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 10:42:58 +00:00
weichenandCursor fad7fac044 fix(authz): close preference, session project, and recategorize IDOR gaps
Bind preference writes and session-scoped project reads to the authenticated principal, and require an owned session_id for recategorize so empty ids cannot touch all messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 10:42:58 +00:00
weichen e347c0d138 merge: fix/capability-merge-00058-2026-09-20 2026-09-20 10:39:21 +00:00
weichenandCursor d4b38a273b docs(ops): claim integration slot for capability-00058 merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 10:39:21 +00:00
weichenandCursor 37fb1ba44e merge: feature/capability-enablement-impact-plan; renumber chat_summaries to 00058
Absorb stalled capability fixes and avoid goose out-of-order on schema 57 DBs by shipping chat_summaries as 00058.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 10:38:12 +00:00
weichen 43688fd4c3 merge: docs/p0-triage-2026-09-20 2026-09-20 10:37:18 +00:00
weichenandCursor 1313cf19b1 docs(ops): archive 2026-09-20 system triage audit and P0 remediation plan
Claim P0 hotfixes waves, correct schema snapshot to 57, and park non-P0 findings in long-term backlog.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 10:37:08 +00:00
weichenandCursor 518d5d6132 docs(ops): release integration slot after duty-reassign smoke
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:52:22 +00:00
weichenandCursor 5c9f9aa57c docs(ops): close duty-reassign task and release integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:52:14 +00:00
weichenandCursor 95329aad58 docs(test): archive duty-reassign and member-chat verification report
Record test-env evidence for chenwei stage chat and post-activation
PATCH duty reassignment after merge and rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:52:04 +00:00
weichen 9d98f1ae33 merge: fix/post-activation-duty-reassign-member-chat
Member stage chat without duties; controlled post-activation duty reassign.
2026-09-20 09:48:59 +00:00
weichenandCursor 2b96987ddd docs(ops): claim integration slot for duty-reassign merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:48:59 +00:00
weichenandCursor c3dad4c643 docs(ops): claim post-activation duty reassign and member chat task
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:48:27 +00:00
weichenandCursor 8e4beff5f8 feat(web): allow duty reassignment in frozen project settings
Show editable duty selects after activation when the user has
project:assign_lead, calling the new PATCH API instead of workflow-plan PUT.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:48:27 +00:00
weichenandCursor 1497473186 feat(projectworkflow): controlled post-activation document duty reassign
Add PATCH /doc-tasks/{taskKey}/duties that updates live snapshot,
assignments, and document_records while blocking when a squad run holds
the document lease. Planning PUT remains PLAN_FROZEN.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:48:27 +00:00
weichenandCursor a82bfdb6d1 fix(authz): allow project members stage chat without document duties
Live workflows still restrict document actions to duty holders, but
AllowedStageKeys now include active/completed stages so members can chat.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:48:19 +00:00
weichen 6d04d98c5f merge: docs/triage-task-done 2026-09-20 09:23:42 +00:00
weichenandCursor 69cae9e4e7 docs(ops): mark test-env triage task done
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:23:42 +00:00
weichen 89abc757f9 merge: docs/test-env-triage-report-2026-09-20 2026-09-20 09:23:31 +00:00
weichenandCursor 95880bf168 docs(test): archive test-env triage fixes verification report
Record E2E PASS for global unique names, member session visibility,
and asset raw preview; release integration slot and mark task done.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:23:31 +00:00
weichen 213ad0159a merge: fix/test-env-triage-2026-09-20
Global unique project names, member chat session provisioning, and
project asset raw preview recovery for test-env triage.
2026-09-20 09:19:08 +00:00
weichenandCursor f603f63ca7 docs(ops): claim integration slot for test-env triage merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:19:08 +00:00
weichenandCursor 18a323c4dc test: cover asset raw round-trip and harden cross-user session upsert
Deny foreign user_id upsert without manage rights (403); unique project
names in ctxmgr PG fixture for global name index; add test-env data repair SQL.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:18:36 +00:00
weichenandCursor 21782751ab fix(server,web): serve project asset raw and recover preview after refresh
Add GET /assets/{id}/raw with project access checks; frontend falls back
to CAS by assetId or filename when local blob is gone. Align upload accept
list with backend whitelist and register binaries into CAS on chat upload.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:14:12 +00:00
weichenandCursor aef3d6d5cb fix(server): create member chat sessions on invite and allow manager upsert
Project managers can register sess-p{N}-u{uid} for other members; adding a
member also ensures their private session so the sidebar is never empty.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:11:36 +00:00
weichenandCursor 28478bdca5 fix(db): enforce global unique project names across creators
Replace per-creator name uniqueness with a global index among
non-retired projects, and reject cross-user duplicate creates with 409.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:10:55 +00:00
weichenandCursor 638083cc74 docs(ops): claim test-env triage fixes (dup name / member session / preview)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 09:10:04 +00:00
weichen bee907ef7e merge: docs/test-env-beta6-verification 2026-09-20 08:06:24 +00:00
weichenandCursor 782b2dd2ce docs(test): archive beta.6 test-env assistant/squad verification report
Record rc-v1.0.0-beta.6 C-level evidence (pi-agent dialogue, intake docs,
12 regressions) and flip CURRENT to test schema 56 with idle integration slot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 08:06:24 +00:00
weichen 9f29b0badb merge: docs/bug-hunt-2026-09-20-closeout 2026-09-20 07:05:51 +00:00
weichenandCursor c7ee6b825e docs(ops): close bug-hunt permissions-uploads task after merge to dev
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 07:05:51 +00:00
weichen 032fdb050f merge: fix/bug-hunt-2026-09-20-permissions-and-uploads 2026-09-20 07:05:34 +00:00
weichenandCursor 6800a2af29 docs(ops): record permissions/uploads bug-hunt audit and short-term task
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 07:05:06 +00:00
weichenandCursor c8dbefe8a1 fix(web): align settings CAS, PDF preview, and collaboration UX guards
Wire expected_revision, blob PDF framing, mustChangePassword session rewrite,
client_key project create, no-project send disable, and right-rail persistence.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 07:05:06 +00:00
weichenandCursor 5cd22c7327 fix(authz): harden permissions, chat gate, and project create idempotency
Add project:manage_members, CSP frame-src, task-run member view, CreateUser
tx error handling, ERR_NO_PROJECT chat gate, and creator-scoped project
name/client_key uniqueness to stop duplicate creates and auth gaps.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 07:04:57 +00:00
weichen 5a5a91dd7f feat(docrevision): keep candidate estimates separate from committed reports
A candidate used the same report later attached to the version, so a preview could be treated as the formal result. Proposed reports now close on replace or reject, and only the commit writes an authoritative successor.
2026-09-20 05:15:41 +00:00
weichenandCursor db1706cd24 feat(docrevision): send clipped diff text to the change-report narrator
The narrator only received counts, so it could not describe the actual change. Caps keep the full document out and leave the input digest unchanged; the flag stays off.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 05:03:31 +00:00
weichenandCursor 686f739b19 fix(pi-agent): enforce a no-tool reasoning profile
语义摘要、变更叙事和 U9 分段改为请求 reasoning。该 profile 的 argv 使用 --no-tools 且不加载搜索扩展;未知 profile 拒绝启动。文档生成仍保留读写工具。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 04:59:15 +00:00
weichenandCursor 848a0457a0 fix(chat): stop treating failed summary writes as durable
新增 chat_summaries 迁移。数据库写失败会返回错误并标明仅本进程可见。test_manager 血缘改用文档版本,不再写死 1。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 04:02:41 +00:00
weichenandCursor 033462a4e6 fix(authz): separate capability readiness from configured flags
管理台不再把开关值当成能力已接入。lineage 读取必须落在 URL 项目内,并按两端文档可见性裁剪,跨项目或不可见文档只返回空列表。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 03:45:16 +00:00
weichenandCursor d3364f9125 docs(capability): record enablement research and remediation plan
把“看似实现、实际未启用”的复核、三条独立轨道和七视角审阅落盘,避免后续把未接线开关当成可以上线。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 03:45:16 +00:00
weichen 8fdcd983a6 docs(ops): record test promotion rc-v1.0.0-beta.5 and release integration slot 2026-09-20 01:10:43 +00:00
weichen 0fd765a392 docs(test): record full deep test report for dev and test promotion 2026-09-20 00:48:11 +00:00
weichen bcbf4eba1c fix(pi-agent): register both MiniMax-M2.7-highspeed and MiniMax-M3 in models.json 2026-09-20 00:47:50 +00:00
weichen f47e40edad test(server): align test_manager task key to tm_system_verification in e2e test 2026-09-20 00:45:33 +00:00
weichen 97b868a942 docs(arch): allow squad in intent and workflowdef in squad and template 2026-09-20 00:44:47 +00:00
weichen 24bc4e6a2f merge: fix/audit-remainder-closeout (audit remainder closeout M1-M15, web modularization, rdev matching, schema 53) 2026-09-20 00:43:33 +00:00
weichen 89e8fb92b0 docs(ops): occupy integration slot for dev sub-branch merge, deep test and test promotion 2026-09-20 00:43:28 +00:00
weichenandCursor 3ae13bfae2 docs(test): record the U7 restart matrix and the gate follow-up
Postgres and app reach ready in about a second. Vite cold cache is not the old ten-second stall, and the login form was not measured.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 15:39:49 +00:00
weichenandCursor b48a832281 fix(squad): score only the first review-minutes table
A later standards table in the same section was counted as issue rows and failed the saved P3 sample.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 15:39:49 +00:00
weichenandCursor 6bd338e273 test(rdev): record the three real PI samples on dev
Software-plan N/A stayed closed and the proposal completed, but the planning review finished quality_failed at score 20. The poller now treats that status as terminal so it does not spin until timeout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 14:33:25 +00:00
weichenandCursor 56a8719863 refactor(web): move the workbench shell out of App
Session state stays in App. The shell, rights dialogs, and project modals now render from WorkbenchView, so App no longer mounts AppShell itself.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 14:11:32 +00:00
weichenandCursor 8a9599fbb0 refactor(web): render the chat column outside App
The workbench shell still owns session and modal state. Message stream, filters, and the composer now live in ChatColumn so App stops assembling that column inline.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 13:57:10 +00:00
weichenandCursor b3a1305e46 docs(test): record twenty-run slow-network login and app restart
The rebuilt bundle stays under the draft login budgets on this machine. Restart-to-health is under half a second, and the wider restart matrix is still open.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 13:35:52 +00:00
weichenandCursor 69e2cd259d refactor(web): render the active document column outside App
The revision toolbar, file preview, and governance bars stay with the document pane so the workbench shell no longer owns that column.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 13:32:39 +00:00
weichenandCursor 26d14b534b docs(test): record schema 53 rebuild and login fanout on dev
The rebuilt workbench issues one member request and one session list request. Slow-network samples improved, but twenty-run percentiles and the restart matrix are still open.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 13:22:38 +00:00
weichenandCursor 404defced2 test(server): reject non-member comment and audit reads on postgres
The in-memory authorizer treats any positive user id as a member, so the HTTP negative has to run against a real project row.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 13:22:37 +00:00
weichenandCursor c49637cbb5 fix(db): restore applied goose files so fresh migrate can parse
The checksum-immutable note inside 00001 contained a goose annotation and would fail a new database. Keep that warning out of files goose already applied.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 13:22:37 +00:00
weichenandCursor 4b2d92a1be docs(test): record login-load baseline against Vite and deployed dev
The current workbench stays at one member fetch across 20 logins, while the deployed bundle still fans out. Slow-network samples stay diagnostic until the container is rebuilt.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 13:00:39 +00:00
weichenandCursor eabaadd2a0 test(web): record login waterfall and init request counts
Give the initial-load baseline a repeatable probe that strips query strings and can assert the login member fanout stays on the current project.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 12:57:12 +00:00
weichenandCursor 95f0e7bcf9 refactor(web): share and save freeform docs from one hook
Keep private-library share, revoke, delete, and save-to-private off the workbench shell so those side effects stay testable without growing App.tsx.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 12:57:12 +00:00
weichenandCursor 8de29466e1 refactor(web): persist project members from one hook
Refresh the roster and workflow documents only after the member write succeeds, so a failed add does not invent a local session.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 12:11:52 +00:00
weichenandCursor a29e98096a refactor(web): create projects from one hook
Remember the new project id as soon as create succeeds so a later member failure retries members instead of creating a second project.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 12:09:28 +00:00
weichenandCursor 9f39fbaaf3 refactor(web): handle interactive cards from one hook
Keep plan confirmation, reject, undo, and approval on the same card so a revision conflict still reconciles before the card changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 12:07:08 +00:00
weichenandCursor 57873f6c84 refactor(web): retry chat and task runs from one hook
Keep reconnect on the existing run id so a dropped stream does not start a second task.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 12:05:01 +00:00
weichenandCursor f9c2b3acdf refactor(web): edit document blocks from one hook
Apply a controlled block only after the server patch succeeds, and keep insert, move, delete, and comments on the same document state.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 12:00:43 +00:00
weichenandCursor 52f69fe180 refactor(web): send chat messages from one hook
Keep attachment registration, task dispatch, and the demo shortcuts on the same path so a failed upload still blocks before any local message is stored.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 11:46:07 +00:00
weichenandCursor c22faecfcb refactor(web): move document lifecycle actions into a hook
Keep claim, review, and approval on one server record so the open document and the sidebar stay in the same state.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 11:40:03 +00:00
weichenandCursor 22ea4c31ed refactor(web): sync server documents from one hook
Keep freeform append, workflow reconcile, and lease polling together so a failed list cannot wipe local docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 11:33:03 +00:00
weichenandCursor 113dea4ac5 refactor(web): hydrate controlled documents from one hook
Keep the editor gate, cancel, and error skeleton together so App no longer owns the fetch path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 11:29:40 +00:00
weichenandCursor 27c1be86d5 refactor(web): move login workspace sync out of App
Project list, member roster, and session fetch ran as four effects inside the workbench component. They now share one hook so the entry file is not the only place that knows the login startup order.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 11:05:29 +00:00
weichenandCursor bfe8cb1407 refactor(web): persist the workbench from one hook
Session, project, and deliverable caches were written from scattered effects, and the legacy message migration ran twice on mount. One hook keeps that write path in a single place.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 11:01:44 +00:00
weichenandCursor 63b0f72081 feat(web): load the formula engine only when math appears
The login entry no longer ships KaTeX. Chat bubbles and document text render formulas after a dynamic import, and rich-text copy does the same.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:57:49 +00:00
weichenandCursor dba8139d56 feat(workflow): namespace task keys without breaking old instances
Published manifests now use bd_/pm_/tm_/sw_ prefixes so workflows cannot share a doc id. Frozen instances keep the old keys; lookup, templates, and duty checks treat the two names as the same task.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:50:25 +00:00
weichenandCursor 2a0f8b4549 docs(ops): record the frontend test and build gate
npm test and the production build passed on this branch. The entry bundle stays near 1 MB, and CURRENT still correctly says schema 52 until the containers are rebuilt.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:34:50 +00:00
weichenandCursor 7e0f3cbf9c feat(web): show the rdev start prerequisite before activation
Selecting the design-control workflow now repeats the server rule: business handover must finish with an approved CDO quote first. Other workflows stay quiet.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:33:11 +00:00
weichenandCursor 6367f865d5 feat(web): fold long workflow stages and batch their approval
Later stages with more than four documents start collapsed, and one action can put the whole stage under human approval or take it back out. The workflow chip still names the design-control flow when the catalog has not loaded.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:30:32 +00:00
weichenandCursor 5bf10c7536 docs(ops): keep the login fan-out note next to the rdev matcher
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:27:08 +00:00
weichenandCursor 2fbb5bab49 feat(intent): match rdev document names when the user asks to generate
生成项目建议书 now resolves to rd_proposal. Longer titles win, so 系统设计方案 is not mistaken for the shorter business-stage phrase, and an explicit generate command is no longer swallowed by a progress question.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:26:57 +00:00
weichenandCursor 890d2fd14e fix(web): stop login from fetching every project member list
The project list is already limited to the current user, so other rosters wait until the member panel opens. Session reload no longer follows project updates, and a newer response cannot overwrite an older user.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:22:04 +00:00
weichenandCursor b550911667 feat(squad): load rdev overlays and enforce document gates
Each rdev step now gets a role-filtered overlay so writing discipline stays out of the template. User needs, system requirements, review minutes, and upload indexes fail the quality gate when IDs, decisions, or attachment indexes are incomplete.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:12:10 +00:00
weichenandCursor 93ee98af0e feat(squad): apply rdev stage step overrides and aliases
Stage-specific squad steps now win over the kind default, including always-on regulatory and searcher roles. Each of the 60 tasks carries its writing hint and Chinese alias so lookup and the writer accept line use them.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:05:26 +00:00
weichenandCursor 8365de3426 docs(ops): keep the load and auth notes next to the rdev remainder
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:58:51 +00:00
weichenandCursor 754cba764c feat(squad): gate rdev regulatory steps on complexity tier
Listed tasks still get a regulatory step when complexity is unset or high. Medium and low skip it, and the squad model now comes from SQUAD_MODEL_ID or MINIMAX_MODEL_ID instead of a fixed name.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:58:40 +00:00
weichenandCursor 32d838285d fix(auth): resolve session and user status once per request
/auth/me was authenticating again after the middleware had already done it, and the session lookup queried user status in a second round trip. Reuse the request principal and join status into the session read so a revoked token still fails on the next request.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:54:10 +00:00
weichenandCursor 17f7fed1db feat(web): load export, preview, and charts only when opened
The login shell was downloading the document engines with the workbench. Those modules now load on click or when a matching block appears, and a failed chunk can be retried without submitting an edit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:51:04 +00:00
weichenandCursor 1b17e01ce7 docs(ops): record frontend gate and the memory authz limit
The branch frontend suite and production build passed. Cross-user document comments still need a Postgres negative because the in-memory authorizer is intentionally open.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:42:30 +00:00
weichenandCursor 952a94b6d5 fix(docrevision): ack content projection only after the fact source is written
The human ledger and the document body are different stores. Record the projection intent in the same transaction as the ledger, and clear it only when the body write succeeds so a retry cannot append a second revision.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:35:14 +00:00
weichenandCursor fc32ba3dc3 fix(web): version chat window cache and cover cross-user session list
Drop window-cache payloads that lack a schema field. Prove a non-owner listing another user's sessions is forbidden. Correct the stale test schema note in CURRENT.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:28:11 +00:00
weichenandCursor 2a666df3c1 fix(events): hold aggregate gaps on production claim
PostgreSQL claim now uses the same next-version rule as MemoryBus, and checkpoints only move forward. A later version cannot be leased while an earlier one is still missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:24:51 +00:00
weichenandCursor 01ca861e94 docs(ops): record which audit remainder items are closed
Keep M7, M15, the frontend split, and the red-line features open so the next pass does not treat them as done.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:20:07 +00:00
weichenandCursor d4041a4f0c fix(coordinator): use the caller name and reject non-decimal user ids
Ambiguous consult only redirects on low confidence, and the testing template greets the signed-in user instead of a hardcoded name. Session tokens no longer parse as user id 0. Live chat sessions now evict the oldest entry at a hard cap.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:19:36 +00:00
weichenandCursor 265f09c1f2 fix(server): cache health probes, surface SSE marshal errors, fail closed on missing duties
Health checks reuse a two-second snapshot and bound the schema query. Task SSE writes an error frame when an event cannot be encoded. ResolveDocTask errors when the frozen plan has no duty row, while explicit none-duties stay zero. Drop the unwired semantic-summary replace env, record the intentional dev versus release model split, document the test/main cutover path, and archive pre-goose SQL.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:16:18 +00:00
weichenandCursor 4c34e8a503 fix(server): close security headers, lease clamp, replay digest, double start
Add nosniff, frame denial, referrer policy, and a self-origin CSP. Clamp human and squad lease TTLs and require author edit rights before a human lease. Include DryRun in replay digests so a dry-run approval cannot authorize apply. Stop Server.Start from swallowing a second Runtime.Start.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:12:17 +00:00
weichenandCursor 62ce2781ae docs(ops): record pre-test promotion readiness review
Capture the read-only check that planned capabilities are wired, while dev is not ready to merge into test until the container is rebuilt and the remaining gates run.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 08:36:58 +00:00
weichen 66421b162d merge: docs/audit-remediation-backlog (audit batch 4 report + medium backlog) 2026-09-19 07:55:48 +00:00
weichenandCursor d9cd7ebb82 docs(ops): close audit batch 4 report and park medium leftovers
Critical/high fixes are already on dev. Record the frontend test report, restore the audit note, and move remaining medium/low items into long-term so they are not treated as release blockers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 07:55:43 +00:00
weichen d73bc79800 merge: fix/audit-b4-frontend (audit batch 4: markdown XSS, unread rollback, excel preview cap) 2026-09-19 07:53:36 +00:00
weichenandCursor 6c28fca98f fix(web): close markdown placeholder XSS and unread/excel edge cases
- Escape KaTeX fallback HTML and salt math/code placeholders per render
- Roll back optimistic unread marks when POST /chat/read fails
- Reset MessageStream scroll baseline when the session changes
- Preview only the first 1000 Excel rows and say so in the sheet header

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 07:53:31 +00:00
weichen 84ba1c97d7 docs(test): audit batch 3 test report and slot release 2026-09-19 07:49:45 +00:00
weichen a2a49a64f5 merge: fix/audit-b3-sse-events (audit batch 3: sse heartbeat, task idempotency, write deadline, fencing log) 2026-09-19 07:49:15 +00:00
weichenandCursor b65e8fb642 docs(db): mark baseline and seed migrations as checksum-immutable
Goose checksums forbid rewriting applied files. Document that 00001-00009
have no down migration and that 00012's unconditional DELETE is demo-only.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 07:49:01 +00:00
weichenandCursor 0531462acc fix(sse): bound heartbeat lifetime and reuse idempotent task streams
- Wait for the chat SSE heartbeat goroutine to exit before the handler
  returns, so it cannot write a recycled connection
- Extend /tasks/run write deadline to 75m so long sync runs are not cut
  by the global 120s WriteTimeout before the response is written
- Reuse an existing task run on the SSE path when the idempotency key
  already belongs to the same user/session/project
- Log stale fencing on event ack so unbounded replay is observable

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 07:49:01 +00:00
weichen 9fa29bec42 docs(test): audit batch 2 test report 2026-09-19 06:03:31 +00:00
weichen c3c2b39abd docs(ops): record audit batch 1+2 merges and slot release 2026-09-19 06:02:38 +00:00
weichen 08f4e0bbf8 merge: fix/audit-b2-authz-hardening (audit batch 2: principal identity, docgov access, rate limit, compose secrets) 2026-09-19 06:01:00 +00:00
weichenandCursor 2dd8f46e64 fix(server): login/register rate limiting + compose secret hygiene (H4/H8/M8)
- H4: sliding-window rate limiter (10 attempts / 5min per IP+username)
  on login and register; successful login resets the counter; pure
  stdlib, no new dependency
- H8: docker-compose.test.yml DB/ADMIN passwords now :?required (align
  with main); docker-compose.main.yml AUTH_REGISTRATION_ENABLED
  defaults to false
- M8: fix FAV_PUBLISHER_ENABLE -> FAV_PUBLISHER_ENABLED typo so the
  gate test actually guards the real flag

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 06:00:30 +00:00
weichenandCursor d2903a1662 fix(server): enforce principal identity and docgov project access (H1-H3)
- H1: log legacy test-principal fallback (path/method/remote_addr) via
  slog.Warn so silent unauthenticated access is observable
- H2: AddComment/Claim now derive actor ID/Name/Role from the auth
  principal and server-side doc duty resolution (resolveDocGovRole),
  never from request body; GetDocument/ListComments/ListAuditLogs now
  require project membership via requireDocGovDocAccess
- H3: handleGetChatTurn asserts session ownership; handleListChatSessions
  and handleGetUserContext reject cross-user user_id (403) and stop
  defaulting to user id=1

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 05:33:38 +00:00
weichen 844f757af3 merge: fix/audit-b1-data-consistency (audit batch 1: docgov persist errors, session race, workflow plan tx, ctx threading) 2026-09-19 05:04:18 +00:00
weichenandCursor a81db16cdd fix(server): thread request ctx through session bootstrap, drop Background DB calls
- getOrCreateSession now takes ctx; GetSessionOwnerID/
  RestoreSessionContext/CompilePromptGuidance run under
  context.WithTimeout(5s) instead of context.Background()
- SyncRecentDialogue's rolling summary uses a 30s timeout context
  instead of Background, so client disconnect cancels the LLM call

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 05:03:01 +00:00
weichenandCursor e2b13406db fix(projectinstance): atomic plan save and correct completed_by attribution
- Add Store.SavePlanWithRevision: single-transaction planning upsert +
  revision bump (bump first with optimistic lock, conflict rolls back
  before any plan write), closing the SaveWorkflowPlan split-transaction
  race where plan content and revision could diverge
- AdvanceStage now takes operatorID and writes completed_by explicitly
  instead of SELECT activated_by, so the completing operator is the
  actual advancing user, not the original activator
- Service.SaveWorkflowPlan/AdvanceStage pass userID through; memStore
  implements SavePlanWithRevision under its single mutex

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 05:00:01 +00:00
weichenandCursor c7eab1f7d1 fix(chat): add RWMutex to Session and snapshot accessors to close data race
- Session gains mu sync.RWMutex + SnapshotMessages/AppendMessage/
  TouchLastAccessed/SetProjectID/Project accessors
- sendMessageInternal, hydrateVisibleHistory, getOrCreateSession,
  cleanStaleSessionsLocked, handleChat, handleChatStream,
  enrichSessionWorkflowStage, bindSessionDocumentSummaryReader all use
  locked accessors instead of raw field access
- ProjectID mutation now goes through SetProjectID (only when changed),
  closing the cross-project pollution window in handleChat/handleChatStream

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 04:55:55 +00:00
weichenandCursor 11f375f53d fix(docgov): surface lease/audit persist failures and read back fencing token
- persistLeaseLocked now returns error; AcquireLease rolls back in-memory
  lease on DB failure so memory and PG stay consistent
- appendAuditLocked uses request ctx and logs audit INSERT failures
  instead of swallowing them with context.Background()
- loadDocumentFromDBLocked now SELECTs lease_fencing_token so fencing
  survives process restart
- SaveDocumentContent/RecordDocumentViewed/RecordDocumentEdited/
  DecideModificationProposal/SetDocumentWorkDir log persist failures
  via slog.Error instead of silent _, _

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 04:50:40 +00:00
weichen e8ed33b0aa merge: fix/remove-control-center leftover cleanup 2026-09-19 03:55:40 +00:00
weichenandCursor 597aa76e60 docs: record leftover Control Center cleanup
The untracked node_modules tree and the local feature branch are gone.
The remote branch was left in place.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 03:55:40 +00:00
weichen d21f024dbe merge: fix/remove-control-center health closeout 2026-09-19 03:43:22 +00:00
weichenandCursor 9f2c510b62 docs(test): record dev health after Control Center removal
The rebuilt dev service returned 200 with schema 52.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 03:43:22 +00:00
weichen 03ec351643 merge: fix/remove-control-center 2026-09-19 03:42:23 +00:00
weichenandCursor 87f6b68001 docs(test): record Control Center removal verification
The short tests, archtest, and product web build passed after the
module was deleted.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 03:42:23 +00:00
weichenandCursor 14f75df1ac refactor: remove Control Center from this repository
Progress tracking now lives in a separate project. Drop the server,
docs, and module-boundary entries without restoring engineering-dashboard.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 03:40:00 +00:00
weichen 2641045547 merge: feature/control-center-server (supersede engineering-dashboard) 2026-09-19 03:21:12 +00:00
weichenandCursor 55fa8ddfcd docs(test): keep the merge-gate command log
*.log is ignored, so the vet/test/build transcript is stored as verify.txt.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 03:21:05 +00:00
weichenandCursor be0a71cf7f docs(control-center): close the merge gate
Record the unit, live LLM, and SPA walkthrough evidence, and mark the
control-center row done now that engineering-dashboard is superseded.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 03:20:22 +00:00
weichenandCursor 0929f58aef chore(control-center): bind the database port to loopback
The compose file published 5440 on all interfaces. Match the other
environment databases and listen only on 127.0.0.1.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 03:20:22 +00:00
weichenandCursor 69524205b0 fix(audit): ignore MiniMax think blocks when parsing findings
Real highspeed responses wrap reasoning in think tags that contain
brackets, which made the JSON span extractor fail before the array.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 03:04:25 +00:00
weichenandCursor 049a18d5bc test(controlcenter): cover config pick, store, and leases
Gate the merge on unit coverage for the three packages that previously
had none: env precedence, migrate/query, and claim/heartbeat/reap.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 02:58:03 +00:00
weichenandCursor b3093f1b60 merge: dev into feature/control-center-server
Keep Control Center and drop engineering-dashboard. Resolve CURRENT
claim rows and module-boundaries by removing the superseded dashboard
entry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 02:55:35 +00:00
weichen 283f39df34 merge: fix/user-manual-dist 2026-09-18 09:53:32 +00:00
weichen 0d94556c4f docs(ops): 记录 dist 补录合入 2026-09-18 09:53:32 +00:00
weichen 65df9d13ed docs(user-manual): 强制纳入 dist 交付物(html/pdf/docx)并补充重建说明 2026-09-18 09:53:17 +00:00
weichen 8142389b4b merge: feature/user-manual slot release 2026-09-18 09:51:32 +00:00
weichen f38e1d5ee6 docs(ops): 释放集成槽位(user-manual 冒烟 PASS) 2026-09-18 09:51:10 +00:00
weichen 6c2fbc45a3 merge: feature/user-manual 2026-09-18 09:49:04 +00:00
weichen f746a59862 docs(ops): 占用集成槽位(feature/user-manual 合入 dev) 2026-09-18 09:48:13 +00:00
weichen f6f34b87cb merge: docs/wave7-roadmap-orchestration 2026-09-18 04:43:32 +00:00
weichenandCursor 60120b7977 docs(test): archive Wave 7 orchestration confirmation report
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:43:19 +00:00
weichenandCursor e64bf5ca8b docs(ops): mark Wave 0-7 done and flag Control Center conflict
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:22:22 +00:00
weichenandCursor a42e7902d7 docs(remediation): mark Wave 7 done and link orchestration record
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:21:56 +00:00
weichenandCursor 7d8029978e docs(ops): record Wave 7 roadmap orchestration confirmations
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:21:37 +00:00
weichen a88ed85cf3 merge: docs/wave6-doc-drift 2026-09-18 04:13:48 +00:00
weichenandCursor 4d7b1b5d25 docs(ops): close Wave 6 doc-drift D-1~D-6 and update SSOT
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:13:29 +00:00
weichenandCursor 28e1fa2e4b docs(project): align remaining-blocker section with gap-matrix production_ready=yes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:11:15 +00:00
weichenandCursor 6b70d28b2e docs(backlog): sync D3/D7 status with FEATURE-MATRIX
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:11:15 +00:00
weichenandCursor 447b830ff5 docs(ops): backfill closure note on intent dual-tab handoff
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:11:15 +00:00
weichenandCursor 8e17814cea docs(adr): accept modular-monolith-decoupling ADR (Phase 1/2 landed)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:11:15 +00:00
weichenandCursor eee392d93d docs(ops): archive completed PU8/W4 U9-U12 short-term tasks
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:10:53 +00:00
weichenandCursor ca0d334d57 docs(ops): flip PU8 U9-U12 contracts to status done
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:10:48 +00:00
weichen 688d9d30eb docs(user-manual): 新增系统使用说明书(33 张 dev 真实截图 + md/html/pdf/docx 四格式) 2026-09-18 04:08:49 +00:00
weichen 2ce2625c94 merge: fix/wave5-deadcode-decisions 2026-09-18 04:02:26 +00:00
weichenandCursor 60b17c03ab docs(ops): close Wave5 deadcode decisions
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:02:19 +00:00
weichenandCursor 2e14b3563c fix(web): remove dead notification/workflow/settings components and orphaned APIs (X-5)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:02:18 +00:00
weichenandCursor da62c49952 docs(sysadmin): annotate unwired system_settings keys as phase-2 backlog (X-4)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:02:18 +00:00
weichenandCursor 527e6daa99 docs(swboot): mark 00048 tables deferred to SWBOOT-10 (X-3)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:02:18 +00:00
weichenandCursor 6c61a5bc37 docs(ctxmgr): seal SEMANTIC_SUMMARY_REPLACE with decision link (X-2)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:02:18 +00:00
weichenandCursor a41836dec0 fix(intent,sysadmin): delete dead SEMANTIC_FALLBACK_ENABLED flag (X-1)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:02:18 +00:00
weichenandCursor e0f6d5991c docs(ops): plan Wave5 deadcode decisions (X-1~X-5)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 04:02:18 +00:00
weichen a12c94700f merge: fix/wave4-hardening-r1-r8 (slot release) 2026-09-18 03:47:59 +00:00
weichenandCursor e30ae4b96b docs(ops): 释放 Wave4 集成槽位为 idle
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:47:59 +00:00
weichen c4db565c40 merge: fix/wave4-hardening-r1-r8
Wave 4 隐患加固 R-1~R-8 合入本地 dev。
2026-09-18 03:47:46 +00:00
weichenandCursor e4c53a4ccd docs(ops): Wave4 R-1~R-8 收口
归档 test-report 与 assets;CURRENT/remediation 标 Wave 4 done;勾选跨用户会话挂靠负例。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:47:46 +00:00
weichenandCursor e8d2d86542 test(docrevision): hydrate 负例写入类型错误 JSONB 并先落 blob
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:46:22 +00:00
weichenandCursor c1ea8f156c fix(server): 清除 NewSession ProjectID=1 占位以免误触发项目鉴权
非项目会话创建时 ProjectID 归零,避免跨用户负例在 PG 上被 ERR_FORBIDDEN 误挡。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:46:21 +00:00
weichenandCursor 4473a2ae10 test(web): 补 401 fail-fast、单帧容错、abortAllSessions 单测
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:44:08 +00:00
weichenandCursor be9b855783 fix(web): 登出主动 abort 所有会话在途流(R-8)
新增 abortAllSessions;logout 先中止全会话再清 session。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:44:08 +00:00
weichenandCursor 21049607f4 fix(web): SSE 重连 401/404 fail-fast,单帧解析容错(R-7)
TaskRunHttpError 携带 status;非法 JSON 帧跳过并保留 seq。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:44:08 +00:00
weichenandCursor ce7d1b8ac5 fix(server): 后台 ticker 纳入 Shutdown;vault Drain 告警;bizdev 心跳超时(R-6)
reminder/vault 可停止;Drain 失败 slog.Warn;心跳/释放 lease 使用 10s 超时。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:44:08 +00:00
weichenandCursor 58b69a2b08 fix(docrevision): pg_store JSONB 反序列化失败显式报错(R-5)
hydrateDocLocked 损坏字段不再静默零值化;补 PG 负例测试。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:44:08 +00:00
weichenandCursor e25a197410 fix(ctxmgr): memTurns 改为实例作用域并加 TTL/容量淘汰(R-4)
消除跨 ContextManager 实例共享;超过容量时淘汰 2h 陈旧回合。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:44:08 +00:00
weichenandCursor 207e26241c fix(events): dispatcher Handlers 读路径加 RWMutex(R-3)
Register 写锁不变;shadowScan/handle 读路径 RLock,消除导出字段无锁读隐患。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:44:08 +00:00
weichenandCursor 9038c65329 fix: 补齐 rows.Err() 检查(R-2,其余包)
覆盖 kb/storage/projectworkflow/docgov/freedoc 与两个 document CLI。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:40:24 +00:00
weichenandCursor b53a97b36d fix(ctxmgr): 补齐 rows.Err() 检查(R-2,ctxmgr 包)
A 类硬失败返回;manager 降级读路径用 slog.Warn 保持既有容忍语义。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:40:24 +00:00
weichenandCursor ba1fc71f16 test(server): 跨用户会话挂靠负例测试(PG + 内存双实现)
覆盖 chat / chat/stream / chat/sessions 三条路径;受害者续用不受影响。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:39:08 +00:00
weichenandCursor a805a6bfd7 fix(server): chat/sessions upsert 与任务创建强制取 principal(R-1b)
upsert 忽略客户端自报 user_id;EnsureChatSessionOwned 拒绝跨用户挂靠。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:39:08 +00:00
weichenandCursor ecdf1fc833 fix(server): getOrCreateSession 增加会话归属校验(R-1a)
调用方传入 callerUserID;持久层与内存会话归属不匹配时返回 SESSION_FORBIDDEN;覆盖 NewSession 默认 UserID=1 占位。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:39:08 +00:00
weichenandCursor 426af51365 fix(ctxmgr): EnsureChatSession 归属 COALESCE 改为已有值优先(R-1c)
防止跨用户通过 upsert/消息落库覆盖已绑定的 chat_sessions.user_id;新增 EnsureChatSessionOwned。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:39:08 +00:00
weichen 32932e468e merge: fix/wave3-test-debt-blindspots 2026-09-18 03:02:59 +00:00
weichenandCursor 2ebf6adb2d docs(ops): close Wave 3 test-debt-blindspots (S-1/S-2/S-4/S-5)
Archive isolated PG reconcile evidence, mark gap-matrix debt closed, and
release the integration slot for Wave 4 hardening.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:02:59 +00:00
weichenandCursor 17f430b267 fix(web): reuse projectSettingsError envelope across API clients
Prefer error_code when present and route projectMembers/freeformDoc/
taskRuns/chatSessions failures through the shared structured parser.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:02:06 +00:00
weichenandCursor 3b4c9cfddf test(web): add npm scripts for all e2e specs; retire redundant revision smoke
Eliminate DOCREV_E2E_BASE_URL dual gating by deleting the one-assert smoke
spec covered by document-revision-runtime UI-10, and expose per-spec scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:02:06 +00:00
weichenandCursor a99e3f725f test(server,app): delete dead resume-workspace test; clarify plan_owner redirect
Remove the skipped client work_dir resume coverage that targeted a deleted
entry point, and document why the real-PI stop-gate stays redirected to
internal/server to avoid an import cycle.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 03:02:06 +00:00
weichenandCursor c6e7656f8e docs(ops): sync Wave 2 closeout checklist into dev lineage
Carry the done checklist and test-report link that lagged the Wave 2
merge tip so Wave 3 starts from a consistent ops state.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 02:59:03 +00:00
weichen 423f7e7413 merge: fix/wave2-config-flag-align 2026-09-18 02:29:07 +00:00
weichenandCursor 24c0e5b16a docs(ops): close Wave 2 config flag alignment (E-3/E-4/E-6/E-7/E-9)
Archive three-env compose/env smoke evidence, mark remediation Wave 2
done, and release the integration slot for Wave 3.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 02:29:07 +00:00
weichenandCursor 8d97dd6b18 test(config): add compose flag declaration regression tests
Pin E-3/E-4/E-6 compose declarations so dead runner config and missing
flag wiring cannot silently regress.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 02:26:47 +00:00
weichenandCursor 55a539c551 chore(infra): drop CURSOR_RUNNER_PORT from env examples
Placeholder cursor-agent service is gone; keep CURSOR_API_KEY/MODEL/BIN
for the local cursor-cli subprocess backend.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 02:26:47 +00:00
weichenandCursor e0aabecf59 fix(infra): declare MULTI_INTENT_PLAN_TIER and U9-U12 flags in all compose envs
Also declare SEMANTIC_SUMMARY_SHADOW and PI_CHANGE_REPORT_NARRATIVE on
test/main, remove dead CURSOR_RUNNER_URL/cursor-agent, and set main
SEED_DEMO_USERS=false. Defaults stay legacy/false (no behavior change).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 02:26:47 +00:00
weichenandCursor 07fc0ecf55 fix(intent): fail closed INTENT_V2_DECISION_TIER unknown values to none
Align illegal-tier fallback with PlanTier's conservative policy so
unrecognized values never silently enable V2 query routing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 02:26:47 +00:00
weichen e35f106162 merge: Wave 1 docs closeout 2026-09-17 17:08:12 +00:00
weichenandCursor c61963633e docs(test): archive Wave 1 main env fix acceptance evidence
Close short-term task, mark remediation Wave 1 done, release integration
slot, and record main env=main / schema 52 / modes-off smoke evidence.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 17:08:12 +00:00
weichen 805aa1259f merge: Wave 1 events secrets unblock 2026-09-17 17:06:24 +00:00
weichenandCursor fb4a4f263d fix(infra): supply main events secrets so ENV=main can boot
validateProductionSecrets rejected events under ENV=main without
KB/admin passwords; depends_on events healthy then blocked app forever.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 17:06:24 +00:00
weichen 27ccd12116 merge: fix/wave1-main-env-fix
Wave 1: align main app/events ENV=main, app depends_on events healthy,
fail-closed empty-Env chat import.
2026-09-17 17:03:54 +00:00
weichenandCursor 053bfe234b docs(ops): occupy integration slot for Wave 1 main env merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 17:03:54 +00:00
weichenandCursor e286fca71b fix(server): fail-closed chat import when Env is empty
Drop Env==\"\" as a dev alias; pin compose app/events ENV alignment and
main depends_on events with unit tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 17:03:08 +00:00
weichenandCursor db964da21a fix(infra): align main app ENV with events and gate on events health
Set app ENV=main (was prod) and require events service_healthy before
app starts so goose migrations finish before app queries new columns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 17:03:08 +00:00
weichenandCursor 5ad2585ed7 docs(ops): claim Wave 1 main env fix branch
Register short-term task and CURRENT mutex=infra for E-1/E-2/E-5.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 17:03:08 +00:00
weichen af0912b0b3 merge: Wave 0 SSE evidence asset 2026-09-17 16:49:48 +00:00
weichenandCursor 7aca97e9b3 docs(test): store Wave 0 SSE evidence as txt (log gitignored)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 16:49:48 +00:00
weichen 4bccedb4ad merge: docs Wave 0 P0 closeout 2026-09-17 16:49:32 +00:00
weichenandCursor 40a9c1b285 docs(test): archive Wave 0 P0 bug-fix acceptance evidence
Close short-term task, mark remediation Wave 0 done, release integration
slot, and attach real pi-agent SSE heartbeat log plus suite results.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 16:49:32 +00:00
weichen 810fb96e76 merge: fix/wave0-p0-sse-chat-cache-bugs
Wave 0 P0: SSE heartbeat/deadline, run/stream 400+pre-flush start,
chat window cache key/LRU, IndexedDB restore merge.
2026-09-17 16:43:01 +00:00
weichenandCursor 2620d808c4 fix(web): unify chat window cache keys and merge IndexedDB restore
Pass userId on every saveSessionWindowCache write, LRU-evict full cache
keys, and applyRestoredFileRaw so mount restore cannot drop newer deliverables.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 16:42:56 +00:00
weichenandCursor 54244ed97a fix(server): extend SSE write deadline for chat and run/stream
Wire heartbeat + SetWriteDeadline into handleChatStream and
handleRunTaskStream; reject malformed run/stream JSON with 400; move
CreateAndStart/Subscribe before SSE Flush so failures stay JSON errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 16:42:56 +00:00
weichenandCursor 64efaa32c8 docs(ops): register system health audit and claim Wave 0 fix branch
Archive the 2026-09-17 health-check audit/remediation and short-term Wave 0
task so P0 SSE/cache fixes can proceed under mutex chat+web.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 16:42:55 +00:00
weichen dfa2d2d4bd merge: chore/release-s1c-integration-slot
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-17 15:52:53 +00:00
weichenandCursor 1dd1a8d23f docs(ops): release integration slot after S1-continued smoke
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 15:52:53 +00:00
weichen e58c707df6 merge: feature/rdev-template-depth-s1-continued
S1 continued: deepen remaining 46 rdev templates, lint 60/60, real-PI samples, instance_no fix.
2026-09-17 15:51:41 +00:00
weichenandCursor 36261e9d13 docs(ops): claim merge slot and archive S1-continued short-term
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 15:51:30 +00:00
weichenandCursor 9b35c1abd1 docs(test): archive S1-continued rdev template depth report and sync matrix
Record real-PI samples for review and verification templates, mark S1 continued done across writing-spec/backlog/FEATURE-MATRIX/CURRENT.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 15:51:09 +00:00
weichenandCursor 12608c21ef fix(projectinstance): allocate next instance_no for planning drafts
Avoid unique (project_id, instance_no) collisions when saving a new
workflow plan after a completed main instance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:56:50 +00:00
weichenandCursor 04243e64d8 feat(rdev-templates): deepen stage-10–13 transfer/validation templates (S1 batch 5)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:37:19 +00:00
weichenandCursor 7c50128bd1 feat(rdev-templates): deepen stage-08 verification templates (S1 batch 4)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:37:18 +00:00
weichenandCursor 05629721f0 feat(rdev-templates): deepen stage-06 software/inspection/list templates (S1 batch 3)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:37:18 +00:00
weichenandCursor 1692a57175 feat(rdev-templates): deepen stage-06 hardware/process templates (S1 batch 2)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:37:18 +00:00
weichenandCursor 8c37ac0cd5 feat(rdev-templates): deepen 6 review-record templates (S1 batch 1)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:37:03 +00:00
weichenandCursor 535eb442b5 docs(ops): add short-term for rdev-template-depth-s1-continued
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:34:45 +00:00
weichenandCursor b800f9adf9 docs(ops): claim rdev-template-depth-s1-continued and open short-term
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:34:34 +00:00
weichen f8c4a61922 merge: chore/archive-proposal-http-task
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-17 14:12:13 +00:00
weichenandCursor 51d6d53ede docs(ops): archive proposal-http short-term after closeout
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:12:13 +00:00
weichen 21fb95458a merge: chore/closeout-claim-cleanup
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-17 14:12:02 +00:00
weichenandCursor fc227f339c docs(ops): clear closed feature worktree claims after closeout
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:12:02 +00:00
weichenandCursor dcc859ecb0 docs(test): archive proposal HTTP live evidence and release slot
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:11:23 +00:00
weichen 1f2fcd0727 merge: feature/docgov-modification-proposal-http 2026-09-17 14:08:06 +00:00
weichenandCursor c89a58e026 docs(ops): occupy integration slot for proposal-http merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:08:02 +00:00
weichenandCursor d01694b556 docs(ops): record author-only pilot and proposal-http task claim
Archive CAS evidence for workflow.allow_author_only_approval on dev,
mark proposal HTTP audit resolved, and claim the feature branch in CURRENT.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:07:52 +00:00
weichenandCursor c0e7df5abf feat(docgov): expose proposal HTTP and wire frontend decide flow
Add POST /api/v1/docgov/proposal for ProposeModification, harden decide
status mapping, and replace App pendingProposal local mock with real API calls.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 14:07:52 +00:00
weichen bea70b064b docs(control-center): strengthen agent integration spec — onboarding protocol, per-stage entry/exit criteria, decision quality bar, event cadence 2026-09-17 14:06:24 +00:00
weichen b5bacee331 refactor(control-center): remove legacy engineering-dashboard, superseded by control-center
- delete cmd/engineering-dashboard, internal/engineeringdashboard, scripts/engineering-dashboard.sh
- archive old design doc to .doc/archive/design/ with deprecation banner
- FEATURE-MATRIX: mark old row removed, add removed to status contract
- system-design README: section 8 now points to Control Center SSOT
2026-09-17 14:00:38 +00:00
weichenandCursor ba92a8b3a5 docs(status): note author-only merged to dev in FEATURE-MATRIX
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:58:30 +00:00
weichenandCursor cbeefdb9ed docs(ops): release integration slot after author-only merge smoke
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:58:19 +00:00
weichenandCursor 09a9921e87 merge: feature/document-author-only-plan
Close out document author_only U1–U6 into dev (default policy off).
Resolved CURRENT claim table and bizdev service conflicts with rdev prior-doc injection.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:57:12 +00:00
weichenandCursor 4f1bb1f02d docs(ops): archive author-only U1–U6 and close remediation DoD
Move short-term tasks to archive, update MATRIX/INDEX/CURRENT, and hand off merge to dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:55:17 +00:00
weichenandCursor 472f845a88 docs(test): track U6 API evidence as txt (logs gitignored)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:49:12 +00:00
weichenandCursor 7b09da1f99 docs(ops): close document-author-only U6 and note proposal HTTP gap
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:48:59 +00:00
weichenandCursor 58b785e110 docs(test): add document-author-only U6 closed-loop report
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:48:59 +00:00
weichenandCursor cf7f55a1b9 test(web): cover author_only action visibility and docgov client shapes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:48:59 +00:00
weichenandCursor 916931f5d8 feat(web): surface duty_policy author_only badge end-to-end
Propagate summary.duty_policy into deliverables/AST and show 编制人兼任 on the action bar.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:48:59 +00:00
weichenandCursor b87fc5007f feat(web): call real docgov lifecycle APIs from action handlers
Replace local lifecycleState mocks; add handleRejectApprove; use holdsDocDuty for chat shortcuts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:48:59 +00:00
weichenandCursor aed7f3f9b5 fix(web): gate docgov actions by duty id, not folded role
author_only A/A/A users were stuck as author-only under resolveCurrentDocRole priority.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:48:59 +00:00
weichenandCursor 3c6342bfee feat(web): add docgov claim/submit/review/approve API client
Wire frontend to existing lifecycle HTTP so approval actions can leave local mock state.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:48:59 +00:00
weichenandCursor 8658a135ab docs(ops): claim and close document-author-only U4 and U5
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:15:05 +00:00
weichenandCursor 7ccb821d6c test(web): cover author_only duty resolution and validation
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:15:05 +00:00
weichenandCursor 72686d13cb feat(web): add per-document author_only toggle in project settings
Show a single author picker when兼任 is enabled, respect the system
capability flag, and surface author_only docs in activation preview.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:15:05 +00:00
weichenandCursor be128602e4 feat(web): resolve client duty_policy for author_only plans
Align TypeScript types and projectSettingsDuties with backend
ResolveDocTaskDuty so author_only no longer fails as partial.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:15:05 +00:00
weichenandCursor 2c012ee59f test: cover author_only access matrix and duty_policy audits
Prove A can run the full action chain and outsiders stay denied; assert
audit Details carry duty_policy on all five transitions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:15:05 +00:00
weichenandCursor 3f7358d454 feat(docgov): record duty_policy on lifecycle audit details
Surface the document duty mode on submit/review/approve transitions for
consistent logs under author_only.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:15:05 +00:00
weichenandCursor f02600d75c fix(projectinstance): resolve author_only duties in ABAC gates
Use ResolveDocTaskDuty so normalized author-only plans (author ID only)
are treated as full A/A/A for access, stage visibility, and readiness.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 13:15:05 +00:00
weichen 87bcf05043 feat(control-center): allow LAN bind with mandatory fixed console token (serve-lan) 2026-09-17 13:11:52 +00:00
weichen 6714081b12 docs(control-center): P6 design spec, agent integration guide, acceptance report
Also fixes ListTasks ?q= filter 500 (duplicate $%d placeholder rendered as
%!d(MISSING)) found in P6 smoke; adds TestTaskListQueryFilter regression.
2026-09-17 12:59:12 +00:00
weichen 07a8e126fc feat(control-center): P5 scheduled repo audits — deterministic checks, LLM review, findings UI 2026-09-17 12:39:46 +00:00
weichen f79956c498 feat(control-center): P4 .doc importer, agent CLI, task doc export
- internal/controlcenter/importer: scan .doc/ops/{short-term,long-term}
  and .doc/backlog for task docs, upsert cc_tasks keyed by slug; maps doc
  status/stage, auto-creates the three plans, follows doc status only
  while a task is planned/in_progress (terminal statuses never regress),
  skips unchanged docs, and resolves cross-directory slug collisions by
  fixed directory precedence with a warning
- cmd/control-center: import-docs subcommand (also runs at serve startup
  and on the doc-sync ticker) plus the agent CLI: next / instruction /
  claim / heartbeat / release / event / artifact / advance-request /
  decision / report, thin net/http client, compact JSON output
- console API POST /api/v1/tasks/{id}/export-doc renders a task per
  .doc/ops/templates/short-term-task.md into .doc/ops/short-term/, refuses
  overwrite (409) and unsafe slugs, then backfills doc_path
- fix pre-existing TestAgentHasNoAdvanceRoute: SPA catch-all GET / makes
  the mux answer 405 for unmatched POST paths; accept 404 or 405
- archtest allowlist: controlcenter/importer -> pipeline, store
2026-09-17 11:57:47 +00:00
weichen b0095de398 feat(control-center): P3 web SPA — overview, stage kanban, task pipeline, decisions, docs search
- control-center/web: Vite+React+TS SPA (hash routing, token login via
  localStorage, marked-lexer markdown rendering without raw HTML injection)
- pages: overview (stage x state matrix, SSE feed w/ 10s poll fallback),
  8-lane kanban + task create, task detail stepper/pipeline/ops
  (assign/advance/send-back/external-submit), decision inbox, docs browse
  + semantic/keyword/hybrid search, global stage settings, audit placeholder
- internal/controlcenter/webui: //go:embed dist, SPA fallback, index no-store;
  dist committed so go build works without node
- server: GET / serves embedded SPA; pipeline view now includes artifact
  content for console rendering
- archtest: allowlist controlcenter/server -> controlcenter/webui
2026-09-17 10:13:16 +00:00
weichenandCursor c6c07263c7 docs(ops): claim and close document-author-only U3
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:59:38 +00:00
weichenandCursor 67b3b5e070 test: cover duty lock, heal/revoke skip, and instance duty adapter
Unit evidence for AE5a/AE5b filters; optional PG cases when
TEST_DATABASE_URL is set.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:59:38 +00:00
weichenandCursor 750b904439 feat(app): wire projectinstance duties into bizdev
Composition-root adapter maps live instance DocTasks to bizdev's narrow
InstanceDutySource without crossing module boundaries.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:59:38 +00:00
weichenandCursor 5b9b46ee8d feat(bizdev): prefer instance-governed duties when generating docs
Inject InstanceDutySource, resolve governed bindings, lock duties after
create, and skip in-memory HealBinding overwrite for governed docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:59:38 +00:00
weichenandCursor 42a3b1e56c feat(docduty): skip duty_locked rows in heal and revoke
Keep instance-governed A/A/A (or separated) bindings immune to project
default heal and member-slot revocation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:59:38 +00:00
weichenandCursor 89484177ee feat(docgov): lock document duties and project duty_policy
Add LockDocumentDuty for PG/memory and expose duty_policy on workflow
document summaries for later UI marking.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:59:38 +00:00
weichenandCursor 7d3474816b feat(db): add document_records duty_locked and duty_policy columns
Stamp instance-governed document duties at create time so heal/revoke can
skip locked rows without importing projectinstance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:59:38 +00:00
weichenandCursor 748df016b2 docs(ops): release rdev merge slot, archive P0/P1 task, register S1续批
Also record the ad-hoc verification Path("") join pitfall as a low-severity
audit note so future sampling scripts fail closed instead of scanning bizdev/.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:52:24 +00:00
weichenandCursor 7e6860f861 docs(ops): smoke phase for rdev merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:47:57 +00:00
weichen 68f63d3c30 merge: feature/rdev-template-depth 2026-09-17 09:47:49 +00:00
weichen 9bb4ec3665 merge: feature/rdev-core 2026-09-17 09:47:44 +00:00
weichen 63f1fa5f87 feat(control-center): P2 document vector store — ingestion, chunking, embedding, hybrid search
- internal/controlcenter/embed: OpenAI-compatible /embeddings client
  (batch<=16, 30s timeout, 5xx/network retried once, 4xx not), Embedder
  interface, deterministic offline Stub, pgvector literal formatting
- internal/controlcenter/docs: .doc/**/*.md sync into cc_documents with
  sha256 diffing and vanished-file removal; YAML front matter -> jsonb,
  title fallback, taxonomy from first .doc dir; heading-based chunking
  with paragraph bisection over ~1800 est. tokens; chunk_hash idempotent
  inserts (unchanged chunks keep embeddings); embedding failures degrade
  to NULL vectors without failing the sync; IndexArtifact for
  cc_stage_artifacts; StartPeriodic ticker (CC_DOC_SYNC_SECONDS)
- server: GET /api/v1/docs (taxonomy/q filters), /api/v1/docs/{id},
  /api/v1/docs/search (semantic|keyword|hybrid, ts_rank+ILIKE keyword
  fallback, 0.6/0.4 max-normalized fusion, degraded flag when embedding
  unavailable); async artifact indexing hooked into agent artifacts and
  external-submit handlers
- archtest module-boundaries allowlist updated for new packages
2026-09-17 09:47:29 +00:00
weichenandCursor 7f30a5049e docs(ops): occupy slot to merge rdev-core and template-depth
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:47:14 +00:00
weichenandCursor 4e271c54bb docs(test): archive rdev template-depth S0/S1 real-PI evidence
Record true PI samples (intake + rd_design_input_spec), update FEATURE-MATRIX
remaining work, backlog S1续批/S2/S3, and allowlist engineeringdashboard for
archtest green on this branch lineage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:47:05 +00:00
weichenandCursor ca7b7da237 docs(ops): claim rdev-template-depth short-term and CURRENT mutex
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:46:52 +00:00
weichenandCursor 93ad80b9a7 feat(rdev): deepen phase 01-05 templates with ISO 13485 sections
Replace generic placeholders for 14 rd_* docs, add writing-norm doc and
allowlist lint so structure and per-section instructions stay enforceable.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:46:37 +00:00
weichenandCursor dc3aef4607 fix(squad): inject rdev_leader InstructionsFile for DHF final review
Prefer AgentSpec.InstructionsFile when building AGENTS.md so rd_* leader
steps no longer fall back to business-tone leader.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:46:37 +00:00
weichenandCursor aba38ef7a9 fix(engineering-dashboard): drop startup token for personal local use
Rely on loopback bind plus Host/Origin checks; open http://127.0.0.1:8787/
without a query token after SSH tunnel.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:46:26 +00:00
weichenandCursor 37b1aaa3ae feat(rdev): add medical design-control workflow (13 stages / 60 docs)
Seed rdev.v2.json, rd_ templates, catalog policy (order 40), squad
kind orchestration, and hard precheck requiring completed main (CDO).
Includes StageKey dynamicization from P0 and docs for P2–P4 skeleton.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:46:26 +00:00
weichenandCursor a39823da38 fix(docgov): pass dynamic StageKey into document ledger create
Stop hardcoding V0.5_feasibility when creating docgov records; prefer
frozen-instance StageKey from TaskRunRequest with main-task fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:46:09 +00:00
weichenandCursor c03d0a3a6e docs(ops): claim and close document-author-only U2
Record short-term evidence and mark the CURRENT claim done.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:39:59 +00:00
weichenandCursor 68dbe8a6b2 test(projectinstance): cover author_only planning and activation
Verify resolve/normalize/hash stability, policy gating, stale token
rejection, and HTTP error mapping for the new duty policy path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:39:59 +00:00
weichenandCursor 1651c30e90 feat(api): map author-only policy errors on workflow settings
Return 403/409/503 for disabled, changed, and unavailable governance
policy conditions during plan save and activation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:39:59 +00:00
weichenandCursor 0b67a901a9 feat(app): wire sysadmin author-only policy into projectinstance
Adapt sysadmin.AuthorOnlyPolicySource at the composition root so
projectinstance stays within module-boundary allowlists.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:39:59 +00:00
weichenandCursor a2aa3d41bd feat(projectinstance): support per-doc author_only duty policy
Add ResolveDocTaskDuty, require the system policy on save/preview,
lock the policy row during activation, and derive A/A/A assignments.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:39:59 +00:00
weichenandCursor ba57c9a4de feat(db): bind activation tokens to author-only policy revision
Prevent preview tokens from activating after the governance switch
revision changes by storing the revision on each confirmation token.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:39:59 +00:00
weichenandCursor 3b6def256e docs(ops): claim and close document-author-only U1
Record short-term task evidence and mark the CURRENT claim done.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:15:15 +00:00
weichenandCursor 430a47ad8c test(sysadmin): cover author-only CAS, audit rollback, and HTTP gates
Verify concurrent revision conflicts, null/string rejection, plain-user
denials, and PG lock/read paths for the new policy key.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:15:15 +00:00
weichenandCursor a2cbaf1e33 feat(sysadmin): CAS author-only policy with transactional audit
Register the workflow total switch, require expected_revision for
updates, and expose AuthorOnlyPolicySource for activation locking.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:15:15 +00:00
weichenandCursor b4b300bb8a feat(db): add author-only approval policy revision and audit
Seed workflow.allow_author_only_approval closed, add monotonic
revision on system_settings, and a narrow policy audit table.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:15:15 +00:00
weichen b11cc64845 feat(control-center): P1 pipeline core — stage machine, decisions, artifacts, leases, SSE
- pipeline: 8-stage order, NextStage (testing skippable), gate pure
  functions (agents may never advance; only in_progress->awaiting_review)
- tasks: domain layer over cc_* tables — CRUD, claim/heartbeat/release
  leases, advance-request, decisions with strict suggestion validation,
  stage transitions, external submit, stage settings, overview, lease reaping
- server: agent + console routes, SSE broker broadcasting every event
  insert, 60s lease reaper goroutine, 1MB body limit, domain error mapping
- archtest: allowlist controlcenter/* and engineeringdashboard packages
2026-09-17 09:13:36 +00:00
weichenandCursor 7a590670e9 docs(workflow): approve R9/R10 and harden heal acceptance
Mark lifecycle boundaries reviewed; require HealProjectDocuments
projection stability across list/generate/member triggers, and
explicitly exclude emergency stop from the global switch scope.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:06:51 +00:00
weichen f6c9638e60 docs(workflow): plan per-document author-only approval policy 2026-09-17 08:49:46 +00:00
weichen 2be43efddd feat(control-center): P0 skeleton — standalone server, pgvector compose, goose schema, token auth 2026-09-17 08:38:50 +00:00
weichen cf805a73a7 docs(ops): claim control-center-server task and register in CURRENT 2026-09-17 08:33:10 +00:00
weichen adb48c86a5 merge: feature/initial-load-perf-u2 (docs acceptance) 2026-09-17 08:25:43 +00:00
weichenandCursor ae219955ab docs(test): archive initial-load U2 acceptance evidence
Record curl/browser before-after metrics, mark U2 done, and release the
integration slot while leaving U1/U3–U7 open.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 08:25:43 +00:00
weichen bc01781438 merge: feature/initial-load-perf-u2 2026-09-17 08:18:18 +00:00
weichenandCursor 9335c4c90c feat(server): negotiate static compression and fix asset SPA fallback
Serve precompressed .br/.gz with Cache-Control and Vary, and return 404
for missing /assets and /fonts instead of index.html.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 08:18:11 +00:00
weichenandCursor 3dbd9770b5 feat(web): precompress dist assets to .br and .gz at build time
Use Node zlib in a post-vite step so the Go server can serve negotiated
variants without per-request compression cost.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 08:18:02 +00:00
weichenandCursor dc769686a9 feat(web): self-host Inter and JetBrains Mono for login shell
Remove blocking Google Fonts stylesheet so the login form is not gated
on an external CSS request; keep unicode-range subsets and OFL license.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 08:18:02 +00:00
weichen 59e6fade72 merge: feature/initial-load-performance-plan 2026-09-17 08:08:23 +00:00
weichenandCursor 3445d386ea docs(perf): archive initial-load diagnosis and remediation plan
Capture audit evidence, performance baseline, and U1–U7 remediation plan
without business code changes so the work can land on dev before U2.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 08:08:20 +00:00
weichenandCursor d0ef6961b4 docs(ops): release slot after engineering-dashboard CSP fix
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 07:40:28 +00:00
weichen 0a1302eab0 merge: fix/engineering-dashboard-csp-token 2026-09-17 07:40:27 +00:00
weichenandCursor 2319138800 docs(ops): occupy slot to merge engineering-dashboard CSP fix
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 07:40:27 +00:00
weichenandCursor 7fd7fb8a2a fix(engineering-dashboard): read token from URL/meta under CSP
Remove the inline token script blocked by script-src 'self', so the
live page no longer calls the snapshot API with token=undefined.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 07:39:21 +00:00
weichenandCursor ce2a561d4d docs(ops): release slot after engineering-dashboard merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 07:11:18 +00:00
weichenandCursor f47161131c merge: feature/engineering-dashboard
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 07:11:17 +00:00
weichenandCursor fd1659a416 docs(ops): occupy slot to merge engineering-dashboard
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 07:10:36 +00:00
weichenandCursor 7e05473cf5 docs(engineering-dashboard): closeout report matrix and launcher
Add test report, FEATURE-MATRIX row, archive the short-term task,
mark CURRENT claim done, and ship the thin serve/export script.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 07:10:04 +00:00
weichenandCursor e251ce325a feat(engineering-dashboard): U6-U7 serve UI and offline export
Add loopback-only HTTP server with startup token, Host/Origin/CSP
guards, embedded live UI, CLI serve/export, and safe single-file HTML.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 07:08:27 +00:00
weichen dd887bb08f merge: feature/system-admin-console closeout docs 2026-09-17 07:08:07 +00:00
weichen 62d6241348 docs(test): system admin console acceptance report and closeout
- test report: dev smoke (schema 48->49), 4 admin endpoints, settings
  write-read roundtrip, anon 401 / unknown-key 400 / non-admin 403
- task status done; FEATURE-MATRIX row done; release integration slot;
  env snapshot dev schema 49
2026-09-17 07:08:07 +00:00
weichenandCursor 79ee72267c feat(engineering-dashboard): U5 reconcile and snapshot publisher
Merge docs/git/runtime facts into an immutable snapshot with conflict
retention, last-known stale handling, and acceptance-sample coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 07:04:46 +00:00
weichenandCursor a07ba1065b feat(engineering-dashboard): U2-U4 docs git and runtime collectors
Add allowlisted markdown indexing, read-only git plumbing via injected
runners, and docker/readiness collection with path and loopback guards.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 07:03:32 +00:00
weichen dc7c31edc9 merge: feature/system-admin-console 2026-09-17 06:59:21 +00:00
weichen 0088ae7d44 docs(ops): occupy integration slot for system-admin-console merge 2026-09-17 06:59:21 +00:00
weichenandCursor e46ec0e4e7 feat(engineering-dashboard): U1 freeze snapshot and facet model
Define versioned Snapshot/Fact/Conflict/TaskState contracts with
independent plan/git/verification/deployment axes and acceptance fixtures.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:59:02 +00:00
weichen e7fa6fb023 docs(status): add system admin console row to FEATURE-MATRIX 2026-09-17 06:58:08 +00:00
weichen e310f06504 docs(ops): register system-admin-console task and claim 2026-09-17 06:57:13 +00:00
weichen 0eaca61545 feat(web): full-screen system admin console, absorb AdminSettingsModal
- top-level view switch workbench|admin in App.tsx (no router; hash #turn
  anchors untouched)
- new admin/console/AdminConsoleView with left group nav in the existing
  token/inline-style idiom, plus 8 self-fetching sections: overview, kb,
  features, settings, workflows, roles, users, docs
- absorb the six AdminSettingsModal tabs into sections and delete the modal
- new api/systemAdmin.ts + types for /api/v1/admin/system/* endpoints
- playwright smoke spec web/e2e/admin-console.spec.ts (skip by default)
2026-09-17 06:57:03 +00:00
weichen f1404d5bd2 feat(sysadmin): add system admin aggregation API and system_settings store
- new internal/sysadmin package (overview/kb/features/settings) with small
  port interfaces; business packages stay unaware of sysadmin
- new routes /api/v1/admin/system/{overview,kb,features,settings} guarded
  by requireSystemAdmin
- goose 00049: system_settings table (key/jsonb value, updated_by/at)
- SettingSpec whitelist registry with DB > env > default precedence
- register sysadmin in module-boundaries.yaml (archtest rules)
2026-09-17 06:56:46 +00:00
weichenandCursor fa5e10542a docs(ops): claim engineering-dashboard implementation
Register CURRENT mutex and mark short-term in_progress on the
feature/engineering-dashboard worktree before coding.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:56:20 +00:00
weichenandCursor 12884a1710 docs(ops): release slot after engineering-dashboard plan merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:55:44 +00:00
weichen c336de59b8 merge: feature/project-control-center-plan 2026-09-17 06:55:44 +00:00
weichenandCursor 44fa8d5059 docs(ops): occupy slot to merge engineering-dashboard plan
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:55:44 +00:00
weichenandCursor ed4a49bfa6 docs(engineering-dashboard): add personal control center design plan
Freeze the independent local readonly engineering-dashboard design,
short-term task entry, and system-design index before implementation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:55:32 +00:00
weichen 173a512c28 merge: docs/promote-null-fk-to-test-closeout 2026-09-17 06:20:40 +00:00
weichenandCursor ef5f0fdef9 docs(ops): close null-fk promote to test at rc-v1.0.0-beta.4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:20:40 +00:00
weichen 7f0f8a1ca2 merge: feature/promote-null-fk-to-test 2026-09-17 06:19:57 +00:00
weichenandCursor fa8598e89b docs(ops): occupy slot to promote optional-duty null FK into test
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:19:57 +00:00
weichen e78b6c1470 merge: docs/docgov-optional-duty-null-fk-report 2026-09-17 06:12:56 +00:00
weichenandCursor c9fd8a4d7f docs(test): archive optional-duty null FK fix report and close task
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:12:56 +00:00
weichen e488d10840 merge: fix/docgov-optional-duty-null-fk 2026-09-17 06:08:52 +00:00
weichenandCursor 4606119581 docs(ops): occupy integration slot for optional-duty null FK smoke
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:08:52 +00:00
weichenandCursor 149dec8993 docs(ops): claim and audit docgov optional-duty null FK fix
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:08:35 +00:00
weichenandCursor fa2407f92c fix(stream): classify document ledger FK failures as DOC_LEDGER_ERROR
Avoid masking persist document ledger / 23503 errors as INTERNAL_ERROR.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:08:35 +00:00
weichenandCursor c2efcdbacd fix(docgov): map zero duty ids to NULL on CreateOrGetDocument
Optional reviewer/approver duties leave UserID=0; writing 0 into
document_records FK columns failed with SQLSTATE 23503. Align create
path with docduty nullIfZero and surface ensureUser failures in logs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:08:35 +00:00
weichen feefc322a7 merge: feature/promote-dev-to-test-closeout
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-17 05:05:26 +00:00
weichenandCursor 3978e6b461 docs(ops): record test promotion to rc-v1.0.0-beta.3
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 05:05:26 +00:00
weichen 4fce16c91b merge: feature/promote-dev-to-test-2026-09-17 2026-09-17 05:03:04 +00:00
weichenandCursor 151953a520 docs(ops): occupy slot to promote local dev into test
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 05:03:04 +00:00
weichen 46a0fb2d5a merge: feature/w7-d7-data-inventory 2026-09-17 04:58:52 +00:00
weichenandCursor dbc9b73278 docs(ops): record W7 D7 chat data inventory without deletion
Keep the D7 matrix row deferred until compliance signoff; no gap-matrix blocker.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 04:58:52 +00:00
weichen cb4fbb69a6 merge: feature/w6-fav-subscriber-shadow 2026-09-17 04:26:18 +00:00
weichenandCursor 58c04ff6c5 docs(ops): close W6 FAV shadow and release integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 04:26:18 +00:00
weichenandCursor 9c0954ba6e docs(ops): record W6 FAV subscriber shadow evidence
Keep the FAV matrix row partial because live staging was not opened.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 04:25:17 +00:00
weichenandCursor 2c1d040ccf feat(events): add FAV subscriber shadow without live writes
ObserveShadow computes intended outcome only and refuses FAV_DEGRADED_READ; HandleLease and Register(fav) stay fail-closed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 04:25:17 +00:00
weichen 49d901e964 merge: feature/w5a-software-bootstrap-ui-pi 2026-09-17 04:12:38 +00:00
weichenandCursor 7c1ae7ec38 docs(ops): close W5a and release integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 04:12:38 +00:00
weichenandCursor eee42d1d16 feat(workflow-design): catalog-driven software create wizard and docs_only PI
Software projects mount only bootstrap/delivery keys and skip the medical
seven-template clone. SWBOOT-10 stays a fail-closed stub.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 04:11:03 +00:00
weichen f5a80fd653 merge: feature/w4-u9-segment-live 2026-09-17 03:15:35 +00:00
weichenandCursor 1c1a4bb683 docs(ops): close W4 U9–U12 and release integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 03:15:35 +00:00
weichenandCursor 43555e5d08 feat(intent-plan): wire U9 PI segment proposer and per-flag U10–U12 evidence
Rules that already split skip the LLM. Independent flags stay off by
default and do not raise MULTI_INTENT_PLAN_TIER.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 03:14:57 +00:00
weichen 9ac1eb178e merge: feature/w3-pi-change-report-narrative-live 2026-09-17 03:03:20 +00:00
weichenandCursor 2ba6b3ec74 docs(ops): close W3 narrative live and release integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 03:03:20 +00:00
weichenandCursor 47a740a9c4 feat(docgov): wire no-tool PI change-report narrative
Flag-on CreateAgentCandidate asks the product PI runner for
change_report_narrative_v1 after the real digest is known; timeout
and malformed payloads stay full fallback. Default flag remains off.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 03:02:11 +00:00
weichen 0bc98c6da4 merge: feature/w2-semantic-summary-shadow-live 2026-09-17 02:51:55 +00:00
weichenandCursor 886449958f feat(chat): wire no-tool PI semantic summary shadow
Enable SEMANTIC_SUMMARY_SHADOW to call the product PI runner on authorized messages only, keep REPLACE unwired, and record MiniMax evidence for the D3 matrix close.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:51:55 +00:00
weichen 982dc48345 merge: chore/leftover-hygiene-2026-09-17 2026-09-17 02:43:44 +00:00
weichenandCursor 4b509efefc docs(ops): align leftover branches and contracts with local dev
Prune merged worktrees/refs and correct SWBOOT/PU scaffolding docs so W2–W7 start from git truth, without merging frozen FAV/herdr/project143 branches.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:43:44 +00:00
weichen 80ef2f61a0 merge: docs/archive-kb-host-auth-short-term 2026-09-17 02:06:19 +00:00
weichenandCursor f2c2e34f0b docs(ops): archive completed kb-host-auth short-term task
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:06:19 +00:00
weichen 392b3bc1c9 merge: docs close kb-host-auth 2026-09-17 02:06:09 +00:00
weichenandCursor 6f52896dad docs(ops): close kb-host-auth task and release integration slot
Record rebuild smoke: kb_ready=true and redacted online DSN in container.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:06:09 +00:00
weichen 5182da20ed merge: fix/kb-host-auth-layered-load (no Fatalf) 2026-09-17 02:04:51 +00:00
weichenandCursor 6fa933ac27 fix(kb): return offline client instead of Fatalf under require-online
Library must not abort the process; E2E callers use EnsureOnline/t.Fatal
so ambient RUN_PI_E2E no longer kills short server tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:04:51 +00:00
weichen cdd3f8c559 merge: fix/kb-host-auth-layered-load 2026-09-17 02:03:21 +00:00
weichenandCursor abbb461780 docs(ops): claim integration slot for kb-host-auth merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:03:21 +00:00
weichenandCursor c977e8247a docs(test): record KB host-auth layered load fix and acceptance
Short-term task, CURRENT claim, and unit/live boolean test report.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:03:07 +00:00
weichenandCursor e782400736 fix(api): expose kb_ready and gate E2E/nightly on shared KB
Health reports kb_ready; PI E2E uses layered Load + require-online;
nightly preflights SELECT 1 before product suite.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:03:07 +00:00
weichenandCursor f3ed57c41f fix(kb): redact DSN logs and fail closed when KB must be online
Add Online(), honor KB_REQUIRE_ONLINE/RUN_PI_E2E unless KB_ALLOW_OFFLINE,
and refuse empty/wrong credentials without leaking secrets in logs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:03:07 +00:00
weichenandCursor cdbf9cab63 fix(config): layer root .env over configs/.env.{ENV} for KB auth
Stop using a fake default KB password; merge Compose-style env files and
rewrite compose DNS to localhost on the host so go test/E2E authenticate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 02:03:07 +00:00
weichen e694408851 merge: docs/w1-release-integration-slot 2026-09-17 01:48:19 +00:00
weichenandCursor cacbf755b6 docs(ops): release integration slot after W1 merge smoke
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 01:48:19 +00:00
weichen 1d075aa4c3 merge: fix/w1-archtest-app-fav-allowlist 2026-09-17 01:47:52 +00:00
weichenandCursor 86a4c9af63 fix(arch): allowlist app/fav imports for archtest baseline
FAV U7 stub package was missing from module-boundaries imports map,
breaking go test -short smoke after W1 merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 01:47:52 +00:00
weichen 4d6b95dea4 merge: feature/w1-ci-e2e-green-nightly 2026-09-17 01:44:02 +00:00
weichenandCursor 8d3fd089f2 docs(ops): mark W1 step complete on partial-deferred controller
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 01:44:02 +00:00
weichenandCursor 6981223087 docs(test): close W1 CI/E2E with FullNone nightly pass receipt
Archive green receipt 6e2476f0, raise FEATURE-MATRIX CI/E2E to done,
and mark short-term/CURRENT W1 complete.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 01:43:54 +00:00
weichenandCursor 6e2476f0f2 fix(ci): retry nightly suite on MISSING_TARGET flakes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 01:12:37 +00:00
weichenandCursor 11e030db30 fix(squad): stop requiring fields.json as hard PI runner target
Organizer still prompts for fields.json, but missing it must not fail
closed as MISSING_TARGET when output.md is present (FullNone flake).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 00:55:11 +00:00
weichenandCursor 0f52ab89db fix(ci): load real KB password for host-side PI E2E
configs/.env.dev omits KB_DB_PASSWORD so Load kept the default
shared_kb_secret_pass; fall back to root .env so research can use KB.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 00:52:01 +00:00
weichenandCursor a02c67db82 fix(ci): stabilize FullNone PI E2E timeouts and host KB DNS
Raise HTTP client timeout above AgentTimeout, rewrite compose KB host
to localhost for host-side tests, and retry nightly on deadline flakes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 00:28:38 +00:00
weichenandCursor 4f2e5f013f fix(db): remove duplicate goose 00048 software-project-type migration
Two 00048 files made goose panic on CollectMigrations, blocking all
TEST_DATABASE_URL PG suites including FullNone and nightly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 23:37:04 +00:00
weichen 4bda6484a2 merge: docs/partial-deferred-completion-plan 2026-09-16 23:34:16 +00:00
weichenandCursor 251b5f9c3d docs(ops): claim integration slot for docs closeout merge and W1
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 23:34:16 +00:00
weichenandCursor c649067d19 docs(remediation): freeze §7 open decisions for partial/deferred closeout
Confirm D7 retention draft ADR, confirm-tier gate, REPLACE default-off,
and FAV live order with observation windows; sync CURRENT and short-term.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 16:13:17 +00:00
weichen bb8d921e7c docs(remediation): add partial/deferred completion plan (W1-W7) and short-term controller 2026-09-16 16:03:50 +00:00
weichenandCursor 83f9004f9e docs(ops): close SWBOOT short-term after remote push
CI / go-vet-and-short-test (push) Failing after 1s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:49:21 +00:00
weichenandCursor 92e0ae7ec4 merge: origin/feature/intent-plan-cards-playwright
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:49:21 +00:00
weichenandCursor 49db87ebe5 docs(ops): release integration slot after agent-delta merge
CI / go-vet-and-short-test (push) Failing after 1s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:48:24 +00:00
weichenandCursor 51c8ec1e8a docs(ops): mark P0–P7 agent-delta merge complete on SSOT
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:48:07 +00:00
weichenandCursor 768729d85e fix(swboot): drop thin allowlist stub after agent SWBOOT merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:57 +00:00
weichenandCursor f0029dffed merge: origin/feature/software-project-bootstrap
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:45 +00:00
weichenandCursor 00cc5b6645 merge: origin/feature/fav-u7-publisher
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:29 +00:00
weichenandCursor 131380e858 merge: origin/feature/pu8-u9-u12-flags
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:23 +00:00
weichenandCursor b92e226497 fix(docgov): drop thin pi_narrative stub after agent PU7 merge
Use ResolveChangeReport from feature/pu7-pi-narrative.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:16 +00:00
weichenandCursor a380c218bb merge: origin/feature/pu7-pi-narrative
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:06 +00:00
weichenandCursor f3351ce750 fix(chat): drop thin semantic_shadow stub after agent PU6 merge
Keep applySemanticShadow path from feature/pu6-semantic-summary.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:01 +00:00
weichenandCursor f55887e2a2 docs(test): archive intent-plan Playwright dual-tab report
Record RUN_UI_ACCEPTANCE live PASS evidence and close the dual-tab short-term.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:45:50 +00:00
weichenandCursor b74b9ab1d0 test(web): add intent-plan dual-tab Playwright acceptance
Gate on RUN_UI_ACCEPTANCE=1; seed awaiting PG plan via SQL without raising
MULTI_INTENT_PLAN_TIER; assert one confirm wins and reload/relogin match PG.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:45:50 +00:00
weichenandCursor cc8557b8c6 feat(web): hydrate PLAN_CONFIRM from active intent plan
Load GET /intent-plans/active into a live card on session restore, use a
unique decision nonce per confirm click, and keep an empty-docAST fallback
so login still renders when demo seeds are off.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:45:50 +00:00
weichenandCursor 003bc7a5b9 merge: origin/feature/pu6-semantic-summary
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:45:45 +00:00
weichenandCursor 6aea8784c2 docs(test): record nightly run#30 U8 PASS after DATA_DIR rw fix
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 1s
CI / web (push) Failing after 0s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:44:56 +00:00
weichenandCursor 6087d0bdef docs(test): archive PU8 U9–U12 flags scaffolding report
Record default-off flag gates, unit evidence, and FEATURE-MATRIX partial status.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:42:49 +00:00
weichenandCursor 0611b1f24f feat(intentflow): wire U9–U12 ports and gated OwnerMux
Register dry-run adapters via BuildOwnerMux when independent flags are on;
U9 stub fail-closes on malformed/timeout/out-of-bounds without raising PlanTier.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:42:49 +00:00
weichenandCursor d860c6430e docs(ops): close full-backlog override checklist P1–P7
CI / go-vet-and-short-test (push) Failing after 0s
CI / backup-restore-drill (push) Failing after 0s
CI / web (push) Failing after 0s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:41:30 +00:00
weichenandCursor b015f8723f fix(docgov): keep invalid ReportJSON path when narrative flag off
Preserve prior ValidateChangeReportJSON error semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:41:30 +00:00
weichenandCursor 2b3302ece4 feat(workflow-design): SWBOOT ADR, project_type migration, patch deny stub
SWBOOT-10 remains stub-only pending secondary approval.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:56 +00:00
weichen f1d8f49df7 merge: feature/fav-u7-publisher-impl 2026-09-16 15:40:56 +00:00
weichen 0409e399d8 merge: feature/intent-plan-cards-playwright-impl 2026-09-16 15:40:56 +00:00
weichen 975af54fd6 merge: feature/pu8-u9-u12-flags-impl 2026-09-16 15:40:56 +00:00
weichen 5596ead7fd merge: feature/pu7-pi-narrative-impl 2026-09-16 15:40:55 +00:00
weichen 7583f109a1 merge: feature/pu6-semantic-summary-impl 2026-09-16 15:40:55 +00:00
weichenandCursor 6356fb5a8c docs(ops): mark FAV U7 incremental push complete
Feature branch pushed; still not merged to dev; fav subscriber remains OFF.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:38 +00:00
weichenandCursor 1cd1cddf64 feat(intent-plan): independent PU8 U9–U12 flags default off
Dry-run/fail-closed adapters; does not raise plan tier.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:26 +00:00
weichenandCursor 47376aeb84 feat(events): FAV publisher cmd stub gated off by default
Incremental U7; degraded read still approval-gated.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:26 +00:00
weichenandCursor d45a1eef75 test(web): intent-plan dual-tab Playwright acceptance gate
RUN_UI_ACCEPTANCE=1 required; no tier upgrade.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:26 +00:00
weichenandCursor e7e981356c feat(docgov): PI_CHANGE_REPORT_NARRATIVE gate with full fallback
Default off; malformed or risk downgrade forces deterministic report.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:25 +00:00
weichenandCursor 8fdf50ab2a feat(chat): SEMANTIC_SUMMARY_SHADOW optional deterministic annotate
Default off; unauthorized views skipped; facts preserved.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:25 +00:00
weichenandCursor de65cee96c docs(test): record FAV U7 incremental go/no-go evidence
Subscriber remains OFF until separate approval; document remaining FAV
port inventory and claim feature/fav-u7-publisher.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:10 +00:00
weichenandCursor 5392238354 chore(compose): pin FAV_DEGRADED_READ and publisher off
Document false defaults in all envs; main hardcodes both flags to false.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:10 +00:00
weichenandCursor 47a173e7bb feat(events): add fav subscriber and artifact-vault CLI stubs
Keep durable fav unregistered and fail-closed; CLI only prints status and
remaining-port inventory without destructive backfill/recover commands.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:10 +00:00
weichenandCursor 92d7a3d117 feat(api): add FAV vault status stub with gated publisher
Expose GET /api/v1/vault/status and only wire in-process Drain when
FAV_PUBLISHER_ENABLED is explicitly true; degraded read stays off by default.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:10 +00:00
weichenandCursor 3478a5a05a feat(config): add FAV vault flags defaulting off
Gate FAV_DEGRADED_READ and FAV_PUBLISHER_ENABLED behind explicit opt-in,
and refuse VAULT_STATE_ROOT colliding with runtime data/{env}.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:40:10 +00:00
weichenandCursor 56f6a66f2e docs(test): archive PU7 PI narrative acceptance report
Record flag-off and full-fallback evidence; sync CURRENT, matrix, and contract.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:39:54 +00:00
weichenandCursor 51568ea080 feat(web): distinguish change-report narrative vs factual fields
Panel and view-model label server risk/lineage separately from PI narrative;
add change_report_narrative_v1 helper aligned with typed-result patterns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:39:54 +00:00
weichenandCursor 18f2729472 feat(docrevision): add PI change-report narrative with flag-gated fallback
Introduce PI_CHANGE_REPORT_NARRATIVE (default off). When on, consume typed
narrative bound to input digest only; malformed/timeout paths fully fall back
without mixing fields or lowering server risk.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:39:54 +00:00
weichenandCursor 5493bf6108 docs(test): archive PU6 shadow report and mark matrix partial
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:37:50 +00:00
weichenandCursor d86528b45b test(chat): characterize semantic summary shadow and auth negatives
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:37:50 +00:00
weichenandCursor b7b880a316 feat(chatflow): authorize rolling summary and surface digest freshness
GenerateRollingSummary filters to authorized-visible messages; digest API
exposes shadow/freshness without enabling REPLACE.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:37:50 +00:00
weichenandCursor 209c997b22 feat(ctxmgr): add SEMANTIC_SUMMARY_SHADOW with deterministic fallback
Shadow evaluates a no-tool summarizer on caller-supplied messages; served
narrative stays deterministic and REPLACE remains unwired.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:37:50 +00:00
weichenandCursor 884e5dbf44 docs(ops): claim PU6 semantic summary shadow on chat mutex
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:37:50 +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
2616 changed files with 244634 additions and 23127 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"]
}
}
}
+2 -21
View File
@@ -1,25 +1,6 @@
---
description: 强制 Agent 文档同步与 ops 协作纪律;详情见 AGENTS.md
description: 任务分级、授权、文档与收口入口
alwaysApply: true
---
# Agent 文档同步(强制)
完整规范见 [AGENTS.md](../../AGENTS.md) 与 [PROJECT.md](../../PROJECT.md)。
## 开场必读
1. `AGENTS.md` → `PROJECT.md` → `.doc/README.md` → `.doc/ops/CURRENT.md` → `FEATURE-MATRIX` → short-term / handoff
## 红线
- 任务开始前:short-term/long-term + CURRENT 并行认领(mutex)
- 合 dev + 容器测:占用 CURRENT 集成槽位;他人 queue 等待
- 多 Agent 并行:worktree(`.worktrees/`);禁止 worktree 内 env-service start
- 禁止只改代码;done 任务 → `archive/ops/`
- 验收报告 → `.doc/test-reports/`;运行产物 → `test-reports/assets/`
- 禁止在 `.doc/` 根或 `docs/` 随意新建文档
## 状态
`planned | in_progress | blocked | done | cancelled`
遵循 [AGENTS](../../AGENTS.md) 的启动、任务分级与收口规则。写入文档前读 [文档地图](../../.doc/README.md);创建、集成、环境操作、清理前读 [操作规范](../../.doc/ops/2026-09-21-agent-worktree-workflow.md)。
+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/` 目录
+2 -20
View File
@@ -1,24 +1,6 @@
---
description: Git push 凭证自主读取;禁止向用户索要 token;详情见 AGENTS.md §8
description: 凭证与推送授权入口
alwaysApply: true
---
# Git Secrets 自主(禁止索要)
完整规范见 [AGENTS.md](../../AGENTS.md) §8 与 [PROJECT.md](../../PROJECT.md) §7。
## 本仓约定
- 凭证:`${HOME}/.secrets/gitea`
- 字段:`- ACCESS_TOKEN=`、`- URL_PREFIX=`
- 推送:优先 `./scripts/git-push-dev.sh <branch>`
## 禁止
- 向用户索要或要求粘贴 token
- 在聊天/文档/commit 中展示 secret
- 写入 git config 或提交到仓库
## 缺失时
在 `.doc/ops` 记 blocker(路径 + 缺字段),提示用户本机补齐后重试;**仍不索要内容**。
遵循 [AGENTS 安全与证据](../../AGENTS.md#5-安全与证据);授权推送的凭证和脚本入口见 [PROJECT](../../PROJECT.md#凭证与推送)。
@@ -1,60 +1,6 @@
---
description: 项目固定3分支模型(dev/test/main)、逐步渐进式提交规范与三套独立服务(知识库共享+对话与DB隔离)准则
description: 分支、原子提交与环境操作入口
alwaysApply: true
---
# Git 三分支流转与三套服务环境架构准则
本仓库严格遵循以下固定分支体系、提交拆分规范与多套独立服务运行准则:
## 一、 Git 固定三分支体系
1. **开发分支 (`dev`)**:
- **合入基线**,不是日常 commit 目标。
- **禁止**在 `dev` 上直接开发提交(含 docs/chore)。
- 一律从最新 `dev` 检出 `feature/<name>` 或 `fix/<name>`,在 feature 分支上渐进式提交;自测后占集成槽位,`--no-ff` 合回 `dev`,并删除临时子分支(见 [AGENTS.md](../../AGENTS.md) §6.2)。
2. **测试分支 (`test`)**:
- 当 `dev` 积累了一定的功能阶段后,合并至 `test` 分支,创建阶段候选节点 Tag(如 `rc-vX.Y.Z-beta.1`)。
- 用于较长时间的真实环境部署、全链路集成测试、运维稳定性检验。
- **严禁**在 `test` 分支进行开发或直接 commit。
3. **主分支 (`main`)**:
- 生产发布分支(Release)。
- **严禁**直接在 `main` 上开发或 commit!
- 只有 `test` 分支的代码经过实际运维和测试充分验证达到发布标准后,方可将对应验证节点合并回 `main` 分支,并打正式发布 Tag(如 `v1.0.0`)。
---
## 二、 任务拆分与渐进式提交规范 (Progressive Commits)
- **原子性拆分**:严禁把整个任务的大量改动揉合成一次庞大的提交。
- **阶段逐步提交**:一个任务必须按功能逻辑分层逐步提交:
1. `feat(db)` / `refactor(db)`: 数据表、模型、迁移脚本
2. `feat(agent)` / `feat(service)`: 业务逻辑、智能体执行流程
3. `feat(api)`: 接口路由与交互
4. `test(...)`: 单元测试与集成测试用例
5. `docs(...)` / `chore(...)`: 配置、运维脚本与文档同步
- **提交规范**:遵循 Conventional Commits (`feat`, `fix`, `refactor`, `test`, `docs`, `chore`, `ci`)。
---
## 三、 三套环境独立运行准则 (知识库共享 + 对话与DB隔离)
三套独立服务对应三个分支的运行态:
| 环境 | 分支 | Compose 项目 | HTTP 端口 | DB 端口 | 数据/对话路径 |
| :--- | :--- | :--- | :--- | :--- | :--- |
| **共享知识库** | 跨环境 | `agent-infra` | - | `5432` | `data/shared/kb` |
| **开发环境** | `dev` | `agent-dev` | `8080` | `5433` | `data/dev` |
| **测试环境** | `test` | `agent-test` | `8081` | `5434` | `data/test` |
| **生产环境** | `main` | `agent-main` | `8000` | `5435` | `data/main` |
### 核心约束:
1. **知识库共享**:
- 三套环境服务均通过共享网络或内网连接同一个知识库数据库(`shuimu-kb-shared:5432`)。
- 知识库法规、向量索引保持全局一致。
2. **对话数据与数据库隔离(红线)**:
- 各环境对话记录(Chat History)、Agent 思考工作区、审计事件及 SQLite/Postgres 业务库必须严格隔离!
- 严禁任何环境读取或写入其他环境的对话数据与业务库。
- 宿主机挂载目录严格区分:`data/dev/`、`data/test/`、`data/main/`。
分支/原子提交边界见 [AGENTS](../../AGENTS.md),环境拓扑见 [PROJECT](../../PROJECT.md)。创建、集成、环境写操作及清理按 [操作规范](../../.doc/ops/2026-09-21-agent-worktree-workflow.md) 执行。
+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`。
+18 -20
View File
@@ -1,12 +1,13 @@
---
description: 规定项目中所有自动化测试、功能测试、集成测试报告的存放路径与结构标准规范
globs: ["**/*test*.go", ".doc/test-reports/**/*.md"]
description: Cursor-side test report path/naming conventions; validation scope comes from the validation contract.
alwaysApply: true
---
# 测试报告规范准则 (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。运行模板、提示词和业务变更不属于此例外——按验证契约选层级。
## 一、 测试报告归档路径规范
@@ -15,11 +16,9 @@ alwaysApply: true
- 例如:`.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
# [功能/模块名称] 测试报告
@@ -28,38 +27,37 @@ alwaysApply: true
- 简述被测功能/特性的产生背景、业务痛点或上一轮测试中发现的缺陷与瓶颈。
## 二、 测试目标 (Test Objectives)
- 列举本次测试需要验证的核心功能点、质量指标(如通过率 100%、无流程卡点、非阻塞人机协同等)。
- 列举本次测试需要验证的核心功能点、质量指标。
## 三、 测试方案与环境 (Test Plan & Environment)
- 测试环境(OS、Go 版本、后端 Stub/Real 模型);
- 测试层级分层(单元测试、协同集成测试、CLI 真实交互测试);
- 测试环境(OS、工具版本、目标环境批准配置);
- 测试层级分层(按验证契约矩阵选行);
- 核心测试用例矩阵设计。
## 四、 预期结果 (Expected Results)
- 明确给出各用例输入下的理论判定分支、目标意图、提取槽位、参谋回复风格与状态机流转。
- 明确给出各用例输入下的理论判定。
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
- 必须包含针对每一个典型测试用例的真实记录:
- **测试输入 (Input)**
- **实际输出 (Actual Output)**:贴出真实的终端/日志输出文本
- **评价判定 (Evaluation / Verdict)**:PASS / FAIL 标志及判定依据
- **实际输出 (Actual Output)**:贴出真实的终端/日志输出文本(可脱敏)
- **评价判定 (Evaluation / Verdict)**:PASS / FAIL / SKIP / 未运行
- **性能与耗时 (Duration & Latency)**
## 六、 自动化测试套件汇总 (Test Suite Execution)
- 附带 `go test -v ./...` 全量回归测试输出与通过率统计。
- 只列本次适用并**实际运行**的检查与通过率;不无条件要求全量 `go test`。
- 工程工具改动优先 `python3 -B -m unittest discover -s scripts/tests -p 'test_*.py' -v`(见验证契约「工程工具验收补充」)。
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
- 总结测试是否达到上线/合并标准,提出后续演进或强化点。
- 总结测试是否达到授权交付终点,提出后续演进或强化点。
```
---
## 三、 执行要求与真实 Agent 交付铁律
1. **真实 Agent 交付铁律(红线)**:
- **开发实现阶段**:可以快速使用 `stub` 验证状态机、协议分流、数据落盘与逻辑契约,加速反馈;
- **交付前验收与测试报告生成**:**必须切回真实环境与真实 Agent(`pi-agent` + 实际运行的 `MiniMax-M2.7-highspeed` 容器)进行全链路端到端实测**;
- **严禁**使用 stub 的测试输出作为最终交付报告的验收数据。
2. **严禁散落存放**:测试报告统一归档至 `.doc/test-reports/` 目录下,禁止散落在根目录或临时沙箱中。
- **开发实现阶段**:可以快速使用 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` 取决于授权交付终点,不因会话结束自动完成。
+15 -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,13 +33,21 @@
| 我要… | 读这里 |
|--------|--------|
| 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) |
| 创建任务、集成、部署、清理 | [worktree 工作规范](ops/2026-09-21-agent-worktree-workflow.md) |
| 当前在做什么 | [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) |
| 架构设计 | [system-design/README.md](system-design/README.md) |
| 用错误码定位失败 | [错误码目录](system-design/2026-09-28-error-code-catalog.md) |
| 测试报告 | [test-reports/](test-reports/) |
| 历史功能设计 | [archive/design/superpowers/](archive/design/superpowers/) |
| Herdr 角色、审批与备援 | [ops/2026-09-13-herdr-agent-roster.md](ops/2026-09-13-herdr-agent-roster.md) |
@@ -57,9 +65,13 @@
## 文档生命周期
按 [AGENTS 任务分级](../AGENTS.md#2-任务分级与授权) 选择最小产物。下图是可选信息流,不要求每任务创建所有文件;小任务/有价值的只读审查可由一个主文档承载范围、结论、验证与交接。主文档先明确 task_id、owner、授权来源、状态和证据;跨阶段信息确需独立时才拆分并回链。
```text
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 纠挂完成前不得对现网开启。
@@ -2,7 +2,7 @@
## 状态
提议(2026-09-14;架构与实施计划已修订,等待用户确认后进入首个实现里程碑)
已接受(2026-09-14 提议;2026-09-18 确认——Phase 1 纵向绞杀与 Phase 2 持久事件交付已落地并验收,见 gap-matrix `DOC-RELIABILITY-PILOT` PASS、[Phase 1 计划](../remediation/2026-09-14-module-decoupling-refactor-plan.md)、[Phase 2 修订计划](../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)、[Track E 复盘](../ops/research/2026-09-15-track-e-retrospective.md))
## 背景
@@ -0,0 +1,63 @@
---
title: "D7 对话数据留存与删除口径(草案)"
status: proposed
created: 2026-09-17
updated: 2026-09-17
compliance: pending-compliance-signoff
owner: Cline
related:
- ../remediation/2026-09-16-partial-deferred-completion-plan.md
- ../ops/short-term/2026-09-16-partial-deferred-completion.md
- ../status/FEATURE-MATRIX.md
---
# ADR:D7 对话数据留存与删除口径
## 状态
**提议 / 工程草案**(2026-09-17)。数字与删除口径标 `pending-compliance-signoff`:合规签字或改数前,W7 仅允许数据分类盘点与现状审计,不得按未签字数字执行物理删除或备份清除。接受后状态改为 `accepted`。
## 背景
FEATURE-MATRIX「对话数据治理(D7)」为 `deferred`。收口计划 W7 要求:数据分类盘点 → 留存/删除口径落 ADR → 库/备份/日志控制 → 敏感字段加密边界。工程不能单方面定合规数字,但必须提供可审草案,避免无限期停在 deferred。Track E / R13 / R18 / R22 已对日志脱敏与销毁门禁有硬约束,本 ADR 将其固化为 D7 口径。
## 决策(建议默认;待合规确认)
### 1. 数据分类与留存
| 数据类 | 留存 | 说明 |
|--------|------|------|
| 会话正文(chat sessions/messages) | 热库 **365 天**(可配置) | 超期 soft-delete → 观察窗 → 物理清理 |
| 派生文档 / 私密文档 | 与聊天**独立周期**;回收站 **30 天**后物理清理 | 删除 UI 须说明影响范围(只删聊天 / 只删文档 / 两者) |
| 审计元数据(导出/治理审计) | **180 天** | 不可被普通用户删除覆盖 |
| Agent trace / workspace 非终态 | 任务结束后 **30 天**;nightly 仅合成数据 | 禁止当长期事实源 |
| 日志 / dead-letter / reconciliation | 不按正文留存;**只存 ID、digest、typed error code、allowlist 摘要** | Track E 红线 |
| FAV 终态制品 | `retention_class` + legal hold + delete ledger | 与聊天口径解耦 |
### 2. 删除路径
1. **用户删除**:soft-delete / tombstone → 观察窗 → 物理清理。
2. **备份清除**:须二次批准 + 精确 delete manifest;对齐销毁门禁 R22(完整备份恢复演练、migration corpus、FAV coverage、manifest、用户批准)。
3. **删除界面**:必须说明聊天源消息与派生文档的独立保留周期及本次操作影响范围。
### 3. 加密边界(首期)
- 首期范围:敏感字段**盘点** + 传输与备份访问控制。
- **不默认**上字段级加密;选型待合规确认与威胁模型后再立实现任务。
### 4. 违规升级
盘点确认当前基线违反已确认的安全或合规要求 → **立即**写入 [`gap-matrix.md`](../remediation/gap-matrix.md),不得继续当普通 backlog;本行 `done` 让位于整改。
## 后果
- W7 可按本草案启动盘点;物理删除与备份清除在 `pending-compliance-signoff` 解除前禁止按建议数字自动执行。
- 2026-09-17 只读盘点:[../audit/2026-09-17-d7-data-inventory.md](../audit/2026-09-17-d7-data-inventory.md)(未删数据、未升矩阵 done、未写 gap-matrix blocker)。
- 日志/DLQ/reconciliation 实现与审计须持续满足 Track E ID-only 红线。
- 合规改数后:更新本 ADR 数字表、`updated` 日期,并将 `compliance` 改为 `signed` / `accepted`;再开 W7 整改实现。
## 相关链接
- 收口计划 §7.1:[../remediation/2026-09-16-partial-deferred-completion-plan.md](../remediation/2026-09-16-partial-deferred-completion-plan.md)
- FEATURE-MATRIX D7 行:[../status/FEATURE-MATRIX.md](../status/FEATURE-MATRIX.md)
- Track E Phase 2:[../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md](../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
@@ -0,0 +1,609 @@
---
title: "个人工程中控台:实时项目看板与离线 HTML 快照"
type: feat
date: 2026-09-17
artifact_contract: ce-unified-plan/v1
product_contract_source: ce-plan-bootstrap
execution: code
---
> **已废弃(2026-09-17;2026-09-19 更新)**:旧版只读工程中控台代码已移除。后来短暂合入的 Control Center 也已移出本仓库,进度管理由独立项目承担。本文仅作历史证据保留。
# 个人工程中控台:实时项目看板与离线 HTML 快照
## Goal Capsule
为仓库所有者提供一个独立于产品后台的本地只读中控台。打开一个页面即可判断当前系统由什么组成、哪些任务正在计划或实施、真实分支和 worktree 在哪里、各环境实际运行了什么,并能在两次点击内到达对应的设计、审计、整改、任务和测试材料。
中控台同时提供两种输出:
1. `serve`:持续采集本地仓库、Git 和运行环境,提供自动刷新的 HTML 页面与机器可读 JSON;
2. `export`:基于同一份不可变快照生成单文件 HTML,便于归档、离线查看和交接。
这不是产品功能,不接入产品后台、产品数据库或产品权限体系;它也不是发布系统,不执行 Git、Docker、部署或文档写操作。
### 成功标准
- 在当前仓库规模下,首次可用页面目标为 2 秒内出现;慢数据源可随后标记为 `degraded`,不得拖垮整页。
- 正常情况下,本地文件、Git 或运行态变化在 5 秒内反映到新快照。
- 页面分别展示“文档声明、Git 实施、验证证据、环境实装”,不把任务文档的 `done` 翻译为已合并或已部署。
- 每个关键结论均显示来源、采集时间、新鲜度和可信类型;冲突保留双方证据,不静默选边。
- 在线模式检索 allowlist 内未截断的 Markdown 正文;离线导出同时给出 included、truncated 和 metadata-only 清单,二进制附件只索引路径、类型、大小和归属。
- 单文件 HTML 默认权限为 `0600`,可脱离仓库阅读已纳入 inclusion manifest 的 Markdown 正文,并醒目标出截断或仅元数据条目;不打包 `.doc/**/assets`。
- 任一采集源失败时仍可查看最近成功数据,并明确显示 `stale/error/last_success_at`。
---
## Product Contract
### 用户与使用场景
唯一主要用户是仓库所有者。典型使用包括:
- 每天开始工作时查看焦点任务、阻塞、集成槽和环境异常;
- 从模块进入设计、任务、测试和部署证据链;
- 判断某项工作究竟只是有计划、正在实现、已经验证,还是已在某环境实装;
- 查看本地分支、远端跟踪引用、ahead/behind、worktree 和未提交变更;
- 发现 `CURRENT`、功能矩阵、发布门禁、Git 与 Docker 之间的漂移;
- 导出一个自包含 HTML,作为某一时点的项目快照。
### 已确定的产品决策
#### PKD-1:独立本地工具
采用独立 Go CLI 和本地 Web 页面,不加入现有产品后台。
(session-settled: user-approved — chosen over product-admin integration: the console is for the repository owner’s local engineering management and the production image excludes `.doc` and `.git`)
#### PKD-2:只读实时页与离线快照共用数据模型
实时服务和导出文件必须由同一份版本化快照生成,避免在线页面与离线报告出现两套口径。
(session-settled: user-approved — chosen over a static-only report: the requested console must follow agent tasks and project state as they change)
### 核心需求
| ID | 需求 |
|---|---|
| R1 | CLI 默认解析当前 Git 仓库根,也接受显式 `--repo`;页面始终显示绝对根路径、当前分支、HEAD 和采集时间。 |
| R2 | 仅监听 `127.0.0.1`,不依赖产品容器、产品数据库或产品登录。 |
| R3 | 架构与模块页聚合 `module-boundaries.yaml`、系统设计索引和 `FEATURE-MATRIX`,展示模块、能力、依赖和证据链。 |
| R4 | 任务状态至少拆为 `doc_status`、Git facets、`verification_result`/`verification_freshness`、deployment facets;可并存事实不得压成单值枚举。 |
| R5 | Git 页展示本地/跟踪分支、ahead/behind、最近提交、worktree、dirty/untracked 和任务声明匹配情况;不得隐式 `fetch`。 |
| R6 | 部署页按 shared/dev/test/main 分别展示容器状态、应用 readiness、服务完整性、schema、镜像与 promotion receipt;不得计算未经定义的综合绿灯。 |
| R7 | 文档页支持按 taxonomy、状态、模块和关键词筛选,展示正文、正向链接、反向链接、broken、orphan 与 unindexed 状态;查询状态可通过 URL 恢复。 |
| R8 | 一个不可变快照包含 `schema_version`、`generation_id`、`revision_id`、`generated_at`、仓库/提交身份、来源状态、事实与冲突。 |
| R9 | 自动刷新采用完整快照原子切换;每个来源独立超时,失败时保留最近成功数据并标注过期。 |
| R10 | 每条关键事实标注 `declared`、`observed`、`verified` 或 `inferred`,并保留来源路径和采集时间。 |
| R11 | 单 HTML 内嵌结构化模型、页面资源和允许导出的 Markdown 正文;附件只保留元数据及相对链接,并显示内容覆盖清单。 |
| R12 | 对 Agent 暴露稳定的只读 JSON,而不是让 Agent 解析 HTML;JSON 与页面引用同一 `generation_id` 和 `revision_id`。 |
| R13 | TaskState 显示声明的 owner/Agent 类型/认领/mutex 与基于 Git 的最近活动证据;Herdr 工程 Agent 和产品 PI Agent Runner 使用不同类型。没有运行态来源时必须显示 unknown,不得把“已认领”写成“正在执行”。 |
| R14 | 文件、命令和 HTTP 均采用 allowlist;拒绝路径穿越、symlink 越界、原始 HTML 执行、远程资源加载和凭证读取。 |
### 事实源与权威边界
| 领域 | 权威来源 | 中控台处理方式 |
|---|---|---|
| 发布门禁 | `.doc/remediation/gap-matrix.md` | 只解释发布 blocker,不替代能力完成度。 |
| 能力成熟度 | `.doc/status/FEATURE-MATRIX.md` | 显示功能完成度,不据此推断是否部署。 |
| 当前焦点、认领、集成槽 | `.doc/ops/CURRENT.md` | 作为团队声明,与 Git 和运行态对账。 |
| 任务计划 | `ops/short-term`、`ops/long-term`、backlog front matter | 作为计划状态,不据此推断实现。 |
| 分支与 worktree | Git plumbing | 作为本地观测;远端状态注明“基于本地 refs,未联网刷新”。 |
| 环境运行态 | Docker/Compose 元数据与 `/ready` | 分开展示容器、应用与服务完整性。 |
| 验收证据 | `.doc/test-reports` 及 promotion receipts | 显示证据存在性与身份,不以文件名替代内容校验。 |
来源之间不设全局覆盖顺序。各来源回答自己的问题;值不一致时生成 drift,并并列展示原值、时间和来源。
### 用户流程
```mermaid
flowchart LR
Start[启动 serve 或 export] --> Root[解析显式 repo root]
Root --> Collect[并行采集文档 Git 运行态]
Collect --> Snapshot[构建不可变快照]
Snapshot --> Reconcile[按领域对账]
Reconcile --> Live[本地实时页面和 JSON]
Reconcile --> Export[单文件 HTML]
Live --> Refresh[定时生成下一快照]
Refresh --> Snapshot
```
总览默认优先显示 `in_progress`、`blocked`、`planned`、`partial/deferred`、drift 和 degraded。`done` 与 archive 默认收起,避免历史材料淹没当前工作。
任务详情按照以下证据链导航:
```mermaid
flowchart LR
Audit[audit 问题] --> Remediation[remediation 方案]
Remediation --> Task[任务声明]
Task --> Git[分支 worktree commit merge]
Git --> Test[测试与验收报告]
Test --> Deploy[环境 artifact 与 readiness]
```
显式 Markdown 链接和既定 taxonomy 属于强关系;仅由文件名或 slug 推断的关系标为“候选”,不得参与完成度计算。
### 状态模型
```mermaid
flowchart TB
D[doc_status: planned/in_progress/blocked/done] --> View[并列状态视图]
G[Git facets: branch/worktree/merge/cleanliness/ahead-behind] --> View
V[Verification: result + freshness + bound identity] --> View
P[Deployment facets: container/readiness/services/artifact identity] --> View
View --> Drift{来源是否一致}
Drift -->|是| Consistent[consistent]
Drift -->|否| Conflict[drift + 双方证据]
```
“实装”定义为存在可核对的环境观测证据,而不是任务文档为 `done`。容器可达但 artifact identity 无法核对时显示“运行可见、版本未验证”,不得提升为 verified deployment。当文档声明 healthy、Docker 显示异常而 `/ready` 为 ok 时,页面保留多值并标记 drift,不输出统一绿灯。
### 真实验收样本
1. rdev:存在调研、设计、任务与 backlog,但若没有 CURRENT 认领和真实分支,应显示“已计划、未认领、未实施、未实装”。
2. main 环境:若 CURRENT 声明整体 healthy,而 events 容器实际 restarting、应用 `/ready` 仍为 ok,应同时显示三项证据与 drift。
3. 本地 dev:若分支领先 `origin/dev`,必须显示“本地已具备、远端未确认可用”,不得写成已远程发布。
4. `system-admin-console`:作为产品管理后台能力,与本计划的个人工程中控台分开展示,名称和边界不得混淆。
### 安全与非目标
一期明确不做:
- 不写文档,不修改任务状态,不占用集成槽;
- 不创建、切换、合并、删除或推送 Git 分支;
- 不执行 `git fetch`,不调用远端托管平台 API;
- 不启动、停止、重建或部署容器;
- 不控制 Herdr 或向 Agent 派发任务;
- 不读取 `.env`、`.secrets`、Docker `Config.Env`、数据库数据或 `.git` 内部文件正文;
- 不加入产品 API、产品前端、产品数据库或生产镜像;
- 不执行 Markdown 原始 HTML、脚本、Mermaid 或远程资源。
后续候选包括跨快照历史、远端 CI/Gitea 聚合、受限 Markdown/Mermaid 渲染、Agent 查询 API 和修复建议。任何写操作继续保持在本工具之外。
---
## Planning Contract
### High-Level Technical Design
以下图示冻结边界和协议,不规定具体函数签名。
```mermaid
flowchart LR
Docs[.doc sources] --> DC[Document collector]
Git[Git/worktrees] --> GC[Git collector]
Run[Docker/ready/receipts] --> RC[Runtime collector]
DC --> Build[Snapshot builder]
GC --> Build
RC --> Build
Build --> Rec[Reconcile facts and conflicts]
Rec --> JSON[Read-only JSON]
Rec --> Web[Local HTML]
Rec --> File[Offline HTML]
```
```mermaid
sequenceDiagram
participant UI as Browser
participant C as Collection coordinator
participant S as Sources
participant P as Snapshot publisher
UI->>C: poll with revision_id
C-->>UI: current snapshot immediately
C->>S: singleflight collection with deadlines
S-->>C: facts or source error
C->>P: publish complete generation atomically
P-->>UI: new revision or not-modified
```
```mermaid
stateDiagram-v2
[*] --> Loading
Loading --> Fresh: first collection succeeds
Loading --> ErrorUnknown: first collection fails
Fresh --> Refreshing: TTL expires
Refreshing --> Fresh: new generation succeeds
Refreshing --> Stale: source fails and last-known exists
Stale --> Fresh: source recovers
ErrorUnknown --> Fresh: source first succeeds
```
### 技术决策
#### KTD-1:采用仓库内独立 Go CLI
新增 `cmd/engineering-dashboard` 与 `internal/engineeringdashboard`,复用仓库 Go 工具链但不导入产品业务包。Go 标准库足以提供本地 HTTP、资源嵌入、JSON、并发和原子文件输出;现有 `yaml.v3` 可用于已定义的 YAML 契约。
#### KTD-2:快照是唯一交付模型
采集器只生产事实,reconcile 层只生产派生状态和冲突,HTTP/API/export 只消费已完成的不可变快照。快照至少包含:
```text
schema_version, generation_id, revision_id, generated_at, collection_duration
repository { root, branch, head, dirty }
sources[] { name, status, observed_at, last_success_at, error }
facts[] { subject, field, value, provenance, source_ref, observed_at, confidence }
conflicts[] { subject, field, kind, fact_refs[] }
documents[], modules[], tasks[], git[], environments[]
```
`generation_id` 唯一标识一次采集,包含采集批次语义;`revision_id` 只由 schema、仓库身份和规范化的非易变事实、冲突、来源状态确定,明确排除 `generated_at`、`observed_at` 和采集耗时。HTML 与 JSON 必须展示同一对标识,HTTP ETag 和前端是否重绘使用 `revision_id`。一期不读取旧 schema 的外部 JSON;离线 HTML 自带对应 renderer,因此不依赖未来二进制迁移。
#### KTD-3:专用解析器与容错索引并存
对 CURRENT、FEATURE-MATRIX、gap-matrix、任务 front matter 和 module boundaries 编写契约化解析器。文档层只索引 promotion receipt 的路径与链接,结构化部署凭证由运行态采集器唯一负责。对其余 Markdown 只提取安全元数据、标题、正文与链接。专用解析器失败时保留原文入口并标记 degraded,不凭模糊规则编造状态。
#### KTD-4:命令执行采用固定 argv 和超时
Git 与 Docker 采集通过注入式 command runner 执行固定程序和分离 argv,不通过 shell 拼接。`--repo` 先转为绝对、symlink-resolved 的 Git 根并作为单个参数传递。每个来源默认 2 秒超时;错误输出做长度限制和敏感字段清理。Git 使用 porcelain/plumbing 输出,例如 `status --porcelain=v2`、`worktree list --porcelain`、`for-each-ref`、`rev-list`、`merge-base`。
#### KTD-5:一期采用短轮询,不引入持久数据库
服务端由单一采集协调器按 TTL 触发完整重采集,2–5 秒刷新;同一仓库最多一轮采集在途,请求只读取当前快照,不直接叠加扫描。每轮带单调 generation 序号和整轮 deadline,只有当前有效轮次能原子发布。页面使用 ETag/`revision_id` 避免重复传输。last-known 只在同一 `serve` 进程内有效;冷启动或单次 export 首次采集失败时显示 unknown/error,不伪造历史值。文件监听、SSE 通知、持久缓存和历史数据库均后置。
#### KTD-6:安全阅读优先于富渲染
在线详情页一期将 Markdown 全部作为纯文本安全转义,并保留换行和空白;标题、列表、链接、代码、图片和 Mermaid 均显示源码,不生成 HTML 节点或发起资源请求。静态导出内嵌同一正文和内部导航。所有文档 ID 都是规范化仓库相对路径,只允许 `.doc/**/*.md` 及明确列入 allowlist 的根 Markdown;读取前后都校验解析路径,直接拒绝 symlink,并对 `.git`、`.env*`、`.secrets`、`data` 等敏感路径执行最终目标 denylist。
#### KTD-7:导出为自包含、有限尺寸的证据快照
导出将模型、CSS、JS 和允许的 Markdown 正文写入单 HTML,采用临时文件加 rename 原子落盘,默认 `0600`。数据使用 HTML-safe JSON 或等价编码封装,正文只通过 `textContent`/DOM API 写入;CSP 禁止网络、外部资源和内联事件执行。默认只嵌入 Git tracked、allowlist 内的 Markdown;untracked Markdown 只列元数据,除非用户显式选择。导出前输出 inclusion manifest 与敏感模式告警;`.doc/**/assets`、数据库、构建产物和二进制报告不嵌入。
### 建议目录
```text
cmd/engineering-dashboard/
main.go
internal/engineeringdashboard/
model.go
collector.go
source_docs.go
source_git.go
source_runtime.go
reconcile.go
server.go
export.go
assets/
index.html
app.js
app.css
testdata/
docs/
git/
runtime/
scripts/
engineering-dashboard.sh
.doc/test-reports/
YYYY-MM-DD-engineering-dashboard-test-report.md
```
### 风险与缓解
| 风险 | 缓解 |
|---|---|
| 文档结构并不完全统一 | 只对 SSOT 和任务 front matter 使用严格契约;其余文档容错索引并暴露解析告警。 |
| 看板制造“假完成” | 多轴 facets、事实 provenance、验证身份绑定、冲突不覆盖、真实反例测试。 |
| Docker/Git 卡住或不可用 | 独立超时、并行采集、last-known 状态、degraded 页面。 |
| 文档 XSS 或路径穿越 | 纯文本渲染、HTML-safe 数据封装、CSP、路径 allowlist、拒绝 symlink、最终目标敏感路径 denylist。 |
| `.doc` 附件导致扫描/导出失控 | 默认跳过 assets 内容,只采集元数据;设置单文档和总正文上限并报告截断。 |
| 导出副本离开本机后 `0600` 不再提供保护 | 页面首部标明敏感快照、仓库身份和生成时间;输出 inclusion manifest,交接者自行控制接收者、保留期与删除。 |
| worktree 与主 checkout 混淆 | 只管理 `--repo` 指定/解析出的根,页面常驻显示根与 HEAD;其他 worktree 仅作为 Git 元数据。 |
| 本地 remote refs 被误认为远端实时状态 | 显示 refs 观测时间和“未联网刷新”,不自动 fetch。 |
| 与产品 `system-admin-console` 命名冲突 | CLI、包和文档统一使用 `engineering-dashboard` / “个人工程中控台”。 |
---
## Implementation Units
### U1:冻结快照、事实与状态契约
**目标**:先建立不会把计划、实现、验证、部署混为一谈的模型与测试夹具。
**覆盖需求**:R4、R8、R10、R12、R13;承接 PKD-2 的同源快照决策。
**依赖**:无。
**文件**:
- `internal/engineeringdashboard/model.go`
- `internal/engineeringdashboard/model_test.go`
- `internal/engineeringdashboard/testdata/**`
**实施要点**:
1. 定义版本化 `Snapshot`、`SourceState`、`Fact`、`Conflict`、`TaskState`、`AgentClaim`、`EnvironmentState`。
2. provenance 固定为 `declared|observed|verified|inferred`;freshness 固定为 `fresh|stale|error|unknown`。
3. 状态使用可组合 facets:Git 分为 branch/worktree/merge/cleanliness/ahead-behind;验证分为 result/freshness/subject identity;部署分为 container/readiness/services/artifact identity。
4. TaskState 保留 owner、agent kind、claim、mutex、声明分支、观测 worktree、最近活动时间及证据;声明与观测不可互相提升。
5. 建立 rdev、dev ahead、main events restarting、CURRENT/worktree 不匹配等夹具。
**测试场景**:
- 文档 `done` 但无 merge/deploy 时,Git 与部署 facets 不改变;
- `claimed` 但无可观测运行信号时,Agent 活动保持 unknown;Herdr 与产品 PI Runner 不共享类型;
- 同字段多来源不一致时生成 conflict 并保留所有 fact 引用;
- JSON round-trip 保留 schema 与 snapshot identity;
- 枚举未知值失败且错误可定位。
**完成证据**:模型测试通过,schema 示例落入 Go fixture,不存在页面专用的第二套状态类型。
### U2:实现文档图谱与领域解析器
**目标**:将 `.doc` taxonomy、模块、任务、测试和链接转换为可追溯文档图谱。
**覆盖需求**:R3、R7、R10、R11、R14。
**依赖**:U1。
**文件**:
- `internal/engineeringdashboard/source_docs.go`
- `internal/engineeringdashboard/docs_test.go`
**实施要点**:
1. 扫描 allowlist 内 Markdown,默认跳过任何 `assets` 目录正文;记录附件元数据。
2. 解析 front matter、标题、显式 Markdown 链接和反向链接。
3. 为 CURRENT、FEATURE-MATRIX、gap-matrix、任务文、module boundaries 和 test report 建立专用适配器;receipt 只在文档图谱中作为文档与链接,结构化解析归 U4。
4. 区分 `broken`、`orphan`、`unindexed`;slug 相似只形成候选关系。
5. 规范化路径并阻止 `..`、绝对路径和任何 symlink;最终目标再次应用扩展名 allowlist 与敏感路径 denylist。
**测试场景**:
- taxonomy 内文档可检索且反向链接正确;
- broken link 不导致整个索引失败;
- front matter 缺失或非标准时产生告警并仍可阅读;
- assets 不读正文,越界 symlink 被拒绝;
- rdev 文档链被发现,但没有被推断为已实现。
**完成证据**:文档索引能从 fixture 生成稳定 JSON,路径安全负例通过。
### U3:实现 Git 与 worktree 采集
**目标**:以只读 Git plumbing 形成可复现的分支、提交和 worktree 观测。
**覆盖需求**:R1、R4、R5、R10、R14。
**依赖**:U1。
**文件**:
- `internal/engineeringdashboard/source_git.go`
- `internal/engineeringdashboard/git_test.go`
**实施要点**:
1. 抽象 command runner,固定 argv、工作目录、超时和输出上限。
2. 收集当前分支/HEAD、dirty/untracked、local/remote-tracking refs、ahead/behind、merge-base 和 worktree。
3. 不执行 fetch;remote tracking ref 始终带本地观测时间与免责声明。
4. 对账任务声明的 branch/worktree,但不因路径名相似而认定一致。
**测试场景**:
- 本地分支领先 origin 时显示 ahead 且不显示“远端可用”;
- worktree 目录名与真实检出分支不一致时生成 drift;
- 命令超时、Git 不存在、非 Git 目录时单源 degraded;
- runner 记录中不存在 shell、fetch、push 或写命令。
**完成证据**:临时 Git 仓库集成测试和 fake runner 单元测试通过。
### U4:实现运行态与部署证据采集
**目标**:按环境独立呈现容器、应用 readiness、服务完整性、schema、镜像和晋升凭证。
**覆盖需求**:R4、R6、R10、R14。
**依赖**:U1。
**文件**:
- `internal/engineeringdashboard/source_runtime.go`
- `internal/engineeringdashboard/runtime_test.go`
**实施要点**:
1. 从仓库内批准的 Compose 静态配置和 allowlist labels 映射环境与服务;无法明确映射时显示 unknown,不用名称猜测。容器 JSON 只提取容器名、image/digest、状态、restart count、health,以及 allowlist 内的 Compose project/service labels;不复制 Env、Mounts、完整 NetworkSettings 或任意 labels。
2. 对 allowlist 中的本地 `/ready` 端点执行短超时、响应大小受限的请求;禁用重定向,或对每一跳重新校验 scheme、解析后 IP、端口和 host。
3. 解析 promotion receipt/candidate image 等仓库证据,保留 artifact identity。
4. 将 container health、app readiness、required-service completeness 分开建模。
**测试场景**:
- app ready 且 events restarting 时同时保留两项状态;
- Docker 不可用或 HTTP 超时时,其他数据源仍可输出;
- receipt 与容器 image 不一致时生成 deployment drift;容器可达但 identity 缺失时标记“运行可见、版本未验证”;
- readiness 重定向到外网或非 allowlist 本地端口时拒绝访问;
- 输出中不存在容器环境变量或凭证。
**完成证据**:fixture 和 fake HTTP/Docker runner 测试通过,main 分叉场景被覆盖。
### U5:实现对账、派生视图与新鲜度
**目标**:把来源事实组合成用户可判断的视图,但不替来源做未经定义的裁决。
**覆盖需求**:R3、R4、R6、R8、R9、R10、R13。
**依赖**:U2、U3、U4。
**文件**:
- `internal/engineeringdashboard/reconcile.go`
- `internal/engineeringdashboard/reconcile_test.go`
**实施要点**:
1. 按领域 SSOT 规则构建 module、task、environment 和 evidence-chain 视图。
2. 实现 conflict 分类:declared-vs-observed、task-vs-git、test-vs-subject、receipt-vs-runtime、stale-source、missing-evidence。
3. 快照构建期间每个来源独立记录 `observed_at`、持续时间和错误;成功后一次性发布。
4. 失败源只可复用同一 serve 进程的 last-known,并标注 stale、age 与 last-success;冷启动无缓存时为 unknown/error。过期数据不隐藏,但按年龄提升告警级别。
5. 测试报告只有在 commit/artifact identity 与当前 subject 对齐时才能派生 pass;身份缺失为 unbound,身份不匹配为 stale/drift。
**测试场景**:
- 三个真实样本得到预期多轴状态;
- 同一组输入顺序变化不改变规范化快照;
- 单源失败不会删除其他源,也不会重写 last-known 的观测时间;冷启动失败没有伪造 last-known;
- 旧测试报告、新 HEAD 与不同 image 不会派生当前验证通过;
- 恢复后 stale 自动清除并产生新 snapshot ID。
**完成证据**:reconcile table tests 覆盖一致、漂移、缺失、过期和恢复。
### U6:实现本地服务、总览与文档导航
**目标**:提供能快速判断异常并下钻证据的本地只读页面和 JSON。
**覆盖需求**:R1、R2、R3、R7–R10、R12–R14;承接 PKD-1 和 PKD-2。
**依赖**:U5。
**文件**:
- `internal/engineeringdashboard/server.go`
- `internal/engineeringdashboard/server_test.go`
- `internal/engineeringdashboard/assets/index.html`
- `internal/engineeringdashboard/assets/app.js`
- `internal/engineeringdashboard/assets/app.css`
- `cmd/engineering-dashboard/main.go`
**实施要点**:
1. `serve --repo <path> --addr 127.0.0.1:<port>`;一期无条件拒绝所有非 loopback 地址,包括通配、IPv6 非 loopback 和显式传入值。
2. 暴露 `/api/v1/snapshot`、`/api/v1/doc/<id>`、`/healthz`;所有接口只读。严格校验 Host/Origin/Fetch Metadata,不信任代理转发头;页面和 API 使用每次启动生成的不可预测访问令牌,降低 DNS rebinding 与跨站读取风险。
3. 页面分为总览、架构/模块、任务、Git、部署、文档和证据链。
4. 自动刷新完整快照,保留当前筛选、滚动位置、焦点和选中文档;ETag 未变化时不重绘。
5. 明确一级视图状态:initial loading、fresh empty、fresh success、partial/degraded with last-known、hard error without cache、refreshing、recovered。刷新中继续展示上一完整快照,直到下一版本原子替换。
6. 搜索覆盖标题、仓库相对路径、front matter 和未截断正文;不同维度用 AND、同一维度多选用 OR,默认先排当前任务和异常证据,再按匹配度与路径稳定排序。筛选、查询和选中文档写入 URL 参数,支持浏览器前进/后退与深链。
7. 桌面优先;窄屏下侧栏变为可关闭抽屉,宽表格保留可横向滚动的语义表头,详情区单列。所有功能可键盘完成,使用 landmark/标题/表格语义,drift/degraded 不只靠颜色表达,自动刷新通过非打断式 live region 报告且不抢焦点。
8. Markdown 正文只进入文本节点;在线页与导出页均设置限制性 CSP,不执行 HTML、脚本、SVG、远程 URL 或事件属性。
**测试场景**:
- 只监听 loopback,方法 allowlist 拒绝写请求;Host/Origin/token、DNS rebinding 和跨 Origin 负例被拒绝;
- HTML 与 JSON 的 generation/revision identity 一致;
- 文档 ID 越界、symlink 越界、未知 ID 返回安全错误;
- degraded source 在总览可见且页面仍可导航;
- 任务状态四轴、drift 和来源时间在浏览器中可见。
- 首次加载、空数据、无缓存错误、刷新、恢复状态可区分;键盘、焦点、语义结构、窄屏和非颜色告警验收通过。
- 搜索组合逻辑、排序、无结果、URL 深链和刷新后的视图保持通过。
**完成证据**:HTTP tests、基本无障碍检查和真实浏览器验收通过。
### U7:实现离线导出、启动脚本与治理文档
**目标**:生成安全、可携带、可追踪的单文件快照,并完成仓库治理接线。
**覆盖需求**:R1、R8、R9、R11、R14;承接 PKD-1 和 PKD-2。
**依赖**:U6。
**文件**:
- `internal/engineeringdashboard/export.go`
- `internal/engineeringdashboard/export_test.go`
- `scripts/engineering-dashboard.sh`
- `.doc/status/FEATURE-MATRIX.md`
- `.doc/ops/CURRENT.md`
- `.doc/test-reports/YYYY-MM-DD-engineering-dashboard-test-report.md`
**实施要点**:
1. `export --repo <path> --output <file>` 构建一次不可变快照并原子写入;首次采集失败的来源显示 unknown/error。
2. 以 HTML-safe JSON/等价编码内嵌允许的 Markdown 正文、索引和页面资源;附件保持元数据与相对链接,所有正文只写入文本节点。
3. 默认权限 `0600`,输出页显示生成时间、repo、HEAD、snapshot ID 和 degraded/drift。
4. 薄脚本只负责定位仓库与调用 Go CLI,不隐藏参数或执行安装/部署副作用。
5. 实施期间按仓库规范更新 CURRENT、FEATURE-MATRIX 和 test report;完成后再迁移任务生命周期状态。
**测试场景**:
- 导出文件脱离仓库后仍能搜索和阅读 Markdown;
- 导出中不含附件字节、绝对凭证路径、env 值或远程请求;`</script>`、事件属性、SVG、危险 URL scheme 和 Unicode 边界载荷不能逃逸数据上下文;
- 默认 tracked/untracked 与敏感模式策略、inclusion manifest 和覆盖清单符合契约;
- 采集部分失败时仍能导出并保留错误;
- 输出中 JSON/HTML snapshot identity 一致,权限符合预期;
- 大文档和总正文上限触发时明确标记截断。
**完成证据**:export tests、离线浏览器验收和治理文档回链完整。
---
## Verification Contract
### 自动验证
实施阶段至少运行:
```bash
go test ./internal/engineeringdashboard/...
go test ./cmd/engineering-dashboard/...
go vet ./...
go test -short ./...
git diff --check
```
涉及共享容器的只读验收也必须遵守 CURRENT 集成槽规则;中控台本身不得为测试启动、停止或重建共享容器。
### 契约验证矩阵
| 领域 | 必须证明 |
|---|---|
| 模型 | 计划、Git facets、验证、部署 facets 互不覆盖;Agent 声明和运行观测分离;所有派生结论可追溯到 facts。 |
| 文档 | taxonomy、全文检索、反链、broken/unindexed、路径安全与 assets 排除。 |
| Git | ahead/behind、worktree、dirty、local refs 新鲜度和无隐式 fetch。 |
| 部署 | container/app/service 三类信号分离,receipt/artifact 身份可核对。 |
| 降级 | 每个源超时、错误、stale、恢复都不会让整页不可用。 |
| 实时 | 变化在目标时间内形成完整新快照,不出现半新半旧卡片。 |
| 导出 | 单文件离线可读、默认 `0600`、不嵌 assets、不产生网络请求。 |
| 安全 | loopback、Host/Origin/startup token、read-only methods、命令 allowlist、路径边界、Docker 字段 allowlist、CSP 与输出脱敏。 |
### 浏览器验收
1. 从总览进入 rdev,确认“计划/实施/验证/实装”四轴与源文档链接均可见。
2. 在仓库外复制导出 HTML,断网打开并全文搜索、阅读至少一份设计与一份测试报告。
3. 制造 fixture 中的 CURRENT/Docker/readiness 冲突,确认页面保留多值且不出现综合绿灯。
4. 切换 fixture 快照,确认页面刷新后筛选条件和当前文档保持不变。
5. 尝试路径穿越、未知文档、POST、DNS rebinding、跨 Origin、readiness 重定向和含原始 HTML/脚本逃逸载荷的 Markdown,确认均不能越界、外联或执行。
### 性能与容量验证
- 记录当前 `.doc` 规模下的冷启动、增量刷新、JSON 大小和 HTML 导出大小。
- 建议一期门槛:UI shell 与来源状态在 2 秒内可交互,P95 完整快照重建不超过 5 秒,单源超时不超过 2 秒;基线不达标时必须记录实测并拆分后台正文索引,不能伪造 PASS。
- 导出达到配置上限时必须显式列出被截断文档,不允许静默丢失。
---
## Definition of Done
- [ ] `serve` 和 `export` 在显式仓库根下可重复运行,且没有产品后台依赖。
- [ ] 实时 HTML、离线 HTML 与 JSON 使用同一版本化快照契约。
- [ ] `generation_id` 标识采集实例,`revision_id` 标识内容版本并驱动 ETag;无内容变化不会触发重绘。
- [ ] 架构、模块、功能、任务、Git、部署、文档和证据链均可从页面访问。
- [ ] 计划、实施、验证、实装四轴独立,rdev、dev ahead、main events 分叉样本通过。
- [ ] Agent 认领与可观测活动分开,Herdr 工程 Agent 与产品 PI Agent Runner 不混称。
- [ ] 所有 drift、degraded、stale 都带来源和时间,不存在未经定义的综合绿灯。
- [ ] 默认 loopback、Host/Origin/startup token、只读命令、路径边界、脱敏、CSP 和 Markdown 安全测试通过。
- [ ] 首次加载、空数据、部分失败、无缓存失败、恢复、键盘、窄屏和 URL 深链验收通过。
- [ ] 导出 HTML 脱离仓库可读 Markdown,且不包含二进制 assets 或凭证数据。
- [ ] 单元、集成、全仓短测、浏览器验收和 `git diff --check` 均有真实输出。
- [ ] `.doc/test-reports` 报告回链任务文,FEATURE-MATRIX 与 CURRENT 按实际状态更新。
- [ ] 没有遗留调试入口、写操作按钮、未使用的替代模型或与产品后台重名的组件。
---
## Appendix
### 一期交付边界
一期交付:本地只读服务、版本化快照 JSON、架构/任务/Git/部署/文档视图、四轴状态、drift/degraded、全文搜索、安全文档阅读和单 HTML 导出。
后续评估:跨快照历史趋势、远端托管/CI 聚合、受限富文本与 Mermaid、跨仓库聚合、面向 Agent 的筛选查询 API。
永久排除:在页面中修改文档、切换或推送分支、控制 Agent、执行部署、读取密钥、成为产品后台模块。
### 方案依据
- `.doc/README.md` 定义的文档 taxonomy 与生命周期;
- `.doc/ops/CURRENT.md` 的焦点、认领、集成槽与环境声明;
- `.doc/status/FEATURE-MATRIX.md` 的模块完成度口径;
- `.doc/remediation/gap-matrix.md` 的发布门禁口径;
- `.doc/system-design/README.md` 与模块边界清单;
- Git/worktree、Docker/Compose、`/ready` 和 promotion receipts 的当前可观测能力。
@@ -0,0 +1,55 @@
---
title: "PU6 语义摘要 shadow(SEMANTIC_SUMMARY_SHADOW)"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
branch: feature/pu6-semantic-summary
worktree: ".worktrees/feature-pu6-semantic-summary"
mutex: chat
---
# PU6 语义摘要 shadow
## 目标
在授权可见消息集合上落地 `SEMANTIC_SUMMARY_SHADOW`(默认 off):shadow 语义摘要、失败回 deterministic 并标注 freshness;不启用 REPLACE。
## 范围
- `internal/ctxmgr/summarizer.go` + semantic shadow
- `internal/app/chatflow/` 授权过滤入口
- `internal/server/chat_digest_api.go` 出站 freshness/shadow 字段
- 单元/表征测试;测试报告
## 非目标
- 不启用 `SEMANTIC_SUMMARY_REPLACE`
- 不合入 `dev`
- 不改 plan 文件
## 步骤
1. [x] 从 `dev` 开分支 / worktree 并认领
2. [x] flags + 无工具语义摘要器 + rolling summary shadow
3. [x] chatflow 授权路径 + digest API
4. [x] 测试与报告
5. [x] 渐进提交并 push
## 验收标准
- [x] flag off 行为与基线一致
- [x] shadow on:仅 authorized 消息;失败保留 deterministic + freshness
- [x] injection 不能提权;REPLACE 路径未接线
- [x] 测试报告归档
## 相关链接
- Contract: `../long-term/2026-09-16-pu6-semantic-summary-contract.md`
- Test report: `../../test-reports/2026-09-16-pu6-semantic-summary-test-report.md`
## 证据 / 备注
- 分支:`feature/pu6-semantic-summary`(worktree)
- 测试:`go test -short ./internal/ctxmgr/ ./internal/app/chatflow/ ./internal/server/` PASS
@@ -0,0 +1,48 @@
---
title: "P5 PU8 U9–U12 独立 flag 脚手架"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/pu8-u9-u12-flags
worktree: /tmp/wt-pu8
mutex: intent-plan
---
# P5 PU8 U9–U12 独立 flag 脚手架
## 目标
为多意图扩面 U9–U12 落地独立 env flag(默认 OFF)与 stub/dry-run 端口,不升 `MULTI_INTENT_PLAN_TIER`。
## 范围
- `MULTI_INTENT_U9_SEGMENT` / `U10_MUTATE` / `U11_DOCGOV` / `U12_RUN_CONTROL`
- U9 segment proposal port + fail-closed stub
- U10–U12 dry-run adapters + `BuildOwnerMux` 门控
- 单测证明默认 off 与 enable 路径不 panic
## 非目标
- 真实 LLM 分段 / 升 tier / 合入 `dev`
- 真实 docgov/workflow 副作用写路径
## 步骤
1. [x] 独立 flags + `.env.example`
2. [x] segment proposal + expansion adapters + mux 门控
3. [x] Assemble `BuildOwnerMux` 接线
4. [x] 单测 + 测试报告
5. [x] push(不合 `dev`)
## 验收标准
- [x] 四 flag 默认 off;开 flag 不升 PlanTier
- [x] flag off ≡ legacy(无 LLM proposal、无新 adapters)
- [x] flag on:U9 fail-closed;U10–U12 dry-run/guarded
- [x] 报告归档
## 相关链接
- Contracts: [u9](../long-term/2026-09-16-pu8-u9-segment-proposal-contract.md) … [u12](../long-term/2026-09-16-pu8-u12-workflow-run-control-contract.md)
- Test report: [../../test-reports/2026-09-16-pu8-u9-u12-flags-test-report.md](../../test-reports/2026-09-16-pu8-u9-u12-flags-test-report.md)
@@ -0,0 +1,48 @@
---
title: "docgov 变更提案 HTTP + 前端接线"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/docgov-modification-proposal-http
worktree: .worktrees/feature-docgov-modification-proposal-http
mutex: docgov
---
# docgov 变更提案 HTTP + 前端接线
## 目标
暴露 `POST /api/v1/docgov/proposal`,前端「修改」快捷分支与 `ProposalConfirmCard` 走真实 propose/decide,不再本地假装成功。
## 范围
- API:`ProposeModification` 路由;decide 补 404/403 映射
- 前端:`docgov.ts` + `App.tsx` 接线
- 单测 + 真实 HTTP 证据
- 关闭 audit 缺口;dev 试点总开关证据归档
## 非目标
- 晋升 test/main
- 变更提案自动改写受控正文(批准后仍为 UI 演示增补)
## 步骤
1. [x] 实现 propose handler + 路由
2. [x] 前端 client + App 接线
3. [x] handler/client 单测
4. [x] 合入 dev + rebuild + 真实 HTTP
5. [x] push origin/dev;清理 author-only worktree
## 验收标准
- [x] `POST /api/v1/docgov/proposal` 可写库(单测)
- [x] 真实 HTTP claim → propose → decide PASS
- [x] audit 缺口 resolved;CURRENT 认领收敛
## 相关链接
- Audit: [../../audit/2026-09-17-docgov-modification-proposal-http-gap.md](../../audit/2026-09-17-docgov-modification-proposal-http-gap.md)
- Pilot: [../../test-reports/assets/2026-09-17-author-only-pilot/](../../test-reports/assets/2026-09-17-author-only-pilot/)
- Closeout: [../handoffs/2026-09-17-document-author-only-closeout.md](../handoffs/2026-09-17-document-author-only-closeout.md)
@@ -0,0 +1,53 @@
---
title: "修复 CreateOrGetDocument 可选职责 0→NULL FK"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: fix/docgov-optional-duty-null-fk
worktree: "-"
mutex: docgov
---
# 修复 CreateOrGetDocument 可选职责 0→NULL FK
## 目标
无 reviewer/approver 职责时创建文档账本成功,不再因 `reviewer_id=0` FK 失败并被标成 `INTERNAL_ERROR`。
## 范围
- `internal/docgov/engine.go`:`nullIfZero` 写入 author/reviewer/approver
- `internal/stream/classify.go`:`DOC_LEDGER_ERROR` 分型
- 回归测试 + audit/test-report
## 非目标
- 不强制项目配置 reviewer
- 不改前端 flushSync / 虚拟列表
- 不改项目 6417 存量数据(代码修好后重试即可)
## 步骤
1. [x] CreateOrGetDocument 0→NULL
2. [x] ClassifyError `DOC_LEDGER_ERROR`
3. [x] 单元/回归测试(`-short` 已绿)
4. [x] 占集成槽位 rebuild + 6417 复测(`run_1789625396102207018`,`doc_proj6417_intake` NULL FK)
5. [x] test-report 归档;合入 `dev`
## 验收标准
- [x] `go test -short ./internal/docgov/... ./internal/stream/...` PASS
- [x] 仅-author 项目 `CreateOrGetDocument` / 任务发起不再 `INTERNAL_ERROR`;`reviewer_id IS NULL`
- [x] 项目 6417 账本创建成功(full 职责路径未被本修复改动)
## 相关链接
- Audit: [../../audit/2026-09-17-docgov-optional-duty-null-fk.md](../../audit/2026-09-17-docgov-optional-duty-null-fk.md)
- Test report: [../../test-reports/2026-09-17-docgov-optional-duty-null-fk-test-report.md](../../test-reports/2026-09-17-docgov-optional-duty-null-fk-test-report.md)
## 证据 / 备注
- 失败 run:`run_1789622069585300787`
- 验证 run:`run_1789625396102207018` / `doc_proj6417_intake` author=9 reviewer/approver NULL
- merge:`e488d10 merge: fix/docgov-optional-duty-null-fk`
@@ -0,0 +1,47 @@
---
title: 文档编制人兼任审核批准方案
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Codex
branch: feature/document-author-only-plan
worktree: .worktrees/feature-document-author-only-plan
mutex: document-duty-policy-plan
---
# 文档编制人兼任审核批准方案
## 目标
基于当前源码形成管理员总授权、项目创建者逐文档选择的详细实施方案,交用户审核。
## 范围
权限、系统设置、工作流规划和冻结、文档三职、动作鉴权、状态机、前端、迁移与验收。
## 非目标
本次不修改业务代码、不变更数据库或共享容器、不推送。
## 步骤
1. [x] 阅读启动链并从本地 dev 建立隔离分支。
2. [x] 核查实现并记录证据。
3. [x] 编写方案、检查边界与验收覆盖。
## 验收标准
- [x] 方案覆盖用户两个权限层级及逐文档持久化。
- [x] 当前事实与拟议行为分开,列明实施单元与测试场景。
## 证据 / 备注
基线 dev adb48c8。已 fetch origin/dev,本地 dev 领先 44、落后 0,保留未推送集成成果;主工作区 feature/control-center-server 未切换。worktree 脚本默认从当前 HEAD 创建,故直接指定 dev 创建本 worktree,避免引入他人分支。
## 交付
- 方案:`.doc/remediation/2026-09-17-document-author-only-plan.md`
- 核查:`.doc/audit/2026-09-17-document-author-only-analysis.md`
- 本任务完成仅指方案交付,业务实现为 planned;R9/R10 待用户审核。
- 未合入 dev:方案保留在独立分支供审核;未推送、未修改业务代码或容器。
- 验证:源码与文档一致性检查、git diff --check;未执行业务测试。
@@ -0,0 +1,57 @@
---
title: "文档编制人兼任:U1 策略存储与总授权"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/document-author-only-plan
worktree: ".worktrees/feature-document-author-only-plan"
mutex: sysadmin + document-duty-policy
---
# 文档编制人兼任:U1 策略存储与总授权
## 目标
落地 `workflow.allow_author_only_approval` 管理员总开关:默认关闭、严格 bool、revision CAS、事务内审计,并向 projectinstance 提供可参与激活事务的窄读取接口。
## 范围
- Goose 增量迁移(revision 列、种子行、策略审计表)
- `internal/sysadmin` 存储/服务/窄 Policy 接口
- `admin_system_handlers` 对本 key 的 `expected_revision` 协议
- 单元 / PG / HTTP 负例测试
## 非目标
- 逐文档 duty_policy(U2)
- 前端设置页文案(U5)
- 已激活实例紧急熔断
## 步骤
1. [x] 认领 CURRENT
2. [x] 迁移 00050
3. [x] sysadmin CAS + 审计 + PolicySource
4. [x] admin handler
5. [x] 测试与提交
## 验收标准
- [x] 管理员可开关;非管理员 403
- [x] null/字符串布尔拒绝
- [x] 并发 CAS 仅一版成功
- [x] 审计失败回滚设置
- [x] 窄接口可读 allowed+revision;缺行默认 false;DB 故障不伪装
## 相关链接
- Plan: `.doc/remediation/2026-09-17-document-author-only-plan.md` U1
- Checklist:
## 证据 / 备注
- `go test ./internal/sysadmin/ ./internal/server/ -run 'Settings|AuthorOnly|PGSettings|AdminSystem'` PASS
- `go test -short ./internal/sysadmin/ ./internal/server/` PASS
- Key: `workflow.allow_author_only_approval`
- 窄接口: `sysadmin.AuthorOnlyPolicySource`
@@ -0,0 +1,54 @@
---
title: "文档编制人兼任:U2 逐文档模式与激活"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/document-author-only-plan
worktree: ".worktrees/feature-document-author-only-plan"
mutex: projectinstance + document-duty-policy
---
# 文档编制人兼任:U2 逐文档模式与激活
## 目标
落地逐文档 `duty_policy=author_only`:规划校验、预览摘要、激活 token 绑定策略 revision,激活事务内行锁串行化关闭总开关。
## 范围
- DocTaskPlan / PreviewSummary / ProjectSettings 扩展
- ResolveDocTaskDuty、Save/Preview/Activate 消费 U1 策略
- Goose 00051 token revision 列
- app 适配器装配、HTTP 错误码映射
- 单元测试
## 非目标
- Heal/文档投影(U3)
- 前端 UI(U5)
- 运行时动作多职责(U4/U6)
## 步骤
1. [x] 类型与解析器
2. [x] service/store/迁移
3. [x] app 装配与 handler
4. [x] 测试与提交
## 验收标准
- [x] 一位成员兼任可存/预览/激活(总开关开)
- [x] 总开关关时 Save 拒绝
- [x] 预览后 revision 变化旧 token 409
- [x] 未开模式只填作者仍 partial 拒绝
- [x] 旧快照缺 duty_policy 时 hash 稳定
## 相关链接
- Plan: `.doc/remediation/2026-09-17-document-author-only-plan.md` U2
## 证据 / 备注
- `go vet ./internal/projectinstance/ ./internal/app/ ./internal/server/`
- `go test -short ./internal/projectinstance/ ./internal/server/ ./internal/app/` PASS
@@ -0,0 +1,55 @@
---
title: "文档编制人兼任:U3 文档绑定与职责投影"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/document-author-only-plan
worktree: ".worktrees/feature-document-author-only-plan"
mutex: docgov + docduty + bizdev + document-duty-policy
---
# 文档编制人兼任:U3 文档绑定与职责投影
## 目标
生成时写入实例治理职责并 `duty_locked`;heal/revoke 跳过锁定行;读侧投影 `duty_policy`。
## 范围
- Goose 00052:`document_records.duty_locked` / `duty_policy`
- `docgov.LockDocumentDuty` + 列表投影
- `docduty` heal/revoke `AND NOT duty_locked`
- `bizdev.InstanceDutySource` + `resolveTaskDocumentDuties` 治理分支;跳过 governed 内存 heal
- `app/instance_duty_adapter.go` 装配
## 非目标
- U4 动作鉴权 / allowed_actions
- U5/U6 前端
- 合入 `dev`
## 步骤
1. [x] 迁移
2. [x] docgov / docduty
3. [x] bizdev + app 适配器
4. [x] 测试与提交
## 验收标准
- [x] 受治理文档创建后 `duty_locked=true` 且三职来自实例
- [x] heal/revoke 不清锁定行(SQL 过滤 + 单测/PG 可选)
- [x] 生成后 governed 路径不再用项目默认覆盖内存态
- [x] 模块边界:bizdev/docduty/docgov 不导入 projectinstance
## 相关链接
- Plan: U3(文档绑定与职责投影一致性)
- 依赖:U1 `3b6def2`、U2 `c03d0a3`
## 证据 / 备注
- `go vet ./internal/docgov/ ./internal/docduty/ ./internal/bizdev/ ./internal/app/ ./internal/projectinstance/`
- `go test -short` 上述包 PASS
- PG:`TEST_DATABASE_URL` 未配置时 `Heal/Revoke SkipsDutyLocked` 自动跳过
@@ -0,0 +1,47 @@
---
title: "文档编制人兼任:U4 动作鉴权与审计"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/document-author-only-plan
worktree: ".worktrees/feature-document-author-only-plan"
mutex: projectinstance + docgov + document-duty-policy
---
# 文档编制人兼任:U4 动作鉴权与审计
## 目标
ABAC 门禁识别 `duty_policy=author_only` 派生职责;审计 Details 携带 duty_policy。
## 范围
- `duty_action` / `stage_access` / `gate` 改用 `ResolveDocTaskDuty`
- `state_machine` Transition* Details 补 `duty_policy`
- author_only 动作矩阵与阶段可见性测试
## 非目标
- U5 UI / U6 浏览器闭环
## 步骤
1. [x] ABAC 三文件
2. [x] 审计详情
3. [x] 测试与提交
## 验收标准
- [x] author_only 规范存储(仅 Author ID)下 A 可 run/edit/submit/review/approve
- [x] 非 A 拒绝;阶段门禁将 author_only 视为 approvalManaged
- [x] 审计 Details 含 duty_policy
## 相关链接
- Plan: U4+U5 实施计划
- 依赖:U1–U3
## 证据 / 备注
- `go test -short ./internal/projectinstance/ ./internal/docgov/ ./internal/app/ ./internal/server/` PASS
@@ -0,0 +1,48 @@
---
title: "文档编制人兼任:U5 系统设置与逐文档 UI"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/document-author-only-plan
worktree: ".worktrees/feature-document-author-only-plan"
mutex: web + document-duty-policy
---
# 文档编制人兼任:U5 系统设置与逐文档 UI
## 目标
前端识别 `duty_policy` / `author_only_policy`;项目设置可逐文档开启兼任。
## 范围
- `projectSettings.ts` 类型
- `projectSettingsDuties.ts` resolveClientDocTaskDuty + 校验
- `ProjectSettingsModal` 兼任勾选与预览
- SettingsSection 不改(白名单通用渲染)
## 非目标
- U6 多职责动作栏 / 浏览器 E2E
## 步骤
1. [x] 类型与 lib
2. [x] UI
3. [x] 测试与提交
## 验收标准
- [x] author_only 客户端校验通过且不计三人门槛
- [x] 总开关关闭时兼任勾选禁用并提示
- [x] 预览展示兼任文档计数
## 相关链接
- Plan: U4+U5 实施计划
## 证据 / 备注
- `npx tsc --noEmit` PASS
- `npm test` PASS(含 projectSettingsDuties author_only 用例)
@@ -0,0 +1,55 @@
---
title: "文档编制人兼任:U6 多职责动作与真实闭环"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/document-author-only-plan
worktree: ".worktrees/feature-document-author-only-plan"
mutex: web + document-duty-policy
---
# 文档编制人兼任:U6 多职责动作与真实闭环
## 目标
去掉 author-first 动作短路,把认领/送审/审核/批准接到真实 docgov HTTP,完成 author_only 端到端验收。
## 范围
- `web/src/api/docgov.ts` 四接口客户端
- `docGovActionVisibility` / `holdsDocDuty`
- `App.tsx` 真实 handler + 快捷指令
- `duty_policy` 透传与「编制人兼任」徽标
- 单测 + 真实闭环报告
## 非目标
- 变更提案 HTTP 路由(另记 audit)
- 合入 `dev` / 推送远端(未授权不推)
## 步骤
1. [x] API 客户端
2. [x] ID 直判可见性
3. [x] App 接线 + 驳回批准修正
4. [x] duty_policy 徽标透传
5. [x] 单测 / tsc
6. [x] 真实闭环与报告
## 验收标准
- [x] author_only 下 A 可见三动作;非 A 403
- [x] 真实 API 闭环写库与审计含 duty_policy
- [x] 浏览器可见「编制人兼任」徽标
- [x] 测试报告归档
## 相关链接
- Test report: [../../test-reports/2026-09-17-document-author-only-u6-test-report.md](../../test-reports/2026-09-17-document-author-only-u6-test-report.md)
- Remediation U6: [../../remediation/2026-09-17-document-author-only-plan.md](../../remediation/2026-09-17-document-author-only-plan.md)
## 证据 / 备注
- `npm test` 390 pass;`tsc --noEmit` clean
- assets: `test-reports/assets/2026-09-17-document-author-only-u6/`
@@ -0,0 +1,41 @@
---
title: "首次加载性能诊断与改进方案"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Codex
branch: feature/initial-load-performance-plan
worktree: .worktrees/feature-initial-load-performance-plan
mutex: loading-performance-audit
---
# 首次加载性能诊断与改进方案
## 目标
以源码、现有容器静态资源和只读浏览器测量定位首次加载瓶颈,输出可审核的分期改进方案。
## 范围
登录前首屏、登录后初始化、项目/文档首次打开、静态资源交付;区分事实与待验证假设。
## 非目标
不修改业务代码,不重启/重建共享服务,不触发真实对话或文档写任务,不提交或推送其他人的工作。
## 步骤
1. [x] 阅读仓库启动链;独立 dev 基线 worktree,主仓保留其他 Agent 分支。
2. [x] 采集数值基线和源码证据。
3. [x] 写 audit 和 remediation,同步 CURRENT,归档任务。
## 验收标准
- [x] 原因有文件位置或运行时测量支持,未覆盖环境明确标注。
- [x] 方案包含优先级、改动边界、性能预算、回归门禁和回滚。
## 证据 / 备注
仅诊断与方案,不代表优化已实施。fetch 后 origin/dev 落后本地 dev;不拉回或覆盖本地工作。worktree 从创建瞬间的 dev 建立。
## 交付
- 诊断:`.doc/audit/2026-09-17-initial-load-performance-audit.md`
- 方案:`.doc/remediation/2026-09-17-initial-load-performance-plan.md`
- 报告:`.doc/test-reports/2026-09-17-initial-load-performance-baseline.md`
- 本轮仅方案;没有业务代码、没有部署、未提交、未合dev、未推送。主仓仅同步本任务认领。
- 临时3199 Vite已停止;既有3100/8080/8081未重启。未占集成槽。
@@ -0,0 +1,55 @@
---
title: "修复 KB 宿主机错误口令与静默离线降级"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: fix/kb-host-auth-layered-load
worktree: "-"
mutex: infra
---
# 修复 KB 宿主机错误口令与静默离线降级
## 目标
消除 `config.Load("")` 只读 `configs/.env.dev`、忽略根 `.env` 的 `KB_DB_PASSWORD` 导致的错误默认口令与静默离线;E2E/nightly 默认 fail-closed。
## 范围
- `internal/config` 分层加载 + 宿主机 DNS 归一化 + 空默认口令
- `internal/kb` 脱敏日志、`Online()`、`KB_REQUIRE_ONLINE` / `KB_ALLOW_OFFLINE`
- `/health` 增加 `kb_ready`
- PI E2E helper 与 `scripts/run-nightly-real-pi.sh` 预检
- env 模板与验收报告
## 非目标
- 不改 KB 数据内容 / 法规迁移
- 不把真实口令写入 git 跟踪的 `configs/.env.*`
- 不把容器内 DNS 改成 localhost
## 步骤
1. [x] 分层 Load + 默认口令清空
2. [x] NormalizeKBHostForRuntime
3. [x] kb 客户端脱敏 + RequireOnline(EnsureOnline;不 Fatalf)
4. [x] health `kb_ready` + E2E/nightly 门禁
5. [x] 合入 `dev` 冒烟(rebuild + `/health` `kb_ready=true`)
## 验收标准
- [x] `config.Load("")` 分层合并后口令来自根 `.env`(单测临时文件 + live 布尔校验)
- [x] 宿主机 `shuimu-kb-shared` → `127.0.0.1`;容器内保留 compose DNS
- [x] 错口令/空口令离线且日志无明文密码;`KB_ALLOW_OFFLINE=1` 可降级
- [x] 合 `dev` 后 short 测 PASS;dev rebuild 后 `kb_ready=true`,日志 `online=true dsn=...:***@shuimu-kb-shared...`,无 `shared_kb_secret_pass`
## 相关链接
- Test report: `.doc/test-reports/2026-09-17-kb-host-auth-layered-load-test-report.md`
- Plan: 修复 KB 连接降级
## 证据 / 备注
根因:`Load` 优先单文件 `configs/.env.dev`(故意省略 `KB_DB_PASSWORD`),保留错误默认 `shared_kb_secret_pass`;Compose 本已分层,宿主机 `go test` 未对齐。
合入后容器日志:`[kb] online=true dsn=postgres://regkb:***@shuimu-kb-shared:5432/regulations?sslmode=disable`;health `kb_ready=true`。
@@ -0,0 +1,57 @@
---
title: "rdev 模板深度补强 S1 续批(剩余 46 份)"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/rdev-template-depth-s1-continued
worktree: ".worktrees/feature-rdev-template-depth-s1-continued"
mutex: rdev-templates
---
# rdev 模板深度补强 S1 续批(剩余 46 份)
## 目标
将剩余 46 份 `rd_*` 模板按写作规范做同等深度补强,lint allowlist 扩至全 60 份,抽样真 PI 打样收口。
## 范围
- 批1:6 份评审记录
- 批2:阶段06 硬件/工艺 8 份
- 批3:阶段06 软件/检验/技术要求+清单 9 份
- 批4:阶段08 验证 12 份
- 批5:阶段10–13 转换/确认 11 份
- lint allowlist + 抽样真 PI + 文档同步
## 非目标
- S2/S3、P2 前端、P3 三样本全量 E2E、P4 键名空间化
- 晋升 test/main
## 步骤
1. [x] 批1 评审记录 6 份
2. [x] 批2 硬件/工艺 8 份
3. [x] 批3 软件/检验/清单 9 份
4. [x] 批4 验证 12 份
5. [x] 批5 转换/确认 11 份
6. [x] 抽样真 PI + 文档同步(合入 push 见 merge 步骤)
## 验收标准
- [x] 46 份无「按本阶段专业结构写」;lint allowlist 60/60
- [x] 抽样 1–2 份真 PI PASS(`rd_planning_review` + `rd_design_vv`,项目 6446)
- [x] FEATURE-MATRIX / 写作规范 / backlog 已更新
## 相关链接
- Backlog: [.doc/backlog/2026-09-17-rdev-phase2-backlog.md](../../backlog/2026-09-17-rdev-phase2-backlog.md)
- 写作规范: [.doc/system-design/project-workflow/08-rdev模板写作规范.md](../../system-design/project-workflow/08-rdev模板写作规范.md)
- 首批报告: [.doc/test-reports/2026-09-17-rdev-template-depth-test-report.md](../../test-reports/2026-09-17-rdev-template-depth-test-report.md)
- 续批报告: [.doc/test-reports/2026-09-17-rdev-template-depth-s1-continued-test-report.md](../../test-reports/2026-09-17-rdev-template-depth-s1-continued-test-report.md)
## 证据 / 备注
- 资产:`.doc/test-reports/assets/2026-09-17-rdev-template-depth-s1-continued/`
- 附带:`fix(projectinstance): allocate next instance_no for planning drafts`
@@ -0,0 +1,54 @@
---
title: "rdev 模板深度补强 S0 + S1 首批"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/rdev-template-depth
worktree: ".worktrees/feature-rdev-template-depth"
mutex: rdev-templates
---
# rdev 模板深度补强 S0 + S1 首批
## 目标
修复 rdev leader prompt 错配,并为阶段 01–05 的 14 份 rdev 模板补齐 ISO 13485 专业章节与逐节写作指令,以 dev 真实 PI 打样验证收口。
## 范围
- S0.1 B1:`rdev_leader.md` + InstructionsFile 注入链
- S0.2:`rd_design_input_spec` 样例 + 写作规范 + lint
- S0.3:dev 真实 PI 打样
- S1 首批:阶段 01–05 共 14 份模板(分 3 批)
## 非目标
- overlay 机制本体、R1–R7 二期、per-stage 步骤定制、模型配置化、manifest 元数据、前端(P2)、键名空间化(P4)、阶段 06–13 模板
## 步骤
1. [x] S0.1 leader prompt 注入链(`6a09062`)
2. [x] S0.2 样例模板 + 规范 + lint(含于 `eb09b21`)
3. [x] S0.3 真实 PI 打样(项目 6424 intake + 6425 `rd_design_input_spec`)
4. [x] S1 批 1–3(`eb09b21`)
5. [x] 文档与门禁
## 验收标准
- [x] rdev leader AGENTS.md 含「设计控制」且不含「商务对接负责人」「CDO」
- [x] intake leader 回归仍含「商务对接负责人」
- [x] 14 份模板 lint 绿灯;真 PI 终稿五节实质论证
- [x] `go vet` + `go test -short` 全绿
## 相关链接
- Test report: [.doc/test-reports/2026-09-17-rdev-template-depth-test-report.md](../../test-reports/2026-09-17-rdev-template-depth-test-report.md)
- Assets: [.doc/test-reports/assets/2026-09-17-rdev-template-depth/](../../test-reports/assets/2026-09-17-rdev-template-depth/)
- Backlog: [.doc/backlog/2026-09-17-rdev-phase2-backlog.md](../../backlog/2026-09-17-rdev-phase2-backlog.md)
- 写作规范: [.doc/system-design/project-workflow/08-rdev模板写作规范.md](../../system-design/project-workflow/08-rdev模板写作规范.md)
## 证据 / 备注
- 依赖 `feature/rdev-core`(尚未合 dev);合入前需 rebase 丢弃已进 dev 的 engineering-dashboard 重复提交。
- 真 PI:`run_1789635054471569201`(intake ~220s);`run_1789635960880707641`(DI ~450s,`stage=RD03_design_input`)。
@@ -0,0 +1,70 @@
---
title: "研发工作流(rdev)接入:13 阶段 / 60 文档任务"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: fix/docgov-stage-dynamic → feature/rdev-core
worktree: "-"
mutex: workflow-def
---
# 研发工作流(rdev)接入:13 阶段 / 60 文档任务
## 目标
在现有 5 个正式工作流外新增医疗第 4 工作流「研发设计控制流程」(key: `rdev`),完整承载参考项目 13 phase / 60 文档任务的 ISO 13485 DHF 设计控制链,并通过真实 PI 验收;随后完成全工作流任务键命名空间化(P4)。
## 范围
- 方案:[07-研发工作流rdev接入-设计与实施计划](../../system-design/project-workflow/07-研发工作流rdev接入-设计与实施计划.md)(P0–P4 五期;§8 四项决策已确认)
- P0:docgov Stage 去硬编码 + stage key 透传
- P1:rdev.v2.json manifest(13×60 一次到位)+ 60 份 rd_ 前缀模板 + catalog/seed/registry + squad kind 编排 + main-completed precheck + 齐套测试 + stub PG 全链路
- P2:前端激活规划/切换/前置 Banner + intent 文档名匹配 + prior docs 注入与血缘
- P3:真实 PI Agent E2E(rd_proposal / rd_planning_review / rd_sw_plan 三样本)+ CI 门禁扩四
- P4:现有工作流(main/pm/tm + 软件两盘点)任务键 `bd_`/`pm_`/`tm_`(`sw_`)空间化,alias 兼容式改名(D12),独立分支独立验收
## 非目标
- 二期增强全部移入 backlog:[2026-09-17-rdev-phase2-backlog](../../backlog/2026-09-17-rdev-phase2-backlog.md)(N/A 不适用页生成、UR/RS 结构化门禁、kind 专用门禁、depends_on 精确血缘、DMR 归档、sw_ 键盘点、complexity regulatory 注入)
- 云盘 canonical DHF/DMR 归档(本仓库无云盘模块)
- 软件域(non_medical_software)开放 rdev
## 步骤
1. [x] 用户确认方案 §8 四项决策(2026-09-17:名称「研发设计控制流程」/ 60 任务一次到位 / N/A 规划期关闭 + backlog / rd_ 前缀并扩展到现有工作流键名空间化)
2. [x] P0 分支 `fix/docgov-stage-dynamic`(StageKey 透传;已叠入 `feature/rdev-core`)
3. [x] P1 分支 `feature/rdev-core`(manifest/模板/seed/编排/precheck/齐套测试)
4. [ ] P2 分支 `feature/rdev-web-governance`(前端 + intent + 血缘)— **骨架已定,待独立认领**
5. [ ] P3 真实 PI 验收 + 报告归档 + FEATURE-MATRIX 更新 — **骨架已定,待独立认领**
6. [ ] P4 分支 `feature/workflow-key-namespace`(D12 alias 兼容式改名 + 双路径回归)— **骨架已定,待独立认领**
## 验收标准
- [x] `go vet ./...` && `go test -short` 相关包 PASS(P0+P1)
- [x] 齐套断言:manifest 60 任务 ↔ `templates/docs/rd_*.md` 存在非空;rd_ 键与既有任务键不相交
- [x] precheck:main 未 completed 时 rd 任务启动被拒且文案含 CDO
- [ ] PG 集成:rdev 实例 planning→live→推进(`TestPG_RDevActivateWithNAClose`,需 `TEST_DATABASE_URL`)
- [ ] web `npm test && npm run build` PASS;Playwright 抽检激活/推进(P2)
- [ ] 真实 PI + MiniMax 三样本 E2E 报告归档 `.doc/test-reports/`(P3)
- [ ] P4:旧 live 实例(旧键)+ 新实例(新键)双路径回归 PASS;全工作流任务键集合无交集
## 相关链接
- 设计方案: [07-研发工作流rdev接入-设计与实施计划](../../system-design/project-workflow/07-研发工作流rdev接入-设计与实施计划.md)
- 参考调研: [2026-09-17-rdev-workflow-reference-analysis](../research/2026-09-17-rdev-workflow-reference-analysis.md)
- 二期 backlog: [2026-09-17-rdev-phase2-backlog](../../backlog/2026-09-17-rdev-phase2-backlog.md)
- Checklist: -
- Handoff: -
- Test report: -
## 证据 / 备注
- 参考项目:`.refs/weichen-agent-system`(configs/workflows/rdev.yaml 60 stage、templates/docs 60 模板、squads/overlays 配套)
- 关键约束:WF-DEF-06(无流程级依赖,precheck 先例 test_manager);doc_id `doc_proj{pid}_{taskKey}` 平铺命名 → rd_ 前缀
## 合入说明(2026-09-17)
- P0+P1 已 `--no-ff` 合入本地 `dev`(含 template-depth S0+S1)。
- P2/P3/P4 仍 planned,待独立认领。
@@ -0,0 +1,39 @@
---
title: "W4 PU8 U9–U12 独立 flag live"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor
branch: feature/w4-u9-segment-live
worktree: "-"
mutex: intent-plan
---
# W4 PU8 U9–U12 独立 flag live
## 目标
U9 真实 LLM proposer(规则能切则不出 proposal);U10–U12 各自独立 flag 的 dry-run→confirm 证据;不升 `MULTI_INTENT_PLAN_TIER`。
## 范围
- `PiSegmentProposer` + 规则门 + 组合根接线
- U10 mutate 幂等 dry-run receipt;U11 项目 143 只读;U12 run-control 独立 flag
- 四份独立 test-report
## 非目标
- 不升 `confirm` / `full`
- 不把 U10–U12 dry-run 写成领域 live 写
## 步骤
1. [x] U9 PI proposer + 规则门
2. [x] U10–U12 分 flag 证据
3. [x] 合 `dev` + 矩阵升 done
## 验收标准
- [x] 真实 MiniMax U9
- [x] 负例 malformed/timeout/OOB/规则已切
- [x] PLAN_TIER 仍 legacy
@@ -0,0 +1,40 @@
---
title: "功能启用与文档修改影响分析调研"
status: done
created: 2026-09-20
updated: 2026-09-20
owner: Codex
branch: feature/capability-enablement-impact-plan
worktree: "-"
mutex: capability-impact-research
---
# 功能启用与文档修改影响分析调研
## 目标
核实已实现功能的有效启用状态,形成分阶段启用方案及需求追踪、增量影响分析设计。
## 范围
源码、配置、只读运行态、已有证据;研究报告与整改方案落盘。
## 非目标
本轮不修改业务代码、不启用开关、不改变共享容器或真实项目数据。
## 步骤
1. [x] 核实功能状态和接线。
2. [x] 调研已有修改报告、依赖与需求追踪模型。
3. [x] 编写详细报告和可实施方案,完成文档核查。
## 验收标准
- [x] 当前事实与历史验收分开;每项启用方案有前置条件、验收、回退。
- [x] 影响分析有版本、权限、增量更新、一致性和用户交互契约。
## 证据 / 备注
开始时 dev=8fdcd98,工作区干净;git pull --ff-only 返回 Already up to date。无集成槽占用、无 push 授权。
产物:
- [调研报告](../../ops/research/2026-09-20-capability-enablement-impact-research.md)
- [整改方案](../../remediation/2026-09-20-capability-enablement-impact-plan.md)
- [FEATURE-MATRIX 校准](../../status/FEATURE-MATRIX.md)
- [方案审阅记录](../../ops/research/2026-09-20-capability-enablement-impact-plan-review.md)
@@ -0,0 +1,49 @@
---
title: "2026-09-20 P0 热修(迁移 / 越权 / 稳定性 / 凭证)"
status: done
created: 2026-09-20
updated: 2026-09-20
owner: Cursor-Auto
branch: docs/p0-closeout-2026-09-20
worktree: "-"
mutex: docs
---
# 2026-09-20 P0 热修
## 目标
关闭系统体检发现的 P0 critical:迁移断链、三项 IDOR、进程 panic/race、凭证泄漏与生产口令轮换。
## 范围
- Wave 0–4(见 [整改方案](../../remediation/2026-09-20-p0-remediation-plan.md))
- 后续实现分支:`fix/capability-merge-00058-2026-09-20`、`fix/authz-idor-hotfixes-2026-09-20`、`fix/runtime-panic-races-2026-09-20`、`fix/credential-hardening-2026-09-20`、`docs/p0-closeout-2026-09-20`
## 非目标
- main 分支对齐晋升
- FAV / SWBOOT-10 / D7 / MULTI_INTENT full
## 步骤
1. [x] Wave 0:审计与整改文档、CURRENT 认领、long-term 增补
2. [x] Wave 1:capability 合入 + 00058 + rebuild
3. [x] Wave 2:三项越权
4. [x] Wave 2b:panic/race/recover/XSS
5. [x] Wave 3:凭证 + 口令轮换
6. [x] Wave 4:测试报告与收口
## 验收标准
- [x] 见 [测试报告](../../test-reports/2026-09-20-p0-hotfixes-test-report.md)
## 相关链接
- Audit: [../../audit/2026-09-20-system-triage-audit.md](../../audit/2026-09-20-system-triage-audit.md)
- Remediation: [../../remediation/2026-09-20-p0-remediation-plan.md](../../remediation/2026-09-20-p0-remediation-plan.md)
- Test report: [../../test-reports/2026-09-20-p0-hotfixes-test-report.md](../../test-reports/2026-09-20-p0-hotfixes-test-report.md)
## 证据 / 备注
(各波次合入 commit 与健康输出)
@@ -0,0 +1,51 @@
---
title: "落实 Agent 规范与 L1 操作门禁"
status: done
created: 2026-09-21
updated: 2026-09-21
owner: Codex
branch: feature/agent-governance-implementation
worktree: .worktrees/agent-governance-implementation
base_dev_sha: a241e838150f218f3a09d3523f93291b847d45fd
mutex: agent-governance
review_state: passed
integration_state: integrated
deployment: not_required
cleanup: pending
cleanup_owner: independent-maintainer-after-owner-exit
remote_sync: not_requested
---
# 落实 Agent 规范与 L1 操作门禁
用户已授权“按照方案实现这些规范”。范围:审查 R01–R10、两项安全补充、两个共享文档与 dev 操作的 L1 管理入口。所有修改在本任务 worktree;不改产品业务代码、数据库、模型配置,不升级 test/main,不 push。Python 标准库 sqlite3/fcntl 实现本机协调,不增加产品 Go 依赖。
## 实施单元与所有权
- 规范 Agent:AGENTS/PROJECT/客户端薄入口/模板/测试规范/CURRENT 归档,互斥 policy-docs。
- 工具 Agent:worktree helper、env-service、candidate-images-build 与对应测试,互斥 ops-scripts。
- 根 Agent:agentctl/SQLite/lease/CAS/提交与集成门禁、runbook、报告、FEATURE-MATRIX、ignore,互斥 coordination-core。
- 测试 Agent:核心独立行为测试,仅写自己的测试文件,使用临时 Git 仓库。
## 验收
- [x] 新规范一致、轻量入口和真实状态可用;历史迁移不丢失。
- [x] 主仓唯一 .locks;原子资源集合、父子冲突、活跃/失效身份、幂等及保守恢复。
- [x] CURRENT/MATRIX 受控增量/CAS 更新,旧基线不覆盖,记录恢复证据。
- [x] 错误工作区/无租约服务写入被拒;候选镜像源码 SHA 不符被拒。
- [x] 安全 create/remove、commit/ref 门禁正反例通过。
- [x] 独立代码审查及真实临时仓库并发验收;本地 dev 接收验证后的候选;安全清理。
## 交付边界
L1 对统一入口与 Git hooks 防误改,不能阻止任意同 UID shell 绕过。OS 沙箱、跨机锁、产品 PI 镜像交付等独立运行架构变更不在本次规范/最小门禁改动内。纯工程代码与文档不触发产品重建;将验证主目录运行挂载和就绪未因本轮改变。
## 验证与集成结果
- 76 项 Python 工程测试通过;最终候选复跑同样 76 PASS。20 个真实进程/独立 Git worktree 争同一资源:1 个执行、19 个 LOCK_BUSY。
- ce-simplify-code 三视角完成;ce-code-review `20260921-133611-5e4781e6` 的 5 个确认问题全部修复并经独立复核关闭。详见[报告](../../test-reports/2026-09-21-agent-governance-test-report.md)。
- 源码实现提交 `fed87ad1`;保留并行 Cursor 材料切块任务后任务 HEAD 为 `578a96440da56717582ec5ab267a094ceea3d941`。dev 从 `a5ea469ca44171a5c3e6419b1757852270fb991d` 接收完整验证候选 `7e9317b849e0696e110bac5b27749861178d7e3d`,这是规则 effective_commit。
- 主仓 `.locks` 初始化、旧/新 dev flock 同 inode 和三个 hooks 已启用;doctor 正常,无租约 env guard 返回 LEASE_REQUIRED。收口文档使用已生效入口完成 CAS、提交与后续候选集成。
- 真实 dev 合入前后 ready=ok/schema61、容器镜像和主目录 data/dev 挂载一致。本轮 deployment=not_required;未 push、未操作 test/main、无产品数据库或模型配置改动。
- cleanup=pending:实际普通 remove 因部分同 UID 进程 cwd 不可读拒绝。保留本任务及 integrate-agent-governance-implementation 两个工作区,不使用 force/-D。独立维护者在 owner 退出并解决/核实进程可见性后重跑全部门禁;仅含可再生 pycache 的文件先明确删除。其他任务现场不在清理范围。
- 文档链接检查 356 个目标中,唯一已存在的 `FEATURE-MATRIX` 历史 promotion receipt 断链不由本轮引入;本轮新增/修改链接全部有效。
@@ -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。
@@ -0,0 +1,48 @@
---
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-plan
---
# Agent 工作规范与 worktree 并行治理方案
## 目标
基于当前仓库规范、脚本和现场,评估主目录保护、强制 worktree、串行集成与清理机制,交付可审核方案。
## 范围
- 只读检查 Git、脚本、Compose、测试入口和协作记录。
- 形成调研、治理方案及交接文档;仅在本任务 worktree 写文档。
## 非目标
- 不修改业务代码、Agent 规则或运维脚本;不切换主目录分支、不干预其他任务、不重建服务、不清理既有 worktree、不 push。
## 步骤
1. [x] 阅读启动链并盘点现场。
2. [x] 显式从本地 dev@15b8a4a8 创建独立 worktree。
3. [x] 完成机制核验、方案和边界审查。
4. [x] 写交接并核查文档差异。
## 验收标准
- [x] 有现状证据、方案比较、操作流程、并行边界、恢复与验收标准。
- [x] 区分已存在机制与拟实现机制;不将方案宣称为已落地。
## 证据 / 备注
初始主目录为 fix/intent-workflow-scoping-2026-09-21,有其他任务未提交变更。为保护现场,未执行 checkout dev / pull;从显式本地 dev 创建 worktree。origin/dev...dev 为 0/309,仅为本地远端跟踪引用快照,本轮未 fetch。认领仅登记本 worktree 的 CURRENT,尚无跨 worktree 实时协调入口;本任务只读代码且使用独立文档路径。
## 交付
- [调研](../../ops/research/2026-09-21-agent-workflow-governance-research.md)
- [方案](../../remediation/2026-09-21-agent-workflow-governance-plan.md)
- [交接](../../ops/handoffs/2026-09-21-agent-workflow-governance-plan.md)
- 仅文档核验,未执行产品测试;治理能力在 FEATURE-MATRIX 保持 planned。
@@ -0,0 +1,286 @@
# CURRENT 历史快照(2026-09-21)
归档来源:实施基线 `eb4dbdca5baae8dd5f3ddefc0f5510ac2978dcd3` 的 `.doc/ops/CURRENT.md`。以下保留原始认领、环境断言、焦点和证据索引;只调整移动后的 Markdown 相对链接。历史状态不是当前锁、环境或授权依据,活跃协调见 [CURRENT](../../ops/CURRENT.md)。基线内已失效的旧链接另在本次验证记录中说明,不把历史声明改写成新结论。
---
# 当前焦点
**更新**: 2026-09-21
**production_ready**: yes(门禁 B1–B4 已签;dev schema **61**,test/main 仍为 **58**。P0 热修 done;rdev 种子热修 done,见 [报告](../../test-reports/2026-09-20-rdev-seed-hotfix-test-report.md))
## 焦点
1. **工作流作用域权重**:`WORKFLOW_SCOPE_MODE` 默认 `strict`;`weighted` 按关系权重打分,只读跨流注明归属,写动作仍拦截。见 [报告](../../test-reports/2026-09-21-workflow-scope-weighting-test-report.md)。test/main 未晋升。
2. **意图确认优先与阶段感知**:弱写「整理需求」→ intake 确认卡片。见 [报告](../../test-reports/2026-09-21-intent-confirm-stage-aware-test-report.md)。test/main 未晋升。
3. **上传解析提示 / 去重 / CoW 收口**:MinerU 解析状态轮询闭环(pending→running→done)、重复文件「已复用」提示、失败原因+重新解析、CAS 不可变 CoW 契约测试,已合入 `dev`(代码 `99905571`、证据 `74587ccf`、收口 `a0464eb5`)。见 [报告](../../test-reports/2026-09-21-upload-parse-ux-dedup-test-report.md)。test/main 未晋升。前序任务执行状态卡收口见 [报告](../../test-reports/2026-09-21-taskrun-status-card-persistence-test-report.md)(含二轮修复:completed 步骤 label 冻结为"正在…(NN%)"的收口归一化 + dev 历史回填,已合入 `dev@4b303247` 并真实 PI 验收)。
4. **MinerU 真实 PDF 二轮验收**:用户反馈「PDF 内容未被理解」由两因叠加——(A) 首轮在 worktree 内跑 `env-service dev rebuild` 令挂载漂到 worktree `data/dev`,真实历史 blob 全部读不到;(B) Agent 轻量 API 硬限 20 页,28 页真实文件失败。首轮结论作废。二轮从**主目录** rebuild 修复挂载,`internal/mineru` 在 `-30003` 时按 20 页窗分块解析并重编全局页锚;`ReadRefBytes` 失败改为 `slog.Warn`。已合入 `dev@362b68a0`。真实 `bd_intake`(项目 6532)`completed`,工作区 `materials_text` 注入 29152 字节中文正文。见 [报告](../../test-reports/2026-09-21-mineru-doc-parsing-test-report.md) 第八节。
5. **红线**:禁止整支 merge FAV;不默认升 `MULTI_INTENT_PLAN_TIER=full`;`SEMANTIC_SUMMARY_REPLACE` 不随 W2 开启;FAV live 观察窗证据驱动;`FAV_DEGRADED_READ=false`;项目 143 只读;SWBOOT-10 保持 fail-closed stub;D7 对话 ADR 仍待合规签字(追踪表留存类别已定为 `record`,不授权物理删除);**不改 `production_ready`**;模块解耦批次 A–G 与回溯实施切片未单独认领前保持 `planned`;**合入 dev 后必须回主目录跑 `env-service.sh dev rebuild`,禁止任何 worktree 内运行 `env-service`**(脚本 ROOT_DIR 取自脚本所在目录树,会带走 bind mount,导致 `/app/data` 漂到 worktree 空目录)。
## 并行认领
| owner | task | branch | worktree | mutex | status |
|-------|------|--------|----------|-------|--------|
| Codex | 2026-09-21-agent-governance-implementation | feature/agent-governance-implementation | .worktrees/agent-governance-implementation | agent-governance | in_progress |
| 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 |
| Cursor | 2026-09-21-intent-workflow-scoping | fix/intent-workflow-scoping-2026-09-21 | - | intent+web+docgov | done |
| Codex | 2026-09-21-agent-workflow-governance-adoption | feature/agent-workflow-governance-plan | .worktrees/feature-agent-workflow-governance-plan | agent-workflow-governance | in_progress |
| 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-deep-test-four-issues | fix/dev-deep-test-four-issues-2026-09-21 | - | web+intent+taskrun | done |
| Cursor | 2026-09-21-trace-panel-to-chat | feature/trace-panel-to-chat-2026-09-21 | - | trace-impact+web | done |
| Cursor | 2026-09-21-taskrun-scope-persist | fix/taskrun-scope-persist-2026-09-21 | - | projectinstance+taskrun | 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 |
| Cursor | 2026-09-21-taskrun-error-transparency | fix/taskrun-error-transparency-2026-09-21 | - | chat+web | done |
| Cursor | 2026-09-21-trace-panel-null-crash | fix/trace-panel-null-crash-2026-09-21 | - | trace-index+web | done |
| Cursor-Auto | 2026-09-20-stage-backtrack-design | feature/stage-backtrack-design | - | trace-impact-design | done |
| Cursor-Auto | 2026-09-20-impact-loop-t1 至 T3/B1–B3 | feature/stage-backtrack-impl | - | trace-index | done |
| Cursor | 2026-09-20-rdev-seed-hotfix | fix/workflow-seed-bootstrap-2026-09-20 | - | workflow-def | done |
| Cursor-Auto | 2026-09-20-module-decoupling-spec-audit | docs/module-decoupling-spec-2026-09-20 | - | module-decoupling-spec | done |
| Cursor-Auto | 2026-09-20-p0-closeout | docs/p0-closeout-2026-09-20 | - | docs | done |
| Cursor-Auto | 2026-09-20-p0-hotfixes(Wave 0 文档) | docs/p0-triage-2026-09-20 | - | docs | done |
| Cursor-Auto | 2026-09-20-p0-capability-00058 | fix/capability-merge-00058-2026-09-20 | - | infra+chat | done |
| Cursor-Auto | 2026-09-20-p0-idor | fix/authz-idor-hotfixes-2026-09-20 | - | authz | done |
| Cursor-Auto | 2026-09-20-p0-runtime-stability | fix/runtime-panic-races-2026-09-20 | - | taskrun+chat+web | done |
| Cursor-Auto | 2026-09-20-p0-credentials | fix/credential-hardening-2026-09-20 | - | ops+infra | done |
| Cursor-Auto | 2026-09-20-proposed-authoritative-reports | feature/capability-enablement-impact-plan | - | docgov | done |
| Cursor-Auto | 2026-09-20-pi-narrative-clipped-diff | feature/capability-enablement-impact-plan | - | docgov | done |
| Cursor-Auto | 2026-09-20-pi-reasoning-profile | feature/capability-enablement-impact-plan | - | pi-agent | done |
| Cursor-Auto | 2026-09-20-semantic-summary-persistence | feature/capability-enablement-impact-plan | - | chat+lineage-version | done |
| Cursor-Auto | 2026-09-20-feature-readiness-and-lineage-authz | feature/capability-enablement-impact-plan | - | sysadmin+lineage | done |
| Codex | 2026-09-20-capability-enablement-impact-plan | feature/capability-enablement-impact-plan | - | capability-impact-research | done |
| Cursor-Auto | 2026-09-20-post-activation-duty-reassign-member-chat | fix/post-activation-duty-reassign-member-chat | - | projectworkflow+authz+web | done |
| Cursor-Auto | 2026-09-20-test-env-triage-fixes | fix/test-env-triage-2026-09-20 | - | projectworkflow+chat+assets | done |
| Cursor-Auto | 2026-09-20-test-env-beta6-verification | docs/test-env-beta6-verification | - | infra+docs | done |
| Cursor-Auto | 2026-09-20-bug-hunt-permissions-uploads | fix/bug-hunt-2026-09-20-permissions-and-uploads | - | authz+web+projectworkflow | done |
| Cursor | audit-b1-data-consistency | fix/audit-b1-data-consistency | - | docgov+workflow+chat | done |
| Cursor | audit-b2-authz-hardening | fix/audit-b2-authz-hardening | - | authz | done |
| Cursor | audit-b3-sse-events | fix/audit-b3-sse-events | - | chat+events | done |
| Cursor | audit-b4-frontend | fix/audit-b4-frontend | - | web | done |
| Cursor-Auto | 2026-09-19-audit-remainder-closeout | fix/audit-remainder-closeout | - | audit-remainder | done |
| Antigravity | 2026-09-20-dev-deep-test-and-promotion | feature/dev-deep-test-and-promotion | - | integration | done |
| Cursor-Auto | 2026-09-19-remove-control-center | fix/remove-control-center | - | controlcenter | done |
| Cursor-Auto | 2026-09-17-control-center-server | feature/control-center-server | - | controlcenter | cancelled |
| Kimi | 2026-09-18-user-manual | feature/user-manual | .worktrees/feature-user-manual | docs | done |
| Cursor-Auto | 2026-09-18-wave7-roadmap-orchestration | docs/wave7-roadmap-orchestration | - | roadmap-orchestration | done |
| Cursor-Auto | 2026-09-18-wave6-doc-drift | docs/wave6-doc-drift | - | doc-drift | done |
| Cursor-Auto | 2026-09-18-wave5-deadcode-decisions | fix/wave5-deadcode-decisions | - | deadcode-cleanup | done |
| Cursor-Auto | 2026-09-18-wave4-hardening-r1-r8 | fix/wave4-hardening-r1-r8 | - | hardening | done |
| Cursor-Auto | 2026-09-18-wave3-test-debt-blindspots | fix/wave3-test-debt-blindspots | - | test-debt | done |
| Cursor-Auto | 2026-09-18-wave2-config-flag-align | fix/wave2-config-flag-align | - | infra | done |
| Cursor | 2026-09-18-wave1-main-env-fix | fix/wave1-main-env-fix | - | infra | done |
| Cursor | 2026-09-18-wave0-p0-bug-fixes | fix/wave0-p0-sse-chat-cache-bugs | - | chat + web | done |
| Kimi | 2026-09-17-system-health-check(只读审计,未实施) | - | - | audit | done |
| Cursor | 2026-09-17-docgov-modification-proposal-http | feature/docgov-modification-proposal-http | - | docgov | done |
| Cursor | 2026-09-17-document-author-only-closeout | feature/document-author-only-plan | - | document-duty-policy | done |
| Cursor | 2026-09-17-rdev-template-depth-s1-continued | feature/rdev-template-depth-s1-continued | .worktrees/feature-rdev-template-depth-s1-continued | rdev-templates | done |
| Cursor | 2026-09-17-rdev-workflow-integration | feature/rdev-core | - | workflow-def | done |
| Cursor | 2026-09-17-rdev-template-depth | feature/rdev-template-depth | .worktrees/feature-rdev-template-depth | rdev-templates | done |
| Codex | 2026-09-17-document-author-only-plan | feature/document-author-only-plan | - | document-duty-policy-plan | done |
| Cursor | 2026-09-17-initial-load-perf-u2 | feature/initial-load-perf-u2 | - | web + static-delivery | done |
| Codex | 2026-09-17-initial-load-performance-plan | feature/initial-load-performance-plan | .worktrees/feature-initial-load-performance-plan | loading-performance-audit | done |
| Kimi | 2026-09-17-system-admin-console | feature/system-admin-console | - | web + sysadmin | done |
| Cursor-Auto | 2026-09-17-engineering-dashboard | feature/engineering-dashboard | .worktrees/feature-engineering-dashboard | engineering-dashboard | done |
| Cursor | 2026-09-17-promote-null-fk-to-test | feature/promote-null-fk-to-test | - | infra | done |
| Cursor | 2026-09-17-docgov-optional-duty-null-fk | fix/docgov-optional-duty-null-fk | - | docgov | done |
| Cursor | 2026-09-17-leftover-hygiene | chore/leftover-hygiene-2026-09-17 | - | ops | done |
| Cursor | 2026-09-17-w2-semantic-summary-shadow | feature/w2-semantic-summary-shadow-live | - | chat | done |
| Cursor | 2026-09-17-w3-pi-change-report-narrative | feature/w3-pi-change-report-narrative-live | - | docgov | done |
| Cursor | 2026-09-17-w4-multi-intent-u9-u12 | feature/w4-u9-segment-live | - | intent-plan | done |
| Cursor | 2026-09-17-w5a-software-bootstrap-ui | feature/w5a-software-bootstrap-ui-pi | - | workflow-design | done |
| Cursor | 2026-09-17-w6-fav-subscriber-shadow | feature/w6-fav-subscriber-shadow | - | events | done |
| Cursor | 2026-09-17-w7-d7-inventory | feature/w7-d7-data-inventory | - | chat | done |
| Cursor | 2026-09-17-promote-dev-to-test | feature/promote-dev-to-test-2026-09-17 | - | infra | done |
| Cursor | 2026-09-17-kb-host-auth-fix | fix/kb-host-auth-layered-load | - | infra | done |
| Cursor | 2026-09-17-w1-ci-e2e-green-nightly | feature/w1-ci-e2e-green-nightly | - | ci | done |
| Cline | 2026-09-16-partial-deferred-completion | docs/partial-deferred-completion-plan | - | architecture-docs | in_progress |
| Cursor | 2026-09-16-intent-plan-playwright-dual-tab | feature/intent-plan-cards-playwright | .worktrees/feature-intent-plan-cards-playwright | web | done |
| Cursor | 2026-09-16-full-backlog-override | docs/override-nogo-full-backlog | - | architecture-docs | done |
| Cursor | 2026-09-16-gitea-nightly-docker-datadir | fix/gitea-nightly-docker-datadir | - | ci | done |
| Cursor | 2026-09-16-gitea-nightly-host-tools | fix/gitea-nightly-host-tools | - | ci | done |
| Cursor | 2026-09-21-test-env-lazy-doc-verification | docs/lazy-doc-verification-2026-09-21 | - | infra+docs | done |
| Cursor | 2026-09-16-wave-leftovers | fix/wave-leftovers-n7-playwright-dod | - | ci | done |
| Cursor | 2026-09-16-wave3-pu6-pu8-go-no-go | feature/wave3-pu6-pu8-go-no-go | - | architecture-docs | done |
| Cursor | 2026-09-16-wave2c-same-image-digest | feature/wave2c-same-image-digest | - | infra | done |
| Cursor | 2026-09-16-wave2b-nightly-promotion-receipt | feature/wave2b-nightly-promotion-receipt | - | ci | done |
| Cursor | 2026-09-16-wave2-real-pi-evidence | feature/wave2-real-pi-evidence | - | intent-plan | done |
| Cursor | 2026-09-16-wave1-race-tempdir-cleanup | fix/race-tempdir-cleanup | - | ci | done |
| Cursor | 2026-09-16-wave1-iam-fail-closed | fix/iam-store-fail-closed | - | authz | done |
| Cursor | 2026-09-16-feature-matrix-wave0-calibration | feature/feature-matrix-production-readiness-plan | .worktrees/feature-matrix-production-readiness-plan | architecture-docs | done |
| Codex | 2026-09-16-feature-matrix-production-readiness-plan | feature/feature-matrix-production-readiness-plan | .worktrees/feature-matrix-production-readiness-plan | architecture-docs | done |
| Cursor-Auto | 2026-09-16-matrix-deep-test-promote-test | feature/matrix-deep-test-promote-test | - | infra | done |
| Cursor-Auto | 2026-09-16-production-ready-gates | docs/production-ready-flip | - | ci | done |
| Cursor-Auto | 2026-09-16-demo-seed-pollution | fix/demo-data-pollution-web | - | web | done |
| Cursor | 2026-09-16-multi-intent-u8-task-generate | feature/multi-intent-u8-task-generate | - | intent-plan | done |
| Cursor | 2026-09-16-multi-intent-u7-auto-read | feature/multi-intent-u7-auto-read | - | intent-plan | done |
| Cursor | 2026-09-16-multi-intent-u6-web-cards | feature/multi-intent-u6-web-cards | - | web | done |
| Cursor | 2026-09-16-multi-intent-u5-decision-api | feature/multi-intent-u5-decision-api | - | intent-plan | done |
| Cursor | 2026-09-16-multi-intent-u4-outbox-projection | feature/multi-intent-u4-outbox-projection | - | events | done |
| Cursor | 2026-09-15-multi-intent-u3-intentflow-pg | feature/multi-intent-u3-intentflow-pg | - | intent-plan | done |
| Cursor | 2026-09-15-multi-intent-u2-segmenter | feature/multi-intent-u2-segmenter | - | intent | done |
| Cursor | 2026-09-15-multi-intent-u1-contracts | feature/multi-intent-u1-contracts | - | architecture-docs | done |
| Cursor | app-composition-u11-u12 | feature/app-composition-u11-u12 | - | app | done |
| Cursor | chatlog-contextasm-u10 | feature/chatlog-contextasm-u10 | - | chat | done |
| Cursor | chat-history-refresh-remediation | fix/chat-history-refresh | - | chat | done |
| Cursor | dataset-lifecycle-u9 | feature/dataset-lifecycle-u9 | - | dataset | done |
| Cursor | taskrun-runmanifest-u8 | feature/taskrun-runmanifest | - | taskrun | done |
| Cursor | document-reliability-m1-live-and-m2 | refactor/document-reliability-pilot | - | workspace | done |
| Codex | module-decoupling-remediation-plan | feature/module-decoupling-remediation | - | architecture-docs | done |
| Codex | module-decoupling-phase2-plan-review | docs/module-decoupling-ipc-assessment | - | architecture-docs | done |
| Cursor | module-decoupling-phase2-docs | feature/module-decoupling-phase2-docs | - | architecture-docs | done |
| verifier_antigravity | controlled-content-ui-acceptance | fix/controlled-content-ui-acceptance | - | document-content-ui-acceptance | done |
| implementer_cursor | controlled-content-canonical-hash | fix/controlled-content-canonical-hash | - | docgov | done |
| Codex | project143-controlled-content-404-diagnosis | fix/project143-controlled-content-404-diagnosis | - | docgov-content-diagnosis | done |
| Codex | software-project-bootstrap-plan | feature/software-project-bootstrap-plan | - | workflow-design | done |
| Codex | conversation-intent-runtime-state | fix/conversation-intent-state | - | intent | done |
| Cursor | conversation-intent-runtime-state | docs/conversation-intent-dual-tab | - | intent | done |
| Cursor | document-revision-wave1-6-implementation | feature/document-revision-management | - | docgov | done |
| Cursor-Auto | document-revision-runtime-ui03 | fix/document-revision-runtime-ui03 | - | docgov | done |
| Cursor-Auto | document-revision-sse-idempotency | fix/document-revision-sse-idempotency | - | docgov | done |
| Cursor-Auto | document-revision-active-doc-routing | fix/document-revision-active-doc-routing | - | docgov | done |
| Cursor-Auto | document-revision-quality-context | fix/document-revision-quality-context | - | docgov | done |
| Cursor-Auto | document-revision-e2e-pending-flow | fix/document-revision-e2e-pending-flow | - | pending-report-ui | done |
| Cursor-Auto | document-revision-e2e-reject-routing | fix/document-revision-e2e-reject-routing | - | document-revision-runtime-ui | done |
| Cursor-Auto | document-revision-e2e-block-selector | fix/document-revision-e2e-block-selector | - | document-revision-block-selector | done |
| Cursor-Auto | document-revision-e2e-save-selector | fix/document-revision-e2e-save-selector | - | document-revision-save-selector | done |
| Cursor-Auto | document-revision-e2e-overlay-selector | fix/document-revision-e2e-overlay-selector | - | document-revision-overlay-selector | done |
| Cursor-Auto | document-revision-e2e-overlay-transition | fix/document-revision-e2e-overlay-transition | - | document-revision-overlay-transition | done |
| Cursor-Auto | document-revision-second-doc-routing-lease | fix/document-revision-second-doc-routing-lease | - | document-revision-second-doc-routing-lease | done |
| Cursor-Auto | document-revision-prelim-output | fix/document-revision-pi-runner-module | - | document-revision-prelim-output | done |
| Cursor-Auto | document-revision-editor-hydration-race | fix/document-revision-editor-hydration-race | - | document-revision-editor-hydration-race | done |
| Cursor-Auto | document-revision-quality-repair-workspace-contract | fix/document-revision-quality-repair-workspace-contract | - | document-revision-quality-repair-workspace-contract | done |
| Cursor-Auto | document-revision-fast-completion-observation | fix/document-revision-fast-completion-observation | - | document-revision-fast-completion-observation | done |
| Cursor-Auto | document-revision-workflow-category-navigation | fix/document-revision-workflow-category-navigation | - | document-revision-workflow-category-navigation | done |
| Cursor-Auto | document-revision-duty-cell-assertion | fix/document-revision-duty-cell-assertion | - | document-revision-duty-cell-assertion | done |
| Cursor-Auto | document-revision-reviewer-duty-sync | fix/document-revision-reviewer-duty-sync | - | document-revision-reviewer-duty-sync | done |
| Cursor-Auto | document-revision-post-restart-selector | fix/document-revision-post-restart-selector | - | document-revision-post-restart-selector | done |
| Cursor-Auto | document-revision-post-restart-final-snippet | fix/document-revision-post-restart-final-snippet | - | document-revision-post-restart-final-snippet | done |
| Cursor-Auto | document-revision-pg-id-remap | fix/document-revision-pg-id-remap | - | document-revision | done |
| Cursor-Auto | document-revision-runtime | fix/document-revision-runtime-ui03 | - | docgov | done |
| Cursor-Auto | document-revision-runtime-ui-final-report | feature/document-revision-runtime-ui-final-report | - | document-revision-runtime-ui | done |
| Cursor-Auto | document-revision-evidence-count | fix/document-revision-evidence-count | - | document-revision-evidence-count | done |
| Cursor-Auto | document-revision-session-close | feature/document-revision-session-close | - | document-revision-session-close | done |
| Cursor-Auto | vite-frp-allowed-hosts | fix/vite-frp-allowed-hosts | - | web-devserver | done |
| implementer_cursor | workflow-plan-409-frozen-and-optional-duties | fix/workflow-plan-409-frozen-and-optional-duties | - | workflow | done |
| implementer_cursor | governance-action-level-authz | fix/governance-action-level-authz | - | workflow | done |
| Cursor | leftover-branch-cleanup | chore/leftover-branch-cleanup | - | ops | done |
| Cursor | event-e0a-production-scope-contract | fix/event-production-scope-contract | - | events | done |
| Cursor | event-e0b-dispatcher-pg | feature/events-dispatcher-pg | - | events | done |
| Cursor | event-e1a-notify-cutover | fix/event-notify-cutover | - | events | done |
| Cursor | event-e1b-workflow-advance | fix/event-workflow-advance | - | events | done |
| Cursor | event-e1c-projection-cutover | fix/event-projection-cutover | - | events | done |
| Cursor | event-e2-hook-guard | fix/event-e2-hook-guard | - | events | done |
| Cursor | doccontent-canonical-boundary | fix/doccontent-canonical-boundary | - | docgov | done |
| Cursor | intent-bizdev-boundary | fix/intent-bizdev-boundary | - | intent | done |
| Cursor | stageflow-type-ownership | fix/stageflow-type-ownership | - | stageflow | done |
| Cursor | bizdev-locator-removal | fix/bizdev-locator-removal | - | bizdev | done |
| Cursor | chatflow-orchestration-boundary | fix/chatflow-orchestration-boundary | - | chat | done |
| Cursor | phase2-closeout-inventories | feature/phase2-closeout-inventories | - | architecture-docs | done |
| Cursor | event-shared-live-cutover | feature/event-shared-live-cutover | - | events | done |
| Cursor | pi-typed-result | feature/pi-typed-result | - | pi-agent | done |
| Cursor | promote-dev-to-test-2026-09-15 | feature/promote-dev-to-test-2026-09-15 | - | infra | done |
> 新任务开始前登记。`branch` 必须为 `feature/<slug>` 或 `fix/<slug>`,**禁止** `dev` / `test` / `main`。同一 `mutex` 同时仅一个 `in_progress`。
> workflow-plan 409 与治理鉴权 G1–G5 已收口(见 [test-report](../../test-reports/2026-09-14-governance-action-level-authz-test-report.md))。禁止终止或改写项目 143。
> `document-reliability-pilot` U11–U12 已合入 `dev@bf59cce` 并 rebuild。`CHAT-INTENT-STATE` 双标签 busy 已 PASS(项目 6275)。禁止 worktree 内 `env-service`。项目 143 只读,禁止终止。
> 2026-09-17 leftover 二次收口:[报告](../../test-reports/2026-09-17-leftover-hygiene-test-report.md)。已合入 leftover worktree/旁支再拆一轮;`feature/software-project-bootstrap` L1 已在 `dev`(残留关闭 commit 已丢弃)。`fix/clean-test-env-baseline` **不 merge**(前端 demo 清理已放弃;仅保留已挑拣的 `SEED_DEMO_USERS=false`)。extra worktree 仅余 `.worktrees/fix-dev-runtime-data-root-guard`(目录名是 guard,检出的是 `feature/final-artifact-vault`)。**故意不合入、不删**:`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/*`。不整支 merge FAV;不启用 `FAV_DEGRADED_READ`。
## 集成槽位
| holder | phase | since | scope | queue |
|--------|-------|-------|-------|-------|
| - | idle | 2026-09-21 | taskrun-status-card label 修复已合入 dev@4b303247 并真实 PI 验收(round2 docs 随后合入);mineru 二轮文档已合入;schema=61 | - |
**phase**: `idle` | `merging` | `smoke` | `e2e`
> 合入 `dev` + 共享容器验证必须串行。详见 [AGENTS.md](../../../AGENTS.md) §6.3。
## 环境快照
| 环境 | 端口 | schema | 状态 |
|------|------|--------|------|
| dev | 8080 | **61** | healthy(mineru `00061`;intent-confirm 真实 PI PASS;`/health` schema_version=61;`pi-agent`;events `:8088`) |
| test | 8081 | **58** | healthy(`rc-v1.0.0-beta.7`;rdev v1 active;`published_by` 回落到用户 4;events `:8089`) |
| main | 8000 | **58** | healthy(P0 Wave3 rebuild 已追平 schema;分支树对齐仍记 backlog;口令已轮换;events `:8090`) |
## SSOT
| 类型 | 路径 |
|------|------|
| 2026-09-21 Agent worktree 工作规范 | [方案](../../remediation/2026-09-21-agent-workflow-governance-plan.md) · [调研](../../ops/research/2026-09-21-agent-workflow-governance-research.md) · [交接](../../ops/handoffs/2026-09-21-agent-workflow-governance-plan.md);规范已采纳,自动化另列 planned |
| 2026-09-20 rdev 种子 | [short-term](../../ops/short-term/2026-09-20-rdev-seed-hotfix.md) · [报告](../../test-reports/2026-09-20-rdev-seed-hotfix-test-report.md) |
| 2026-09-20 模块解耦 | [审计](../../audit/2026-09-20-module-coupling-audit.md) · [规范](../../system-design/2026-09-20-module-development-standards.md) · [批次 A–G](../../remediation/2026-09-20-module-decoupling-batch-plan.md) · [short-term](../../ops/short-term/2026-09-20-module-decoupling-spec-audit.md) |
| 文档总地图 | [../README.md](../../README.md) |
| 模块完成度 | [FEATURE-MATRIX](../../status/FEATURE-MATRIX.md)(Wave 0 已校准契约与冻结边界) |
| 发布缺口 | [gap-matrix](../../remediation/gap-matrix.md)(`production_ready=yes`;Wave 0 IAM 只读未发现旁路) |
| 2026-09-20 系统体检 | [audit](../../audit/2026-09-20-system-triage-audit.md) · [P0 整改](../../remediation/2026-09-20-p0-remediation-plan.md) · [short-term](../../ops/short-term/2026-09-20-p0-hotfixes.md) |
| 连续性审计/计划 | [audit](../../audit/2026-09-16-feature-matrix-production-readiness-audit.md) · [remediation](../../remediation/2026-09-16-feature-matrix-production-readiness-plan.md) · [Wave 0 任务](../../ops/short-term/2026-09-16-feature-matrix-wave0-calibration.md) |
| 测试报告 | [test-reports/](../../test-reports) |
| dev→test 晋升前复核 | [research](../../ops/research/2026-09-19-pre-test-promotion-review.md)(2026-09-19 只读;静态门禁过,容器未 rebuild,暂不合并) |
| D7 盘点(W7) | [audit](../../audit/2026-09-17-d7-data-inventory.md) · [报告](../../test-reports/2026-09-17-w7-d7-inventory-test-report.md) · ADR 仍 `pending-compliance-signoff` |
| 功能启用与文档影响分析 | [调研](../../ops/research/2026-09-20-capability-enablement-impact-research.md) · [整改方案](../../remediation/2026-09-20-capability-enablement-impact-plan.md) · [方案审阅](../../ops/research/2026-09-20-capability-enablement-impact-plan-review.md)(2026-09-20;未启用开关、未改业务代码) |
| 阶段回溯与影响闭环 | [设计](../../system-design/2026-09-20-stage-backtrack-and-impact-loop-design.md) · [short-term](../../ops/short-term/2026-09-20-stage-backtrack-design.md)(2026-09-20;仅设计。切片 T1/T2/B1/B2/B3/T3 均为 planned) |
| Wave 7 编排确认 | [决策记录](../../ops/short-term/2026-09-18-wave7-roadmap-orchestration.md) |
| Agent 手册 | [AGENTS.md](../../../AGENTS.md) |
| 意图双标签 busy 交接 | [./handoffs/2026-09-15-conversation-intent-dual-tab.md](../../ops/handoffs/2026-09-15-conversation-intent-dual-tab.md) |
| 受控正文 hash 漂移 W1–W6 | [../ops/handoffs/2026-09-14-controlled-content-canonical-hash.md](../../ops/handoffs/2026-09-14-controlled-content-canonical-hash.md) |
| DOCREV ADR | [../adr/2026-09-13-document-version-boundary.md](../../adr/2026-09-13-document-version-boundary.md) |
| DOCREV 管理测试 | [../test-reports/2026-09-13-document-revision-management-test-report.md](../../test-reports/2026-09-13-document-revision-management-test-report.md) |
| DOCREV 运行时 UI Round20 | [../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md](../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md) |
| 纯软件项目自举设计 | [../system-design/2026-09-14-software-project-bootstrap-workflow.md](../../system-design/2026-09-14-software-project-bootstrap-workflow.md) |
| 模块化单体解耦架构 | [../system-design/2026-09-14-module-decoupling-architecture.md](../../system-design/2026-09-14-module-decoupling-architecture.md) |
| 模块解耦整改计划 | [../remediation/2026-09-14-module-decoupling-refactor-plan.md](../../remediation/2026-09-14-module-decoupling-refactor-plan.md) |
| Phase 2 方案审阅 | [../audit/2026-09-15-module-decoupling-phase2-plan-review.md](../../audit/2026-09-15-module-decoupling-phase2-plan-review.md) |
| Phase 2 修订计划 | [../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md) |
| 多意图 HITL 复核方案 | [../system-design/2026-09-15-multi-intent-hitl-plan.md](../../system-design/2026-09-15-multi-intent-hitl-plan.md) |
| 多意图 HITL U1 契约 | [../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md](../../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md) |
| 多意图 HITL U2 分段 | [../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md](../../test-reports/2026-09-15-multi-intent-u2-segmenter-test-report.md) |
| 多意图 HITL U3 PG | [../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md](../../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md) |
| 多意图 HITL U4 投影 | [../test-reports/2026-09-16-multi-intent-u4-outbox-projection-test-report.md](../../test-reports/2026-09-16-multi-intent-u4-outbox-projection-test-report.md) |
| 多意图 HITL U5 API | [../test-reports/2026-09-16-multi-intent-u5-decision-api-test-report.md](../../test-reports/2026-09-16-multi-intent-u5-decision-api-test-report.md) |
| 多意图 HITL U6 Web | [../test-reports/2026-09-16-multi-intent-u6-web-cards-test-report.md](../../test-reports/2026-09-16-multi-intent-u6-web-cards-test-report.md) |
| 多意图 HITL U8 generate | [../test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md](../../test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md) |
| 多意图 HITL U7 只读 | [../test-reports/2026-09-16-multi-intent-u7-auto-read-test-report.md](../../test-reports/2026-09-16-multi-intent-u7-auto-read-test-report.md) |
| 文档可靠性 M1 报告 | [../test-reports/2026-09-14-document-reliability-pilot-test-report.md](../../test-reports/2026-09-14-document-reliability-pilot-test-report.md) |
| 文档可靠性 M1 活验 | [../test-reports/2026-09-14-document-reliability-pilot-live-test-report.md](../../test-reports/2026-09-14-document-reliability-pilot-live-test-report.md) |
| 文档可靠性 M2 | [../test-reports/2026-09-14-document-reliability-m2-test-report.md](../../test-reports/2026-09-14-document-reliability-m2-test-report.md) |
| 文档可靠性 M3 U8 | [../test-reports/2026-09-15-taskrun-runmanifest-u8-test-report.md](../../test-reports/2026-09-15-taskrun-runmanifest-u8-test-report.md) |
| 文档可靠性 M3 U9 | [../test-reports/2026-09-15-dataset-lifecycle-u9-test-report.md](../../test-reports/2026-09-15-dataset-lifecycle-u9-test-report.md) |
| 文档可靠性 M4 U10 | [../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md](../../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md) |
| 文档可靠性 M5/M6 U11–U12 | [../test-reports/2026-09-15-app-composition-u11-u12-test-report.md](../../test-reports/2026-09-15-app-composition-u11-u12-test-report.md) |
| Track E E2 闭包守卫 | [../test-reports/2026-09-15-event-e2-hook-guard-test-report.md](../../test-reports/2026-09-15-event-e2-hook-guard-test-report.md) |
| Track E 复盘 | [./research/2026-09-15-track-e-retrospective.md](../../ops/research/2026-09-15-track-e-retrospective.md) |
| 旁支清点收口 | [../test-reports/2026-09-15-leftover-branch-cleanup-test-report.md](../../test-reports/2026-09-15-leftover-branch-cleanup-test-report.md) · [二次收口](../../test-reports/2026-09-17-leftover-hygiene-test-report.md) |
| SSE/幂等审计 | [../audit/2026-09-13-document-revision-sse-idempotency.md](../../audit/2026-09-13-document-revision-sse-idempotency.md) |
| 质量门禁自污染审计 | [../audit/2026-09-13-document-revision-quality-gate-self-pollution.md](../../audit/2026-09-13-document-revision-quality-gate-self-pollution.md) |
| 当前文档路由审计 | [../audit/2026-09-13-document-revision-active-doc-routing.md](../../audit/2026-09-13-document-revision-active-doc-routing.md) |
| 行动表状态假阳性审计 | [../audit/2026-09-13-document-revision-quality-status-false-positive.md](../../audit/2026-09-13-document-revision-quality-status-false-positive.md) |
| 待确认报告选择失败审计 | [../audit/2026-09-13-document-revision-pending-report-selection.md](../../audit/2026-09-13-document-revision-pending-report-selection.md) |
| UI-05b 拒绝路由失败审计 | [../audit/2026-09-13-document-revision-e2e-reject-routing.md](../../audit/2026-09-13-document-revision-e2e-reject-routing.md) |
| 职责伪造与 ETag 覆盖审计 | [../audit/2026-09-13-document-revision-duty-etag-overwrite.md](../../audit/2026-09-13-document-revision-duty-etag-overwrite.md) |
| UI-06 块选择器失败审计 | [../audit/2026-09-13-document-revision-block-selector.md](../../audit/2026-09-13-document-revision-block-selector.md) |
| UI-06 保存选择器失败审计 | [../audit/2026-09-13-document-revision-save-selector.md](../../audit/2026-09-13-document-revision-save-selector.md) |
| UI-07 纯净阅读取样失败审计 | [../audit/2026-09-13-document-revision-overlay-selector.md](../../audit/2026-09-13-document-revision-overlay-selector.md) |
| UI-07 transition 中间帧取样审计 | [../audit/2026-09-13-document-revision-overlay-transition.md](../../audit/2026-09-13-document-revision-overlay-transition.md) |
| UI-11 第二份文档路由与 lease 审计 | [../audit/2026-09-13-document-revision-second-doc-routing-lease.md](../../audit/2026-09-13-document-revision-second-doc-routing-lease.md) |
| UI-11 prelim_design 缺 output.md 审计 | [../audit/2026-09-13-document-revision-prelim-output.md](../../audit/2026-09-13-document-revision-prelim-output.md) |
| UI-06 编辑弹窗 hydration 竞态审计 | [../audit/2026-09-13-document-revision-editor-hydration-race.md](../../audit/2026-09-13-document-revision-editor-hydration-race.md) |
| UI-03 质量修复子工作区契约审计 | [../audit/2026-09-13-document-revision-quality-repair-workspace-contract.md](../../audit/2026-09-13-document-revision-quality-repair-workspace-contract.md) |
| UI-11 快速完成观测误判审计 | [../audit/2026-09-13-document-revision-fast-completion-observation.md](../../audit/2026-09-13-document-revision-fast-completion-observation.md) |
| UI-13a 私密分类导航失败审计 | [../audit/2026-09-13-document-revision-workflow-category-navigation.md](../../audit/2026-09-13-document-revision-workflow-category-navigation.md) |
| UI-13a 职责单元格误判审计 | [../audit/2026-09-13-document-revision-duty-cell-assertion.md](../../audit/2026-09-13-document-revision-duty-cell-assertion.md) |
| UI-13a reviewer 职责未同步审计 | [../audit/2026-09-13-document-revision-reviewer-duty-sync.md](../../audit/2026-09-13-document-revision-reviewer-duty-sync.md) |
| UI-03 首次生成 PG ID 误删 baseline | [../audit/2026-09-13-document-revision-pg-id-remap.md](../../audit/2026-09-13-document-revision-pg-id-remap.md) |
| UI-06 刷新后缓存竞争死锁审计 | [../audit/2026-09-14-document-revision-refresh-cache-race.md](../../audit/2026-09-14-document-revision-refresh-cache-race.md) |
| 受控正文真实 UI 验收报告 | [../test-reports/2026-09-14-controlled-content-ui-acceptance.md](../../test-reports/2026-09-14-controlled-content-ui-acceptance.md) |
## 并行集成补录
来源:dev@a5ea469c 的 CURRENT 增量。保留材料切块任务的新结论;活跃 CURRENT 保留其认领和最新槽位。
5. **材料切块不再看体积**:项目 6579 `doc_proj6579_bd_intake` 已确认候选 535,正式正文不再含「二进制压缩流」。成功解析的材料一律写入 `material_chunks`,≤60KB 仍全文注入。见 [报告](../../test-reports/2026-09-21-force-material-chunk-index-test-report.md)。已合入 `dev` 并从主目录 rebuild。test/main 未晋升。
@@ -0,0 +1,46 @@
---
task_id: herdr-orchestration-v12
status: done
owner: Codex
branch: feature/herdr-orchestration-v12
base_dev_sha: d919e06a73f7a4e18ed9d0cc26728f9cb32f8d97
policy_revision: agent-governance-2026-09-21-r1
deployment: not_required
remote_sync: not_requested
integration_state: merged
review_state: passed
cleanup: pending
cleanup_owner: independent-maintainer-after-owner-exit
effective_commit: 8c5e3477585fe27a485343dac97a670d95cf8905
---
# Herdr v1.2 分工与自动审批
授权:用户要求研究所给方案、纳入仅 Herdr 生效规范,并让已准备客户端自动通过工具请求。本轮修改规则与对应本地入口,提交/合入 dev;不改个人全局配置,不花费模型额度做探针,不操作产品/test/main,不 push。
本会话 HERDR_ENV 检查失败;依 Herdr 技能不查看/操作现有会话。以本机帮助/非敏感模型别名、官方文档及真实临时 Git/SQLite 配合模拟 Herdr 边界验收,不能声称真实 pane 已启动。
范围:AGENTS/PROJECT 条件入口、roster、两个启动/派发脚本及共享模块/测试。写入通过任务 path 租约;共享 CURRENT 用 CAS。保留其他任务与已存在 cleanup_pending。
结论与验收见下文。交付后的原 task_id 继续用于 Kimi 总次数;不得以拆子任务重置预算。
## 研究与验证结果
总体采纳。修正 Cursor“无限量”前提、执行跟踪与代码实施边界、默认唯一实施与显式故障接管的矛盾;Kimi 应急/终稿共用上限,GPT 耗尽不以文稿审核代替代码安全终审;普通会话不套用本分工。
本机配置只读核验:Claude Opus/Sonnet 别名为 glm-5.3[1m],Haiku 为 glm-5.3-flash[1m];Codex 默认 gpt-6-astra;PI 默认 minimax-cn/MiniMax-M3,模型目录可列出 qwen-token-plan-cn/qwen3.8-max、qwen3.8-flash 与 zai-coding-cn/glm-5.3。未读取或输出凭证;未修改这些全局设置;未实际调用远端模型。
- 11 项专用行为测试 PASS(4.664s),包含九个 profile 的自动审批 flags、Herdr 外/错工作区拒绝、目标 pane 检查、报告路由、显式实施备援、不确定发送不重投、唯一重试标记、同角色歧义、Kimi 关停/跨入口计数/未知结果不退款;八进程竞争只有一次真实模拟发送。
- [测试输出](../../test-reports/assets/2026-09-21-herdr-v12/focused-tests.txt);[九种启动命令](../../test-reports/assets/2026-09-21-herdr-v12/launch-commands.json)。Git/SQLite 是真实临时仓库,Herdr transport 为 fake,绝不将其声明为实际 pane 启动/模型 E2E。
- PI 安装版本 0.85.1 的本机 README 明确内置工具无权限弹窗,`--approve` 是项目文件信任;扩展仍可自建交互。Cursor force 保留显式 deny,Kimi 使用 auto 而非 yolo。其他本机帮助与[官方出处](../../ops/2026-09-13-herdr-agent-roster.md#5-自动通过请求与实际启动)相互核对。
- 本地复核:路由/参数集中于一个 Python 模块,两个 shell 薄入口不复制策略;保留 task 与主仓 `.locks` 身份校验;Kimi 占用在投递前事务提交。没有后台队列/全账户计费控制,MiniMax/GPT 预算轮次由任务记录管理。
- 代码不涉及产品 Go/前端/数据库业务;无需产品重建。提交后的候选将按工程测试全集验证,再受控合入 dev;真实 Herdr 会话核验留给下一次在 Herdr 内的实际任务,不在外部强行接入。
## 收口
实现提交 `8bc7940e`;生效 dev 候选 `8c5e3477585fe27a485343dac97a670d95cf8905`,其第一父节点 `d919e06a`,主目录持锁快进接收同一已验证节点。[候选完整输出](../../test-reports/assets/2026-09-21-herdr-v12/candidate-tests.txt):87 tests PASS,36.216s,含原门禁与本轮 11 项测试。语法、diff 与本轮链接检查均通过。收口附加提交仅文档,按文档契约另验。
运行边界:未启动真实 Herdr/pane/模型请求,未改全局配置、产品服务或数据库;deployment=not_required,无远端 push。不会把模拟 transport 的通过当作实际账户、余额或审批 UI 已消失的证明。
清理:[进程可见性预检](../../test-reports/assets/2026-09-21-herdr-v12/cleanup-preflight.json)拒绝,部分同 UID cwd 不可读。保留 `.worktrees/herdr-orchestration-v12` 与 `.worktrees/integrate-herdr-orchestration-v12`;独立维护者在 owner 退出和进程可见性核实后重跑普通 remove/-d 的全部门禁,不强删,不接管其他任务。
影响:Herdr roster、条件入口、规范登记、启动/派发脚本一致;不改变 FEATURE-MATRIX 的产品状态或治理完整自动化 partial,也不改变 gap-matrix。下一次实际 Herdr 任务先核验模型/自动审批启动状态,再按既有任务范围调度;Kimi 仅有必要时调用一次。
@@ -0,0 +1,41 @@
---
title: "意图确认优先与阶段感知消解"
status: done
created: 2026-09-21
updated: 2026-09-21
owner: Cursor
branch: fix/intent-confirm-stage-aware-2026-09-21
worktree: .worktrees/intent-confirm-stage-aware-2026-09-21
base_dev_sha: 49fb68fec1ea56f00616c23d08efb15950c2300d
mutex: intent+web+docgov
---
# 意图确认优先与阶段感知消解
## 目标
商务流初期「整理一下需求」等弱写表述 → 阶段感知消解为 intake,经确认卡片拍板后再执行;不强指令误伤。扩展已合入的工作流作用域修复。
## 范围
- 批次5 `feat(intent)`:弱写动词 + `stageAwareRequirementsTask` + `needs_confirmation`
- 批次6 `feat(coordinator)`:智能确认门禁(PendingExpectation)
- 批次7 `feat(web)`:阶段错误降级聊天一次
- 批次8:验收报告 + 合回 `dev` + 真实 PI 抽样
## 步骤
1. [x] 批次5–7 实现与单元门禁
2. [x] 批次8:合入 `dev@0c401904` + rebuild + 真实链路抽样(陈威项目 6579)
## 验收标准
- [x] V0.1「整理一下需求」→ 确认 →「好」→ intake(单元 + 真实 PI)
- [x] 强指令不强制确认;「编写用户需求表」无 rdev 误拦
- [x] 合入后真实 PI 抽样(见测试报告)
## 相关链接
- Plan: `~/.cursor/plans/意图确认优先与阶段感知_7ab2c4d5.plan.md`
- Prior (done): `.doc/archive/ops/2026-09-21-intent-workflow-scoping.md`
- Test report: `.doc/test-reports/2026-09-21-intent-confirm-stage-aware-test-report.md`
@@ -0,0 +1,70 @@
---
title: "意图填槽工作流作用域修复"
status: done
created: 2026-09-21
updated: 2026-09-21
owner: Cursor
branch: fix/intent-workflow-scoping-2026-09-21
worktree: "-"
mutex: intent+web+docgov
---
# 意图填槽工作流作用域修复
## 目标
意图识别填槽(target_doc / target_task)只命中当前激活工作流的文档与任务;显式点名其他工作流的文档时拦截并引导切换工作流,不误触、不执行。
## 背景
用户反馈:填「要修改的文档」等槽位时可能命中其他工作流的文档。根因链(2026-09-21 调研):
1. `intent.ContextSnapshot` 无 workflow 字段,`ToSnapshot()` 丢弃 `Project.ActiveWorkflowKey`;server 默认上下文硬编码 `CurrentWorkflow: "intake"`
2. `extractDocName` 词表全是 main(bd_)流文档名,无按流归属约束
3. 消费端匹配池 `ListWorkflowDocumentsByProject` 仅按 project_id 过滤(跨工作流全量),`selectReadableWorkflowDocument` 双向 contains 模糊匹配取首个命中
4. 前端 `resolveTaskTemplateForMessage` 匹配池 `currentProjectDeliverables` 仅按 projectId 过滤;`activeWorkflowKey` 只用于徽标展示
## 范围
- 批次1 `feat(intent)`:`ContextSnapshot` 增加 `ActiveWorkflowKey`;`ToSnapshot` 下传;docgov 命中他流文档名时打 `workflow_scope_mismatch` 标记不误填
- 批次2 `feat(coordinator+server+projectinstance)`:`ActiveWorkflowTaskKeys` 辅助查询;文档匹配池收窄到激活流;`ErrDocWrongWorkflow` 拦截引导;TRIGGER_TASK 任务键归属校验;enrich 时注入真实 `active_workflow_key`
- 批次3 `feat(web)`:`DeliverableItem.workflowKey`;文档列表 API 附带 `workflow_key` 与 `active_workflow_key`;templateMatch 匹配池按激活流过滤,他流点名返回 wrongWorkflow 提示
- 批次4:真实环境验收 + 测试报告 + 合回 dev
## 非目标
- 不迁移 `document_records` 表(不加 workflow_instance_id 列)
- 不改 `production_ready`、不晋升 test/main、不动项目 143
- 不改 SWITCH_WORKFLOW 意图本身行为
- UI 文档展示列表保持全量(仅匹配池收窄)
## 渐进安全策略
`active_workflow_key` 为空或查不到激活实例(存量单流项目、planning 态)→ 不过滤,保持现状行为。
## 步骤
1. [x] 批次1:intent 快照与工作流词表归属
2. [x] 批次2:服务端匹配池收窄与拦截引导
3. [x] 批次3:前端模板匹配池收窄
4. [x] 批次4:真实环境验收、报告归档、合回 dev
## 验收标准
- [x] 激活 main 流说「查看调研报告」→ 命中 main 流文档(正例;修改/生成话术另记路由噪声)
- [x] 激活 main 流说「编写项目建议书」(rdev 流文档)→ 拦截 + 引导切换(反例;tasks/run 409 ERR_DOC_WRONG_WORKFLOW)
- [ ] 激活 rdev 流后同名操作 → 正常执行(切换后正例;本轮 SWITCH 落库未兑现,记 deferred)
- [x] 存量无 active_workflow_key 项目 → 行为不变(回归)
- [x] 相关包 `go vet` / scoped `go test -short`、`web: npm test && npm run build` 全绿
## 相关链接
- Plan: `~/.cursor/plans/意图填槽工作流作用域修复_dba2ab4c.plan.md`
- Handoff:
- Test report: `.doc/test-reports/2026-09-21-intent-workflow-scoping-test-report.md`
## 证据 / 备注
用户在 dev 商务对接实测发现跨工作流误命中。用户在方案确认时选定:严格拦截 + 引导切换;等四问题修复 mutex 释放后独立分支推进。
- 2026-09-21 收口:已合入 `dev@e0665ca4`,验收报告见 `.doc/test-reports/2026-09-21-intent-workflow-scoping-test-report.md`。
@@ -0,0 +1,59 @@
---
title: "工作流作用域权重化"
status: done
created: 2026-09-21
updated: 2026-09-21
owner: Cursor
branch: feature/workflow-scope-weighting-2026-09-21
worktree: .worktrees/workflow-scope-weighting-2026-09-21
base_dev_sha: 10aee3feb478c550adc9959f2d3a8d17cd5b48a0
write_scope: [internal/workflowscope, internal/intent, internal/server, internal/coordinator, internal/config, internal/sysadmin, web/src, docker-compose.dev.yml, docker-compose.test.yml, docker-compose.main.yml, .env.example, .doc]
head_sha: 7723a5515948788602b342cdda1137c90fee311b
deployment: deployed
cleanup: pending
mutex: intent+web+docgov
---
# 工作流作用域权重化
## 目标
把「句子里出现他流文档短语就硬拦截」改为「匹配质量 × 工作流关系权重」裁决。激活流优先;只有他流精确命中明显压过激活流时才跨流。只读跨流在查看权限通过后放行并注明归属;写动作仍引导到项目设置切换(跨流写在现架构下不可执行)。`WORKFLOW_SCOPE_MODE` 默认 `strict`,保持现状。
## 范围
- 新建 `internal/workflowscope`(开关、关系权重、打分裁决)
- 服务端文档读取、意图填槽、前端模板匹配改用同一裁决
- compose / `.env.example` / sysadmin 登记开关
- dev 真实环境验收与测试报告
## 非目标
- 不迁移 `document_records`,不加 `workflow_instance_id`
- 不改工作流切换 / 激活接口
- 不改 `production_ready`,不晋升 test/main,不动项目 143
## 步骤
1. [x] 打分内核与开关
2. [x] 服务端只读跨流放行与查看权限
3. [x] 意图填槽改打分
4. [x] 前端模板匹配改打分
5. [x] 开关声明、真实验收、报告、合回 dev
## 验收标准
- [x] strict 模式与现有跨流拦截断言一致
- [x] weighted 下激活流精确名压过他流短语,不再误拦
- [x] weighted 下只读精确点名他流文档可放行并注明归属;写动作仍拦截
- [x] 无查看权限 / 实例已关闭时跨流只读拒绝
- [x] 空激活键不过滤
## 相关链接
- Plan: `~/.cursor/plans/工作流作用域权重化_411b5e35.plan.md`
- Test report: `.doc/test-reports/2026-09-21-workflow-scope-weighting-test-report.md`
## 证据 / 备注
查看权限:治理实例 `ViewableTaskKeys` 只含当前实例已启用文档。他流任务键不在快照内,不能把它当成「显式隐藏」。判定为:解析失败按 `failClosedAuthz` 拒绝;`ViewableTaskKeys` 为空(实例已关闭)拒绝;键落在当前实例但不可见则拒绝;键不属于当前实例、且调用方已能查看该实例文档时允许只读。
@@ -0,0 +1,59 @@
---
title: "个人工程中控台:实时项目看板与离线 HTML 快照"
status: done
created: 2026-09-17
updated: 2026-09-17
owner: Cursor-Auto
branch: feature/engineering-dashboard
worktree: .worktrees/feature-engineering-dashboard
mutex: engineering-dashboard
---
# 个人工程中控台:实时项目看板与离线 HTML 快照
## 目标
实现一个独立于产品后台的本地只读中控台,以同一不可变快照驱动实时页面、机器可读 JSON 与单文件 HTML 导出。
## 范围
- 聚合 `.doc`、Git/worktree、Docker/Compose、`/ready` 和晋升凭证。
- 展示架构、模块、功能、任务、分支、验证和环境实装证据。
- 提供 Markdown 搜索、阅读、正反向链接和证据链导航。
- 显示来源、新鲜度、degraded 与 drift,不把声明状态当作观测状态。
## 非目标
- 不接入产品后台、产品数据库或产品权限体系。
- 不写文档,不操作 Git、Docker、部署或 Herdr。
- 不隐式联网或执行 `git fetch`。
## 步骤
1. [x] U1:冻结快照、事实与四轴状态契约。
2. [x] U2:实现文档图谱与领域解析器。
3. [x] U3:实现 Git 与 worktree 采集。
4. [x] U4:实现运行态与部署证据采集。
5. [x] U5:实现对账、派生视图与新鲜度。
6. [x] U6:实现本地服务、总览与文档导航。
7. [x] U7:实现离线导出、脚本、浏览器验收和治理文档同步。
## 验收标准
- [x] 实时 HTML、离线 HTML 和 JSON 引用同一 `generation_id` 与 `revision_id`。
- [x] 计划、实施、验证、实装四轴独立展示。
- [x] rdev、dev ahead、main events 分叉三个真实样本按方案输出。
- [x] 单源失败时页面仍可用,且显示 stale/error/last-success。
- [x] 默认仅监听 loopback,无写操作、凭证暴露、路径越界和远程资源执行。
- [x] 导出 HTML 离开仓库后仍可阅读 Markdown,且不嵌入 assets。
## 相关链接
- 设计与实施方案:[../../archive/design/2026-09-17-personal-engineering-control-center-plan.md](../../archive/design/2026-09-17-personal-engineering-control-center-plan.md)
- Test report: [../../test-reports/2026-09-17-engineering-dashboard-test-report.md](../../test-reports/2026-09-17-engineering-dashboard-test-report.md)
## 证据 / 备注
- 实现提交序列见 `feature/engineering-dashboard`(U1→U7)。
- 启动:`./scripts/engineering-dashboard.sh serve --repo . --addr 127.0.0.1:8787`
- 导出:`./scripts/engineering-dashboard.sh export --repo . --output /tmp/engdash.html`
@@ -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 硬门槛。
@@ -0,0 +1,24 @@
---
title: "FAV U7 incremental — remaining port inventory"
status: open
created: 2026-09-16
updated: 2026-09-17
---
# FAV U7 增量:未移植清单
相对 `feature/final-artifact-vault`,本切片 **未** 整支 merge,且因 `internal/artifactvault` 与当前 `dev`(dataset Candidate backfill)大面积 DIFF,下列能力仍待后续手工移植 + 审计:
| 项 | 旁支路径 | 阻塞 |
|----|----------|------|
| EnumerateTerminals / LoadExclusions | `internal/artifactvault/enumerate.go` | 依赖 TerminalRow;与现 `Enumerate(Candidate)` 并存需设计 |
| TerminalRow Backfill | FAV `backfill.go` | 现 backfill 已改为 dataset 路径 |
| 完整 CLI | `cmd/artifact-vault` 全命令 | 本切片仅 status stub |
| ingest hooks | `internal/server/vault.go` OnFinalArtifact* | 会写 staging;需与 publisher 门闩同批审批 |
| schema JSON | `*.schema.json` | 可选文档资产 |
| durable Register(fav) | `cmd/events` | events 硬门 + 单独 cutover 审批 |
| live staging → artifact → publication | publisher Drain / ingest hooks | 每级观察窗 ≥7 天;本轮 **未** 放量 |
**W6 已移植(仍非 live)**:`internal/app/fav.EventConsumer.ObserveShadow` 只计算 intended outcome(`WouldStage`/`WouldPublish` 恒 false);`FAV_DEGRADED_READ` 为 true 时 shadow 直接拒绝;`HandleLease` 与 `Registry.Register(fav)` 仍 fail-closed。
**红线保持**:`FAV_DEGRADED_READ=false`;fav consumer mode=off;禁止整支 merge。
@@ -0,0 +1,45 @@
---
title: "临时验证脚本 Path 空字符串拼接导致跨任务取证串味"
status: done
created: 2026-09-17
updated: 2026-09-17
severity: low
---
# 临时验证脚本 Path 空字符串拼接导致跨任务取证串味
## 现象
S0.3 真 PI 打样归档时,`rd_design_input_spec-final.md` 一度被写成无关客户的商务对标报告(「掌上无线超声系统 × GE Vscan / Philips Lumify」),而非设计输入规格书终稿。
## 根因分析
产品侧小队/工作区创建正常:失败的 `rd_*` 请求因 main-completed 硬 precheck 拒绝,`task_runs.WorkspaceID` 如实为空。
缺陷在**本地临时取证脚本**(`.doc/test-reports/assets/2026-09-17-rdev-template-depth/run_s0_*.py`)的兜底逻辑:
1. `ws_id = pi_result.get("workspace_id") or ""` 在响应无该字段时得到空串;
2. Python `pathlib`:`Path(bizdev_root) / ""` **坍缩为父目录本身**(无报错);
3. 随后 `root.rglob("output.md")` 扫遍共享 `data/dev/workspaces/bizdev/` 全树;
4. 「取最长文本」启发式选中历史商务任务终稿并误归档。
证据:会话内 `task_runs` 失败记录 `WorkspaceID=""`;`Path('/a/b') / '' == Path('/a/b')` 可复现;误归档文件内含 `adhoc_GEVsca_...` 工作区路径。
## 严重度
`low` — 仅本地取证脚本;未污染产品库、未改小队/黑板创建逻辑;同轮已用精确工作区路径重归档并随测试报告提交干净终稿。
## 关联整改
- 无需产品代码改动。
- 经验红线:临时验证脚本禁止「空路径拼接 + 全树 `rglob` + 取最大值」组合;`work_dir`/`WorkspaceID` 为空时必须失败退出,不得扩大搜索范围。
## 证据
- 正确终稿:`.doc/test-reports/assets/2026-09-17-rdev-template-depth/rd_design_input_spec-final.md`
- 测试报告:`.doc/test-reports/2026-09-17-rdev-template-depth-test-report.md`
- 工作区 ID 生成:`internal/squad/workspace.go`(`ws_%s_%d` + UnixNano)
## 开放问题
- 无。
@@ -0,0 +1,62 @@
---
title: "D7 对话数据分类盘点"
status: done
created: 2026-09-17
updated: 2026-09-17
severity: medium
---
# D7 对话数据分类盘点
## 现象
FEATURE-MATRIX「对话数据治理(D7)」为 `deferred`;ADR 数字 `pending-compliance-signoff`。W7 只盘点当前基线:会话正文、派生副本、共享 KB、日志、备份、事件敏感字段。本轮**未**按草案 365/180/30 天执行物理删除或备份清除。
## 根因分析
当前基线是「热库明文 + 软删除列预留 + 事件 ID 化」,不是已签字的留存作业。缺口是**尚未实现**的治理能力,不是已确认合规数字被违反。
## 严重度
`medium`(实现缺口;**不**升 gap-matrix blocker)
## 分类盘点
| 数据类 | 位置 | 形态 | 现状 |
|--------|------|------|------|
| 会话正文 | `chat_sessions` / `chat_messages.content` | 热库明文 TEXT;`deleted_at` 列存在 | dev 619 sessions / 3291 messages;`deleted_at` 全 NULL;Go 无 `SET deleted_at`、无 `DELETE FROM chat_*` |
| 派生摘要 | `chat_daily_digests` | headline / key_points JSON | 0 行 |
| 向量记忆 | `context_memory_chunks` | `content` TEXT + embedding | 102 行:`project_doc` 71、`chat_history` 24、`approved_case` 7。聊天派生副本会随正文留存 |
| 私密文档 | `freeform_documents` | `is_deleted` / `deleted_at` + version markdown | 122 份,其中 113 已软删(聊天消息无对等写路径) |
| 共享 KB | `shuimu-kb-shared` / `regulations` | 法规 chunks,无 chat 表 | `reg_documents` 2907、`reg_chunks` 312919;与对话库隔离 |
| 事件 envelope | `event_envelopes.payload` BYTEA | JSON 字段 | 4 条;keys 均为 ID/digest/`summary_ref`,`has_content=false` |
| 事件 DLQ / attempts | `event_dead_letters` / `event_delivery_attempts` | ID + reason / error_code | DLQ 0;attempts 4;无正文列 |
| 日志 | Docker `json-file` 无 max-size | 应用 slog | 抽检 rebuild 日志:DSN 已 `***`,无 chat content |
| 备份 | `scripts/backup-system-db.sh` `pg_dump -Fc` | 整库含 chat 明文 | 宿主机无 `./backups` 目录;CI 有 backup-restore-drill |
| Agent workspace | `data/dev/workspaces` 150M | 非终态工作区 | 无 30 天清理作业(ADR 草案待签字) |
| FAV | `final_artifacts` | 1 行;consumer mode=off | 与聊天口径解耦;W6 shadow 不写 |
事件 payload 比 `StaticContracts` allowlist **多出** `workspace_id` / `manifest_sha256` 等 ID 字段,但仍无聊天正文。属契约收紧 follow-up,不是 Track E 正文泄漏。
## 违规判定
对照已签字约束(Track E ID-only 日志/DLQ、R13 出站最小化、ADR 明确「签字前禁止按数字删除」):
- **未发现**已确认安全/合规基线被当前实现违反。
- **因此不写** `gap-matrix` blocker。
- 缺 365 天热库清理、缺聊天 soft-delete 写路径、缺字段级加密,均属 ADR 签字后的 W7 整改实现,不得在本轮当「已违规」执行删除。
## 关联整改
- ADR 草案: [../adr/2026-09-17-d7-chat-data-retention.md](../adr/2026-09-17-d7-chat-data-retention.md)
- 签字后整改:soft-delete 写路径 → 观察窗 → 物理清理;同步清 `context_memory_chunks` 的 `chat_history`;备份二次批准 + delete manifest(R22)
## 证据
`.doc/test-reports/assets/2026-09-17-w7-d7-inventory/`(counts / columns / event keys / KB / logs / health)。查询只读,未 `DELETE`/`UPDATE`。
## 开放问题
- 合规何时签字或改数(365/180/30)?
- 聊天 UI 删除是否要与 freeform 回收站对齐?
- `taskrun.completed` payload 额外 ID 字段是否收紧 allowlist?
@@ -0,0 +1,32 @@
---
title: "docgov 变更提案缺少 HTTP 路由"
status: resolved
created: 2026-09-17
updated: 2026-09-17
severity: medium
---
# docgov 变更提案缺少 HTTP 路由
## 现象
引擎侧存在 `docgov.ProposeModification` / `DecideModificationProposal`,但服务端此前仅注册 `POST /api/v1/docgov/proposal/decide`;前端 `App.tsx`「变更方案提议」(`pendingProposal`)为本地模拟。
## 根因分析
生命周期三接口与 claim 已注册;变更提案 **propose** 路径从未暴露为 HTTP。
## 严重度
`medium` — 不阻塞编制→审核→批准主链;阻塞「认领后小队修改须提案确认」的真实治理。
## 处置(resolved)
- 新增 `POST /api/v1/docgov/proposal` → `ProposeModification`
- 前端 `proposeModification` / `decideModificationProposal` + App 接线
- 单测:`TestServer_DocGovProposeAndDecideHTTP`、`web/src/api/docgov.test.ts`
- 任务:`.doc/ops/short-term/2026-09-17-docgov-modification-proposal-http.md`
## 证据
- 合入后真实 HTTP 证据见 `.doc/test-reports/assets/2026-09-17-docgov-modification-proposal-http/`
@@ -0,0 +1,54 @@
---
title: "可选职责空审核人 CreateOrGetDocument 写 reviewer_id=0 触发 FK"
status: done
created: 2026-09-17
updated: 2026-09-17
severity: high
---
# 可选职责空审核人 CreateOrGetDocument 写 reviewer_id=0 触发 FK
## 现象
dev 项目「内廷元无创神经刺激器」(6417) 发起 `intake` 任务后 UI 显示:
- `code: INTERNAL_ERROR`
- `userMessage: 系统内部错误,请重新开始会话`
- `requestId: run_1789622069585300787`
- `sessionId: sess-p6417-u9`
浏览器偶发 `flushSync was called from inside a lifecycle method`(错误态重渲染副作用,非根因)。
## 根因分析
1. app-dev 日志:`persist document ledger: ... document_records_reviewer_id_fkey (SQLSTATE 23503)`
2. 项目成员仅 `document_duty=author`(user 9),无 reviewer/approver
3. `resolveTaskDocumentDuties` 合法返回 `ReviewerID=0`
4. [`internal/docgov/engine.go`](../../internal/docgov/engine.go) `CreateOrGetDocument` 把 `0` 写入可空 FK,PG 拒绝(无 `users.id=0`)
5. `ClassifyError` 默认分支掩盖为 `INTERNAL_ERROR`
对照:[`internal/docduty/store.go`](../../internal/docduty/store.go) heal 路径已有 `nullIfZero`,**创建路径漏改**。
复现:`INSERT ... reviewer_id=0` → 同 FK 错误。近 7 天同因至少 3 次(6417/6359/6274)。
## 严重度
`high`(任何无 reviewer 职责的项目首次落文档账本均会失败;可扩散至 test/main)
## 关联整改
- Short-term: [../archive/ops/2026-09-17-docgov-optional-duty-null-fk.md](../archive/ops/2026-09-17-docgov-optional-duty-null-fk.md)
- Fix branch: `fix/docgov-optional-duty-null-fk`
- Test report: [../test-reports/2026-09-17-docgov-optional-duty-null-fk-test-report.md](../test-reports/2026-09-17-docgov-optional-duty-null-fk-test-report.md)
## 证据
- `docker logs shuimu-agent-app-dev` @ `2026-09-17T05:14:29Z` run_1789622069585300787
- `task_runs.error_message` 与上述一致;`document_records` 对 project 6417 为 0 行
- 手工 `INSERT reviewer_id=0` → `Key (reviewer_id)=(0) is not present in table "users"`
## 后续
- 创建路径 0→NULL;ClassifyError 增加 `DOC_LEDGER_ERROR`
- 不强制配置 reviewer(保持可选职责语义)
- flushSync 另开任务
@@ -0,0 +1,45 @@
---
title: 文档编制人兼任模式源码核查
status: done
created: 2026-09-17
updated: 2026-09-17
severity: medium
---
# 文档编制人兼任模式源码核查
## 结论
当前 dev 基线 adb48c8 不支持本需求。已有标准三人审批、可选免审批、系统设置白名单可复用,但必须补齐逐文档模式、职责来源和前端多职责。
## 根因与证据
1. `internal/projectinstance/duty_mode.go`:partial 拒绝,full 要求三人分离。
2. `internal/projectinstance/service.go`:创建者规划权限与激活后冻结已存在。新需求需在这条链上增加总授权,不能只改 UI。
3. `internal/docduty/store.go`:HealProjectDocuments 按项目默认职责回填受控文档。`internal/docgov/project_docs.go` 在列表读取时调用;`internal/bizdev/service.go` 在生成后调用。新增逐文档策略必须阻止该链覆盖实例职责。
4. `web/src/lib/currentDocRole.ts` 优先返回 author;`docGovActionVisibility.ts` 按单角色显示动作。同人三职会缺审核和批准入口。
5. `internal/server/handlers.go` 三个动作端点固定使用相应 action role,并以登录身份调用引擎;`internal/docgov/state_machine.go` 可复用逐步流转。
6. `internal/sysadmin/settings.go` 有白名单 bool 设置,但没有本需求 key;存储只保留最后修改人时间,新策略需独立版本与审计。
以上为静态源码核查,未查询真实用户数据,未执行功能测试,未声称线上已复现或已修复。完整源码映射与实施单元见方案。
## 关联方案
[文档编制人兼任审核批准](../remediation/2026-09-17-document-author-only-plan.md)
## 文档检查
已检查两级权限、逐文档独立性、full/none 兼容、前后端职责来源、状态与锁、并发授权撤销、成员退出、迁移及回滚。修正一处 docflow 路径为 internal/app/docflow。方案明确区分已知事实与建议口径。
ce-doc-review 未运行:当前工具目录未提供可调用的 skill invocation 入口;按 ce-plan 的 skill_unreachable 分支记录,不能把本地自检当作独立文档审查通过。
```yaml
fixes_applied: 0
proposed_fixes_count: 0
decisions_count: 0
fyi_count: 0
skipped_reason: skill_unreachable
skipped_detail: No callable skill invocation interface in this session; local source and consistency checks only.
```
上方计数仅为未运行技能的占位,不代表产品决策已解决。开放问题仍为 R9、R10;用户未答复时保持方案建议,业务实现不得自行视为授权。
@@ -0,0 +1,117 @@
---
title: "首次加载慢:静态资源、字体与初始化请求诊断"
status: done
created: 2026-09-17
updated: 2026-09-17
severity: high
---
# 首次加载性能诊断
## 结论与适用范围
当前已复现的主要问题在浏览器加载入口:登录页也下载约 2.82 MB 未压缩 JavaScript;外部 Google Fonts CSS 阻塞页面加载;若用户访问 Vite 3100,首访进一步扩大为 207 个资源请求、12.24 MB。冷缓存与热缓存差异很大,与“尤其第一次慢”一致。
登录后还有已确认的请求放大和后端重复工作,但没有登录态浏览器瀑布图或 SQL 耗时,不能声称已量化其贡献。用户已确认 3100/8080/8081,系统重启后第一次访问约十数秒;设备、网络与“系统重启”包含宿主机还是仅应用尚未确认;本次未复现用户原始环境的完整等待时间。
- 主仓读取时 `feature/rdev-core@52f0fbc`;其他 Agent 正在工作,未切换其分支。
- 文档独立 worktree 基线为 `dev@d0ef696`。创建前已 fetch;本地 dev 有未推送提交,未 reset/覆盖。
- 实测现有 8080/8081/8000 构建入口与 3100 Vite;以资源 hash 为运行产物标识,**没有证据证明容器恰好等于上述源码 commit**。
- “首次”定义为新浏览器 context、空 HTTP 缓存;没有重启服务、清空 DB 缓存或重启 Vite,故不是服务/依赖预构建冷启动。
- 未登录、没有调用对话/文档写接口;浏览器探针未使用真实用户会话。
## 实测基线
工具:隔离 Playwright v1.63.0 Docker 浏览器,host 网络访问既有服务。宿主浏览器缺 libatk,改用本机已有浏览器镜像;未修改应用容器。每个场景一个样本,仅诊断,不是 p95 或交付验收。
| 场景 | 登录输入框可见 | FCP | 资源数 | transferSize 合计 |
|---|---:|---:|---:|---:|
| 8080 本机冷缓存 | 662 ms | 664 ms | 4 | 2,857,761 B |
| 同 context 再次导航 | 62 ms | 60 ms | 5 | 353 B |
| 8080 CDP 10 Mbps / 80 ms 冷缓存 | 2,636 ms | 2,636 ms | 4 | 2,857,761 B |
| 同 context 再次导航 | 60 ms | 60 ms | 5 | 353 B |
| 8080 CDP 2 Mbps / 80 ms 冷缓存 | 11,776 ms | 11,776 ms | 4 | 2,857,761 B |
| 3100 本机冷缓存 | 659 ms | 652 ms | 207 | 12,238,086 B |
| 3100 同 context 再次导航 | 162 ms | 160 ms | 208 | 52,253 B |
transferSize 是浏览器 Resource Timing 可观测资源求和,不含顶层 HTML,不等于全链路抓包流量。输入框可见按导航命令开始至 selector 可见计时,FCP 来自页面 Performance API,两者采样时钟和帧提交不同。CDP 限速为模拟设置,不能代替真实公网 RTT;本机 document TTFB 仍约 1–3 ms。首次/再次均保持已有服务运行,未运行 Vite 冷预构建基准。
### F1. 入口包过大且未按需加载(高置信)
- `web/src/main.tsx:2` 静态导入 App;`web/src/App.tsx:98,103,108,145-146` 静态导入导出、系统管理、文件预览等模块;未登录判断直到 `App.tsx:3461`,无法避免入口依赖下载和求值。
- `web/src/features/replyExport/download.ts:1` → docx;`web/src/engine/docxRenderer.ts:19-22` → docx、KaTeX、Mermaid;`web/src/engine/xlsxRenderer.ts:1` → XLSX。
- `web/src/components/doc/preview/FilePreviewPanel.tsx:19-24` 全部静态导入预览器;DocxViewer、ExcelViewer 各自静态导入重依赖。
- 浏览器访问登录页即可观测大 JS。3100 瀑布中含 katex.js 485,944 B、xlsx.js 870,702 B(decodedBodySize)。并非仅仅源码中出现依赖但构建已经排除。
- 8080 主 JS `/assets/index-BLnmtk_3.js` = **2,820,055 B**;8081 = 2,805,141 B;8000 = 2,798,137 B。
因果链:空缓存 → 登录视图与全部工具共入口 → 下载/解析无关依赖 → 网络较慢时登录表单迟迟出现。10 Mbps 下主 JS 下载约 2,373 ms;2 Mbps 首屏约 11.78 秒。没有采集 CPU trace,不能进一步把时间分解成具体库的执行成本。
### F2. 静态响应无压缩、无明确长缓存策略(高置信)
- 三个构建入口均携带 `Accept-Encoding: gzip, br` 请求主 JS,响应没有 `Content-Encoding`,`Content-Length` 为原始字节数。
- `internal/server/server.go:344-384` 使用 `http.ServeFile`,没有静态压缩协商或显式 Cache-Control。
- 同一 8080 JS 离线 gzip 后 **796,146 B**,相对原始包减少约 **71.8%**。这是体积估算,不是已部署优化结果,也不是端到端提速承诺。
- 资源有 Last-Modified,没有显式 Cache-Control/ETag。本次再次导航已命中浏览器缓存;**不能写成“完全没有缓存”**。问题是版本化资源缺少可预测的长期缓存契约。
源站是上述行为,未知用户实际入口是否另有反向代理压缩。优先在真正提供构建资源的层验证和修复。
### F3. 外部字体 CSS 可放大首次白屏(高置信机制,用户网络贡献待测)
- `web/index.html:9-15` 的 Google Fonts 是 head 中普通 stylesheet。`display=swap` 控制字体显示,不会让外链 CSS 本身变为非阻塞。
- 本机自然请求字体 CSS 耗时 **508 ms**,DOMContentLoaded 609 ms,登录可见 662 ms。
- 浏览器拦截并立即失败字体 CSS:登录可见 **210 ms**。Playwright route 会禁用 HTTP cache,因此这个场景不能用于热缓存收益对比,也不能据单样本得出精确净收益。
- 控制实验仅让字体 CSS 等待 5 秒再失败,其余请求正常:DOMContentLoaded **5,111 ms**、登录可见 **5,161 ms**。证明该依赖可以把外部等待传到登录首屏,**不表示自然字体请求真的用了 5 秒**。
### F4. 登录后项目成员扇出并放大会话同步(源码已证实,耗时待测)
`web/src/App.tsx:524-540` 获取项目后,对每个项目调用成员接口;`:383-387` 每次成员结果用 map 生成新的 projects 数组;`:560-590` 的会话列表 effect 依赖 projects,因此成员返回可重复触发会话列表请求。取消标志仅忽略部分返回,没有 AbortController 终止已发请求。React 批处理可能合并更新,**不能写成固定 N 次会话请求**。
项目数 N 增大时,初始成员请求为 N,叠加会话重取、setProjects 及本地持久化。`web/src/data/storage.ts:63` JSON.stringify + localStorage.setItem,`App.tsx:343` 随 projects 更新保存。持久化是否成为长任务还须 profile,不能预设为主要根因。
### F5. 认证有重复查询和同 session 写放大(源码已证实,耗时待测)
`internal/server/auth_middleware.go:48,62` 已认证并保存 principal;`internal/server/auth_handlers.go:126-139` 的 me 再认证。每次经 `internal/auth/service.go:197-203`、`internal/auth/pg_store.go:335-367` 执行 SELECT session、SELECT status、UPDATE session、GetUserByID。正常 PG me 路径共 8 次认证 DB 操作,加一次权限查询。
其他鉴权请求也无条件 UPDATE 同一 auth_sessions 行;首屏并发可能放大行锁/连接等待。未采集 pg_stat_activity/锁等待或接口 p95,锁竞争是待验证风险。
### F6. 文档列表的隐含写修复与轮询叠加(源码已证实,耗时待测)
`internal/docgov/project_docs.go:59-74` 列表先调用 `HealProjectDocuments`;`internal/docduty/store.go:173-205` 开事务并取得项目 advisory lock(`internal/docduty/revoke.go:111-126`),重复读取创建者/成员,扫描文档,按需逐条 UPDATE,commit 后才正式 SELECT。
前端 `App.tsx:1507-1545` 每 5 秒为租约同步调用这个完整列表。请求时长超过间隔时可能重叠;相同项目多个标签放大成本。**不能直接删除 heal**:须先补齐创建/成员变更/转交/撤销写路径与历史数据修复闭环。本轮没有用该 GET 做只读探针。
### F7. 会话列表先聚合消息再分页(源码已证实,耗时待测)
`internal/ctxmgr/chat_history.go:110-125` 候选会话 JOIN 消息、COUNT、GROUP BY/ORDER BY 后 LIMIT,另取最新消息内容。仅返回少量会话不代表少量消息扫描。`internal/projectworkflow/store.go:171-240` 项目列表也无分页。
已有 `chat_messages(session_id, created_at)` 索引(`deploy/postgres/goose/00001_baseline.sql:119`);不笼统认定缺索引。先 EXPLAIN/数据量和可见性分析,再决定先分页后统计、索引或摘要。
### F8. 重启场景补查(用户补充后)
用户明确 3100、8080、8081 在系统重启后首次进入约十数秒。三种冷态须分开:浏览器 HTTP 缓存、Vite 转换/依赖缓存、Go/DB/代理启动就绪。重启若不改变构建 hash,并不会自动清掉浏览器持久 HTTP 缓存;不能直接用新 context 测量解释全部重启现象。
现存容器启动记录:dev StartedAt `2026-09-17T07:00:38.127811581Z`,打印“监听地址”于 `07:00:38.293728694Z`(约 **166 ms**);test StartedAt `06:20:05.243037366Z`,打印监听于 `06:20:05.384607542Z`(约 **142 ms**)。这是已有 DB 就绪条件下的一次启动、且日志先于真正 ListenAndServe,**不是 host reboot→ready 时间**;但未支持“Go 每次初始化必然十几秒”。
`cmd/server/main.go:41-50` 的初始化在监听前,`internal/bizdev/service.go:69-114` 包括 DB Ping/迁移/成员补齐/seed;DB连接段 timeout 5 秒,后续 seed 使用 Background,缺少分阶段耗时。`internal/app/app.go:355` 的 Runtime.Start 幂等,入口重复调用不会重复启动 worker,不能据此误判双倍启动。
Compose app healthcheck 每 10 秒、start_period 20 秒;start_period 是失败宽限窗口,**不代表强制等待20秒**。若代理/运维脚本等健康状态才放流,则探测周期可能影响可见就绪,需要对齐宿主启动、DB healthy、app listen、ready、首次请求时间。3100 的无缓存 Vite 预构建/按请求转换为独立候选,8080/8081 构建产物不存在 Vite 首次编译。
隔离 Vite 在 3199 使用独立空 cacheDir,同源码、未重启宿主/DB:监听准备 43 ms,首访登录可见 **1,580 ms**、207 资源/14,445,631 B,再次 171 ms。服务先启动、浏览器随后连接,部分预构建可能已在导航前完成;该值不是“启动到首屏”总时间。支持开发冷态有额外成本,但本机未复现自然网络十数秒;不得仅靠 warmup 宣称已解决 8080/8081。证据见 `../test-reports/assets/2026-09-17-initial-load-performance/vite-cold.json`。
本轮不重启正在使用的共享服务;U1/U7 纳入计划中的隔离重启矩阵和阶段计时。没有把服务冷启动排除在用户需求之外。
## 已排除与未证明
- 本机静态 HTML TTFB 约 1–3 ms;这组未登录测试并非后端生成首页耗时数秒。
- 没有请求产品 PI Runner,因此本次首屏慢不能归因于大模型冷启动。
- 服务监听前迁移/种子初始化(`cmd/server/main.go:41-50,84-85`;`internal/bizdev/service.go:69-114`)只解释重启就绪,不等于每个新浏览器首访。
- 没有用户重启时的 FRP/公网瀑布、登录后基线、慢 CPU profile、数据库 EXPLAIN;不对这些项宣称已复现。
- 基线现有测试以功能为主;本轮未发现首屏资源预算/冷缓存性能门禁。未运行业务测试,因为没有业务代码变更。
## 关联整改与证据
- [改进方案](../remediation/2026-09-17-initial-load-performance-plan.md)
- [诊断测量报告](../test-reports/2026-09-17-initial-load-performance-baseline.md)
- [完整浏览器数据](../test-reports/assets/2026-09-17-initial-load-performance/browser.json)
- [受控实验](../test-reports/assets/2026-09-17-initial-load-performance/controlled.json)
- [静态响应摘要](../test-reports/assets/2026-09-17-initial-load-performance/assets.json)
@@ -0,0 +1,180 @@
---
title: "系统全面体检:任务收口、缺陷与未启用功能审计"
status: done
created: 2026-09-17
updated: 2026-09-17
severity: high
---
# 系统全面体检(2026-09-17)
> 范围:① 规划未实现 / 需变更 / 实施中任务;② 现存与潜在 bug;③ 已实现但未启用或未测试的功能。
> 方法:文档 SSOT 盘点(CURRENT / FEATURE-MATRIX / gap-matrix / short-term / long-term / backlog / ADR / handoff)+ Go 全量 vet/build/test + 前端 test/build + 特性开关与环境配置交叉核对。只读审计,未实施任何修改。
> 基线验证:`go vet ./...` 与 `go build ./...` 全绿;`go test -short -count=1 ./...` 62 包全 ok;`web` npm test(380+32)与 build 通过。
---
## 一、任务状态盘点
### 1.1 实施中(in_progress)
| # | 任务 | 位置 | 剩余工作 |
|---|------|------|----------|
| T1 | partial/deferred 全量收口总控 | `.doc/ops/short-term/2026-09-16-partial-deferred-completion.md`(owner Cline) | W5(SWBOOT-10 真实现 + 真实 PI + UI 二次验收)、W6(FAV shadow→live 放量)、W7(D7 按 ADR 整改,待合规签字)、逐行升 done |
| T2 | Control Center 个人中控台 | 2026-09-19 已移出本仓库 | 进度管理改由独立项目承担;本仓库不再保留该模块 |
| T3 | 纯软件项目自举 W5b | `.doc/ops/long-term/2026-09-14-software-project-bootstrap-implementation.md` | SWBOOT-10 受控执行器(真 patch/merge)未启动,需独立安全评审,当前 fail-closed stub |
### 1.2 已规划未开始
| # | 任务 | 位置 |
|---|------|------|
| T4 | 首次加载性能 U1/U3–U7 | `.doc/remediation/2026-09-17-initial-load-performance-plan.md`(仅 U2 done:主 JS 传输 2.82 MB→~624 KB) |
| T5 | 选择性模块解耦 M4–M6 | `.doc/ops/long-term/2026-09-14-selective-module-decoupling.md`(planned,owner=TBD) |
| T6 | 产品 backlog:B5 报价复核、A5/A6 小队降级与 trace、A7 中文注释迁移、D5 KB 按环境隔离评估 | `.doc/backlog/chat-agent-p6-backlog.md`(均无任务文件) |
| T7 | `TestReconcile_LegacyRepair_PG` 工程测试债 | gap-matrix DOC-CONTENT-CANONICAL-HASH-DRIFT 行(需隔离 PG,本机无) |
| T8 | IAM 收尾开放项:410 退役产品拍板、R13 全量清单勾选 | handoff `2026-09-16-phase3-leftover-closeout.md` |
### 1.3 部分完成(partial,剩余关闭条件)
| 行 | 剩余关闭条件 |
|----|--------------|
| 纯软件项目自举 | SWBOOT-10 非 stub(W5b)+ 真实 PI 全链路 + UI 二次验收 |
| FAV | W6 shadow 已合;live 未放量(staging→artifact→publication 各 ≥7 天观察窗) |
| Control Center | 2026-09-19 已移出本仓库,不再作为本仓库关闭条件 |
| 首次加载性能 | U1/U3–U7 |
| 文档可靠性试点 | M1 结论「停止扩面」;M2(U5–U12)明确禁止开工,真实 PI/浏览器验收未勾 |
### 1.4 deferred 待决策
- **D7 对话数据治理**:ADR `2026-09-17-d7-chat-data-retention.md` 仍 `pending-compliance-signoff`;W7 盘点未发现违规;签字前禁止物理删除。
- **`SEMANTIC_SUMMARY_REPLACE`**:决策默认不启用;启用须另开授权 + fail-closed 灰度。
- **`MULTI_INTENT_PLAN_TIER` 升 confirm**:W4 证据闭环,升级需独立授权;永不默认 full。
### 1.5 文档漂移 / 矛盾(文档债)
| # | 漂移 | 涉及文件 |
|---|------|----------|
| D-1 | PU8 四份契约文件仍 `status: in_progress`,但 U9–U12 已升 done、报告已归档 | `.doc/ops/long-term/2026-09-16-pu8-u9/u10/u11/u12-*.md` |
| D-2 | ADR modular-monolith-decoupling 仍「提议,等待用户确认」,但 Phase 1/2 已落地并被当作已确认结论引用 | `.doc/adr/2026-09-14-modular-monolith-decoupling.md` |
| D-3 | audit/INDEX.md 与 remediation/INDEX.md 末行称首次加载性能「方案未实施」,与 U2 已验收矛盾 | 两个 INDEX.md(**本审计已顺手修正为准确表述**) |
| D-4 | handoff `2026-09-15-conversation-intent-dual-tab.md` 的「未完成」已被后续 PASS 覆盖但未回标 | 该 handoff |
| D-5 | backlog D3/D7 条目与 W2 done、W7/ADR 草案并存,backlog 未同步 | `.doc/backlog/chat-agent-p6-backlog.md` |
| D-6 | PROJECT.md §9「剩余 blocker」表述与 gap-matrix「门禁已签、production_ready=yes」口径冲突 | `PROJECT.md` |
---
## 二、Bug 清单
### 2.1 确认 bug(有明确证据)
**后端**
| ID | 描述 | 证据 | 严重度 |
|----|------|------|--------|
| B-1 | **SSE 聊天流被全局 WriteTimeout=120s 强杀**:`server.go:350` 的 WriteTimeout 是绝对期限;`handleChatStream`(`sse.go:129`)从不调用 `extendSSEWriteDeadline`、无心跳,该机制只接到了 run-events 订阅端点。任何 >120s 的聊天回合(长 PI 推演常见)必断流 | `internal/server/server.go:350`、`internal/server/sse.go:46-64,129` | high |
| B-2 | **`POST /tasks/run/stream` 同样无 deadline 延长/心跳**,且断线后无法续订:`sse.go:390` 写死 `Subscribe(created.RunID, 0)`,不接受 `after_seq` | `internal/server/sse.go:305-424,390` | high |
| B-3 | `handleRunTaskStream` **静默吞 JSON 解析错误**:`_ = json.NewDecoder(r.Body).Decode(&req)`,畸形 body 以空请求走默认 `TaskKey="intake"`,可能误启动 intake 任务 | `internal/server/sse.go:315,362-364` | medium |
| B-4 | `handleRunTaskStream` **Flush 200 SSE 头之后才做会失败的操作**(CreateAndStart/Subscribe),失败时往 SSE 流里写 JSON 错误体;同文件 chat 路径明确「授权必须在 Flush 前」,task 路径未对齐 | `internal/server/sse.go:355-360,383-393` | medium |
**前端**
| ID | 描述 | 证据 | 严重度 |
|----|------|------|--------|
| B-5 | **会话窗口缓存 key 不一致**:读/初次写带 `userId` 前缀,但 `loadOlder`/`loadFullDay`/`jumpToDate`/`loadDayForAnchor`/`appendLiveMessage` 等 7 处后续写入不带前缀 → 刷新/切会话恢复到旧窗口;且 LRU 驱逐只用无前缀 key,带前缀缓存永不驱逐,localStorage 只增不减 | `web/src/hooks/useChatWindow.ts:84,100,136,235,271,315,365,416,439,471`、`web/src/data/storage.ts:164-176` | high |
| B-6 | **mount 时 IndexedDB 恢复用陈旧快照整体覆盖 deliverables**:捕获 mount 闭包、非函数式 set,resolve 前新增的 deliverable 被静默丢弃(旁边已有 `deliverablesRef` 未用) | `web/src/App.tsx:326-336` | medium |
| B-7 | `useTaskRunStream` 返回**伪 ref**(每渲染新建对象、快照值非 live),且全仓库无消费方——误导性 API | `web/src/hooks/useTaskRunStream.ts:96` | low |
### 2.2 高风险隐患
| ID | 描述 | 证据 |
|----|------|------|
| R-1 | **聊天会话无归属校验**:`getOrCreateSession` 仅凭客户端传入 `session_id` 返回既有内存会话,随后直接覆盖 `sess.UserID`;非项目会话(ProjectID==0)无任何授权关卡,内存 Messages/Facts 可进入他人 Prompt 与 SSE。缓解:session ID 为纳秒时间戳不易猜 | `internal/server/server.go:394-415`、`handlers.go:181`、`sse.go:187`、`stage_access_helpers.go:251-253` |
| R-2 | **18 个非测试文件 `rows.Next()` 循环后未查 `rows.Err()`**,中途断连静默截断结果集(ctxmgr 历史/窗口/搜索、docgov engine、freedoc、storage/cas、`cmd/document-content-reconcile` 漏检会让 reconcile 漏报文档) | 如 `internal/ctxmgr/chat_history.go`、`internal/docgov/engine.go`、`cmd/document-content-reconcile/main.go:82` |
| R-3 | 事件 dispatcher `Handlers` map **写持锁、读不持锁**(当前仅启动期注册则良性,动态注册即 race) | `internal/events/worker.go:87,154,234` |
| R-4 | `memTurns` 全局幂等表只增不删且跨实例共享,长期运行内存缓增、测试间可能串扰 | `internal/ctxmgr/chat_turns.go:169` |
| R-5 | `internal/docrevision/pg_store.go:68-208` 十余处 `_ = json.Unmarshal(...)`,账本 JSONB 损坏时静默零值化 | 同左 |
| R-6 | 后台 ticker goroutine 无关停通道(通知提醒、vault Drain 错误被丢弃、bizdev 心跳用 `context.Background()`),`Shutdown` 未覆盖 | `notification_reminder_loop.go:15`、`vault.go:63`、`bizdev/service.go:682` |
| R-7 | SSE 重连对 401/404 无 fail-fast:任何错误一律退避重连 40 次(~3 分钟)期间 UI 一直 thinking;`streamChat` 对畸形 data 帧直接抛错中断整条流 | `web/src/api/taskRuns.ts:108-140`、`api/chatStream.ts:122` |
| R-8 | 组件卸载/登出不 abort 任务流,在途 SSE 继续写 localStorage | `web/src/App.tsx:595,2804` |
### 2.3 环境 / 配置缺陷
| ID | 描述 | 证据 | 严重度 |
|----|------|------|--------|
| E-1 | **main 环境 app `ENV=prod` 与 events `ENV=main` 不一致**:事件信封以 `Environment="prod"` 写入,而 `event_consumer_modes` 只种子 dev/test/main 三行 → app 侧 `WriterLive("prod")` 恒 false(in-process 直连不退出),events worker 按 'main' 判定 → **main 存在双写或 durable 管道空转风险**(取决于 main 行 mode)。dev/test 两服务 ENV 一致,无此问题 | `docker-compose.main.yml:90,160`、`internal/app/docflow/commands.go:276`、`goose/00040:55-59`、`internal/events/dispatcher.go:308-313` | **critical(main 专属)** |
| E-2 | **main schema 落后两版(47 vs dev 49)**:00048 给 projects 加 13 列,当前 HEAD 代码直接 SELECT/INSERT 这些列;00049 建 system_settings。若把 dev HEAD 镜像升 main 而不先跑迁移,项目工作流查询/系统设置 API 直接 SQL 报错。**main 晋升顺序必须 events(跑迁移)先于 app** | `goose/00048`、`goose/00049`、`internal/projectworkflow/store.go:76,113` | high(晋升窗口) |
| E-3 | `MULTI_INTENT_PLAN_TIER` 未在任何 compose environment 声明(configs/.env 设了也传不进容器);test/main 连 U9–U12 flag 都未声明 → 容器内锁死 legacy,授权升级时需先改 compose | `docker-compose.*.yml` | medium |
| E-4 | `CURSOR_RUNNER_URL` 三环境 compose 都注入但代码零读取;cursor-agent 容器是 alpine 占位,cursor-cli 后端容器部署不可达 | `docker-compose.*.yml` | low |
| E-5 | `ENABLE_DEV_IMPORT` 不在任何 compose/.env.example;且判断把 `cfg.Env==""` 也算 dev——配置缺失时导入门禁自动放开 | `internal/server/chat_window_api.go:171` | medium |
| E-6 | `SEED_DEMO_USERS` 仅 test compose 显式 false;dev 依赖默认播种(demo 密码 123456),main 靠代码 `Env!="dev/test"` 兜底,主 compose 未显式关闭 | `docker-compose.test.yml:91`、`internal/auth/bootstrap.go:67-116` | low |
| E-7 | `INTENT_V2_DECISION_TIER` 非法值回退 `query`(激进),与 `MULTI_INTENT_PLAN_TIER` 回退 `legacy`(保守)策略不一致 | `internal/intent/flags.go:47-64` | low |
| E-8 | `publisher_gate_test.go:16` 读 `FAV_PUBLISHER_ENABLE`(少 D),与正式变量名不符,该测试门永远走默认分支 | `internal/artifactvault/publisher_gate_test.go:16` | low |
| E-9 | main compose 的 system-db initdb 只挂 00001_baseline.sql,与 dev/test 不一致;新建卷时初始脚本漂移(依赖 events 启动迁移补齐) | `docker-compose.main.yml:23` | low |
---
## 三、已实现但未启用 / 未测试的功能
### 3.1 特性开关封存(实现完整,全环境 off)
| 功能 | 实现位置 | 状态与门禁 |
|------|----------|-----------|
| FAV 事件订阅者 | `internal/app/fav/subscriber.go` | 三重硬门禁:cmd/events 刻意不注册、registry fail-closed、SetMode 拒绝非 off;仅 ObserveShadow 可达 |
| FAV 发布器 | `internal/server/vault.go:18-67` | `FAV_PUBLISHER_ENABLED=false` 三环境显式;且 VAULT_* 三变量 compose 全未声明,容器内即使开 flag 也会静默 return(E-类:实际不可误开,属设计内封存) |
| FAV 降级读 | `internal/docquery/service.go:70` | `FAV_DEGRADED_READ=false` 红线保持 |
| 多意图 PlanTier shadow/auto_read/confirm | `internal/app/intentflow/turn.go` | 容器内锁死 legacy(见 E-3) |
| U9–U12 扩面 | `intentflow/expansion.go`、`mux.go` | 全 false;dev compose 已声明可调,test/main 未声明 |
| 意图 V2 shadow/decision | `internal/intent/shadow_v2.go`、`v2_decision.go` | 三环境显式 false |
| 语义摘要 shadow | `internal/ctxmgr/semantic_summary.go:216` | 默认 off,且仅 AGENT_BACKEND=pi-agent 时挂载 |
| PI change-report 叙事 | `internal/docrevision/narrative.go:68` | 默认 off,仅确定性 fallback(不得冒充完整 PI) |
| artifact-vault CLI | `cmd/artifact-vault/main.go` | 未部署 stub |
| eventmode cutover CLI | `cmd/eventmode/main.go` | 硬门禁仅 dev 可用(`internal/events/cutover.go:13`) |
### 3.2 死代码 / 机制先行无消费方
| # | 项 | 位置 |
|---|----|------|
| X-1 | `SEMANTIC_FALLBACK_ENABLED` 死 flag:无任何业务消费方,仅 sysadmin 展示;三环境 compose 都在设一个没用的变量 | `internal/intent/flags.go:43`、`internal/app/app.go:285` |
| X-2 | `SEMANTIC_SUMMARY_REPLACE` 读取后 `_=` 显式丢弃,刻意永久未接线 | `internal/ctxmgr/semantic_summary.go:257` |
| X-3 | goose 00048 三张新表 `project_source_bindings`/`repo_path_allowlist`/`project_type_workflows` 无代码消费方(swboot 目录硬编码内存版,RepoAllowlist 为 stub) | `internal/swboot/catalog.go:92,118`、`repo_allowlist.go` |
| X-4 | `system_settings` 白名单 6 键全部无业务消费方——可写不生效,纯机制先行 | `internal/sysadmin/settings.go:57-66` |
| X-5 | 前端死组件:`DocumentNotificationList.tsx`(含已读回写,功能完整无挂载点)、`WorkflowPrerequisiteBanner.tsx`、`user/SettingsModal.tsx`(已被 UserSettingsModal 取代);死 API:`api/projectWorkflow.ts:71 activateWorkflow`;`data/storage.ts:141 saveMessages` deprecated no-op | web/src 各文件 |
| X-6 | `useTaskRunStream` 伪 ref(同 B-7) | — |
### 3.3 测试盲区
| # | 盲区 | 说明 |
|---|------|------|
| S-1 | `TestReconcile_LegacyRepair_PG` 从未执行 | 要求隔离 PG 且硬拒绝 5433/5434/5435;canonical-hash 修复链路零自动化验证(gap-matrix 已记测试债) |
| S-2 | 两个「永久跳过」 | `taskstream_test.go:189`(功能已删,测试成死代码应删除);`plan_owner_test.go:125`(重定向跳过) |
| S-3 | 无测试的 cmd 入口 | `cmd/server`、`cmd/events`、`cmd/artifact-vault`、`cmd/dataset`、`cmd/eventmode`、`cmd/recategorize`、`cmd/document-revision-backfill`(仅 bizdev-cli、document-content-reconcile 有);`internal/observability`、`internal/workflow` 无测试文件 |
| S-4 | **E2E 默认全不跑**:web/e2e 9 个 spec 全部被环境门禁(`RUN_UI_ACCEPTANCE=1`/`DOCREV_E2E_BASE_URL`/`INTENT_DUAL_TAB=1`),默认 `playwright test` 实跑 0 用例;`test:ui-acceptance` script 只覆盖 1 个 spec,其余 8 个无 script 入口 | web/e2e/、web/package.json:11 |
| S-5 | 409 信封处理只覆盖部分消费方:projectMembers、freeformDoc、createTaskRun、chatSessions upsert 等 409 只能裸报错(与 FEATURE-MATRIX hardening backlog 一致) | `web/src/api/projectMembers.ts`、`freeformDoc.ts:177`、`taskRuns.ts`、`chatSessions.ts` |
| S-6 | 前端 bundle 大 chunk 未分割(mermaid/katex/xlsx/docx 各成 >500 kB chunk,已有 precompress 缓解) | vite build 警告 |
---
## 四、结论与优先级
**总体判断**:发布门禁与 FEATURE-MATRIX 的 `done/partial/deferred` 口径与代码实况基本一致,未发现「stub 冒充验收」类违规;质量门禁(vet/test/build)全绿。主要风险集中在三处:
1. **E-1(main ENV 不一致 → 双写/空转)是唯一 critical 级发现**,且只在 main 环境存在, dev/test 的「healthy」不能证明 main 事件链路正确。
2. **SSE 120s 断流(B-1/B-2)直接影响长任务可用性**,是用户可感知的现存 bug。
3. **封存面(FAV/多意图 tier/U9–U12/语义摘要/PI 叙事)实现完整但容器内不可调或硬门禁封存**,红线达标,但授权放量时会发现 compose 层缺失(E-3)与若干死接线(X-1/X-2)。
详细整改顺序见 [remediation 方案](../remediation/2026-09-17-system-health-remediation-plan.md)。
## 关联整改
- Remediation: [2026-09-17-system-health-remediation-plan.md](../remediation/2026-09-17-system-health-remediation-plan.md)
## 证据
- `go vet ./...` / `go build ./...` / `go test -short -count=1 ./...`(62 包 ok)/ `cd web && npm test && npm run build`:2026-09-17 全绿。
- 文中所有 `文件:行号` 引用均为 2026-09-17 dev 分支工作区实测。
## 开放问题
- E-1 的修复取向(app 改 `ENV=main` vs 事件信封/consumer mode 键改用部署名)需架构决策。
- D7 合规签字、`MULTI_INTENT_PLAN_TIER` 升 confirm、FAV live 放量均需用户显式授权,不在本整改自动范围内。
- configs/.env.dev/.env.test/.env.main 实际文件未读取(含密钥);若偏离 example 模板,E-3/E-4/E-6 结论需复核。
+130
View File
@@ -0,0 +1,130 @@
---
title: "系统深度体检审计(2026-09-19,dev@e8ed33b)"
status: done
created: 2026-09-19
updated: 2026-09-19
severity: high
---
# 系统深度体检审计(2026-09-19)
> 只读审计,未修改业务代码。分支 `docs/system-deep-audit-2026-09-19`,基点 dev@e8ed33b。
> 方法:go vet / go test -short 静态基线 + 五路并行深潜(后端 server/chat、docgov/events/工作流/迁移、前端 web、配置 flag/死代码、安全鉴权)。
## 一、总体结论
- **静态基线健康**:`go vet ./...` 零告警;`go test -short ./...` 55 包全 PASS;全仓 TODO/FIXME 仅 2 处非实质。
- **四条已声明红线全部核实一致**:`MULTI_INTENT_PLAN_TIER=legacy`、`SEMANTIC_SUMMARY_REPLACE` 未接线、`FAV_DEGRADED_READ=false`、SWBOOT-10 fail-closed stub——代码与三环境 compose 均对齐,无漂移。
- **IAM 主链路复核成立**:路由统一挂鉴权中间件、SQL 全参数化、token 哈希存储、错误出参有内部信息过滤。但存在 dev/test 兜底与端点级鉴权缺口(见 S1/S2)。
- **本次新发现**:2 项 critical(后端数据竞态 + docgov 吞错)、10 项 high、若干 medium/low。其中 3 项被两路独立审查交叉命中(见 ★ 标记),可信度最高。
- FEATURE-MATRIX 已声明的 partial/deferred(rdev、SWBOOT、FAV、D7、首载性能)不在本次重复申报范围;本次发现均为**新增**缺口。
## 二、Critical(发布前必须评估)
### C1 ★ docgov 持久化全链路 fire-and-forget 吞错;fencing token 未读回
`internal/docgov/lease.go:460-467, 485-490`;`internal/docgov/engine.go:318, 392, 405, 470, 477, 650, 743, 750, 1081-1134`
租约获取/续约/回收、正文哈希、认领状态、提案决定及**全部审计日志**均为 `_, _ = e.pool.Exec(...)` 静默吞错:
- 审计 INSERT 失败 → 合规事件永久丢失,无重试无告警;
- 租约 UPDATE 失败 → 内存与 DB 分叉,重启后可并行编辑同一文档;
- `lease.go:485` 用 `context.Background()` 脱离请求生命周期;
- `loadDocumentFromDBLocked` 的 SELECT 列表**不含 `lease_fencing_token` 列**(00034 迁移已建列)→ 进程重启后 fencing 语义完全失效(合法持锁者被误判 stale,或 stale 写者被放行——两个方向都有缺口)。
**建议**:持久化失败必须返回 error 或 slog.Error+指标;审计写入失败进重试队列;lease SELECT 补 fencing 列;persistLeaseLocked 失败回滚内存状态。
### C2 ★ Session 全字段数据竞态 + 跨项目污染
`internal/chat/session.go:275-277`;`internal/server/server.go:432-435`;`internal/server/handlers.go:196-198`
- `Messages`/`UserCtx`/`LastAccessedAt` 的读写锁粒度碎片化:SSE 路径持 `execMu`,而 `hydrateVisibleHistory`、`handleGetProject`、`cleanStaleSessionsLocked`、`server.go:435` 均不持锁。并发 SSE+REST 同会话时 `go test -race` 可复现 data race。
- `handleChat` 无锁写 `sess.ProjectID = req.ProjectID`,同一 sessionID 被不同项目请求交错时跨项目串扰。
**建议**:Session 加 `sync.RWMutex` 统一保护;ProjectID 改为请求级参数不写回共享 sess。
### C3 SSE WriteTimeout=120s 硬杀长任务 + 心跳 goroutine 生命周期不一致
`internal/server/server.go:352-355`;`internal/server/sse.go:252-271`
全局 `WriteTimeout: 120s`;SSE 靠 45s 续期+15s 心跳兜底,心跳被中间代理吞掉时长 LLM 回合(dialogueTimeout=3min)被强杀。非流式 `handleRunTask` 同步执行数十分钟任务,120s 必然截断响应(业务已执行、客户端收不到结果 → 幂等重试造成重复执行观感)。心跳 goroutine 模式与 `handleTaskRunEvents`(主循环 select,无此问题)不一致。
**建议**:长任务端点异步化(提交+轮询/SSE);心跳并入主 select 或 WaitGroup 收敛。
### C4 工作流计划保存跨语句竞态 + completed_by 错填
`internal/projectinstance/service.go:185-190`;`internal/projectinstance/stage_store.go:132-138`
- `SaveWorkflowPlan`:upsert 与 bump revision 两条独立事务,并发下同版本号先互相覆盖 plan 再一方 bump 失败 → **版本号与 plan 内容错位落库**。`Activate` 的 token 前置校验与激活事务间存在 TOCTOU。
- `completed_by = (SELECT activated_by ...)`:最终阶段完成的归属人被错填为激活人,审计归属错误。
**建议**:upsert+bump 同事务 + `FOR UPDATE` 锁 project 行;completed_by 显式传当前操作者。
## 三、High(建议进入 short-term 整改)
| # | 发现 | 位置 | 要点 |
|---|------|------|------|
| H1 ★ | dev/test 未认证静默兜底为 user id=1 | `internal/server/auth_middleware.go:48-51` | `Env=dev|test` + `AllowInMemory` + 无 ContextDB 时,无 token 请求静默识别为 id=1(管理员)。main 已被 `validateProductionSecrets` 兜住。建议:兜底路径加审计日志+启动告警;中期删除 legacy 兜底 |
| H2 ★ | docgov 批注/审计端点无资源级鉴权且信任请求体身份 | `internal/server/handlers.go:858-940, 534-552` | 任意登录用户读任意文档批注/审计;`AddComment` 直接用 `req.UserID/UserName/UserRole` 可伪造他人身份;`Claim` 角色由客户端自选。两路审查交叉命中。建议:actor 一律取 principal;读类端点加项目成员校验 |
| H3 ★ | 会话查询类端点水平越权 | `chat_turn_api.go:12-45`;`handlers.go:947-981, 429-451` | `handleGetChatTurn`/`handleListChatSessions`/`handleGetUserContext` 的 session_id/user_id 来自 query 不校验归属;userID<=0 时默认 1(种子 admin)。建议:改用 principal 或比对不一致 403 |
| H4 | 登录/注册无速率限制 | `server.go:295-296` | 全仓无限流;bcrypt 高成本反而便于 CPU 耗尽 DoS。建议:IP+用户名滑动窗口限流 |
| H5 | SSE 任务流缺幂等前置检查 | `internal/server/sse.go:398-424` | REST 路径有 `FindByIdempotencyKey`,SSE 路径没有;EventSource 断线重连产生重复任务执行 |
| H6 | 事件 dispatcher stale-fencing 无限重放 | `internal/events/worker.go:206-275` | ErrStaleFencing 直接 cancel+return 不计 Failed;handler 半成功被回滚后事件无限重放,永不可达 dead,无告警 |
| H7 | 迁移 00001–00009 缺 down;00012 seed 迁移破坏性 DELETE | `deploy/postgres/goose/` | 前 9 个迁移无 down;00012 无条件 DELETE 30 个 session 的真实消息再插种子;多个迁移事务内 CREATE INDEX(非 CONCURRENTLY)大表会锁表 |
| H8 | compose 弱口令兜底 + main 注册默认开放 | `docker-compose.{dev,test}.yml:17,86,101`;`main.yml:101` | dev/test 的 DB/ADMIN 口令有弱默认值;main 已用 `:?required` 强制但 `AUTH_REGISTRATION_ENABLED` 默认 true。建议 test 对齐 main 必填,main 注册默认 false |
| H9 | 前端 KaTeX 占位符 XSS | `web/src/engine/renderMarkdown.ts:44-64, 106-108` | 数学公式 catch 分支把未转义原文放入占位符数组,还原发生在 escapeHtml 之后 → XSS。建议:catch 分支 escapeHtml(math) + 占位符随机化 |
| H10 | `context.Background()` 脱离请求生命周期 | `internal/chat/session.go:131-134`;`server.go:423,458,566` | LLM 摘要/DB 调用用 Background,客户端断开无法取消,慢库时 handler 挂死。建议:透传请求 ctx + WithTimeout |
## 四、Medium(选录,详见各专项)
| # | 发现 | 位置 |
|---|------|------|
| M1 | 全局缺安全响应头(CSP/nosniff/X-Frame-Options/Referrer-Policy) | `internal/server/server.go:624-636` |
| M2 | 租约 TTL 无上限(可锁文档 1000 天)+ AcquireLease 无编辑权校验 | `handlers.go:1196-1203`;`docgov/lease.go:62-70` |
| M3 | coordinator 关键词命中强制改写意图 + 模板硬编码"张工您好" | `internal/coordinator/engine.go:409-416, 485` |
| M4 | `fmt.Sscanf` 解析 `u_sess_xxx` 必然失败 → UserID=0 审计落空 | `coordinator/engine.go:930-934, 1067-1071` |
| M5 | `Runtime.Start` 被 main 与 Server.Start 双重调用且错误被吞 | `server.go:343-345`;`cmd/server/main.go:47` |
| M6 | sessions map 无硬上限,惰性清理可被随机 session_id 放大 | `server.go:451-453` |
| M7 | 修订三阶段写(账本→DocGov→freeform)无事务,靠客户端重试补偿 | `document_revision_handlers.go:274-318` |
| M8 | 测试 flag 名笔误 `FAV_PUBLISHER_ENABLE`(少 D)门闩失效 | `internal/artifactvault/publisher_gate_test.go:16` |
| M9 | dev compose 声明永不消费的 `SEMANTIC_SUMMARY_REPLACE`(诱导性配置);dev 与 test/main 默认模型不一致(M2.7-highspeed vs M3) | `docker-compose.dev.yml:119,44` |
| M10 | OpsCutover 硬编码 `"dev"`,test/main 无合规 cutover 路径 | `internal/events/cutover.go:12-19` |
| M11 | 前端乐观已读无失败回滚;MessageStream prevMsgCount 跨会话不重置;SSE 无 online 感知重连 | `web/src/hooks/useUnreadMarks.ts:176-233`;`MessageStream.tsx:148-154` |
| M12 | ExcelViewer 无行数上限内存爆炸;React 19 下 30+ 处裸 setTimeout 无清理 | `ExcelViewer.tsx:42-55` |
| M13 | `deploy/postgres/migrations/` 疑似死目录(14 个旧 SQL 无引用,与 goose 重复) | `deploy/postgres/migrations/` |
| M14 | `Orchestrator.ResolveDocTask` 静默返回 0 值三权掩盖数据不一致 | `internal/workflow/runtime/orchestrator.go:69-83` |
| M15 | PG 事件投递允许乱序而 MemoryBus 有 gap 语义——测试替身与生产行为分叉 | `internal/events/dispatcher.go:56-63` vs `bus.go:99-103` |
## 五、Low(选录)
- `handleHealth` 每请求同步两次 DB 往返无缓存无超时(`handlers.go:97-110`)
- `writeStoredEvents` json.Marshal 错误被吞(`task_run_handlers.go:437`)
- `ReplayPlan.Digest()` 不含 DryRun 字段(纵深防御,`internal/events/replay.go:24-38`)
- 前端 localStorage 缓存无版本字段;`lucide-react@^1.16.0` 版本异常需确认来源;App.tsx 4600 行/30 个 useEffect 巨石组件
- `handleRunTaskStream` 死参数 `includeDetails/requestID`(`sse.go:417-418`)
## 六、复核确认无问题的面(证据性记录)
- SQL 注入:全部 pgx 参数化;仅 4 处 fmt.Sprintf 涉 SQL 均为常量
- CORS:白名单制、无 `*`+凭证;SSE 鉴权失败返回 JSON 而非污染流
- 日志:密码 bcrypt、token SHA-256 摘要存储;`httpx.LooksInternal` 过滤内部错误串
- os/exec:bridge 路径来自服务端配置,用户输入只进 stdin payload;无 text/template 引用
- 事件系统:claim 幂等(SKIP LOCKED + fencing 复合判断)、ack+inbox+checkpoint 单事务、envelope 完整性校验、replay 审批人≠操作人——设计正确
- 前端:Mermaid strict 模式、链接 noopener、ErrorBoundary 覆盖根组件、EventSource 卸载清理正确
## 七、优先级建议
1. **进 main 前必须处理**:C1–C4、H1–H5、H8、H9(H8 的 main 注册默认开放一项)
2. **short-term 整改批**:H6、H7、H10、M1、M2、M8(一行修复恢复门闩)
3. **backlog**:其余 medium/low
## 关联整改
- Remediation: 待立项(建议按第七节优先级拆 short-term 任务)
## 证据
- `go vet ./...` 零输出;`go test -short ./...` 55 包 ok(2026-09-19,dev@e8ed33b)
- 五路只读深潜:后端 server/chat、docgov/events/工作流/迁移、前端 web、配置/flag/死代码、安全鉴权
- 任务条目:[ops/short-term/2026-09-19-system-deep-audit.md](../ops/short-term/2026-09-19-system-deep-audit.md)
## 开放问题
- dev 与 test/main 默认模型不一致(M2.7-highspeed vs M3)是否刻意?未见 `.doc/ops` 对齐记录
- `deploy/postgres/migrations/` 是否还有外部工具依赖?无则建议归档
- H1 legacy 兜底是否有仍在使用的内部工具依赖?删除前需盘点
@@ -0,0 +1,48 @@
---
title: "系统权限设置与项目协作多项缺陷排查"
status: done
created: 2026-09-20
updated: 2026-09-20
severity: high
---
# 系统权限设置与项目协作多项缺陷排查
## 现象
用户报告:成员管理勾选无效、系统设置「允许编制人兼任审核批准」400、PDF 预览被拦截、任务 runs 403 刷屏、发起编制被标 NETWORK_ERROR、注册/建号 rollback、改密后刷新再强制改密、退出重登出现同名重复项目、无项目仍可对话、右侧工具栏默认展开且不记忆。
## 根因分析
| # | 根因 | 关键路径 |
|---|------|----------|
| 1 | CSP 缺 `frame-src`,blob iframe fallback 到 `default-src 'self'` | `internal/server/cors.go` |
| 2 | PdfViewer 同源 iframe 直连,触发 `X-Frame-Options: DENY` 原生拦截页 | `web/src/components/doc/preview/renderers/PdfViewer.tsx` |
| 3 | 前端未传 `expected_revision`(该 key 后端强制 CAS) | `web/src/api/systemAdmin.ts` / SettingsSection |
| 4 | `ProjectSettingsApiError` 字段名与消费方 `httpStatus`/`errorCode` 不一致 | `web/src/api/projectSettingsError.ts` |
| 5 | task-run view 仅放行创建者/owner;前端 403 无停止轮询 | `task_run_auth.go` / `App.tsx` |
| 6 | `CanManageProjectMembers` 未读细粒度权限位 | `internal/authz/service.go` |
| 7 | memStore `ListProjectsForUser` 忽略成员表 | `internal/projectworkflow/store.go` |
| 8 | `user_role_bindings` 插入吞错 → commit rollback;handler 一律 400 | `internal/auth/pg_store.go` |
| 9 | 嵌套 `user.mustChangePassword` OR 合并复活 + fetchMe 未回写 session | `authUserMap.ts` / WorkbenchView / useAuthenticatedWorkspaceSync |
| 10 | `projects.name` 无唯一约束 + Create 无幂等键;logout 不清 projects 缓存 | `service.go` / migration 00056 / App logout |
| 11 | `Project()<=0` 时跳过项目访问校验 | `handlers.go` / `sse.go` / `stage_access_helpers.go` |
| 12 | `rightCollapsed` 默认 false 且无持久化 | `AppShell.tsx` / `storage.ts` |
## 严重度
`high`
## 关联整改
- Short-term: `.doc/ops/short-term/2026-09-20-bug-hunt-permissions-uploads.md`
- 分支: `fix/bug-hunt-2026-09-20-permissions-and-uploads`
## 证据
- 产品决策:新增 `project:manage_members`;无项目禁止对话并置灰发送按钮;同创建人内项目名唯一 + `client_key` 幂等。
- 迁移:`00055_...project-manage-members-permission.sql`、`00056_...project-create-idempotency.sql`
## 开放问题
- 无(本批范围内)
@@ -0,0 +1,142 @@
---
title: "模块耦合现状审计(规范与分批整改基线)"
status: done
created: 2026-09-20
updated: 2026-09-20
severity: high
---
# 模块耦合现状审计(规范与分批整改基线)
## 现象
系统已经是模块化单体,不是未治理的大泥球:`module-boundaries.yaml` + `internal/archtest` 已把 import 与事件登记清到零违规(`baseline_counts.import=0`、`event=0`,二者在 `block_kinds`),可靠事件由独立 `cmd/events` worker 经 PostgreSQL lease 消费。
故障仍会跨模块扩散的原因不在“缺总线”,而在四类残留:
1. HTTP 适配层直接持有领域具体类型,而不是只调用用例端口。
2. `chat`、`app` 子包与 `coordinator` 用子包拆分避开了 Go 编译环,逻辑上仍互相依赖。
3. `docgov` 的状态、角色和错误被多个模块当成本模块词汇使用。
4. 带到期日的 SQL/路径例外仍允许非属主写入或拼接工作区路径。
本审计只记录证据与分级,不改代码。整改批次见 [分批计划](../remediation/2026-09-20-module-decoupling-batch-plan.md)。
## 根因分析
### 已有隔离基线(不要推倒)
| 机制 | 位置 | 现状 |
|------|------|------|
| 模块化单体 ADR | [2026-09-14-modular-monolith-decoupling](../adr/2026-09-14-modular-monolith-decoupling.md) | 不拆微服务;窄端口 + 组合根 + 领域事件 |
| 静态边界 | [module-boundaries.yaml](../system-design/module-boundaries.yaml) | import allowlist、表唯一写者、路径属主、事件生产者/消费者 |
| 架构门禁 | `internal/archtest`、`scripts/arch-check.sh --mode block` | import/event 零容忍 |
| 进程内端口 | `internal/app/*flow`(例:`internal/app/chatflow/ports.go`) | 消费者拥有窄接口;组合根注入实现 |
| 跨进程事件 | `internal/events` + `cmd/events` | PG outbox/inbox;dev `:8088` / test `:8089` / main `:8090` |
| 事件契约 | `internal/events/registry.go` `StaticContracts()` | 11 个事件名、schema version、payload 字段 allowlist;与 YAML parity |
`StaticContracts` 现有事件:`document.agent_candidate_ready`、`document.agent_version_committed`、`document.downstream_impact_detected`、`document.change_report_degraded`、`document.approved`、`taskrun.completed`、`taskrun.cancelled`、`fav.artifact_staged`(`Enabled: false`)、`intent.plan.awaiting_input`、`intent.plan.step_changed`、`intent.plan.completed`。
### 热点 1(P1):`server` 上帝适配层
`internal/server/server.go` 的 `Server`(约 40–80 行)同时持有 `*bizdev.Service`、`*coordinator.CoordinatorEngine`、`*docgov.GovernanceEngine`、`*docrevision.Service`、`*taskrun.Manager`、`*projectinstance.Service`、`*pgxpool.Pool` 等具体类型。同结构体里只有少数字段是端口(`chatflow.ChatLog`、`chatflow.ContextAssembler`、`intentflow.Service`、`intent.Recognizer`)。
生产 import 覆盖约 30 个内部包(`server.go` 11–34 行)。handler 直接解释领域错误,例如 `internal/server/handlers.go` 对 `docgov.ErrDocumentBusy` 的分支(426、449 行)以及 `docgov.RoleAuthor`(702、1291 行)。
后果:领域包改一个错误或角色常量,HTTP 层必须跟着改;`pool` 还让适配层有机会绕过表属主写 SQL。
### 热点 2(P2):`chat` ↔ `app` ↔ `coordinator` 逻辑环
编译环被子包拆开了,依赖方向没有:
- `internal/chat/session.go` 11–13 行 import `app/chatflow`、`app/intentflow`、`coordinator`。
- `internal/chat/action_executor.go` 10–14 行 import `app/intentflow`、`app/stageflow`、`coordinator`、`docgov`、`taskrun`,并持有具体引擎指针。
- `internal/app/chatflow/ports.go` 又 import `coordinator`、`ctxmgr`、`projectinstance`(`AssembleRequest` 直接嵌 `coordinator.UserInfo`)。
`chat` 既是领域会话,又反向依赖用例包。用例一变,会话执行器就会编译失败,问题不会停在单一模块。
### 热点 3(P3):`docgov` 词汇泄漏
生产代码(不含本包测试)直接使用 `docgov` 状态/角色/错误的位置包括:
- `internal/coordinator/engine.go`:`ErrDocumentBusy`(955)、`StateDrafting`(1596、1598)。
- `internal/bizdev/service.go`:`ErrDocumentLocked` / `ErrDocumentBusy`(718)。
- `internal/server/handlers.go`、`document_revision_handlers.go`、`auth_helpers.go`:`RoleAuthor`、`ErrDocumentBusy`。
- `internal/chat/action_executor.go`:动作名字符串 `"docgov.review_approve"`(58、150 行),以及 `docgov.StateDrafting`(90)。
这些不是稳定共享词汇(`internal/contracts/vocabulary` 尚未承接它们),而是领域实现类型被当公共 API。
### 热点 4(P3):工作流定义与实例网
- `internal/workflowdef/catalog.go` import `projectworkflow`。
- `internal/workflowdef/validator_v2.go` import `workflow`。
- `internal/projectinstance` 生产文件(`store.go`、`service.go`、`gate.go`、`types.go` 等)import `workflowdef`。
- `internal/workflow/runtime/orchestrator.go` import `projectinstance`。
定义、目录、实例和运行时互相看得见对方的包。改一份工作流校验会同时碰到定义包和实例包。
### 热点 5(P4):巨型文件
非测试生产文件行数(2026-09-20 `wc -l` 口径,探索盘点):
| 行数 | 文件 |
|------|------|
| 1844 | `internal/coordinator/engine.go` |
| 1590 | `internal/bizdev/service.go` |
| 1395 | `internal/server/handlers.go` |
| 1291 | `internal/projectinstance/store.go` |
| 1245 | `internal/intent/recognizer.go` |
| 1235 | `internal/projectworkflow/store.go` |
| 1207 | `internal/docgov/engine.go` |
| 1172 | `internal/docrevision/service.go` |
| 1151 | `internal/squad/workspace.go` |
| 1028 | `internal/freedoc/service.go` |
单文件过大本身不是耦合,但它把多个用例绑在同一变更面上,评审和回滚半径变大。拆分应跟在解环之后,避免边搬边改依赖。
### 热点 6(P4):前端 API 层无统一客户端
`web/src/api/` 约 37 个文件按域各写 `fetch()`,`API_BASE` 与鉴权头分散。错误信封、重试和 401 处理无法在一处收口,后端错误契约一变就会在多个 api 文件重复漏改。这是适配层问题,不是把前端改成 RPC。
### 热点 7(P2,有到期日):边界例外未清零
[module-boundaries.yaml](../system-design/module-boundaries.yaml) `exceptions` 共 21 条,`baseline_counts` 为 sql_write 5、path 16。
| 种类 | 条数 | 里程碑 | 到期 | 风险 |
|------|------|--------|------|------|
| `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` | **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。
## 严重度
整体 `high`:不会单独打穿已签发布门禁(`production_ready` 不因本审计回退),但 P1/P2 使“问题停在单一模块”尚未成立。
| 级别 | 热点 | 扩散方式 |
|------|------|----------|
| P1 | server 具体类型装配 | 领域改动直接编译失败到 HTTP |
| P2 | chat/app/coordinator 逻辑环 | 会话、意图用例、协调引擎必须同改 |
| P2 | 2026-09-28 到期的 sql_write/path 例外 | 非属主写表或读工作区文件 |
| P3 | docgov 词汇泄漏 | 状态机常量变成跨包协议 |
| P3 | workflow 定义/实例网 | 校验与运行时同改 |
| P4 | 巨型文件、前端 fetch 分散 | 变更面大,不立刻产生跨表写入 |
## 关联整改
- Remediation: [2026-09-20-module-decoupling-batch-plan.md](../remediation/2026-09-20-module-decoupling-batch-plan.md)
- 开发规范: [2026-09-20-module-development-standards.md](../system-design/2026-09-20-module-development-standards.md)
- 上位约束(不重复制定): [架构](../system-design/2026-09-14-module-decoupling-architecture.md)、[Phase 2](../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)、[影响面守则 §2](../remediation/2026-09-16-partial-deferred-completion-plan.md)
## 证据
- 结构体与 import:`internal/server/server.go`、`internal/chat/session.go`、`internal/chat/action_executor.go`、`internal/app/chatflow/ports.go`。
- 事件契约:`internal/events/registry.go` `StaticContracts`。
- 例外账本:`module-boundaries.yaml` `exceptions` 与 `baseline_counts`(import 0 / sql_write 5 / path 16 / event 0)。
- 盘点方式:2026-09-20 只读检索生产 import 与 `docgov` 符号引用;行数来自当时文件长度,后续拆分后以 `wc -l` 重测为准。
## 开放问题
- U3/U4 例外在 2026-09-28 到期后,是先延长豁免并写原因,还是立刻占用 `docgov` mutex 做批次 G 的第一刀。本审计不代决,批次 G 开工前必须二选一,禁止静默改到期日。
- `internal/contracts/vocabulary` 在架构文档中已定义,代码侧尚未作为 docgov 状态/角色的唯一出口。批次 C 再决定是新建该包还是把稳定枚举留在消费者端口。
@@ -0,0 +1,68 @@
---
title: "2026-09-20 系统全量体检审计"
status: done
created: 2026-09-20
updated: 2026-09-20
severity: high
---
# 2026-09-20 系统全量体检审计
## 现象
在 `production_ready=yes`、dev/test/main 健康、近期 triage 已合入的前提下,对全系统做只读深度体检,发现若干**未写入 gap-matrix 的 critical/high**,以及一批 medium/low 加固项。
方法:四路并行深潜(后端 Go、安全鉴权、前端 web、基础设施)+ 本机实证(goose 版本表、容器 health、口令登录、代码交叉复核)。
## 根因分析(P0 / critical,均已实证)
| ID | 发现 | 位置 | 证据 |
|----|------|------|------|
| P0-MIG | 迁移序号空洞 00054;`chat_summaries` 建表与 summarizer 写失败修复滞留未合入分支 | `feature/capability-enablement-impact-plan@848a0457`;dev 代码仍读写不存在表 | `goose_db_version` 53→55→57 跳号;`to_regclass('chat_summaries')` 空;`summarizer.go:119` `_ = err` |
| P0-IDOR-PREF | 偏好写入信任请求体 `user_id`,无归属校验 | `internal/server/handlers.go:508-537` | 无 `requireAuthenticatedUser` 比对 |
| P0-IDOR-SESS | `handleGetProject` 以 `callerUserID=0` 调会话,归属校验被跳过 | `server.go:458-463`;`handlers.go` / `project_handlers.go` | `if callerUserID > 0` 守卫 |
| P0-IDOR-RECAT | 重分类无会话归属;空 `session_id` 触及全库消息 | `chat_recategorize_api.go`;`ctxmgr/recategorize.go` | `WHERE ($1 = '' OR session_id = $1)` |
| P0-PANIC | taskrun 订阅发送在锁外,Unsubscribe `close` 后向 closed channel 发送 panic | `taskrun/manager.go:481-497` vs `:590` | select default 不挡 closed;全仓非测试 `recover()`=0 |
| P0-RACE | 同步 `POST /chat` 不取 `execMu`,与 SSE 并发 data race | `handlers.go:240` vs `sse.go:341` | 09-19 C2 残留半修 |
| P0-CRED-BACKUP | 三环境 DB 口令硬编码进仓库;生产口令与脚本一致可登录 | `scripts/backup-system-db.sh:43-56` | 实测 `prod_highly_secure_db_pass` 可连 main |
| P0-CRED-PUSH | push 脚本把 token 拼进 URL,`ps` 可见 | `scripts/git-push-dev.sh:23` | `https://oauth2:${TOKEN}@...` |
| P0-XSS | 块编辑器 math 错误分支未转义 | `BlockEditorModal.tsx:206`;`MathBlockView.tsx:20` | catch 裸拼 + `dangerouslySetInnerHTML` |
### 环境与分支脱节(本轮不做晋升,记 backlog)
| ID | 发现 | 证据 |
|----|------|------|
| ENV-MAIN-DRIFT | main 分支 goose 最高 00025,main 库 schema 52;灾备从分支重建不可复现 | `git ls-tree main`;`goose_db_version` MAX=52 |
| ENV-TEST-DRIFT | test 分支最高 00056,test 库已 57 | 实测 |
| DOC-SCHEMA | CURRENT 写 dev schema 56,实测 57 | health JSON |
| GOOSE-DUP56 | dev 库 version_id=56 记账两行(id 57/58,间隔 2ms) | SQL 取证 |
## 严重度
- **critical / P0**:上表 P0-*(本轮整改)
- **high / medium / low**:见下方「非 P0 清单」与 [long-term](../ops/long-term/2026-09-19-audit-remainder.md) 2026-09-20 增补区
## 关联整改
- Remediation: [../remediation/2026-09-20-p0-remediation-plan.md](../remediation/2026-09-20-p0-remediation-plan.md)
- Short-term: [../ops/short-term/2026-09-20-p0-hotfixes.md](../ops/short-term/2026-09-20-p0-hotfixes.md)
## 证据
- `go vet ./...` 零告警(2026-09-20)
- `go test -short ./...`:仅 `TestPiAgentDockerBuildContext_RunnerModulesPresent` 因外网镜像源 EOF 失败,属测试卫生
- 三环境 health:dev/test schema **57**,main **52**;events `:8088`/`:8089`/`:8090` ok
- 四路深潜交叉:IDOR×3、XSS、凭证、迁移空洞均被 ≥2 条路径或本机取证命中
## 非 P0 清单(摘要,详 long-term)
**后端**:XFF 限流可绕过;events `cancelFns` 只增不减;docrevision/docgov 全局锁内 DB I/O;Shutdown 5s vs 长任务;`idemLocks` 无界;SSE query 传消息;C1 缓存不失效;chat 落库非原子等。
**前端**:`useChatWindow` 切会话竞态;PLAN_CONFIRM 无 try/catch;turn Map 只增不减;重置密码死功能;ErrorBoundary 仅顶层;SSE `\r\n`;token localStorage + 无全局 401 登出等。
**基础设施**:容器 root、无资源限制;健康检查路径不一致;main events 挂 shared-net;init 三套;Dockerfile Go 1.23 基镜像;backup 无定时;main 分支对齐晋升专项。
## 开放问题
- capability 分支合入后 00054 重编号为 00058 是否与其他未合并旁支再撞号?(当前仅该分支占用 54)
- main 分支对齐晋升时 00057 会对存量项目做不可逆改名——晋升前需预演清单
@@ -0,0 +1,234 @@
---
title: "Agent 工作规范增删改审查"
status: done
created: 2026-09-21
owner: Codex
reviewed_dev_sha: a241e838150f218f3a09d3523f93291b847d45fd
implementation_status: not_started
---
# Agent 工作规范增删改审查
## 结论
现有方向合理:任务 worktree、主目录保护、串行集成、真实证据和安全清理应继续保留。当前最值得做的是**消除冲突、减少重复维护、让关键门禁可执行**,不是继续扩充一份越来越长的 AGENTS。
本轮建议集中为 10 组增删改与 2 项安全补充观察。它们不都是缺陷:下文区分已验证问题、流程简化建议与已有方案的实施事项。只形成审查结果,没有修改生效规则、脚本、锁、运行环境或业务代码。
已确定的用户选择不重新讨论:全部新增写入走 `.worktrees`;锁先交付统一入口与提交门禁防误改,OS 权限隔离后续实施;本轮是规范审查,不是实施授权。
## 1. 审查范围与现场
冻结基线为本地 `dev@a241e838`,审查在 `.worktrees/agent-policy-review` 进行。覆盖 AGENTS、PROJECT、worktree 工作规范、Cursor 四条规则、任务/收口/handoff 模板、Herdr roster,并检查相关脚本与测试入口。
主目录采样为干净 dev;未 fetch 或推送。本轮新分支只写审查记录和自己的 CURRENT 快照,不修改被审查规范。
实际测量:
- 基线 CURRENT 并行认领共有 **161 条**:158 条 done、2 条 in_progress、1 条 cancelled。新增本轮认领后为 162 条;不把本轮新增记录算成基线问题。
- 基础启动链六份文件合计 **71,205 字符**,这是文件字符数,不是模型 token 数或耗时指标。
- CURRENT 焦点有 5 项,而 AGENTS 要求 1–3 项;其中长期红线混在当前焦点中。
- 之前的规范收口 `d5302a76` 与 `.locks` 方案 `5987bdcd` 均不是本轮基线 dev 的祖先,不能把它们当作所有 Agent 已能读取的生效规则。
- 本轮没有运行 Go、前端、数据库或产品 PI 测试;命令问题来自源码筛选条件核查,不宣称本轮复现了产品运行故障。
## 2. 优先级总表
“先修”是工程流程优先级,不改变产品 FEATURE-MATRIX 或 production_ready。
| ID | 类别 | 建议动作 | 优先级 | 直接收益 |
|---|---|---|---|---|
| R01 | 已验证冲突 | 修改测试范围与验收模型规则 | 先修 | 消除纯文档也被要求真实 PI 的矛盾 |
| R02 | 已验证命令问题 | 修改真实 PI 示例为准确、可核验的入口 | 先修 | 避免漏测而误以为完成全链路 |
| R03 | 流程简化建议 | 新增任务分级,允许一个主文档承载小任务 | 第二批 | 少建重复记录,减少共享文件写入 |
| R04 | 已验证膨胀/不一致 | 精简 CURRENT 和启动读取范围 | 第二批 | 活跃冲突更易发现,降低每轮上下文成本 |
| R05 | 已验证状态矛盾 | 修改会话结束与任务完成定义 | 先修 | 防止为了结束会话把未完成任务写成 done |
| R06 | 已验证过强要求 | 删除固定五层提交顺序,保留逻辑原子性 | 第二批 | 代码与测试一起可验证、可回退 |
| R07 | 已验证引用问题 + 结构调整 | 确立规范唯一来源与生效版本 | 先修 | 避免客户端副本、草案和历史记录互相覆盖 |
| R08 | 规范增强建议 | 新增任务授权记录与例外处理边界 | 第二批 | 授权内持续执行,超范围才停下确认 |
| R09 | 已知方案实施事项 | 优先落实最小工具门禁 | 与先修并行规划 | 把已知运维误操作挡在执行前 |
| R10 | 收口流程增强 | 明确清理执行者、保留原因和复查触发 | 第二批 | 已完成 worktree 不再长期无主积累 |
## 3. 具体增删改
### R01 修改:测试要求必须按变更范围生效
**依据**:`AGENTS.md:118`、`PROJECT.md:118` 明确纯工程规范/文档不调用产品 PI;`.cursor/rules/test-reports-standard.mdc:49,61` 仍要求报告包含全量 Go 回归,并在报告生成前做真实 PI 全链路。后者是 alwaysApply。旧收口分支虽包含相关澄清,但尚未进入本轮基线 dev。
**后果**:Agent 依据不同入口可能运行无关长测试、误动共享服务,或把必要测试当作可选。冲突本身应先消除,不能依靠“Agent 应该理解”。
**建议修改**:测试范围统一在一处定义,PROJECT 和客户端规则引用它:
| 变更 | 必要验证 |
|---|---|
| 纯规范/普通文档 | 差异、链接、状态与指令一致性 |
| 治理脚本 | 沙盒临时仓库中的真实分支、锁、退出与拒绝路径;不以 shell 语法检查替代行为验证 |
| Go/接口 | 对应单测、项目 Go/架构门禁,受影响 PG/鉴权负例 |
| 前端 | 对应测试和构建;受影响交互用真实浏览器 |
| 迁移/运行配置 | 独立环境升级、兼容性、回退/前滚条件及就绪验证 |
| 产品 Agent/工作流 | 受影响真实产品 PI 链路;不得以 stub/SKIP 替代 |
固定七段报告模板改为“完整报告模板”,小型文档/脚本验证可用精简报告或任务内验证节;必须保留实际命令、结果、提交与适用范围。不要删除真实性要求,也不允许把未运行记作 PASS。
模型要求按目标环境的已批准配置核验并记录实际值。`PROJECT.md:118` 的固定 M2.7-highspeed 不能不分环境套用:当前 dev Compose 默认 M2.7-highspeed,而 test/main Compose 默认 M3。这里是配置源码差异,未检查运行中的秘密配置;建议保留环境策略,禁止为“满足文档”自行切换模型。
### R02 修改:真实 PI 命令要准确选择测试并证明没有跳过
**依据**:`PROJECT.md:91–92` 使用 `RUN_PI_E2E=1 ... go test ./... -run 'PI'`。测试名 `TestPiAgent_FullLifecycle_MultiRole_RealWorld_E2E`(`internal/server/piagent_e2e_test.go:66`)及 `TestWorkflowGovernance_PiAgent_PG_*`(同模块的 `workflow_governance_piagent_pg_test.go:264,278,293`)不匹配大小写敏感的 `PI`。
**后果**:命令执行范围与“全链路”的名称不一致;配置缺失还可能让数据库用例跳过。退出码 0 不能单独证明验收完成。
**建议修改**:优先引用已有 `scripts/run-nightly-real-pi.sh` 作为明确基线入口,写清独立 TEST_DATABASE_URL、Runner 认证、KB/运行环境要求。该脚本当前仅选 U8 和 FullNoneMixedChain 两类测试,**不能把它表述为覆盖全部工作流**;任务按变更范围追加精确测试名与浏览器验收。增加 expected-tests 与实际执行/SKIP 对照,保存最终提交、配置与证据。
不得在文档中填写真实凭证,也不运行测试来试探生产数据。
### R03 新增:任务分级;删除小任务必须重复建多份记录的要求
**依据**:`AGENTS.md:12,37,41–44` 要求任何任务落盘、任务文、研究/审计产物、验收及交接;没有最小产物集或合并记录的规则。
**建议**:保留“需要审计的工作必须有持久证据”,明确三档:
- **信息答复**:解释已有结果、查询简单状态,且不产生新决策、持久成果、仓库写入或运行副作用,可直接答复;不为一次答复单独开 worktree。若要写入任何成果,仍进入任务 worktree。
- **单一小任务/有价值的只读审查**:一个任务文或专用 audit/research 主文档可同时承载范围、结论、验证、状态和交接;不强制再复制同一内容到另外三份文档。
- **跨模块、多阶段、数据/部署任务**:完整 task、必要 plan、验证报告、handoff;仅在信息确实独立时拆文件,互相链接而不复制全文。
本次这样的实质规范审查仍须落盘,不能以“只读”免除证据。将相关追问、修正与收口归入原 task_id;只读子审查使用父任务的范围和记录,不为每个 reviewer 再开业务任务链。无关新增任务才从 dev 建新分支。
这项改变需要审核采纳;本轮仍遵守现有落盘规则,没有提前使用豁免。
### R04 修改:CURRENT 只承载活跃协调,历史留索引
**依据**:CURRENT 161 条认领中 158 条已完成;`AGENTS.md:132` 要求 1–3 焦点,当前正文有 5 项。
**建议删除/迁移**:从 CURRENT 活跃表移出已完成/取消且没有后续阻塞的行,历史 owner、branch、worktree、证据在归档任务/历史索引保留。将长期红线独立为受控约束区或链接;它不是每天反复排序的焦点。
**建议保留**:正在进行、阻塞、等待集成及仍需清理的事项。cleanup_pending 是清理/操作阶段,不新增为 task.status 的第六种状态;一行可写任务 done、cleanup pending,并给 owner、原因和下次检查条件。
**启动读取修改**:每会话先读短核心规则、项目入口、活跃状态摘要;编码前按范围补读相关模块标准、相关 FEATURE-MATRIX 行、任务/方案及操作规程。发布才读完整发布门禁。不要通过摘要跳过硬红线,也不要要求每次解释一个已知结果都重读全部历史。
模块开发任务应有明确条件指针指向已有 `.doc/system-design/2026-09-20-module-development-standards.md`,复用现有接口/事件/表写者规则,不新造一套编码规范。
### R05 修改:会话结束、任务完成、合入与清理分别判定
**依据**:收口模板第 3 行适用于“任务完成或切换 Agent”,第 22 行却无条件要求 `status=done`;AGENTS 同时允许 blocked/cancelled。任务模板已有 deployment/cleanup 字段,但缺少明确的结果判定与集成/同步状态。
**建议替换收口条件**:
> 会话结束不等于任务完成。根据实际情况保留 in_progress、blocked、cancelled 或 done;只有任务范围内的验收条件满足才能 done。换 Agent 必须记录剩余工作及接管条件。只有终态任务才归档;不得为了归档改成 done。
为任务记录补充按需字段:`review_state`、`integration_state`、`deployment`、`cleanup`、`remote_sync`。例如“方案研究 done、review pending、未合入、deployment not_required”是合法状态;“代码已合入、部署 failed”不能报交付完成。字段由工具生成优先,避免人工重复维护多张表。
研究/审查的验收是有据可审的产物,不要求把未获实施授权的方案部署到 dev。实现任务的 done 则按其获授权交付范围判定。收口报告始终区分本地提交、dev 合入、实际运行版本和远端状态。
### R06 删除:固定按数据库、服务、API、测试、文档分层提交的硬性顺序
**依据**:`.cursor/rules/git-workflow-and-environments.mdc:33–38` 规定“一个任务必须”按五类依次提交;AGENTS 的原子提交目标是一个逻辑变更一批。
**后果**:小修复也被机械拆分,代码与对应测试分离;一些提交无法独立构建/验证,回退时还可能留下半套契约。
**建议替换**:
> 每个提交围绕一个可解释、可验证、可回退的逻辑变更;实现与其回归测试可同批。迁移、兼容阶段、配置或文档只有在独立审查/回退有价值时拆分,不要求每项任务凑齐固定提交层次。
保留 Conventional Commits、明确文件范围、渐进式交付和独立 worktree;不以“原子”为名把无关改动揉成一批。
### R07 修改:规范来源、生效状态与客户端薄入口
**已验证的小错误**:`.cursor/rules/git-secrets-autonomy.mdc:2,8` 把 Secrets 指向 AGENTS §8,实际在 §9。AGENTS 开头称可整文件复制到任意项目,但正文包含本仓库日期路径、脚本和 Herdr 约定;应改为“可复用基线,项目路径/流程需调整”。
**建议新增规范生命周期**:每项规则记录 proposed/approved/active/deprecated 的规则状态、适用范围、生效提交与 owner;工具能力另记 manual/enforced。这里是规则生命周期,不复用任务 status。
外层系统约束和当前用户授权仍有效;项目内部规则冲突时有明确处理:AGENTS 保存通用硬边界,PROJECT 定义其授权范围内的项目细则,专门 runbook 负责操作流程;客户端入口只引用同一来源,不复制一套近似规则。草案、旧审计和历史报告属于证据,不能自行覆盖生效规则;较新的日期不等于已生效。
此前收口和锁方案未进入当前 dev,说明“已经写好/提交”与“已被所有新任务读取”必须分开。旧任务启动时记录 policy revision,集成前重读当前 dev 的相关生效规则;期间发生变化时做差异检查,不默默套旧规则,也不突然按未来未实施机制阻塞旧任务。
删除 PROJECT 中重复的“当前已无 blocker”等长期硬编码断言,改为引用有日期/制品身份的权威门禁结果。模型、schema、角色可用性等动态值记录在环境/执行收据中;不要在多个入口重复写一份可能过期的“当前值”。
### R08 新增:任务授权记录与例外边界
这是一项规范增强建议,不是声称现有 Agent 已越权。现有手册限制自动审批扩权、push 和破坏性操作,但任务模板只有范围/非目标,没有统一记录“这次到底获准做到哪一步”。
建议任务创建时记录:任务类型(研究/实现/运维)、用户目标、允许写路径、可执行环境、交付终点及明确禁止项。已授权范围内自主持续执行,不在每个 Git/测试步骤重复确认;分析和方案请求默认不包含业务实施。
只有扩大业务范围、增加外部写入、操作未授权环境或破坏性恢复等才重新确认。push 仍遵守明确授权规则;凭证存在不代表允许推送。合理默认写进任务模板,不用每次都问用户一张权限问卷。
紧急/迁移例外需记录 owner、原因、范围、期限/退出条件和恢复动作;例外仅覆盖明确条款。`AGENTS.md:29` 的紧急热修免启动阅读不能被解释为允许主目录直接开发、删库或取消验收。
### R09 落实:先做最小执行门禁,不再只增加禁止句
这是上一治理/锁方案已承认的工程任务,不作为“新发现的缺失要求”重复计数。
**已有证据**:AGENTS 已禁用旧 helper 的 create/remove;源码仍包含省略 dev 起点和强制删除。env-service 的根目录来自脚本所在树,缺少执行目录/锁守卫。CURRENT 第 11 行及关联 MinerU 报告已记录一次 worktree rebuild 引起数据挂载漂移,说明风险并非仅理论;本轮未重演该事故。
**建议实施顺序**:
1. 修 worktree create/remove 的明确基线、主仓定位和安全删除。
2. 给共享服务写操作加主目录/dev/操作身份/持锁前置检查,明确 status 等只读入口;构建必须校验真实源码与申报 SHA。
3. 为 CURRENT/MATRIX 提供短锁、增量更新、版本检查,接入已设计 `.locks` 流程;旧锁兼容迁移后才换权威位置。
4. Git 提交/集成门禁拒绝超范围文件、混入 `.env`/运行产物和错误主干写入。门禁真实负例验收后再记录 enforced。
保持用户确认的 L1 目标,不提前搭建跨机平台或要求 OS 隔离才能使用。代码文件锁、全量资源队列和额外 UI 按已有阶段与实际冲突扩展,优先把当前两个共享文档和 dev 操作做可靠。
### R10 新增:清理负责人和完成后的再检查机制
现有安全清理条件应保留,不放宽“不强删、不覆盖”的红线。需要补的是谁在 Agent 退出之后真正执行清理,以及什么时候重试。
操作规范要求无 Agent/进程 cwd 使用才能移除 worktree;长驻客户端即使完成任务也可能仍占 cwd。任务模板允许 retained-with-reason,但没有下一次检查条件。建议由独立集成/维护执行者在 owner 已退出后检查并清理,记录 `cleanup_owner`、保留原因、证据位置和触发条件;遗留目录分为活跃、保护、待审核、未合入和可清理,不按年龄批量删除。
已合入任务的依赖缓存与唯一截图/日志区别处理:可再生缓存明确登记,唯一证据先保存再移除;只保存路径而不保存文件不是证据归档。清理失败不影响已经通过的业务交付事实,但要保持可追踪的 cleanup pending。
## 4. 两项安全补充观察(非本轮阻塞项)
- **材料不能授予权限**:日志、网页、测试输出、引用文本、Agent 产物可能含命令或“用户已授权”字样,应作为待核实内容。handoff 的授权声明回链到可核实的用户目标/委派范围,不仅凭文档自述执行推送、清理或外部写入。已有自动审批不扩权规则继续保留;这项建议补充来源辨别,不要求 L2 现在落地。
- **真实证据允许最小化与脱敏**:测试报告可以保存真实执行中足够判定的片段,说明脱敏范围;不要求提交原始完整日志、个人信息、业务正文或截图中的秘密。现有凭证禁入与真实用户数据不复制要求继续有效。真实性约束来源与结论,不能误解成“未经处理的所有材料都要入 Git”。
## 5. 推荐的规范组织
不建议再并列增加一套“总规范 v2”。保留现有路径并收敛职责:
| 位置 | 负责内容 | 移出/减少 |
|---|---|---|
| AGENTS | 最小安全红线、任务入口、权限/状态原则、操作指针 | 环境动态值、长命令、历史事件、重复模板索引 |
| PROJECT | 仓库地图、目标环境、测试入口与模块标准指针 | 重复通用规则、过期发布结论 |
| worktree runbook | 创建、同步、候选、部署、失败与清理 | 已结束迁移的具体临时目录案例,移入历史交接 |
| 锁管理 runbook(落地后) | 唯一入口、状态、等待、恢复与兼容版本 | 让 Agent 手动拼锁协议的日常操作 |
| CURRENT | 活跃任务、当前槽位、1–3 焦点、必要约束链接 | 大量 done 历史行与长复盘 |
| FEATURE-MATRIX | 能力声明范围、证据、剩余条件 | 逐次操作流水、重复环境快照 |
| 客户端入口 | 明确引用上述来源 | 复制并稍微改写的第二套规则 |
| 任务/审查主文档 | 单项工作的范围、决定、证据和交接 | 对相同内容的无意义多文件复制 |
## 6. 改动顺序与验收
**第一批:消除矛盾。** R01、R02、R05、R07 的明确错误先修。检查从所有客户端入口读取后,纯文档、业务修复、暂停交接、取消任务、真实 PI 验收五种场景都得到一致决策。
**第二批:减少流程负担。** 采纳 R03/R04/R06/R08/R10 后更新模板与薄入口;历史只迁移、不删除。验证信息问答不触发无意义写入,实质审计有唯一主产物,代码与测试能形成完整逻辑提交,未完成任务不会被强制 done。
**第三批:工具实现。** R09 与既有 `.locks` 分阶段方案合并为一个实施队列,不重复造项目。用两个并行任务、锁冲突、旧版本共享文档、错误工作区部署、异常退出和清理拒绝的真实证据验收。当前 user-approved 的 L1 防误改边界不变。
规范检查可以自动化为轻量 `doctor/lint`:本地链接、必需字段/状态、过期 waiver、活跃认领冲突、测试入口存在、脚本能力版本与规范声明对齐。没有明确规则契约的模糊 prose lint 不作硬失败,也不为文案偏好构造复杂测试。
## 7. 审查覆盖与可信度
使用 ce-doc-review 非交互只读流程,审查依据为上述实际文件及脚本,而非仅凭历史记忆。
| 审查视角 | 结果 | 本报告处理 |
|---|---|---|
| 一致性(独立上下文) | 3 项 | 复用声明/引用合入 R07,焦点上限合入 R04 |
| 可执行性(独立上下文) | 1 项 | PI 测试筛选问题合入 R02,主审已核对源码 |
| 范围/减负(独立上下文) | 3 项 | 合入 R03/R04;保留实质审计必须落盘,收窄纯只读豁免 |
| 安全(独立上下文) | 2 项观察,置信锚 50 | 仅列为 §4 补充观察,不当作已证实漏洞 |
| 反例审查(独立上下文) | 0 项新增缺陷 | 候选 SHA、失败恢复、累计部署差异等已有引用约束,未重复提出 |
| 主审当前源核查 | 测试范围冲突、状态模板、提交顺序、动态配置与工具事实 | 补充 R01/R05/R06 等;明确区分改进建议与已知实施项 |
外部第三方 CLI 跨模型复核未执行:本轮未获得向其他外部服务发送仓库文档的显式授权;未以此阻塞会话内独立视角审查。未更改技能或项目配置来伪造关闭该步骤。
未采纳的建议形态:不把纯只读豁免扩大到有持久价值的审计;不把 cleanup_pending 塞进既有任务 status;不要求当前实现 OS 级权限隔离;不因为当前 helper 明确标为未修复,就重复说规范已承诺了不存在的能力。
**已应用规范修正:0。** 上述均是待审核建议。本轮只写审查产物与任务记录,未升级 FEATURE-MATRIX、未改 production_ready、未运行产品测试、未合入 dev 或 push。
## 8. 相关资料
- [当前工作手册](../../AGENTS.md)
- [项目入口](../../PROJECT.md)
- [已采纳工作方式](../ops/2026-09-21-agent-worktree-workflow.md)
- [既有治理方案](../remediation/2026-09-21-agent-workflow-governance-plan.md)
- `.locks` 补充方案:目前在 `feature/agent-lock-coordination-plan@5987bdcd` 的 `.doc/remediation/2026-09-21-agent-lock-coordination-plan.md`,不在本轮 dev 基线;后续合入时再建立普通相对链接。
@@ -0,0 +1,46 @@
---
title: "文档存储 CoW(写时复制)现状审计"
status: done
created: 2026-09-21
updated: 2026-09-21
severity: low
---
# 文档存储 CoW(写时复制)现状审计
## 背景
用户诉求:上传文档要「几个人传同一份只存一份」,涉及可编辑文档时「考虑 CoW,写入时复制」。本审计确认系统当前的去重与写时复制实现状态,并明确本次收口补齐了什么。
## 现状分析
系统存在两套内容存储,均已采用内容寻址(Content-Addressed Storage, CAS),天然满足去重与 CoW 语义:
### 1. 二进制资产:`internal/storage/cas.go`
- 物理对象表 `storage_blobs` 以 `sha256` 为主键,`ref_count` 记录引用数。
- 上传命中相同 sha 时([cas.go](../../internal/storage/cas.go) `storeFileDB`)**不写第二份物理文件**,仅 `ref_count + 1`,并新建一条 `file_references` 逻辑引用。→ 满足「多人传同一文档只存一份」。
- 文件路径 `blobs/<xx>/<yy>/<sha>.bin` 由内容 hash 唯一决定;`StoreFile` 对已存在 blob **只读不覆写**(命中去重分支直接返回)。内容变化 → hash 变化 → 新路径新文件。→ 即 CoW:修改等价于写入新对象,旧对象不被就地改写。
### 2. 可编辑文档正文:`internal/docrevision/pg_store.go`
- `document_content_blobs` 以 `content_sha256` 为键,`ensureBlobTX` 使用 `INSERT ... ON CONFLICT DO NOTHING`([pg_store.go:309](../../internal/docrevision/pg_store.go))。
- 每次编辑保存生成新 `document_snapshots`,指向新的 `content_sha256`;未变化的正文块复用同一 blob 行。→ 编辑保存不会复制未改动内容,写入时才产生新 blob。→ 满足「可编辑文档 CoW」。
## 结论
- **去重**:物理层早已实现(sha256 + ref_count);本次补齐的是**逻辑提示**——把 `FileReference.IsDeduplicated` 透出到上传/列表 API 的 `deduplicated` 字段,并在前端附件卡片与文档预览面板展示「重复·已复用」,让"只存一份"对用户可见。跨项目/同项目的逻辑引用记录保留(权限与审计需要),不做合并(已与用户确认方案:物理一份 + 提示)。
- **CoW**:语义已是事实实现,但**缺防回归守卫**。本次新增 `TestCAS_ImmutabilityCoWContract`([cas_test.go](../../internal/storage/cas_test.go))固化契约:① 相同内容重复写入 → 物理 blob 数不变、字节不变;② 内容变化写入 → 新 blob、旧 blob 不被覆写、历史引用仍读原始字节。未来任何"就地改写 blob"的实现都会在测试期失败。
## 严重度
`low` —— 现状正确,本次为可见性增强 + 契约固化,无缺陷修复。
## 关联整改
- 任务:[2026-09-21-upload-parse-ux-dedup.md](../ops/short-term/2026-09-21-upload-parse-ux-dedup.md)
- 验收报告:[2026-09-21-upload-parse-ux-dedup-test-report.md](../test-reports/2026-09-21-upload-parse-ux-dedup-test-report.md)
## 开放问题
- `storage_blobs.ref_count` 目前只增不减;引用删除(若未来支持资产删除)需配套 decrement 与 blob 物理回收,属后续独立任务,不在本次范围。
@@ -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。

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