Compare commits

...
1064 Commits
Author SHA1 Message Date
weichen bd038b126b merge: dev to test (rc-v1.0.0-beta.7 promotion) 2026-09-20 14:04:30 +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 7a6cfeefeb merge: dev to test (rc-v1.0.0-beta.6 promotion) 2026-09-20 07:22:42 +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 dec963c16f merge: dev to test (rc-v1.0.0-beta.5 promotion) 2026-09-20 01:07:10 +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 15881cd0e6 docs: sync null-fk promote closeout onto test 2026-09-17 06:20:40 +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 d73d2e8633 release-candidate: promote optional-duty null FK fix to test [Tag: rc-v1.0.0-beta.4] 2026-09-17 06:19:57 +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 111f25c9a8 docs: sync test promotion closeout onto test 2026-09-17 05:05:26 +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 e5e09560c7 release-candidate: 汇集 dev 功能至 test 分支,准备长期实测 [Tag: rc-v1.0.0-beta.3] 2026-09-17 05:03:13 +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 b5ce947e77 docs(ops): mark SWBOOT-00..09 feature slice done after push
Record remote branch tip and release workflow-design mutex; still not
merged to dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:45:34 +00:00
weichenandCursor 01a783b8d5 test(swboot): SWBOOT-09 L1 suite and acceptance report
Update catalog size expectations to five workflows and archive the
unit-test report; sync FEATURE-MATRIX and task docs without merging to
dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:45:08 +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 f6034fad37 feat(api): SWBOOT-05..08 wizard hooks and SWBOOT-10 allowlist stub
Add project-types/compliance catalogs, creation-preview, software create
fields, and fail-closed repo allowlist stub without real patch/merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:43:13 +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 909384c335 feat(workflow): SWBOOT-02..04 software manifests and catalog allowlist
Add software_bootstrap/delivery v2 manifests, expand selectable keys to
five, keep medical doc-count gates, and filter catalog by product_domain.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:39:01 +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 d661af71d5 feat(db): SWBOOT-01 additive project type and compliance schema
Add project domain/governance fields, catalog tables, source bindings,
and repo allowlist stub table without backfilling legacy classification.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:36:13 +00:00
weichenandCursor a30931349a docs(adr): SWBOOT-00 software_bootstrap/delivery keys and domain boundary
Freeze selectable workflow keys, domain/compliance separation, solo policy,
and SWBOOT-10 fail-closed stub contract without touching medical three.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:36:08 +00:00
weichen 776b2b5cae merge: fix/nightly-datadir-rw
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-16 15:34:50 +00:00
weichenandCursor 81f6378233 fix(ci): treat DATA_DIR read-only mkdir as infra_fail
Host agent-data mount must be writable for nightly workspace create.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:34:49 +00:00
weichen ebe177eec8 merge: feature/iam-route-inventory-p2
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-16 15:34:19 +00:00
weichenandCursor 025ffe0ab3 feat(authz): full route inventory, session interrupt test, 410/R13 freeze
Close FEATURE-MATRIX IAM partial with v3 inventory and policy docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:33:18 +00:00
weichen 89ce3cc143 merge: fix/nightly-datadir-dev-align
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-16 15:30:39 +00:00
weichenandCursor a27f2cc7fb fix(ci): align nightly DATA_DIR with dev PI on :18865
Host-agent-data/test mismatched shuimu-pi-agent-dev workspace mounts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:30:38 +00:00
weichen 247ddcd306 merge: docs/override-nogo-full-backlog
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-16 15:30:01 +00:00
weichenandCursor 05ae1b3ffd docs(ops): override Wave3 no-go; authorize full backlog P0–P7
User scope-3 authorization; capabilities remain flag-off by default.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:30:01 +00:00
weichen 90ad756ce2 merge: docs/gitea-nightly-run21-status
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-16 15:18:49 +00:00
weichenandCursor 950ce66ed8 docs(ops): record Gitea nightly run#21 product_fail after infra green
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:18:49 +00:00
weichen a47cb84313 merge: fix/gitea-nightly-docker-datadir
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-16 15:17:16 +00:00
weichenandCursor 91d21ea632 docs(ops): mark nightly docker-datadir task done
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:17:16 +00:00
weichenandCursor 7df43f419e fix(ci): mount DATA_DIR and docker for Gitea nightly host jobs
Avoid all-SKIP false PASS and exit-127 without receipt when image build lacks docker.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:17:16 +00:00
weichen 212f0974d8 merge: fix/gitea-nightly-host-tools
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-16 15:12:22 +00:00
weichenandCursor db85c7cab9 docs(ops): mark gitea nightly host-tools task done
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:12:21 +00:00
weichenandCursor b2bcea3cd8 ci(nightly): archive receipts without upload-artifact@v4
Gitea act_runner rejects artifact v4; host runner now has curl/node via brew+host net.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:12:03 +00:00
weichen d48b36046d merge: docs/gitea-nightly-runner-label-note
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-16 15:02:39 +00:00
weichenandCursor d07244c980 docs(ops): note Gitea runner .runner label patch for nightly:host
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:02:39 +00:00
weichen fb73d404f4 merge: chore/nightly-gitea-host-runner
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-16 14:59:38 +00:00
weichenandCursor 74d87b9e5d ci(nightly): use local Gitea host runner label for real PI
Point Nightly Real PI at runs-on: nightly (host network) so the local
act_runner can reach host PI :18865 and isolated PG :5434.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:59:38 +00:00
weichen f1f24dca5b merge: docs/phase3-remediation-dod 2026-09-16 14:47:49 +00:00
weichenandCursor 29da12d036 docs(remediation): check remaining Wave DoD after Phase 3 closeout
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:47:49 +00:00
weichen e843c3c7dc merge: fix/wave-leftovers-n7-playwright-dod 2026-09-16 14:47:44 +00:00
weichenandCursor f54abcab82 fix(ci): Phase 3 leftovers — nightly quality_failed retry and gated docs
Retry U8 product quality flakes once in nightly; formalize Playwright
dual-tab as long-term gated; closeout handoff and DoD notes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:47:32 +00:00
weichen 84363b9180 merge: feature/wave3-pu6-pu8-go-no-go 2026-09-16 14:46:05 +00:00
weichenandCursor d1a019b9d7 docs(ops): archive Wave 3 go/no-go short-term
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:46:05 +00:00
weichenandCursor 6264965267 docs(ops): Wave 3 PU6–PU8 go/no-go — all deferred with contracts
Record no-go decisions and independent long-term task contracts; do not
implement or raise MULTI_INTENT tier.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:46:05 +00:00
weichen 5d7ac1a8f9 merge: feature/wave2c-same-image-digest
Wave 2C: same-image digest pin for test/main promotion.
2026-09-16 14:44:45 +00:00
weichenandCursor f0acbb10ad docs(ops): archive Wave 2C short-term and release integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:44:45 +00:00
weichenandCursor da15eb91b6 feat(infra): Wave 2C same-image digest pin for test/main promote
Build/apply candidate images once, require digests on promote, and keep
pinned env-service from rebuilding divergent images.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:44:26 +00:00
weichen 7c808bdcfc merge: docs/wave2b-n7-receipt 2026-09-16 14:34:19 +00:00
weichenandCursor dcab3aec83 docs(test): archive Wave 2B N7 product_fail promotion receipt
Record classified nightly outcome for 67d7335 with image digests and
gate rejection evidence; does not claim product suite green.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:34:19 +00:00
weichen 49ca6cd6dc merge: docs/wave2b-slot-release 2026-09-16 14:32:10 +00:00
weichenandCursor 4187bcfc9e docs(ops): release Wave 2B integration slot and archive short-term
Smoke passed on merge; record N7 product-fail classification evidence
from the in-flight nightly suite without claiming same-image promotion.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:32:10 +00:00
weichen 2498bd2a13 merge: feature/wave2b-nightly-promotion-receipt
Wave 2B PU5B: nightly real-PI entry, promotion receipts, promote/release gates.
2026-09-16 14:05:59 +00:00
weichenandCursor c75842f945 docs(ops): mark Wave 2B short-term done ahead of merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:05:59 +00:00
weichenandCursor 67d73359fd docs(test): Wave 2B nightly promotion-receipt report and matrix sync
Record gate fixtures and infra negative evidence; mark Artifact row
partial for same-commit/digest traceability without same-image claim.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:02:24 +00:00
weichenandCursor fda159c995 feat(ci): nightly real-PI workflow and promote/release receipt gates
Add schedule/dispatch nightly entry that classifies infra vs product
failures, and require a valid receipt (or waiver) before promote/release.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:02:24 +00:00
weichenandCursor a84778f21b feat(ci): add immutable promotion receipt write/check with waiver
Nightly and promote gates need auditable pass/product_fail/infra_fail
receipts under test-reports assets, plus timed owner waivers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 14:02:24 +00:00
weichen 8278022237 merge: docs/wave2-slot-release 2026-09-16 10:57:11 +00:00
weichenandCursor 879f6fadef docs(ops): release integration slot after Wave 2 merge
Smoke: go vet, go test -short (clean env), env-service rebuild, health/ready ok.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 10:57:11 +00:00
weichen c360a928de merge: feature/wave2-real-pi-evidence 2026-09-16 10:55:54 +00:00
weichenandCursor 7461138412 docs(ops): claim integration slot for Wave 2 merge
Also mark PU4 DoD complete after U8/full-none real-PI evidence archive.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 10:55:51 +00:00
weichenandCursor 422f98012e docs(ops): mark Wave 2 short-term done in archive
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 10:42:43 +00:00
weichenandCursor 574758a71f docs(test): archive Wave 2 U8 and full/none real-PI evidence
Close FEATURE-MATRIX evidence gaps for multi-intent U8 and workflow
full/none; release the integration slot after live PASS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 10:42:20 +00:00
weichenandCursor f1e87fb2e7 test(server): add Wave 2 real-PI evidence for U8 and full/none
Replace the U8 stop-gate with a PG+PI confirm/generate harness and add a
mixed-duty governance long chain covering cross-user approve and none
non-blocking advance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 10:42:20 +00:00
weichenandCursor aac42936bc fix(intentflow): keep plan step receipts durable under PG events
Normalize empty TEXT[] binds, isolate step-changed aggregates from plan
revision uniqueness, propagate AdvanceEligible errors, and emit
taskrun.completed to the registered notify consumer so finalize no longer
rolls back live receipts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 10:42:20 +00:00
weichen ad42f83e5b merge: docs/wave1-pu3-slot-release 2026-09-16 09:42:34 +00:00
weichenandCursor 3a3b31996a docs(ops): release integration slot after PU3 merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:42:34 +00:00
weichen c5d10aebcc merge: fix/iam-store-fail-closed
Wave 1 PU3: IAM NewStores fail-closed unless explicit dev/test opt-in.
2026-09-16 09:42:27 +00:00
weichenandCursor a5bc317492 docs(ops): mark PU3 done and claim merge slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:42:27 +00:00
weichenandCursor 299530bf42 docs(test): archive Wave 1 PU3 IAM fail-closed evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:42:07 +00:00
weichenandCursor 7fdbee6c0c test(server): adapt fixtures to IAM dual-gate fail-closed
Boot memory IAM only via explicit test env opt-in; strict auth cases
disable AllowInMemory after startup.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:42:07 +00:00
weichenandCursor 514db3a086 feat(auth): fail-closed IAM store unless dev/test opt-in
Refuse MemoryStore fallback for main/empty/unknown env or missing
ALLOW_IN_MEMORY so production cannot silently use in-memory authority.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:42:07 +00:00
weichen 16d1ba1d54 merge: docs/wave1-pu5a-slot-release 2026-09-16 09:34:05 +00:00
weichen 0353841a4a merge: fix/race-tempdir-cleanup
Wave 1 PU5A: drain taskrun workers before TempDir cleanup under -race.
2026-09-16 09:34:05 +00:00
weichenandCursor 24e716e661 docs(ops): release integration slot after PU5A merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:34:05 +00:00
weichenandCursor 3400f0a7ac docs(ops): mark PU5A done and claim merge slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:34:05 +00:00
weichenandCursor a453b290a7 docs(test): archive PU5A TempDir race cleanup evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:33:41 +00:00
weichenandCursor 73ae4b8f5b fix(server): drain taskrun workers before TempDir cleanup
Register newTestServer cleanup and Shutdown WaitIdle so race detector
no longer hits RemoveAll on a live DataDir.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:33:41 +00:00
weichenandCursor ea2b9f121e feat(taskrun): add WaitRunDone and WaitIdle for async workers
Allow tests and shutdown to drain in-memory workers before TempDir cleanup.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 09:33:41 +00:00
weichen 9d929f0175 merge: docs/wave0-matrix-merge-closeout 2026-09-16 08:33:27 +00:00
weichenandCursor 99504b628e docs(ops): release integration slot after Wave 0 matrix merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 08:33:27 +00:00
weichen a88a7e3b0a merge: feature/feature-matrix-production-readiness-plan
Wave 0 FEATURE-MATRIX calibration and IAM readonly verification docs.
2026-09-16 08:32:43 +00:00
weichenandCursor 8afd37da65 docs(ops): claim integration slot for Wave 0 FEATURE-MATRIX merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 08:32:43 +00:00
weichenandCursor 2fe58ca9d7 docs(remediation): mark Wave 0 DoD items complete
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 08:32:29 +00:00
weichenandCursor c4a7479572 docs(status): Wave 0 calibrate FEATURE-MATRIX and verify IAM deploy facts
Align capability maturity with frozen boundaries, record IAM readonly PASS
without flipping production_ready, and leave Wave 1+ for fail-closed code.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 08:32:29 +00:00
weichen b67816a898 merge: sync detailed matrix deep-test report onto test 2026-09-16 05:37:16 +00:00
weichen 1ff55033f4 merge: docs/matrix-deep-test-detailed-report 2026-09-16 05:37:16 +00:00
weichenandCursor 68455faa94 docs(test): expand matrix deep-test report with I/O analysis verdicts
Rewrite the promote report so each Wave case records input, system
output, analysis, and evaluation against FEATURE-MATRIX evidence.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 05:37:16 +00:00
weichen 56eb0ed4fe merge: sync matrix deep-test closeout docs onto test 2026-09-16 05:25:31 +00:00
weichen 794b1f43b7 merge: docs/matrix-deep-test-closeout 2026-09-16 05:25:31 +00:00
weichenandCursor 9363121071 docs(test): archive matrix deep-test promote report and release slot
Record Wave 1–4 evidence, fix FEATURE-MATRIX schema-47 note, harden
promote-to-test against origin rebase, and mark infra task done.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 05:25:31 +00:00
weichen 8c9a12d996 release-candidate: 汇集 dev 功能至 test 分支,准备长期实测 [Tag: rc-v1.0.0-beta.2] 2026-09-16 05:19:59 +00:00
weichen 50f800a409 merge: feature/matrix-deep-test-promote-test
Matrix deep-test evidence and CURRENT slot claim prior to test promote.
2026-09-16 05:18:52 +00:00
weichenandCursor 0743fb90ec docs(ops): advance integration slot to merging for test promote
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 05:18:52 +00:00
weichenandCursor 895d5f002a test(ops): capture matrix deep-test Wave 1–3 evidence artifacts
Automated short/module/governance-PG outputs plus live :8080 smoke and
PI typed-result sample for promote gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 05:18:52 +00:00
weichenandCursor 4f997a9438 docs(ops): register matrix deep-test claim on CURRENT
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 05:14:00 +00:00
weichenandCursor ef84d1d8f7 docs(ops): claim infra slot for matrix deep test and test promote
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 05:13:38 +00:00
weichen 4298701b2a merge: docs/archive-production-ready-gates 2026-09-16 04:16:03 +00:00
weichenandCursor 28d1512e6e docs(ops): archive completed production-ready gates short-term task
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:16:03 +00:00
weichen 4d048cc4a3 merge: docs/production-ready-flip
Flip SSOT production_ready=yes after release gates and main schema align.
2026-09-16 04:15:55 +00:00
weichenandCursor 1027026e7a docs(ops): flip production_ready=yes after B1–B4 gates and schema 47
Align FEATURE-MATRIX, gap-matrix, and CURRENT; main rebuilt to schema 47
with dev/test. Release blockers closed; backlog items remain partial/planned.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:15:55 +00:00
weichen 8dae227f8c merge: feature/pi-three-workflow-e2e
Release gates B2–B4 evidence, PI E2E harness fixes, and settings conflict recovery.
2026-09-16 04:14:07 +00:00
weichenandCursor 05a84e6677 fix(web): include nested error field in VERSION_CONFLICT unwrap typing
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:13:35 +00:00
weichenandCursor 23a5f6f589 docs(ops): claim integration slot for production-ready gate merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:12:09 +00:00
weichenandCursor 1f35593dcd docs(test): archive B2–B4 release-gate evidence and check gap boxes
PI three-workflow E2E, chat refresh+restart, and frontend conflict/
termination-preview reports; mark corresponding gap-matrix gates done.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:11:54 +00:00
weichenandCursor 736857a292 fix(web): unwrap nested VERSION_CONFLICT business codes for settings recovery
HTTP envelope wraps PLAN_FROZEN/ERR_CONCURRENT_SWITCH; reload settings on
conflict so operators refresh instead of blind retry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:11:54 +00:00
weichenandCursor 64ac437a90 fix(test): upsert project members before SavePlan in chat-refresh live
Duty assignees must be active members or activation path returns 400.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:11:54 +00:00
weichenandCursor 3b80582123 fix(pi-agent): stabilize real PI three-workflow E2E harness
Use shared DATA_DIR permissions (umask/chmod) and drop obsolete sync
notify asserts so governance PG PI chains can complete on MiniMax runner.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 04:11:54 +00:00
weichen 3b56816f4e merge: fix/ci-governance-pg-members 2026-09-16 03:20:32 +00:00
weichenandCursor 56c85bba11 fix(ci): green governance PG on isolated TEST_DATABASE_URL
Add duty holders as project members, drop sync notification assert
after outbox cutover, and add an explicit CI governance PG step.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:20:32 +00:00
weichen eaffe3eb31 merge: docs/demo-seed-merge-closeout 2026-09-16 03:17:37 +00:00
weichenandCursor c8052c8882 docs(ops): close DEMO-DB-SEED after schema 47 migrate and smoke
Record npm/go gates, empty project 6357 docs=0, and release the
integration slot; gap-matrix DEMO-DB-SEED → PASS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:17:37 +00:00
weichen 511012cede merge: fix/demo-chat-sessions-retire-00047 2026-09-16 03:14:59 +00:00
weichenandCursor c741d26eeb fix(db): add goose 00047 to retire demo project chat sessions
Dev already applied 00046 (projects only) before session retirement
was folded into that file; 00047 closes the gap idempotently.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:14:59 +00:00
weichen 0917f39f80 merge: fix/demo-data-pollution-web
Gate demo seeds, retire goose demo projects/sessions, reject stub in
main/prod, and respect SEED_DEMO_USERS=false.
2026-09-16 03:13:51 +00:00
weichenandCursor 765a418df1 docs(ops): claim integration slot for demo-data-pollution merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:13:51 +00:00
weichenandCursor 66c56324ad docs(ops): backlink 2026-09-15 audit and record review P0/P1 evidence
Cherry-picked SEED_DEMO_USERS separately; document npm test gate,
session retire in 00046, and P2 follow-ups.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:13:25 +00:00
weichen 53bb71adae fix(auth): respect SEED_DEMO_USERS=false to prevent re-seeding demo users 2026-09-16 03:12:31 +00:00
weichenandCursor fbda195b7f fix(db): retire demo chat sessions with projects in 00046
Extend unapplied migration to mark 6001–6010 sessions demo_retired
and filter them (and retired projects) out of ListChatSessions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:12:25 +00:00
weichenandCursor a44df9280c fix(web): rewrite demoSeedIds tests for node:test npm gate
Vitest-style suite was caught by tsx --test and broke npm test.
Align with storage.test.ts and narrow vitest include to chat suites.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 03:11:36 +00:00
weichenandCursor 1e19f5c52f docs(test): archive demo seed pollution remediation evidence
Record systemic audit, wave plan status, gap-matrix blockers, and unit/
bundle scan results for the demo-data pollution fix.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:50:34 +00:00
weichenandCursor 8a8197a4f2 fix(taskrun): reject stub backend in main/prod
Require ResolveBackendInEnv to deny stub (and empty stub fallback) when
env is main/prod so production cannot request simulated agent output.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:50:34 +00:00
weichenandCursor bdc6415944 fix(db): retire goose-seeded demo projects from lists
Mark projects 6001–6010 as demo_retired and exclude them from default
project list queries so demo seeds no longer pollute real workspaces.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:50:34 +00:00
weichenandCursor 855363fd60 fix(web): gate demo seeds and reclaim mock deliverables
Stop shipping hard-coded demo docs/projects into production builds,
drop local mock items on authoritative empty server lists, and purge
stale demo seed residue from localStorage on boot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:50:34 +00:00
weichen 2005a4ca0c merge: chore/release-multi-intent-u8-slot 2026-09-16 02:26:03 +00:00
weichenandCursor 8b228e2101 chore(ops): release the U8 integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:26:03 +00:00
weichen 50cf271b53 merge: feature/multi-intent-u8-task-generate 2026-09-16 02:24:39 +00:00
weichenandCursor bf55278740 docs(test): record U8 task generate adapter report
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:24:23 +00:00
weichenandCursor 2e99ee3661 feat(intentflow): route confirmed generate steps through a task adapter
Persist ComboNeedsConfirm plans at confirm tier without executing writes, then run task.run via OwnerMux and a stable idempotency key.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 02:24:23 +00:00
weichen aec374c5dc merge: chore/release-multi-intent-u7-slot 2026-09-16 01:42:42 +00:00
weichenandCursor ad3d10b72d chore(ops): release the U7 integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:42:42 +00:00
weichen 276ceb42b3 merge: feature/multi-intent-u7-auto-read 2026-09-16 01:40:07 +00:00
weichenandCursor fb19b63baf docs(test): record U7 auto_read query execution report
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:40:07 +00:00
weichenandCursor 702cf6f949 feat(intentflow): execute auto_read query plans from HandleTurn
Default legacy stays a no-op; QueryGuard refuses generate keys until U8.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:40:07 +00:00
weichen 5c4caa375e merge: chore/release-multi-intent-u6-slot 2026-09-16 01:11:28 +00:00
weichenandCursor c7677b09f6 chore(ops): release the U6 integration slot
Restore the U5 SSOT rows dropped during the U6 docs commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:11:28 +00:00
weichen b94873ab18 merge: feature/multi-intent-u6-web-cards 2026-09-16 01:09:05 +00:00
weichenandCursor ba713c266b docs(test): record U6 plan card web report
Keep Playwright dual-tab behind RUN_UI_ACCEPTANCE.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:09:05 +00:00
weichenandCursor 29bb63f766 feat(web): render PLAN_CONFIRM from PlanView without local AST writes
Plan actions post to the decision API and reconcile on 409 instead of mutating documents.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:09:05 +00:00
weichen 4044b68c9e merge: chore/release-multi-intent-u5-slot 2026-09-16 01:02:19 +00:00
weichenandCursor 0dd7a412c2 chore(ops): release the U5 integration slot
Drop accidental pycache from the docs commit and ignore Python bytecode.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:02:19 +00:00
weichen 741089eca3 merge: feature/multi-intent-u5-decision-api 2026-09-16 01:01:39 +00:00
weichenandCursor e16fb7eff2 docs(test): record U5 decision API and authorization report
Close the U5 checklist with HTTP scope negatives and same-nonce receipts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:01:39 +00:00
weichenandCursor 3d444fa5e4 feat(api): mount authenticated intent plan decision routes
Principal comes from the session and query scope; body identifiers are ignored and admins cannot skip membership.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:01:39 +00:00
weichenandCursor 08aa56b16c feat(intentflow): re-authorize steps before confirm and execute
Confirmation stays a command receipt; FakeActionOwner now fail-closes on revoke and resource version drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 01:01:39 +00:00
weichen f35d265721 merge: chore/release-multi-intent-u4-slot 2026-09-16 00:52:59 +00:00
weichenandCursor 131c86a919 chore(ops): release the U4 integration slot
U4 smoke (go vet + go test -short) passed; no shared-env rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 00:52:59 +00:00
weichen 839368198a merge: feature/multi-intent-u4-outbox-projection 2026-09-16 00:50:32 +00:00
weichenandCursor 46ee9fe647 chore(ops): occupy the U4 integration slot
Remove accidental promote-dev and pycache files from the U4 docs commit and hold the merge slot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 00:50:26 +00:00
weichenandCursor 2755d916f4 docs(test): record U4 outbox projection report
Close the U4 checklist with golden payload and only-forward projection evidence.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 00:46:09 +00:00
weichenandCursor c36d891b05 feat(intentflow): emit plan facts onto Track E outbox
Append awaiting/step/completed envelopes in the command UoW and project them without changing dispatcher leases.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 00:46:09 +00:00
weichenandCursor cf063f5727 feat(db): add intent plan projection shadow tables
Store idempotent event outcomes and an only-forward shadow without replacing plan SSOT.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 00:46:09 +00:00
weichenandCursor 1afd39c9e8 docs(ops): claim U4 intent plan outbox projection
Register the events mutex before appending intent.plan facts onto Track E.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 00:40:57 +00:00
weichen 0f656638eb merge: chore/release-multi-intent-u3-slot 2026-09-15 23:47:19 +00:00
weichenandCursor 223b2841d7 chore(ops): release the U3 integration slot
Smoke already passed on the feature branch; shared env stays on schema 43 until a planned rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:47:19 +00:00
weichen 26f1632a21 merge: feature/multi-intent-u3-intentflow-pg 2026-09-15 23:46:55 +00:00
weichenandCursor 4cfe6ff59d chore(ops): occupy the U3 integration slot
Hold the shared merge slot for the no-ff merge of the intentflow PG owner.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:46:55 +00:00
weichenandCursor b6956003d5 docs(test): record U3 intentflow PG CAS lease report
Close the U3 checklist with CAS/lease/fencing evidence while leaving chat routing on legacy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:46:34 +00:00
weichenandCursor 1385002350 feat(app): assemble intentflow plan owner
Wire the composition root without letting chat or coordinator call CreatePlan yet.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:43:46 +00:00
weichenandCursor da0b3d812b feat(intentflow): persist plans with CAS lease and fencing
Own plan/step/decision writes behind UoW so two workers cannot both execute the same step.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:43:46 +00:00
weichenandCursor 7dfd6d6f33 feat(db): add intent plan tables in goose 00044
Persist plans, steps, and append-only decisions with typed CAS, lease, and nonce columns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:43:37 +00:00
weichenandCursor a75aa45129 docs(ops): claim U3 intentflow PG CAS lease
Register the intent-plan mutex and freeze U3 scope before schema or repository work.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:33:15 +00:00
weichen 53c0722925 merge: chore/release-multi-intent-u2-slot 2026-09-15 23:18:37 +00:00
weichenandCursor 86f25b26c4 chore(ops): release the U2 integration slot
Smoke already passed on the feature branch; U2 has no schema or container change.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:18:37 +00:00
weichen 53d4077f06 merge: feature/multi-intent-u2-segmenter 2026-09-15 23:18:10 +00:00
weichenandCursor 91edeccb26 chore(ops): occupy the U2 integration slot
Hold the shared merge slot for the no-ff merge of the rule-segmenter shadow proposal.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:18:10 +00:00
weichenandCursor c2e79c8a1d docs(test): record U2 rule segmenter shadow proposal report
Close the U2 checklist with golden/hard-negative evidence while keeping production routing unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:17:45 +00:00
weichenandCursor 932ba87daf feat(intent): add rule segmenter and shadow PlanProposal
Generate 2–4 step L1 proposals with stable digests while leaving TopIntent and the legacy IntentPlan router unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:14:29 +00:00
weichenandCursor 9005766b62 test(intent): lock legacy multi-intent plan routing
Keep write combos and internal-chain summaries on the current TopIntent path so U2 shadow proposals cannot silently change production.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:07:46 +00:00
weichenandCursor 475134802b docs(ops): claim U2 multi-intent rule segmenter
Register the independent U2 short-term on the intent mutex so shadow proposals can land without touching production routing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 23:06:29 +00:00
weichen 8ac3d3fbc6 merge: chore/release-multi-intent-u1-slot 2026-09-15 16:28:07 +00:00
weichenandCursor 3171e4f0e5 chore(ops): release the U1 integration slot
Smoke already passed on the feature branch; U1 has no schema or container rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:28:07 +00:00
weichen 29d9c65603 merge: feature/multi-intent-u1-contracts 2026-09-15 16:27:29 +00:00
weichenandCursor 42c8ae2ccd chore(ops): occupy the integration slot for U1 merge
Serialize the local --no-ff merge of multi-intent U1 contracts onto dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:27:29 +00:00
weichenandCursor 3d326ad81e docs(status): record U1 multi-intent contract freeze
Archive the arch/parity/short evidence and mark the U1 claim done so U2 can take the intent mutex next.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:27:03 +00:00
weichenandCursor 9364da4974 feat(intentflow): freeze plan lifecycle contracts and batch policy
Add the app/intentflow skeleton so HITL state, error codes, REST shapes, and BatchActionPolicy live outside intent and default to the legacy tier.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:22:52 +00:00
weichenandCursor aefb1e45a6 feat(events): register intent.plan contracts and table owners
Freeze the three fact events, intentflow allowlist, and plan table ownership so later units cannot invent producers or write paths outside app/intentflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:20:19 +00:00
weichenandCursor bdccb4dbfe docs(ops): claim U1 multi-intent HITL contract freeze
Register the independent U1 short-term, checklist, and CURRENT mutex so architecture-docs and events stay serial while contracts land.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:19:12 +00:00
weichen dd30e061d8 merge: sync test promotion notes from local dev 2026-09-15 16:04:59 +00:00
weichen 987423794f merge: feature/test-env-smoke-notes 2026-09-15 16:04:59 +00:00
weichenandCursor 8919ca9842 docs(ops): record the test promotion smoke and release the slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:04:59 +00:00
weichen 2e826e7f58 merge: promote local dev to test for Phase 2 actual testing 2026-09-15 16:02:46 +00:00
weichen 5a79752ebe merge: feature/promote-dev-to-test-2026-09-15 2026-09-15 16:02:38 +00:00
weichenandCursor 68755862f1 docs(ops): occupy the integration slot for the test promotion
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 16:02:38 +00:00
weichen 067cf8be18 merge: feature/phase2-session-close 2026-09-15 15:58:47 +00:00
weichenandCursor 035d8594a6 docs: sync multi-intent review index with the parked plan
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:58:47 +00:00
weichenandCursor fa5955be07 docs(design): tighten multi-intent confirm UI and accessibility gates
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:58:26 +00:00
weichenandCursor 69d1203593 docs(ops): close Phase 2 session and park multi-intent HITL plan
Archive the shared-live short-term, refresh CURRENT foci, and check in the reviewed multi-intent design so it no longer sits uncommitted on dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:57:40 +00:00
weichen c1a2bcc26b merge: feature/current-env-snapshot 2026-09-15 15:27:50 +00:00
weichenandCursor 05550f3558 docs(ops): record typed-result and live consumer modes in CURRENT
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:27:50 +00:00
weichen 3d39ee0589 merge: feature/pi-typed-result 2026-09-15 15:27:16 +00:00
weichenandCursor ecba6f3b14 chore: release the pi-typed-result integration slot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:27:16 +00:00
weichenandCursor a3fa7c137b docs(test): record PI typed-result-v1 dual-track evidence
Archive Track P tasks and point FEATURE-MATRIX at the live MiniMax runner report.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:25:34 +00:00
weichenandCursor 0a61cfbe90 feat(agent): add typed-result-v1 and fail-closed remote parser
Remote /v1/run now emits additive result_v1; Go validates run_id, digest, and paths before materializing, and only accepts missing typed payloads with an explicit legacy handshake.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 15:25:18 +00:00
weichen 4dbe6a431c merge: feature/http-error-envelope 2026-09-15 14:41:09 +00:00
weichenandCursor f6813cc272 feat(api): add additive HTTP/SSE error envelopes
Public errors now emit code, safe message, and request_id while keeping the legacy error field. Raw SQL, paths, tokens, and XSS payloads are stripped; the frontend branches on code instead of substring matching.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 14:40:56 +00:00
weichen 39dc68d15c merge: feature/event-shared-live-cutover 2026-09-15 14:24:17 +00:00
weichenandCursor 7a9d0d850d chore: ignore pycache and release the live-cutover integration slot
Shared live rebuild passed health/ready; keep Python bytecode out of test-report assets.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 14:24:17 +00:00
weichenandCursor ad9027fe8f docs(test): record shared event live cutover and close the reliability pilot
Notify, workflow_advance, and projection completed shadow/live/rollback on agent-dev; authorized 6275 digest matches; project 143 stays non-leaking.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 14:23:07 +00:00
weichenandCursor 9b1a94c5bc feat(app): drop production outbox and approval hook registration
Durable notify/advance/projection are live on shared dev, so composition roots must not assign OnOutbox or AddOnApprovedHook. Bind helpers remain for tests and a rollback window.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 14:23:07 +00:00
weichenandCursor 4a662ec2d3 feat(events): gate shared-dev consumer mode changes
Add ValidateOpsCutover, eventmode CLI, and a host script that pin agent_system_dev and refuse FAV plus test/main before any cluster mode write.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 14:11:44 +00:00
weichen a20760953a merge: feature/phase2-closeout-inventories 2026-09-15 13:26:50 +00:00
weichenandCursor 8400427c24 docs: close Phase 2 isolation tracks and file H0/P0 inventories
Archive completed Track E/S short-terms, record HTTP/PI compatibility matrices, and defer shared live plus protocol implementation to long-term tasks.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:26:20 +00:00
weichenandCursor 1c04f17c8c test(events): reject replay apply without approval ref
ReplayPlan two-person apply already required digest match; this pins the missing ApprovalRef negative so dry-run tickets cannot skip the ticket field.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:26:20 +00:00
weichen 3a6d4f45dd merge: fix/chatflow-orchestration-boundary 2026-09-15 13:15:57 +00:00
weichenandCursor 9811ae3841 docs(test): record D7b chatflow orchestration boundary
S4b report and archive; chat production allowlist no longer includes bizdev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:15:48 +00:00
weichenandCursor 425c8ba776 feat(chat): drop production bizdev import from action executor
Pending-action task runs now use stageflow request aliases and Server ports, so chat no longer reaches through the orchestration root.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:15:48 +00:00
weichen 20fc82c485 merge: fix/bizdev-locator-removal 2026-09-15 13:11:10 +00:00
weichenandCursor 6a9e3fb51a docs(test): record D4 bizdev locator removal
S1 report, archive the short-term task, and mark the getter contract closed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:10:47 +00:00
weichenandCursor 2a75abb39e refactor(bizdev): delete eight locator getters
Composition roots already hold Snapshot ports; the interface and archtest now forbid putting Pool/DocGov/DocRevision/ContextManager/CAS/ProjectWorkflow/FreeformDoc/KB back on Service.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:08:25 +00:00
weichenandCursor 3f42149457 feat(bizdev): snapshot collaborators onto Runtime and Server ports
Composition roots copy Parts once so HTTP/CLI handlers stop calling locator getters on every request.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 13:00:33 +00:00
weichen 92a9c6783d merge: fix/stageflow-type-ownership 2026-09-15 11:13:17 +00:00
weichenandCursor acb443e949 docs(test): record D5 stageflow type ownership and chatflow first batch
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 11:13:17 +00:00
weichenandCursor 110c2e810c feat(stageflow): own task/stage types so coordinator drops bizdev
Coordinator now takes a StageTaskRunner and injected context/KB ports.
Chatflow assembler reads maturity tokens instead of the orchestration root.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 11:13:17 +00:00
weichen 6f541feac0 merge: fix/intent-bizdev-boundary 2026-09-15 10:29:38 +00:00
weichenandCursor 23d0cfb10f docs(test): record D7a intent-bizdev boundary
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:29:38 +00:00
weichenandCursor 525047b841 feat(intent): depend on maturity vocabulary instead of bizdev
Intent only needed the three official stage tokens. Moving them to a
leaf package lets the recognizer compile without the orchestration root.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:29:38 +00:00
weichen 0a2ea2477d merge: fix/doccontent-canonical-boundary 2026-09-15 10:24:24 +00:00
weichenandCursor 7728339d08 docs(test): record D6 doccontent canonical boundary
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:24:24 +00:00
weichenandCursor 9ddc673eb8 feat(doccontent): extract shared markdown canonicalization and SHA
docgov saves content hashes through the new leaf module so it no longer
imports docrevision. Existing docrevision exports stay as thin wrappers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:24:24 +00:00
weichen 2771a1ed04 merge: fix/event-e2-hook-guard 2026-09-15 10:17:47 +00:00
weichenandCursor 71502c7ce0 docs(test): record E2 hook live-guard and Track E retrospective
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:17:26 +00:00
weichenandCursor a1316e39cb test(events): prove WriterLive off/shadow/live hook matrix
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:17:26 +00:00
weichenandCursor 97028c33b5 feat(events): skip in-process writers when a consumer is live
Keep OnOutbox and approval hooks registered while dispatcher mode is
off, but no-op them as soon as the matching durable consumer owns the
visible write so a later switch cannot dual-write.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:17:09 +00:00
weichen 51bf791ef0 merge: fix/event-projection-cutover 2026-09-15 10:00:38 +00:00
weichenandCursor dab3e1a355 docs(test): record E1C projection no-replace and worker restart evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 10:00:11 +00:00
weichenandCursor d645eaa1f7 docs(test): record E1C projection no-replace and worker restart evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:59:55 +00:00
weichenandCursor aa2f31dc0f test(docproject): prove projection shadow, uniqueness, and no-replace
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:59:55 +00:00
weichenandCursor 92f31ffa6a feat(events): apply version-committed projections only forward
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:59:55 +00:00
weichenandCursor 21d7692c94 feat(db): record unique projection outcomes per envelope version
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:59:54 +00:00
weichen 1b1d0a1cba merge: fix/event-workflow-advance 2026-09-15 09:43:09 +00:00
weichenandCursor 7d1b7e736b docs(test): record E1B workflow-advance shadow/live/rollback evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:43:09 +00:00
weichenandCursor 0ebaaaed87 test(docadvance): prove workflow advance shadow, uniqueness, and rollback
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:43:09 +00:00
weichenandCursor 965e288d36 feat(events): apply approved events onto workflow advance in one fenced transaction
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:43:09 +00:00
weichenandCursor 28bb0b8356 feat(db): correlate stage-ready requests to envelope event_id
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:43:09 +00:00
weichen ebf16aa094 merge: fix/event-notify-cutover 2026-09-15 09:26:45 +00:00
weichenandCursor ff713ff790 docs(test): record E1A notify shadow/live/rollback evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:26:36 +00:00
weichenandCursor a5e46eeb5f test(docnotify): prove notify shadow, live uniqueness, and rollback on isolated PG
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:26:36 +00:00
weichenandCursor 16a31f8aa5 feat(events): run notify side effects and ack on one fenced transaction
Shadow dry-runs the same handler then rolls back, writing only the intended digest.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:26:36 +00:00
weichenandCursor 6702b16249 feat(db): correlate notifications to envelope event_id for unique visible outcomes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:26:36 +00:00
weichen 06b824ad7c merge: feature/events-dispatcher-pg 2026-09-15 09:08:25 +00:00
weichenandCursor d926f64c2e docs(test): record E0B dispatcher PG, race, and default-off evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:08:15 +00:00
weichenandCursor 6bee7630bd feat(service): run the event dispatcher as an independent cmd/events process
HTTP Runtime does not start the worker. Each compose environment gets its own events service, health port, and bounded pool.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:08:15 +00:00
weichenandCursor d5968ad4ba feat(events): replace SELECT-only claim with fenced atomic leases
Workers claim with SKIP LOCKED, heartbeat by token, and ack/fail only when the fencing token still matches. Shadow scans without acking live deliveries.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:08:15 +00:00
weichenandCursor 5fd5588a3f feat(db): add dispatcher attempts, consumer modes, and checkpoints
E0B needs an additive lease audit trail and a cluster-level off/shadow/live table before any worker can claim. FAV remains constrained to off.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 09:08:15 +00:00
weichen 5f3b117c00 merge: fix/event-production-scope-contract 2026-09-15 08:53:10 +00:00
weichenandCursor 0f2f8d30e5 docs(test): record E0A producer-contract gate and checkpoint ADR
Archive isolated-PG evidence, 7-day read-only inventory, and the decision to bootstrap consumers from the first safe event instead of gap-waiting.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:52:59 +00:00
weichenandCursor 0f2057765a test(docflow): prove three production chains share one Postgres transaction
Isolated-library coverage checks approved/candidate/impact envelopes, empty-env rollback, and zero FAV staging rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:52:48 +00:00
weichenandCursor 504058debf feat(app): inject unique docflow Commands and isolate FAV from production events
HTTP adapters now reuse the composition-root instance. Candidate-ready, downstream impact, and approved envelopes share the domain unit of work, and missing env/project fail closed without defaulting to dev/0.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:52:40 +00:00
weichenandCursor bcb122ac53 feat(events): fail-closed scope, static registry, inventory, and replay digest
Reject empty environment/project, disable FAV consumers at register time, and keep historical classification/repair/replay as audited application use cases with no raw SQL entrypoint.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:52:30 +00:00
weichenandCursor 97305d699e feat(db): add event inventory, repair audit, replay plans, and service principals
E0A needs additive tables for classification and per-consumer identities before any dispatcher can claim work. FAV principals are rejected at the schema check.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:52:19 +00:00
weichen 3d2a1defd8 merge: feature/module-decoupling-phase2-docs 2026-09-15 08:12:47 +00:00
weichenandCursor 15af018734 docs(ops): close architecture-docs mutex after Phase 2 plans land
The next claim is Track E E0A; dispatcher stays off until that gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:12:21 +00:00
weichenandCursor 7647215513 docs(ops): land Phase 2 Track E/S/P plans onto a legal feature branch
Move the reviewed durable-event, HTTP envelope, and PI typed-result
designs off the docs/ prefix so Track E can start from latest dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 08:11:29 +00:00
weichen 5cef85670a docs(remediation): add module decoupling phase-2 remediation plan and index gap-matrix rows 2026-09-15 07:03:39 +00:00
weichen a3392e3e06 docs(research): add module decoupling and IPC/RPC interaction assessment 2026-09-15 06:57:08 +00:00
weichen 9edd6c8190 merge: chore/leftover-branch-cleanup 2026-09-15 06:44:46 +00:00
weichenandCursor edb7411474 docs(ops): record leftover branch cleanup and short smoke evidence
Local merged side branches and their worktrees are gone; FAV/herdr/diagnosis/old-linear stay unmerged on purpose.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 06:44:39 +00:00
weichen 347c5f54a6 merge: docs/conversation-intent-dual-tab 2026-09-15 06:22:58 +00:00
weichenandCursor 8a8f64a931 docs(test): close intent dual-tab busy gate and release the mutex
Record project 6275 PI 409 DOC_BUSY plus Docker screenshots, mark CHAT-INTENT-STATE PASS, and archive the short-term so CURRENT has no in_progress rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 06:22:58 +00:00
weichen f5d32cddd1 merge: docs/u11-u12-slot-close 2026-09-15 05:55:34 +00:00
weichenandCursor 111ab6786e docs(test): close U11–U12 after dev rebuild and archive the app mutex
Record schema 38 health/ready plus the new agent-dev-app digest, then mark the composition-root slice done so intent dual-tab can take the idle slot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:55:25 +00:00
weichen bf59cceef2 merge: feature/app-composition-u11-u12 2026-09-15 05:51:32 +00:00
weichenandCursor 934c0596ea docs(ops): occupy the integration slot for U11–U12 merge
Serial slot is required before --no-ff into local dev and agent-dev rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:51:32 +00:00
weichenandCursor 717162e701 docs(test): record U11–U12 composition root and transport gate evidence
Contract tests, target-package race, and arch-check --mode block passed; merge to dev still needs the integration slot rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:40:15 +00:00
weichenandCursor 84c0841acb feat(app): add composition root, stageflow, ContextUpdate, and SSE transport
Move construction and document OnOutbox out of server, give HTTP/CLI a shared task use case, and block already-cleared import/event arch rules.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:40:15 +00:00
weichenandCursor 652cea1605 docs(ops): claim M5/M6 U11–U12 composition and transport gate
User authorized continuing past U10 stop-ship; register app mutex on feature/app-composition-u11-u12.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:40:00 +00:00
weichen ef9a162314 merge: feature/chatlog-contextasm-u10
M4 U10 ChatLog/ContextAssembler 原地端口化。停止扩面,禁止 U11–U12。
2026-09-15 05:05:27 +00:00
weichenandCursor 6601583cbe docs(test): record U10 occupy-slot rebuild into agent-dev
health/ready schema 38;镜像已含 ChatLog 端口。停走结论仍是停止扩面。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:05:27 +00:00
weichenandCursor 3c9e6d214d docs(ops): occupy the integration slot for M4 U10 merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:04:15 +00:00
weichenandCursor 6e744d3717 docs(test): record U10 ChatLog ports and live chat refresh evidence
Archive the finished chat mutex tasks, attach PI idle-chat refresh same-set evidence for project 6252, and stop expansion after in-place ports without a package split.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 04:11:40 +00:00
weichenandCursor 65bdda8aae feat(api): route chat history reads through ChatLog
Ignore request user_id as identity, authorize from the session Principal, and hydrate restore/memory from the same visible set so HTTP, SSE, and prompt assembly cannot amplify hidden messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 04:11:27 +00:00
weichenandCursor 18d40fa8a9 feat(chatflow): add ChatLog and ContextAssembler ports
Keep ctxmgr as table owner and filter the authorized visible set in-process so window, stats, restore, digest, and prompt assembly share one Principal-scoped collection without a package move.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 04:11:16 +00:00
weichen 3944856b0a merge: feature/dataset-lifecycle-u9
M3 U9 存量回填、migration corpus 与数据生命周期。
2026-09-15 03:01:49 +00:00
weichenandCursor af51e74076 docs(test): M3 U9 dataset lifecycle 验收报告
隔离库 SKIP LOCKED、八轨、arch-check、web 与 rebuild 证据齐全;真实 PI 未测。最后一句:继续 U10。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 03:01:49 +00:00
weichenandCursor 42f356ccd7 docs(ops): occupy the integration slot for M3 U9 rebuild
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:41:06 +00:00
weichenandCursor be0c1e843f feat(dataset): registry, pause/resume backfill, destroy gates, eight tracks
批准 dataset 分类入库;SKIP LOCKED 分批;销毁默认 fail closed。restore 演练拒绝共享 env DSN。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:40:12 +00:00
weichenandCursor b5337d5c77 feat(artifactvault): checkpoint backfill without scanning workspace
只枚举 snapshot、agent_commit、approved 与 completed chat turn;hazard 进 quarantine,禁止工作区路径。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:40:12 +00:00
weichenandCursor 5ac14d649b feat(db): add goose 00038 dataset lifecycle tables
Registry、checkpoint queue 与 destroy 请求表属主 dataset;必须可 Down,不改历史 Goose。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:31:34 +00:00
weichenandCursor e81e7a1bcc docs(ops): claim M3 U9 dataset lifecycle mutex
U8 已签继续 U9。本轮 mutex=dataset,禁止 U10–U12 与共享库销毁。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:30:45 +00:00
weichen 367473730b merge: feature/taskrun-runmanifest
M3 U8 TaskRun 终态与 RunManifest。
2026-09-15 02:17:37 +00:00
weichenandCursor f4dfada9ae docs(test): M3 U8 TaskRun RunManifest 验收报告
隔离库双 pool、目标包 race、arch-check、web 与 rebuild 证据齐全;真实 PI 未测。最后一句:继续 U9。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:17:37 +00:00
weichenandCursor ac302fb78f docs(ops): occupy the integration slot for M3 U8 merge
Serialize merge and container rebuild so other agents wait while RunManifest lands on dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:07:42 +00:00
weichenandCursor 3997a04bdb test(taskrun): cover duplicate finalize, cancel race, and SSE
Use an isolated dual-pool database so idempotent finalize, cancel CAS, commit-fail SSE, and receipt-gated cleanup are proven without a process mutex.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:06:21 +00:00
weichenandCursor 2ddaf769ca feat(workspace): gate cleanup on verified receipts
Hash deliverables through Capability.ReadArtifact, resolve backends on the server, and refuse workspace removal until frozen members match FAV receipts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:06:10 +00:00
weichenandCursor 7be873073c feat(taskrun): finalize RunManifest in one unit of work
CAS the unique terminal status with the assistant turn, frozen manifest, envelope and FAV staging, and join ctxmgr writes through the same UoW instead of a process mutex.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:05:58 +00:00
weichenandCursor eb75f855a5 feat(db): add goose 00037 task_run_manifests
Persist typed RunManifest bytes and SHA per run, and allow a finalizing status so U8 can freeze a unique terminal without sharing env databases.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 02:05:33 +00:00
weichenandCursor 2234af476a docs(ops): claim M3 U8 TaskRun RunManifest mutex
Register feature/taskrun-runmanifest on the taskrun mutex so U8 can start without occupying chat/intent or writing U9–U12.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 01:04:32 +00:00
weichen b8f33b5c55 merge: refactor/document-reliability-pilot
M2 test report and integration-slot release.
2026-09-14 16:07:37 +00:00
weichenandCursor da21911e30 docs(ops): restore the original M1 stop-the-line report link
CURRENT SSOT must keep the unmodified 停止扩面 report alongside the live and M2 reports.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 16:07:37 +00:00
weichenandCursor b1ce9b5c41 docs(test): record document reliability M2 go-no-go
U5–U7 passed isolation-db, race, goose Down, and schema-36 rebuild. The report last sentence is 继续 M3; the integration slot is idle.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 16:07:05 +00:00
weichen 0872d8fbb3 merge: refactor/document-reliability-pilot
M2 WorkspaceRef, durable events, and audited FAV (goose 00034–00036).
2026-09-14 16:00:57 +00:00
weichenandCursor 425338be9e docs(ops): occupy the integration slot for M2 merge
U5–U7 need a main-repo rebuild so schema 00034–00036 is not validated from a worktree docker.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 16:00:42 +00:00
weichenandCursor c7e3e99303 feat(artifactvault): extract audited FAV with union-deny reads
Goose 00036 is a renumbered copy of the vault tables. Degraded read stays off by default and only runs after authorization; tombstones and unpublished artifacts fail closed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 15:59:36 +00:00
weichenandCursor f27059b453 feat(events): add durable envelope delivery and drop commit OnOutbox
Agent commits append a validated envelope inside the command unit of work. SKIP LOCKED is only used to claim, and stale fencing plus integrity failures go to quarantine or dead-letter.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 15:59:24 +00:00
weichenandCursor 18ddd0f862 feat(workspace): add WorkspaceRef fencing and hide physical paths
Cross-module callers get an opaque ref plus rotating lease tokens so stale writers fail closed, and file I/O is refused inside a unit of work.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 15:59:14 +00:00
weichenandCursor b0d9153e52 docs(test): record document reliability M1 live sign-off
Rebuild, real PI, browser reload, and two-pool sessions all passed, so
the live report's last sentence is 继续 M2 and the integration slot is idle.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:46:53 +00:00
weichenandCursor 88b37b60da test(e2e): refresh admin directory before new-project member pick
Create-project candidates come from the in-session user directory, so a
fresh admin page never saw B/C unless the console refresh ran first.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:38:50 +00:00
weichenandCursor 3e4abc51cd test(e2e): cover 143 reload, fail-closed GET, and new-project compile
Live M1 sign-off needs browser proof that missing projection is not 404,
outsiders share DOCUMENT_NOT_FOUND, and a real PI compile survives reload.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:34:37 +00:00
weichenandCursor f34bec40f5 test(docgov): replay same-digest across two pools and four sessions
Cross-pool idempotency is same key plus same digest; a stale in-memory
head from the seeder hid the one-winner four-session lock.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:34:30 +00:00
weichen cb8eacac61 merge: refactor/document-reliability-pilot
Occupy the integration slot to rebuild dev for M1 live sign-off of document reliability U1–U4.
2026-09-14 14:24:56 +00:00
weichenandCursor 7f8ad76d12 test(docgov): add two-pool races and ledger-first live spec
Occupy the integration slot for M1 live sign-off, cover two pgx pools plus four sessions, and add a Playwright spec that treats projection consistency as 200 rather than 404.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:24:46 +00:00
weichenandCursor 3772193747 docs(test): attach M1 suite transcripts
Keep the short and isolated PostgreSQL/race outputs next to the stop-the-line report so the unsigned PI/browser/rebuild columns stay auditable.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:11:52 +00:00
weichenandCursor 9d6594a31c docs(test): record document reliability M1 stop-the-line
Unit, isolated PostgreSQL, and target-package race passed, but real PI, browser, and rebuild were not signed, so the report concludes 停止扩面 and keeps U5–U12 closed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:11:26 +00:00
weichenandCursor f0f57a0755 fix(docflow): avoid mutating shared Commands.Auth
Concurrent HumanEdit/Approve used to assign the default authorizer on the shared Commands value, which raced under -race. Read a local authorizer instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:11:26 +00:00
weichenandCursor c754f7743d feat(docquery): serve ledger when projection is missing
Authorize first, then return immutable ledger markdown with typed consistency so a missing or drifted projection is no longer a 404/409. GET stays read-only and FAV degraded read stays off.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:07:05 +00:00
weichenandCursor ade618b854 feat(docflow): own document commands in one UnitOfWork
Lock the document row and re-authorize duty before edit, agent commit, approve, or reject share a single transaction. Characterization tests pin ETag races, one legal approve/reject terminal, and same-key digest conflicts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 14:02:21 +00:00
weichenandCursor ec22843297 docs(ops): mark U2 UnitOfWork complete on the pilot task
Record that cross-owner rollback is implemented so U3 can take document commands next.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 13:54:33 +00:00
weichenandCursor f8b21ecd7c feat(app): add UnitOfWork and owner-bound repositories
Give each document command one postgres transaction and only let table owners unwrap the scope, so cross-owner writes can roll back together.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 13:54:27 +00:00
weichenandCursor 158ce2586d docs(audit): record U1 architecture baseline
Capture the replayable import/sql/path/event counts and the owned exceptions that later milestones must shrink.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 13:49:54 +00:00
weichenandCursor 312578ccd1 chore(arch): classify production writers and path rules
Replace whole-repo grep with four production-only gates so Goose and tests stop looking like writer debt, and so new SQL, path, or event crossings fail immediately.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 13:49:54 +00:00
weichenandCursor 2269cabf43 docs(arch): archive document reliability pilot plan and claim docgov
Land the revised modular-monolith scheme on the implementation branch so U1–U4 can proceed against a frozen design, and register the docgov mutex without occupying the integration slot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 13:43:54 +00:00
weichen a8f9451410 merge: fix/governance-action-level-authz (G5 acceptance docs) 2026-09-14 08:46:57 +00:00
weichenandCursor 05d2154d66 docs(test): archive governance action-level authz acceptance
Record the real-page and API matrix, release the workflow mutex, and point FEATURE-MATRIX / gap-matrix at the report.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:46:45 +00:00
weichen 68640e4de1 merge: fix/governance-action-level-authz (blocked status + canonical duty check) 2026-09-14 08:40:01 +00:00
weichenandCursor 1d366fd38e test(web): stabilize governance authz page matrix locators
Avoid matching the blocked-run hint when opening settings, and close leftover modals before project 143.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:39:44 +00:00
weichenandCursor aec166ea41 feat(api): duty-check canonical docs before they are persisted
Template doc_proj ids were skipping CheckDocTaskAccess and returning 400 not-found.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:39:44 +00:00
weichenandCursor 68fee06da4 feat(db): allow blocked_pending_governance task run status
Pre-activation 202 runs must persist without hitting chk_task_run_status.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:39:44 +00:00
weichen 1dcffb7d11 merge: fix/governance-action-level-authz
G1–G4 duty-action authz, blocked pre-activation runs, and create-time
planning stay; G5 smoke follows on the shared dev stack.
2026-09-14 08:06:37 +00:00
weichenandCursor 5ee898e2e4 docs(ops): occupy integration slot for governance authz
G5 starts merging and smoke on the shared dev stack; Playwright matrix
is ready for the real page pass after rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:04:34 +00:00
weichenandCursor c048060bae docs(audit): classify planning projects with leftover workflow keys
Read-only dev query shows 83 planning rows with a leftover key; all are
paired PROJ_MGR/TEST_PROJ fixtures, none are live business projects.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:01:46 +00:00
weichenandCursor ab9fccded4 feat(web): disable unmanaged approval actions
Hide submit/review/approve on none docs, surface the blocked-run hint in
chat, and warn that unmanaged duties cannot be added after activation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:00:21 +00:00
weichenandCursor 9baf3c83f8 test(web): cover duty-gated actions and blocked-run copy
Pin unmanaged-doc button visibility and treat blocked_pending_governance
as a governance hint, not a successful generation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 08:00:21 +00:00
weichenandCursor 22f65e5f24 feat(projectworkflow): keep create in planning when key provided
Validate the catalog key only and stop writing lifecycle=active so
activation stays on the settings DutyMode path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:55:51 +00:00
weichenandCursor 2e586c99b8 test(projectworkflow): reject create-time active bypass
Creating with initial_workflow_key must stay in planning with an empty
active key while the catalog still mounts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:55:51 +00:00
weichenandCursor 295ad89860 feat(api): block pre-activation runs without starting squads
Keep 202 for unactivated document runs, persist blocked_pending_governance,
and refuse submit/review/approve/edit until a live workflow exists.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:54:43 +00:00
weichenandCursor 8384136989 feat(projectinstance): map document actions to duties
Route run/edit/submit/review/approve to a single duty, drop full-doc
creator bypass, and keep view listing independent of stage narrowing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:54:43 +00:00
weichenandCursor 66d2a1837f test(projectinstance): pin action-level duty checks
Lock the full/none/pre-activation matrix so creator no longer implies
document-task privilege and unactivated runs stay WORKFLOW_NOT_ACTIVATED.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:54:43 +00:00
weichenandCursor b4699e9cbe docs(ops): start governance action-level authz
Wave 5 is on local dev@19f6df5; claim the workflow mutex and
register the implementation worktree for G1–G5.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:42:48 +00:00
weichen 19f6df58dd merge: fix/workflow-plan-409-frozen-and-optional-duties Wave 5 acceptance 2026-09-14 07:29:27 +00:00
weichenandCursor ed4a3e53de docs(test): archive workflow-plan 409 settings page acceptance
Record the real UI matrix, release the integration slot, and leave
the unrun PI generation/approval path as an explicit residual.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:29:16 +00:00
weichenandCursor bb1927f23b test(web): harden Wave 5 frozen-duties page matrix
Wait for the workflow select step before clicking next, scope duty
dropdowns by role, and finish first-login reset so dual-tab and
member checks reach the real frozen UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:28:56 +00:00
weichen 840b5be94f merge: fix/workflow-plan-409-frozen-and-optional-duties e2e tidy 2026-09-14 07:08:15 +00:00
weichenandCursor 5d40f5938a test(web): drop unused Wave 5 e2e password binding
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:08:06 +00:00
weichen 354e573f37 merge: fix/workflow-plan-409-frozen-and-optional-duties 2026-09-14 07:07:51 +00:00
weichenandCursor f86a44acd4 docs(ops): occupy integration slot for workflow-plan 409 Wave 5
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:07:39 +00:00
weichenandCursor e1ed561917 feat(web): add optional human-approval switch for configurable docs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:02:11 +00:00
weichenandCursor a0904fdd69 test(web): cover per-document approval toggle
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 07:02:11 +00:00
weichenandCursor 708b735eea feat(projectinstance): apply duty mode to readiness access and snapshots
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:58:06 +00:00
weichenandCursor 1dd1cc039e test(projectinstance): unify gate access and preview for duty modes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:58:06 +00:00
weichenandCursor ea97a658c6 feat(projectinstance): classify optional duties without lowering required gates
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:53:21 +00:00
weichenandCursor de66558736 test(projectinstance): pin duty mode and activation governance
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:53:21 +00:00
weichenandCursor 0689ac77c3 feat(web): show frozen read-only project settings
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:48:14 +00:00
weichenandCursor 1b0f99a455 test(web): add typed project settings errors and frozen mode
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:48:14 +00:00
weichenandCursor 94065976a5 docs(ops): start workflow-plan 409 frozen and optional duties
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 06:43:53 +00:00
weichen b01af96045 docs(workflow): register reviewed remediation worktree 2026-09-14 06:28:02 +00:00
weichen 15f52cb14e docs(workflow): review frozen plan and optional duty design 2026-09-14 06:26:36 +00:00
weichen c5810cd907 merge: fix/controlled-content-ui-acceptance-closeout 2026-09-14 04:03:46 +00:00
weichen 6ef80acf8d docs(docgov): reconcile remediation status with UI evidence 2026-09-14 04:03:39 +00:00
weichen ba67c467c4 docs(docgov): close controlled content UI remediation 2026-09-14 04:03:33 +00:00
weichen 81b75b3546 merge: fix/controlled-content-ui-acceptance 2026-09-14 04:01:23 +00:00
weichen 43460ae9ed docs(test-report): align UI acceptance report and checklists with exact results SSOT 2026-09-14 04:00:36 +00:00
weichen fbd8fe469f docs(test-report): complete full-chain post-restart UI acceptance 2026-09-14 03:54:53 +00:00
weichen 36c40f6a86 docs(test-report): record full-chain-final main phase complete pass 2026-09-14 03:50:38 +00:00
weichen 097ba8f457 merge: dev (08bf615 cache race fix) 2026-09-14 03:36:17 +00:00
weichen 36e4bc3001 merge: fix/controlled-content-canonical-hash cache-race 2026-09-14 03:34:41 +00:00
weichenandCursor 08bf615f95 fix(web): keep hydrated content across late list sync
Hard refresh wiped cache/ready after a successful hydrate, then the
unchanged fingerprint never re-ran the effect. Invalidate only via a
planner that preserves list-sync hits and re-hydrates after post-task drops.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 03:33:37 +00:00
weichen 2907c5025d test(docgov): record controlled content UI acceptance and UI-06 cache race diagnosis 2026-09-14 03:33:33 +00:00
weichen 9098069aee merge: dev (f693e1c stop hydrating local legacy mock documents) 2026-09-14 02:59:52 +00:00
weichen d0e8f60915 merge: fix/controlled-content-canonical-hash follow-up 2026-09-14 02:57:20 +00:00
weichenandCursor f693e1c474 fix(web): stop hydrating local legacy mock documents
Login-seeded doc-001 is not server-backed; align shouldLoad with
revisionToolbarMountMode so content and revision-state are never requested.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 02:56:35 +00:00
weichen 46e275db98 docs(test): define browser-only acceptance checklist 2026-09-14 02:39:20 +00:00
weichen 6f07dfcab6 docs(test): claim controlled content UI acceptance 2026-09-14 02:35:20 +00:00
weichen 84fdd7d0bf merge: fix/controlled-content-canonical-hash 2026-09-14 02:31:34 +00:00
weichen 8b47451b90 docs(ops): occupy integration slot for content repair 2026-09-14 02:31:25 +00:00
weichenandCursor e3b72ad64b fix(cli): require positive live-dev identity and exclusive backups
Live apply now accepts only :5433/agent_system_dev plus a data/dev
host root, maps stored work dirs fail-closed, and reports unique
O_EXCL backups after a parent-directory fsync.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 02:30:11 +00:00
weichenandCursor 96fd0e9e6f fix(docgov): persist exclusive old-head backups with dir fsync
Apply now writes the destructive old head markdown beside the original
file, refuses to clobber existing backups, and fsyncs the parent
directory after the atomic persist.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 02:24:49 +00:00
weichenandCursor 50576a2ec5 docs(docgov): record review-blocker fixes and isolated PG gap
W7 must live-apply project 143 before UI acceptance. Isolated
TEST_DATABASE_URL was unavailable; shared env databases were not used.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 02:21:57 +00:00
weichenandCursor 838864f3b2 fix(cli): add gated live-dev reconcile mode and path mapping
Default still refuses shared DSN/paths. Apply to dev requires --live,
--environment dev, a single --doc-id, and confirm REPAIR_SINGLE_DEV_DOC.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 02:21:56 +00:00
weichenandCursor 8892290bf7 fix(docgov): keep repair revision numbers and refuse drifted heads
migration_repair is not a human revision. HashUpdater now loads from DB
and retries still sync. Content reads return a structured drift conflict
instead of the destructive old head.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 02:21:50 +00:00
weichenandCursor e7b46e92d2 feat(db): allow migration_repair snapshot and event kinds
00028 check constraints would reject a real PG apply. Add goose 00032
with Up/Down so repair snapshots can persist.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 02:21:44 +00:00
weichenandCursor c159786a70 fix(docgov): keep markdown hard-breaks and unify content hashes
Semantic-preserving canonicalization, same-byte write paths, structured
content errors, and a dry-run-default migration_repair stop 404s caused
by trimming project-143 hard-breaks and no-op lease hydrations.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 02:02:53 +00:00
weichen f80e7a1ea1 docs(audit): diagnose project143 document content 404 2026-09-14 01:47:21 +00:00
weichen 79d2676bbf merge: docs/release-vite-frp-slot 2026-09-14 01:32:32 +00:00
weichenandCursor 2d0d499aec docs(ops): release integration slot after vite frp merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 01:32:32 +00:00
weichen d208b0e3e4 merge: fix/vite-frp-allowed-hosts 2026-09-14 01:31:56 +00:00
weichenandCursor e760373fd0 docs(ops): occupy integration slot for vite frp merge
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 01:31:56 +00:00
weichenandCursor 00737c7d5e fix(web): allow frp-mix.com Host for Vite dev server
FRP reverse-proxy access to :3100 was blocked by Vite host checks.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 01:30:38 +00:00
weichen 36a59d6700 merge: feature/software-project-bootstrap-plan 2026-09-14 01:13:42 +00:00
weichen 8ce41e101b docs(workflow): design software project bootstrap suite 2026-09-14 01:13:33 +00:00
weichen bad2410994 merge: feature/document-revision-session-close 2026-09-14 00:29:18 +00:00
weichenandCursor 9345109dca docs(ops): archive completed document-revision session files
Move done DOCREV short-terms, checklists, and handoffs into archive/ops and retarget relative links after Round20 close-out.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 00:27:18 +00:00
weichen 4bf8b6d993 merge: fix/document-revision-evidence-count 2026-09-14 00:23:31 +00:00
weichenandCursor bf4f9bdba0 docs(test): split 21 screenshots from 21 results
Record top-level screenshots as 20 main/pre plus 1 post, and the full-package race as FAIL 109.279s instead of a cached ok line.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 00:23:11 +00:00
weichen 5d79da60fc merge: feature/document-revision-runtime-ui-final-report 2026-09-14 00:21:23 +00:00
weichenandCursor 07507c7c24 docs(test): correct runtime UI final-report facts
Rename the close-out branch to feature/*, record 20 screenshots, and state rebuild-then-app-restart so the environment notes match Round20.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 00:20:56 +00:00
weichenandCursor 89163d2d18 docs(test): close document revision runtime UI Round20
Record the official Playwright headless pass for project 6159 and release the runtime integration slot without claiming the whole system production-ready.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 00:17:47 +00:00
weichen b258ab86a5 merge: fix/document-revision-pg-id-remap 2026-09-13 23:48:18 +00:00
weichenandCursor acf62a23d0 docs(audit): separate candidate 175 from output snapshot 250
The 6158 field ledger wrote candidate id=175 and report id=175; 250 is the output snapshot, not the candidate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 23:45:14 +00:00
weichenandCursor 4e0951fe70 docs(ops): record PG ledger ID remap milestone
Claim the document-revision mutex and document the 6158 first-generation not-found root cause without calling UI-03 done.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 23:43:56 +00:00
weichenandCursor 2d0fcb94bc fix(docrevision): keep PG snapshot IDs ahead of in-memory counters
Opening a template stored database IDs without advancing nextSnapID, so the next temporary snapshot could overwrite and then delete the real baseline. Adopt helpers now bump every counter and only drop a map entry when it still points at the same object.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 23:43:56 +00:00
weichen fa6a033c95 merge: fix/document-revision-post-restart-final-snippet 2026-09-13 23:28:53 +00:00
weichenandCursor 39df2d88f7 docs(ops): claim post-restart durable body snippet task
Record that the second restart already restored V3/r2 and that only the stale UI-06 bodySnippet expectation was wrong.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 23:28:17 +00:00
weichenandCursor 5db2d9a3b1 fix(e2e): persist the winning A1 body snippet for post-restart
UI-13b already made A1 the durable document, but phase-state still expected the UI-06 marker. Record successful saves as the latest snippet, ignore conflict drafts, and write that final value at UI-15-pre without relaxing the restore assertion.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 23:28:17 +00:00
weichen eb85b8a068 merge: fix/document-revision-post-restart-selector 2026-09-13 23:23:59 +00:00
weichenandCursor 1a98c0cdeb docs(ops): record phase-split UI acceptance results JSON
Document that main keeps ui-acceptance-results.json and post-restart writes a sibling ledger so the 18-case main book is not overwritten.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 23:23:28 +00:00
weichenandCursor 0936a94fdf fix(e2e): write post-restart results to a separate ledger
A successful post-restart recordPass would overwrite the main 18-case ui-acceptance-results.json. Keep that historical name for main and write ui-acceptance-results-post-restart.json after restart, while still sharing phase-state and secrets.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 23:23:27 +00:00
weichenandCursor 8907b61745 docs(ops): claim post-restart project title selector task
Record the schema31 strict-mode failure, the banner/entry locator contract, and phase-split Playwright directories. Do not mark UI-15 passed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 23:21:09 +00:00
weichenandCursor 3c26fcb2f8 fix(e2e): assert restored project in the banner and isolate phase artifacts
Page-wide project-name text hits both the top bar and the session rail after restart. Click the complementary exact title, then assert the banner exact name. Split Playwright output and HTML reports by UI_PHASE so post-restart cannot wipe main traces.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 23:21:09 +00:00
weichen b824948a5a merge: fix/document-revision-reviewer-duty-sync 2026-09-13 22:48:05 +00:00
weichenandCursor a0196142a3 docs(ops): record heal lock serialization against duty transfer
Note that HealProjectDocuments now shares pg_advisory_xact_lock(project_id) with member writes so an old reviewer cannot be written back.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:44:40 +00:00
weichenandCursor 09e3581def fix(docduty): serialize heal with the project duty lock
Heal used to resolve and backfill on the pool without the member-write advisory lock, so a stale snapshot of reviewer A could overwrite a committed transfer to B. Lock, resolve, and document updates now share one transaction and the same lock key.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:44:40 +00:00
weichenandCursor d7d656f66f docs(ops): record atomic duty-revoke transaction
Document that lock, holder reads, member writes, and reviewer/approver slot clears share one transaction, with heal after commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:37:27 +00:00
weichenandCursor 0fa4a5784e fix(authz): clear reviewer/approver slots in the member-write transaction
Duty revoke must share the project advisory lock with reading old holders and writing members, so a post-commit service snapshot cannot miss a transfer. Heal still fills the new holder after commit, and sync failure stays ERR_DUTY_SYNC.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:37:24 +00:00
weichenandCursor be394bf617 docs(ops): record final reviewer duty-sync repair round
Sync short-term, checklist, and handoff with remaining 6145 risk and
the isolated PG verification path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:29:53 +00:00
weichenandCursor 8b6bf2cca1 fix(api): sync removed members and fail tasks without a ledger
Remove now reconciles document slots and returns ERR_DUTY_SYNC on
failure. CreateOrGetDocument errors abort the task. The frontend
refreshes workflow docs after add, update, restore, and remove.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:29:53 +00:00
weichenandCursor 9a19bcc12c fix(docduty): revoke inactive slots and explicit duty changes
Empty assigned heal now clears only exited or non-member reviewer/approver
holders and never blanks author. Explicit reconcile uses the pre-update
duty plus a project advisory lock so viewer demotion and transfers are
not left to generic heal.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:29:53 +00:00
weichenandCursor ec89b4c8b0 docs(ops): record independent-review duty-sync tighten
Document assigned-authoritative heal, member-change sync, owner
non-demotion, isolated PG command, compatibility, and remaining 6145 risk.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:16:44 +00:00
weichenandCursor c2d4e9a55c test(docduty): add isolated PG heal, backfill, and concurrency fixtures
Require TEST_DATABASE_URL and refuse agent_system_dev. Script creates a
throwaway database, runs packages serially, then drops it.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:16:44 +00:00
weichenandCursor 7ef34a685d fix(web): send document_duty on member add, update, and restore
Post-create role changes were silently dropping reviewer/approver
because only project_role was persisted.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:16:44 +00:00
weichenandCursor 4512132b20 fix(api): keep owner role and sync docs after duty upsert
Omit project_role no longer defaults to member. Exclusive duty writes
take an advisory lock and retry conflicts so last-writer wins without
dual reviewers. Author write tests require err==nil.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:16:43 +00:00
weichenandCursor 2f0a1b337c fix(docduty): treat assigned duty as authoritative on heal
Align document slots to project document_duty even when the wrong ID is
an active member, and fail generate/list instead of returning stale
placeholder duties. Owner author backfill now picks creator, else lowest ID.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 22:16:36 +00:00
weichenandCursor 60e2b1adf2 docs(ops): mark reviewer duty-sync commits complete
Keep the short-term checklist aligned with the four atomic commits on this branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 21:58:02 +00:00
weichenandCursor c1bdfe3920 feat(web): persist exclusive reviewer duty on project create
Keep project_role as member/viewer, send document_duty=reviewer for USER_B, and clear the seed 李主管 reviewer so the assigned reviewer is the one that syncs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 21:57:53 +00:00
weichenandCursor 6a68e04f1f feat(docduty): resolve project reviewer onto controlled docs
Stop inventing reviewer_id=2. Use project document_duty as the authority, heal missing or non-member placeholders, and keep write paths rejected for reviewer and outsiders.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 21:57:44 +00:00
weichenandCursor 6cd3991bad feat(db): store document duty on project members
Project access roles cannot carry reviewer. Persist a separate exclusive document_duty so later controlled docs can inherit the assigned reviewer.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 21:57:43 +00:00
weichenandCursor dd24105742 docs(ops): register reviewer duty-sync task
UI-13a now proves USER_B is viewer despite UI-01 assigning reviewer; claim a new mutex and document the 6145 ledger gap.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 21:57:22 +00:00
weichen 639969ff7e merge: fix/document-revision-duty-cell-assertion 2026-09-13 21:29:26 +00:00
weichenandCursor 5183d2866d docs(ops): record tightened duty-cell test count
UI-13a reviewer contract now has 6 unit cases; keep the short-term note aligned without rewriting the already-reviewed fix commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 21:28:55 +00:00
weichenandCursor c86e229303 fix(e2e): require exact reviewer duty, reject viewer fallback
USER_B is assigned reviewer in UI-01. Accept only role=reviewer on
the duty control, and reject assignable or enabled selects.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 21:28:15 +00:00
weichenandCursor c8318e8551 fix(e2e): read duty from select value, not row option text
UI-13a treated concatenated select options as the current role.
Assert the control value or badge role for that doc instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 21:26:23 +00:00
weichen dd5671e542 merge: fix/document-revision-workflow-category-navigation 2026-09-13 21:06:37 +00:00
weichenandCursor ba4bb41e1c fix(e2e): switch to workflow category before opening controlled docs
UI-13a stayed on private after upload, so the doc menu had no
doc_proj* entries. Always use the category trigger first, then exact id.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 21:03:23 +00:00
weichen 48a4dcb86d merge: fix/document-revision-fast-completion-observation 2026-09-13 20:44:26 +00:00
weichenandCursor f0ab254ed1 fix(e2e): accept already-completed squad turns without waiting inflight
UI-11 can finish before the waiter sees pending. Treat success terminals
as done, keep upload/correspondence/error checks, and cover both timelines.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 20:43:33 +00:00
weichen 339e871242 merge: fix/document-revision-quality-repair-workspace-contract 2026-09-13 20:21:05 +00:00
weichenandCursor 01c5972ead fix(squad): void quality repair rounds on backend or containment failure
Promote root output.md only when the runner succeeded, protected parents
were untouched, and the local target is trusted. Restore errors abort
instead of being ignored.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 20:20:13 +00:00
weichenandCursor b7cfb28217 fix(squad): keep quality repair inside a local snapshot workspace
Repair TASK.md told the model to edit ../../output.md, so the local
target never appeared and UI-03 stayed quality_failed. Snapshot parent
inputs locally, restore them on containment violations, and promote
only a trusted repair/output.md before revalidate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 20:15:54 +00:00
weichen 8b1a531947 merge: fix/document-revision-editor-hydration-race 2026-09-13 20:02:09 +00:00
weichenandCursor 9b43bd6a73 fix(web): bind editor saves to the opened doc and real PATCH
Drop test-only ETag helpers. App now calls saveControlledBlockEdit,
which PATCHes once on the bound editor docId or fail-closes. Resume
hydrate after a blocked first load, and refuse silent doc switches.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 20:00:47 +00:00
weichenandCursor 1b04d962d1 fix(web): keep block ids and drafts across editor hydration races
Background GET rebuilt markdown AST with Math.random ids and dropped
head_block_map, so save closed the modal without PATCH. Align hydrate
to the ledger map, gate in-flight responses, and fail-closed on stale ids.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:54:36 +00:00
weichen 4c465d2cb0 merge: fix/document-revision-pi-runner-module 2026-09-13 19:30:05 +00:00
weichenandCursor 21c8a0063b docs: claim pi-agent settle-policy image COPY hotfix
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:29:34 +00:00
weichenandCursor 369fe7bf51 fix(pi-agent): copy settle-policy into the runner image
runner.mjs imports ./settle-policy.mjs but the Dockerfile only copied
runner.mjs, which crashed shuimu-pi-agent-dev on import. COPY the
runtime module and assert every relative import is in the image set.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:29:34 +00:00
weichen 55a4f399fa merge: fix/document-revision-prelim-output 2026-09-13 19:26:50 +00:00
weichenandCursor 051e69ccd1 fix(pi-agent): clear recovered SDK transients before settle
auto_retry_end success=true now drops providerTransient and lastErr so
a later agent_settled can succeed when the in-process retry landed a
real target. A new error after recovery still fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:25:41 +00:00
weichenandCursor becd295c9d fix(service): keep explicit backend failure fail-closed
A this-invocation output.md is preserved and never retried over, but
Success=false stays a step failure so truncated writes cannot pass.
Prior-round residue without a trusted patch is also not success.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:24:47 +00:00
weichenandCursor d9c1791e56 docs: record dockerignore hole and tightened step retry contract
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:21:56 +00:00
weichenandCursor 6fd685fd47 fix(service): retry only safe transients and keep existing targets
Fresh step invocation is limited to provider terminated/connection plus
a missing target, or an explicit runner failure. A deliverable already
on disk is accepted and never overwritten.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:21:56 +00:00
weichenandCursor 35b2e922bf fix(deploy): keep official templates in the image build context
*.md was excluding templates/docs from Docker context, so COPY and
go:embed could not see prelim_design.md at /app. Un-ignore those trees
and assert the smoke image can cat the official file.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:21:56 +00:00
weichenandCursor 7be683d9c7 docs: record UI-11 write-terminated settled-failure root cause
Separate MiniMax/SDK connection failures from the product gap that
reported process 0 and agent_settled as step success.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:17:09 +00:00
weichenandCursor 11bdba0052 fix(pi-agent): treat exhausted SDK retry plus settle as failure
agent_settled after terminated or auto_retry_end success=false is not a
deliverable. Return retryable for provider transients and keep clean
missing targets permanent.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:17:09 +00:00
weichenandCursor ce89939cd8 feat(service): retry transient step failures with a fresh invocation
runOneStep re-executes the backend at most once when the first attempt
is a settled failure or missing target after provider errors, records
each attempt honestly, and fail-closes after the bound.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:17:09 +00:00
weichenandCursor 98619c7b56 feat(agent): classify settled-failure as bounded retryable
Treat process-0 plus terminated/Connection error/auto_retry_end as a
provider transient. Permanent missing deliverables stay fail-closed and
are never reconstructed from truncated write arguments.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:16:46 +00:00
weichenandCursor 32cf9ad4fc docs: claim UI-11 prelim output contract gap in_progress
Record the missing-output.md failure, embed/path-mapping tradeoffs, and CURRENT mutex without marking the task done.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:09:48 +00:00
weichenandCursor 333c7a604f fix(pi-agent): do not settle success without a deliverable
agent_settled after exhausted retries is not success; missing or empty target files must return ok:false instead of an empty patch list.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:09:48 +00:00
weichenandCursor 4a97ff5dd1 fix(agent): map runner patch paths and require real targets
Normalize absolute, ./, and duplicated step prefixes onto output.md, and fail closed when the runner reports ok without a non-empty deliverable.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:09:48 +00:00
weichenandCursor e04829ee8e fix(template): embed official doc templates for container cwd
App images have no templates/ checkout, so GetDocTemplate fell back to a two-section stub and prelim_design lost its real contract.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:09:48 +00:00
weichen 2a58674299 merge: fix/document-revision-second-doc-routing-lease 2026-09-13 18:47:14 +00:00
weichenandCursor 4dcc5011ac docs: record UI-11 prelim_design card title vs prompt alias
Keep the routing/lease task in_progress and document why the second-doc locator must use the registered doc id.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 18:46:21 +00:00
weichenandCursor bebe1e3690 test(e2e): open UI-11 prelim_design by registered doc_proj id
Card title is 系统初步设计方案, not 系统设计输入; select doc_proj*_prelim_design so the template slot cannot be mistaken for the generated document.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 18:46:21 +00:00
weichenandCursor 9a9e25806c docs: claim UI-11 routing and lease gap in_progress
Record the tenth-round routing/lease failure, request-scoped release tradeoff, and CURRENT claim without marking the task done.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 18:42:44 +00:00
weichenandCursor bdd1b35b86 test(e2e): require UI-11 task run 202 before completion
Arm tasks/runs waiter before send and assert HTTP 202 so a sync DOC_BUSY completed turn cannot pass as a new document run.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 18:42:44 +00:00
weichenandCursor 9f6401847d fix(docgov): release human lease after PATCH request
Request-scoped defer release after authorized acquire so success/409/projection failure cannot leave a 15m residual that blocks squad runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 18:42:44 +00:00
weichenandCursor 56e052f3cb fix(web): prefer named deliverable over negated 需求
Explicit aliases (including 系统设计输入) must win before keyword fallback so UI-11 does not route to intake.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 18:42:44 +00:00
weichen 77f5db1e90 merge: fix/document-revision-e2e-overlay-transition 2026-09-13 18:25:05 +00:00
weichenandCursor 59dc73ec7c docs: claim UI-07 transition sampling gap in_progress
Link the archived ninth-round mid-transition failure; do not mark
the task done before a real UI rerun.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 18:24:27 +00:00
weichenandCursor 9f676273df test(e2e): wait for overlay CSS transition to settle
Poll pane document-block computed styles until two frames match.
Pure requires transparent background and box-shadow none; manual/all
require a real overlay mark without hard-coded theme colors.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 18:24:27 +00:00
weichen 58ae25444d merge: fix/document-revision-e2e-overlay-selector 2026-09-13 18:07:46 +00:00
weichenandCursor 18a5457c07 docs: claim UI-07 overlay selector gap in_progress
Link the archived eighth-round failure; do not mark the task done
before a real UI rerun.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 18:06:53 +00:00
weichenandCursor 20b6092cf0 test(e2e): sample overlay styles on pane document-blocks
UI-07 reads every active-pane document-block after the real overlay
fetch. Pure must stay unmarked; manual/all may share amber on the
same human hunk. UI-10 waits for history to auto-close.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 18:06:53 +00:00
weichen 1b020790da merge: fix/document-revision-e2e-save-selector 2026-09-13 17:47:28 +00:00
weichenandCursor 5705f99fdc docs: claim UI-06 save-selector gap in_progress
Link the archived seventh-round failure; do not mark the task done
before a real UI rerun.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:46:37 +00:00
weichenandCursor 5c42ba7c45 test(e2e): save inside editor dialog with exact 保存修改
UI-06/13b click 保存修改 only inside 编辑受控块; UI-13a asserts
the dialog is absent instead of a page-wide /保存/ match.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:46:37 +00:00
weichenandCursor a42895ccdc feat(web): give block editor an accessible dialog label
Expose role=dialog and a stable aria-label so save can be scoped
without changing the modal's visuals or save behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:46:37 +00:00
weichen 4a4fbcf2a6 merge: fix/document-revision-e2e-block-selector 2026-09-13 17:25:41 +00:00
weichenandCursor bb9f347fc9 docs: claim UI-06 block selector gap in_progress
Link the archived sixth-round failure; do not mark the task done
before a real UI rerun.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:24:54 +00:00
weichenandCursor faaacae5f6 test(e2e): locate pane blocks by document-block testid
UI-06 and UI-13b reuse the pane-scoped helper; stop clicking overlay
or native heading/paragraph tags that the renderer does not emit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:24:54 +00:00
weichenandCursor 9e0901ce25 feat(web): mark real document blocks without overlay
Add data-testid=document-block plus block id on every wrapper so
pure-mode editors stay addressable without changing visuals.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:24:54 +00:00
weichen 61905e99c1 merge: fix/document-revision-e2e-reject-routing 2026-09-13 17:09:42 +00:00
weichenandCursor d45efa2ff1 docs: record fail-closed ETag and viewer comment hardening
Keep the reject-routing task in_progress; no real UI rerun this round.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:08:35 +00:00
weichenandCursor cf3d126436 feat(web): never name-escalate server controlled zero duty ids
Mark server summaries dutiesAuthoritative so id 0 stays fail-closed
viewer instead of matching names like a legacy local document.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:08:35 +00:00
weichenandCursor d5ce81228c feat(web): keep viewer comments read-only
Hide add-comment affordances and reject submit for viewer; keep
author/reviewer/approver comment roles unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:08:35 +00:00
weichenandCursor 4dbd9eecb9 feat(web): fail-closed controlled save without hydrate ETag
Reject revision-state network/5xx and missing ledger on controlled
hydrate; never PATCH 0:0 unless the document is freeform.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:08:35 +00:00
weichenandCursor 0a34daf4b5 docs: record duty forgery and ETag overwrite risks
Document the privilege-escalation and silent-overwrite hazards; keep
the reject-routing task in_progress pending real UI rerun.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:02:23 +00:00
weichenandCursor be33409297 test(e2e): open both editors before UI-13b first save
Require matching r/etag on both windows and keep A2's editor filled
before A1 saves so the conflict is a real race.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:02:23 +00:00
weichenandCursor eefdd4c4fd feat(web): keep server duties and PATCH with hydrate ETag
Retain ledger author/reviewer/approver, fail-closed unknown users to
viewer, and send the opened revision ETag instead of a fresh GET.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:02:23 +00:00
weichenandCursor 79797cab7c feat(docgov): project document summary returns authoritative duties
ListWorkflowDocumentsByProject now projects author/reviewer/approver
id+name so clients cannot invent the current user as author.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 17:02:23 +00:00
weichenandCursor 52c0292ff7 docs(ops): keep pending-flow in_progress and split its mutex
UI-05b has not reached reject yet, so pending-flow cannot be done; move it to pending-report-ui so reject-routing can keep document-revision-runtime-ui.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 16:50:58 +00:00
weichenandCursor 5571e93922 test(e2e): pin UI-05b to intake and tighten history/conflict paths
Require 当前受控文档 deixis plus tasks/runs task_key/doc_id checks so reject stays on intake; compare inside 版本历史, hide the project from non-member C, and split UI-13 into reviewer-readonly plus dual-author conflict.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 16:50:02 +00:00
weichen 3157a66f2d merge: fix/document-revision-e2e-pending-flow 2026-09-13 16:26:19 +00:00
weichenandCursor ca01a1cf9d test(e2e): open pending change report before confirm or reject
UI-04 must close via the dialog 关闭 button; UI-05a/05b must click 待确认报告 and assert panel actions so leftover first-round reports cannot hide the decision path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 16:25:39 +00:00
weichen e6cd7bef9e merge: fix/document-revision-quality-context 2026-09-13 16:11:14 +00:00
weichenandCursor 75345431e4 fix(squad): require action-plan table separator and equal columns
Reject 待续 status-cell exemptions unless the same contiguous table has a header immediately followed by a valid separator and the data row width matches the header.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 16:10:24 +00:00
weichenandCursor dee18d7fc0 fix(squad): exempt only action-plan status cells for 待续
Treat structured 阶段/状态/进度 cells as workflow state, not hedging, while still failing body, lists, and non-status columns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 15:59:56 +00:00
weichen 40526773be merge: fix/document-revision-active-doc-routing 2026-09-13 15:44:48 +00:00
weichenandCursor 6f0057c014 fix(docgov): pin task routing to active controlled doc on current-doc deixis
When the user refers to the current document, keep task_key/doc_id on the selected registered doc_proj instead of rerouting by domain keywords.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 15:43:42 +00:00
weichen 86598e7d0e merge: fix/document-revision-sse-idempotency 2026-09-13 15:22:59 +00:00
weichenandCursor f4aa0da14f test(docgov): lock quality projection, stage halt, and uncontrolled auto-repair
补齐 QualityReport 拦截投影与阶段停链断言,并证明 CLI 非受控路径 AutoRepair=false 不会追加 repair 步。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 15:20:42 +00:00
weichenandCursor 2d86d330e5 fix(docgov): keep squad AutoRepair/Success semantics; force repair only on controlled docs
小队修复预算只认 AutoRepair,Success 只表示执行完成;bizdev 在解析出 docRec 后强制开启修复,投影与阶段停链仍以 QualityReport 为准。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 15:19:20 +00:00
weichenandCursor 9e50bc0543 fix(docgov): stop ExecuteStage on quality_failed without absorbing facts
阶段链在 ExecuteTask err=nil 后同时检查质量门禁与 Success;失败立即停链并保留 artifact,不注入 ExtractedData/PriorDoc,不宣称阶段成功。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 15:17:40 +00:00
weichenandCursor 107f898362 fix(docgov): tighten prohibited-phrase exemption; lock stage request fields
自检豁免改为同行且须 meta+否定紧邻或引号引用,避免正文「无」误放过;buildBizdevStageRequest 单测锁住身份/职责字段与 AutoRepair 契约。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 15:16:12 +00:00
weichenandCursor 92488b327a fix(docgov): short-circuit quality_failed before controlled doc projection
质量门禁未过时在 SetDocumentWorkDir/Materialize/哈希更新/完成活动之前返回,保留隔离工作区与失败摘要,不改正式 head。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 15:14:55 +00:00
weichenandCursor 900af79e14 fix(docgov): quality gate self-pollution, server repair budget, quality_failed UI
受控小队任务服务端启用修复预算;否定性自检引用不再误报;quality_failed 保持失败且不激活未过门禁稿。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 15:00:50 +00:00
weichenandCursor 43e03e4969 fix(docgov): idempotent lookup before busy; SSE write deadline heartbeat
Return existing task run 202 for the same turn before scope/preflight so
SSE disconnect retries do not hit DOC_BUSY or duplicate chat. Extend
task-run events write deadlines with heartbeats without dropping global
HTTP WriteTimeout. Reconnect subscribeTaskRunEvents on EOF via after_seq.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 14:37:18 +00:00
weichen f3e4eeb42b merge: fix/document-revision-runtime-ui03 2026-09-13 14:08:21 +00:00
weichenandCursor 020712dfbd fix(e2e): UI-11 send upload to register freeform doc-free
Chip assert after setInputFiles, wait POST /freeform-documents 2xx on
send, then pin doc-free pane id and drain this-turn assistant before
leaving UI-11.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 14:07:41 +00:00
weichenandCursor c33a6d8406 fix(e2e): strict squad terminal and doc-free upload selectors
Only completed/pending_author_confirmation pass waitForSquadCompletion;
category trigger/data-category for private open; UI-11/16 pin exact
doc-free id without global attachment text clicks.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 14:05:46 +00:00
weichenandCursor 301e1f401e fix(e2e): stable doc selector and this-turn assistant waits
Add doc-selector-trigger / active-document-pane data attrs; resolve
assistant via virtualizer data-index siblings; UI-02/03 and open-by-id
helpers stop relying on global text or first dropdown-trigger.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 14:01:41 +00:00
weichenandCursor 7466a15319 fix(docgov): harden UI-03 sync poll, reconnectRunId, and E2E status attrs
Use deliverablesRef + limited poll for post-task server docs; pass
reconnectRunId across auto-retry; GetRun reads idempotency_key;
StartClaimedRun fails closed on UpdateRun; MessageBubble/E2E scope
this-turn assistant; correct audit retry/schema19 wording.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 13:54:49 +00:00
weichenandCursor 76e2028761 fix(docgov): UI-03 post-task doc sync, claim idempotency, schema30
Restore controlled-doc merge after task terminal states, prioritize intake
template match, ClaimRun before chat writes, and extend chk for
pending_author_confirmation via goose 00030. Real volume migrate + UI
re-run remain pre-merge gates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 13:39:07 +00:00
weichen e45c2b7d36 merge: fix/document-revision-runtime-task-scope 2026-09-13 13:00:17 +00:00
weichenandCursor 5096581651 fix(projectinstance): resolve pre-activation task scope via governing three-state
Never-activated projects were allowed by access ABAC but rejected with
TASK_SCOPE_UNRESOLVED 409; use GetGoverningInstanceForAccess so nil maps to
ScopePreActivation, live to stage scope, and closed stays unresolved.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 12:59:10 +00:00
weichen aeeb48ba7d merge: fix/document-revision-runtime-ui02-access 2026-09-13 12:36:12 +00:00
weichenandCursor b78574b065 fix(web): lock create-project confirm against double-submit race
React state bootstrapId could be read as null by two concurrent confirms;
use a sync in-flight ref plus submitting UI so create runs once and member
retry stays serial/idempotent.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 12:35:46 +00:00
weichenandCursor 1fd500e2b9 docs(audit): record UI-01/02 access, chat authz, and member persist fixes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 12:25:22 +00:00
weichenandCursor c6558bc757 fix(web): persist initial project members after createProject
Create Project no longer treats local member lists as success: non-creator
initialMembers are upserted via the authorized members API, with bootstrap
project id retained for idempotent retry when persistence partially fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 12:25:22 +00:00
weichenandCursor cc394c815c fix(api): require project membership before chat and chat SSE
Unrestricted stage access on projects without a live workflow must not
let arbitrary authenticated users join by project_id. Enforce member or
creator (admin per existing policy) before stage ABAC, and reject chat
streams with JSON 403 before SSE headers/flush.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 12:25:22 +00:00
weichenandCursor f50692be25 fix(projectinstance): distinguish never-activated vs closed governing instances
GetLiveInstance remains active-only; access ABAC now uses
GetGoverningInstanceForAccess so completed/terminated PG rows are not
treated as unrestricted legacy projects, while brand-new projects without
instances stay open for creators.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 12:25:22 +00:00
weichen 0553c48039 merge: feature/herdr-agent-governance 2026-09-13 12:16:29 +00:00
weichen 6544f523f5 docs(ops): finalize Herdr governance integration 2026-09-13 12:16:14 +00:00
weichen e37a5fa399 docs(ops): close Herdr governance task 2026-09-13 12:16:08 +00:00
weichen 846638197d Merge branch 'dev' into feature/herdr-agent-governance 2026-09-13 12:15:07 +00:00
weichen 187084c517 feat(ops): add Herdr agent routing governance 2026-09-13 12:04:41 +00:00
weichen cd69cfd4d8 test(e2e): select project member by exact visible row 2026-09-13 12:03:16 +00:00
weichen 1d2cecc522 test(e2e): scope project creation selectors to fixed modal 2026-09-13 12:02:01 +00:00
weichen d282b1e526 merge: fix/document-revision-runtime-user-directory 2026-09-13 11:59:19 +00:00
weichen fed7af1982 test(e2e): drive real UI bootstrap and role assignment 2026-09-13 11:59:13 +00:00
weichenandCursor ec8a45a5fe fix(web): sync parent user directory after admin account changes
AdminSettingsModal previously left onRefreshUsers as a dead prop, so newly
created users never reached App allUsers/localStorage and Create Project
member candidates stayed stale (UI-01). Wire syncAdminUserDirectories,
surface refresh errors, and document the residual cross-device directory gap.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:58:06 +00:00
weichen 8c5cac17ef merge: fix/document-revision-runtime-auth-ui-evidence 2026-09-13 11:38:02 +00:00
weichenandCursor 4d4ea20e63 chore(e2e): keep Antigravity evidence path and UI harness tweaks
Preserve uncommitted Playwright config/spec adjustments for the ongoing
document-revision runtime acceptance run.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:37:03 +00:00
weichenandCursor c70cdf7261 docs(ops): record UI-00 auth snake_case mapping finding
Add audit note and cross-link short-term/checklist/CURRENT for the
admin entry regression found in real browser acceptance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:37:03 +00:00
weichenandCursor d421fba472 fix(api): fail closed when status update cannot set user role
Return the UpdateUserRole error instead of silently continuing when an
admin approves a user with an explicit role_id.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:37:03 +00:00
weichenandCursor f189ce9ff9 fix(auth): surface BootstrapAdminFromConfig UpdateUserRole failures
Do not ignore role promotion errors when ensuring the configured admin
account holds role-admin; cover success and failure with unit tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:37:03 +00:00
weichenandCursor cf28e53308 fix(web): map Go UserAccount snake_case fields at auth API boundary
Normalize role_id/employee_id/must_change_password/created_at into
camelCase for login, me, and admin user mutations so admin UI gates work.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:37:03 +00:00
weichen 0b36a6ede0 merge: document-revision-ui-e2e-slot 2026-09-13 11:15:47 +00:00
weichen 53f988da49 docs(ops): advance document revision follow-up to UI e2e 2026-09-13 11:15:47 +00:00
weichen edbd01e5cc merge: fix/document-revision-runtime-ui-evidence 2026-09-13 11:13:58 +00:00
weichen 2f4d27d28d docs(ops): mark document revision follow-up merge phase 2026-09-13 11:13:53 +00:00
weichenandCursor 00a31e9b8d fix(e2e): require ADMIN_* env for UI acceptance credentials
Drop the hardcoded admin password fallback so secrets never ship in the
spec; missing ADMIN_USERNAME/ADMIN_PASSWORD fails the suite explicitly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:13:22 +00:00
weichenandCursor e5139d980a docs(ops): note upload freeform registration before send
Record client_key create path and no-orphan send contract on the
document-revision-runtime short-term task.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:12:03 +00:00
weichenandCursor 59b6db74bb test(e2e): tighten UI-01 zero revision-state 404 assertions
Match only hyphenated doc-p template paths, reset logs after login, and
expect registered uploads to use server doc-free ledgers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:12:03 +00:00
weichenandCursor 91de320b67 fix(web): mount revision toolbar for registered uploads only
Keep template/legacy gates; allow doc-free uploaded_file toolbars while
blocking unregistered doc-upload orphans.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:12:03 +00:00
weichenandCursor ef0b2645e5 feat(web): await freeform upload register before send
Make InputArea/onSendMessage async; fail closed with an explicit UI error
when createFreeformDoc fails, and persist fileStore under server doc-free IDs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:12:03 +00:00
weichenandCursor a3c6df309b feat(api): expose POST /freeform-documents for upload registration
Authorize project members, reject direct project_shared creates, and
cover idempotent client_key plus revision-state after register.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:12:03 +00:00
weichenandCursor 9c7d6d49b2 feat(freedoc): CreateDocument with client_key idempotency
Support direct freeform create for upload fact-source registration while
keeping source_content_sha256 as a content fingerprint only.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:12:03 +00:00
weichenandCursor 1e364f17ab feat(db): add freeform client_key for idempotent upload registration
Persist owner-scoped client_key on freeform_documents so upload create
can retry safely without inventing local doc-upload orphans.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 11:12:03 +00:00
weichenandCursor 9a36e7c896 docs(ops): document UI_PHASE split for Playwright acceptance
Note main vs post-restart runs and credential-safe evidence layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:53:35 +00:00
weichenandCursor bd53984790 test(web): rewrite DOCREV UI acceptance without false PASS paths
Require observed squad start before terminal status, dual high-risk
confirm/reject, computed overlay diffs, real A/B contexts, UI logout,
and UI_PHASE post-restart evidence. Sanitize network paths; no mocks.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:53:35 +00:00
weichenandCursor fe979fdd21 fix(web): gate DocumentRevisionToolbar to server-backed docs
Skip revision-state for template-only and legacy local mocks; show a
non-error preview hint instead of 「账本未就绪」. Keep generated controlled
and server freeform on the toolbar; leave IndexedDB upload orphans unmounted.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:53:35 +00:00
weichen 5724f4f74e docs(ops): advance document revision slot to real UI e2e 2026-09-13 10:14:07 +00:00
weichen d94b0d17f5 merge: fix/document-revision-runtime 2026-09-13 10:12:51 +00:00
weichen a7bd65b489 docs(docrev): record fresh gates and acquire integration slot 2026-09-13 10:12:45 +00:00
weichenandCursor 353d9fdf33 docs(ops): drop PutChangeProposal from decision-idempotency notes
Record that compensation must not seed memory-only proposal state.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:10:56 +00:00
weichenandCursor 0aae84d0a8 fix(docgov): remove PutChangeProposal memory-seed helper
Do not expose a production path that mutates only the in-memory proposal
index. Cover decision idempotency via ProposeModification+Decide and the
existing package MarkProposalApplied tests instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:10:56 +00:00
weichenandCursor 5f2063ebbe docs(ops): mark Playwright UI acceptance skeleton as checked in
Point the UI checklist at the committed runtime spec and config instead of
a deferred plan-only placeholder.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:09:32 +00:00
weichenandCursor 09488132dd docs(ops): note decision idempotency and Playwright skeleton
Record MarkProposalApplied ordering, CommitAgentVersion retry contract,
and the UI acceptance skeleton paths on the short-term task.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:09:18 +00:00
weichenandCursor 46769467bf chore(web): add Playwright UI-only acceptance skeleton
Add @playwright/test, headless config, and document-revision-runtime specs
gated by RUN_UI_ACCEPTANCE without mocks, routes, or API/DB fixtures.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:09:18 +00:00
weichenandCursor 9c8a41982c fix(api): guide idempotent decision retry after governance mark failure
Surface a same-decision retry hint and cover commit-then-MarkProposalApplied
compensation via PutChangeProposal when the proposal index was missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:09:18 +00:00
weichenandCursor 9a9ffa48cc fix(docrevision): allow idempotent commit retry after ledger commit
When a candidate is already committed, matching expected hashes return the
current revision state so projection and MarkProposalApplied can finish;
reject on an already-committed candidate stays an error.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:09:18 +00:00
weichenandCursor 0b5f4997e2 fix(docgov): mark proposal applied after durable DB write
Write applied status to Postgres before mutating memory so a failed UPDATE
cannot leave a false in-memory applied state; treat already-applied as
idempotent success and expose PutChangeProposal for compensation seeding.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:09:18 +00:00
weichenandCursor 6fb40af05e docs(ops): note frontend pending_author_confirmation mapping
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:04:14 +00:00
weichenandCursor 7f88b6d882 fix(web): map pending_author_confirmation instead of defaulting completed
History refresh now preserves awaiting-author status and shows a visible
待编制人确认 label; live done path reads run terminal status before paint.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:04:05 +00:00
weichenandCursor 9ed5987104 test(bizdev): drain pending confirmations in full-link stage E2E
Stage chain now stops on high-risk candidates; full-link mirrors the
product path of confirm + re-run until success or DocGov proposal intercept.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 10:00:45 +00:00
weichenandCursor b5a3b72756 fix(bizdev): stop stage chain on pending agent confirmation
PendingAgentCandidateID must not continue the stage loop or inject
unconfirmed MarkdownBody/ExtractedData as PriorDoc. Return explicit
awaiting-confirmation status; user re-runs the stage after deciding.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:57:54 +00:00
weichenandCursor c990bcdb89 fix(bizdev): record delivery activity only after commit; surface proposal mark errors
Move RecordActivity off the pre-Materialize path: pending writes an explicit
awaiting note, failures skip completion, committed records 完成交付物.
MarkProposalApplied failures now return retryable governance/projection errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:55:42 +00:00
weichenandCursor d07d201728 docs(ops): record high-risk fact-source and pending reply gates
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:51:15 +00:00
weichenandCursor 0c6fb090ff fix(chat): show pending confirmation instead of completed for high-risk
Sync coordinator and async CompletionSummary use pending_author_confirmation
with artifact metadata for document entry; completed only after commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:51:15 +00:00
weichenandCursor 4f5a6188a7 fix(docgov): defer fact-source update until high-risk commit
Materialize needs_confirmation restores ledger head to output.md and
document_records hash; only committed heads update DocGov. Decision
handler projects after commit or reject. Stage gates DocGov proposals
via PendingProposal, not bare RequiresAuthorApproval.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:51:15 +00:00
weichenandCursor 87971fc953 docs(test): add high-risk confirm/reject branches to UI acceptance plan
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:38:22 +00:00
weichenandCursor 5caefc887a feat(web): full change-report panel and pending confirm/reject UI
Prefer pending reports on the toolbar, show risk items and impacts, and
call the decision API only when can_decide_pending is true.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:38:22 +00:00
weichenandCursor 79e8349d71 feat(docrevision): expose pending high-risk candidate on revision-state
Surface pending_candidate_id, report id, and risk so NeedsConfirmation
candidates are discoverable before they enter the version list.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:38:22 +00:00
weichenandCursor 8594feb6cc docs(ops): note Materialize honesty and lease/projection review fixes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:32:08 +00:00
weichenandCursor 7b48ca2ecc fix(docgov): assert edit duty before lease; project via SaveDocumentContent
Unauthorized actors no longer grab leases; controlled PATCH projects through
DocGov so author_last_edited and audit survive, with idempotent retry on failure.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:32:08 +00:00
weichenandCursor 645c4b67b0 fix(bizdev): surface Materialize failures and block invalid auto-commit
TaskRunResult now fails visibly when ledger/report materialization errors;
invalid or unassessed reports are never auto-committed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:32:08 +00:00
weichenandCursor 4a91105e99 docs(docrev): evidence for materialize, patch order, and UI refresh
Expand the headless UI checklist and record remaining real blockers without
claiming PI narrative or E2E completion.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:27:07 +00:00
weichenandCursor ff1a126415 feat(web): refresh revision toolbar after save and expose report entry
Bump revisionRefreshKey on save/hydrate so r and overlay reload; add a
latest change-report button wired to version change_report_id.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:27:07 +00:00
weichenandCursor 75ec8785f3 fix(api): assert edit rights before ledger, then project body
Prevent fact-source writes ahead of ledger commit; projection failures return
DOCUMENT_PROJECTION_FAILED while keeping the ledger authoritative.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:27:07 +00:00
weichenandCursor a288dcf0cc feat(docrevision): materialize first-gen agent report without fiction
Open an explicit empty baseline then create a deterministic candidate/report
so the first squad success is visible as fallback analysis, not OpenTemplate-only.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:27:07 +00:00
weichenandCursor 7f8331f893 fix(docrevision): harden empty docID, per-doc auth, and failed-save honesty
Stage generation without a real document must not panic or enter the ledger.
Unknown orphan IDs are denied, write paths check author/lease/lifecycle, PATCH
no longer returns a fake 200, and overlay matching survives client/server block id drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 09:02:54 +00:00
weichenandCursor 95f0ead131 docs(ops): record document-revision-runtime gate evidence and commits
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 08:48:54 +00:00
weichenandCursor fa615fee2a docs(test): add headless UI acceptance plan for document revision runtime
Separate browser-only real acceptance from engineering unit/build gates and record gate evidence on the short-term task.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 08:48:32 +00:00
weichenandCursor d79fdf6ffa feat(web): persist freeform block edits and apply overlay modes
Stop skipping freeform PATCH saves and decorate BlockRenderer for pure/manual/all revision views with clear empty states.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 08:48:32 +00:00
weichenandCursor 46a1fcc945 feat(api): authorize revision routes and project fact-source saves
Resolve controlled/freeform/orphan docs, bootstrap on GET, write output.md or freeform content on PATCH, and wire lineage impacts for agent candidates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 08:48:32 +00:00
weichenandCursor ed1e232022 feat(docrevision): persist ledger in PostgreSQL with bootstrap
Hydrate/mutate against schema 00028, ensure first-access bootstrap, and build deterministic change reports instead of static fiction.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 08:48:32 +00:00
weichenandCursor 7ea686e6ba docs(docrev): audit runtime 404 and claim docgov remediation
Record in-memory ledger root cause, PG persistence plan, and CURRENT mutex claim on fix/document-revision-runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 08:35:19 +00:00
weichen c6c22494f8 merge: docs/release-slot-docrev 2026-09-13 08:14:05 +00:00
weichen 41bbc4049c docs(ops): release integration slot and record dev schema 28 healthy 2026-09-13 08:14:02 +00:00
weichen 17fc510c2c merge: feature/document-revision-management 2026-09-13 08:12:33 +00:00
weichen 501cde7c12 docs(ops): occupy integration slot for document revision merge 2026-09-13 08:12:27 +00:00
weichen 5e1a7e6584 fix(web): pass bearer auth in document revision api and fix ts unused imports 2026-09-13 08:12:19 +00:00
weichenandCursor 4f5bde899a docs(test): archive DOCREV waves and record unit evidence
Update CURRENT/FEATURE-MATRIX, archive short-term tasks, and add
document-revision management test report for Wave 0–6 delivery.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 06:15:20 +00:00
weichenandCursor 9aafe7bd37 feat(web): persist block edits via revision API and compare UI
Remove hardcoded editor actor, add revision toolbar/history/compare
panels, conflict banner, and notification status actions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 06:15:20 +00:00
weichenandCursor 7a7162dcee feat(api): wire document revision HTTP and agent/freeform hooks
Expose revision-state/versions/diff/PATCH content/candidate decision
APIs; emit document notification outbox events; bootstrap ledger from
bizdev success and freeform updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 06:15:20 +00:00
weichenandCursor 268a9bdb56 feat(service): implement docrevision Version/Revision kernel
Add canonicalize, stable block map, diff, risk floor, memory ledger
service, contract fixtures, concurrency tests, and backfill CLI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 06:15:20 +00:00
weichenandCursor 7bbd6783fc feat(db): add document revision ledger schema 00028
Introduce immutable blobs/snapshots, versions, events, candidates,
change reports, and ledger_* root pointers; rename freeform
current_version_id to legacy_version_id.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 06:15:20 +00:00
weichenandCursor 7778559201 docs(docrev): freeze version boundary ADR and Wave 0 task
Accept DOCREV decision gates, archive design short-term, and mark
FEATURE-MATRIX partial as implementation starts on feature branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 05:58:49 +00:00
weichen e372a1467c merge: finalize conversation intent state verification 2026-09-13 04:47:33 +00:00
weichen a676bd0b95 docs(test): record final conversation state smoke 2026-09-13 04:47:29 +00:00
weichen 5bc333b1aa merge: busy preflight without failed runs 2026-09-13 04:44:03 +00:00
weichen 357fcc79ee docs(ops): occupy slot for busy preflight 2026-09-13 04:43:58 +00:00
weichen 6ab8b52113 fix(taskrun): reject busy documents before run creation 2026-09-13 04:43:50 +00:00
weichen 2660260758 merge: fixture cleanup evidence 2026-09-13 04:38:01 +00:00
weichen f17781adb6 docs(test): record fixture workspace cleanup 2026-09-13 04:37:57 +00:00
weichen a7c073d85c merge: release chat integration slot 2026-09-13 04:36:32 +00:00
weichen 06dacc9956 docs(ops): release chat integration slot 2026-09-13 04:36:25 +00:00
weichen 1cd2e681ed merge: truthful integration rebuild command 2026-09-13 04:35:58 +00:00
weichen 0225906f3f fix(ops): rebuild images for integration smoke 2026-09-13 04:35:52 +00:00
weichen e0f07060b9 merge: readonly summary HTTP coverage 2026-09-13 04:29:22 +00:00
weichen deaec82a7c test(chat): cover readonly summary HTTP path 2026-09-13 04:29:17 +00:00
weichen d7a19d4786 merge: authorized readonly document summary 2026-09-13 04:27:16 +00:00
weichen a830d9dcc1 docs(ops): occupy slot for summary integration 2026-09-13 04:27:10 +00:00
weichen cd506d8cc7 fix(chat): add authorized readonly document summaries 2026-09-13 04:27:01 +00:00
weichen 55639b3d26 merge: release chat integration slot 2026-09-13 04:20:02 +00:00
weichen efe630d033 docs(ops): record dev smoke and release slot 2026-09-13 04:19:58 +00:00
weichen ef61e77192 merge: fix/conversation-intent-state 2026-09-13 03:51:55 +00:00
weichen 30ace0234b docs(ops): occupy integration slot for chat fixes 2026-09-13 03:51:45 +00:00
weichen 95ab2badf6 fix(chat): preserve intent and task runtime state 2026-09-13 03:51:18 +00:00
weichenandCursor 995e099026 fix(web): use fatal error class for auth-related chat errors
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:33:34 +00:00
weichenandCursor 38e2e32807 fix(web): satisfy chatRetry task auto-retry type check in docker build
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:32:57 +00:00
weichenandCursor 3e242e6d36 fix(docgov): reclaim orphan squad leases and align run_id
Use task run_id as doc lease holder so release tracks execution, and reclaim squad locks when the holder run is missing or no longer running.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:32:20 +00:00
weichenandCursor 0c5256c60c fix(web): bind task API to resolved intake key when URS-only pool
When deliverables only expose user_requirements templates, requirement phrases still must POST intake on V0.1. Re-resolve task_key on retry and skip auto-retry for stage gate errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:30:13 +00:00
weichenandCursor d08cbdc2de fix(web): route 初始需求 to intake and map stage 403 errors
Debug logs showed task runs used user_requirements on V0.1 while the active stage only allows intake. Prefer intake for 初始需求/摸底 phrasing and surface DOC_TASK_NOT_IN_ACTIVE_STAGE instead of SESSION_FORBIDDEN.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:28:36 +00:00
weichenandCursor 3afd606635 fix(web): resolve project id from session id for task runs
Task template messages were posting to project_id=1 when local session cache lacked projectId, causing 403 on POST /api/v1/tasks/runs. Parse sess-p{id}-u{user} encoding as fallback and surface HTTP status on task failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:23:53 +00:00
weichenandCursor 8032dce435 fix(chat): rebuild path and clarify stream auth errors
Rebuild dev backend so message visibility uses scope-aware filtering instead of dropping messages without stage_key. Map HTTP 401/403 on chat stream to actionable auth errors instead of generic NETWORK_ERROR.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:20:38 +00:00
weichenandCursor e0721a7944 fix(web): add favicon assets to stop /favicon.ico 404
Add public favicon.svg and favicon.ico and link them from index.html
so browsers stop requesting a missing root icon on refresh.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:14:22 +00:00
weichenandCursor 2636542418 fix(web): repair duplicate else in useChatWindow loadInitialWindow
Remove a stray else branch left from the refresh-state refactor that
broke Vite/esbuild parsing on page reload.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:07:51 +00:00
weichenandCursor dca83f0dea docs(chat): archive refresh remediation test report and close gap
Update gap-matrix CHAT-HISTORY-REFRESH to PASS, sync CURRENT and
short-term checklist with implementation evidence.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:06:11 +00:00
weichenandCursor b6aebc8176 fix(web): improve chat window refresh state and user-scoped cache
Distinguish authorized-empty and forbidden phases; skip caching day
buckets with zero messages; bind window cache keys to user id.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:06:11 +00:00
weichenandCursor 4b8d8bf6d6 fix(chat): unify history read authorization and stats filtering
Apply session ownership plus scope_kind visibility across window, day,
search, dates, categories, unread, and digest endpoints; add PG refresh
regression test for pre-activation and task-scoped messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:06:11 +00:00
weichenandCursor 1abafa3176 fix(chat): add message scope columns and write-path resolution
Persist workflow_instance_id, stage_instance_id, scope_kind on chat
messages and task runs; resolve scope from live instance for chat and
document tasks so refresh can apply consistent stage authorization.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 03:06:08 +00:00
2091 changed files with 216848 additions and 10332 deletions
+1
View File
@@ -42,6 +42,7 @@
| 架构设计 | [system-design/README.md](system-design/README.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) |
---
@@ -0,0 +1,25 @@
# ADR:文档 Version / Revision 边界与决策门
## 状态
已接受(2026-09-13,用户确认 DOCREV 整改实施计划)
## 背景
受控文档此前只有当前 `output.md` 与 SHA,无法表达「智能体基线 + 后续人工修改」的业务版本语义;自由文档每次保存 +1 的 `current_version_id` 与本需求冲突。
## 决策
1. **版本边界**:模板或一次成功提交的智能体/智能体小队产物开启 `Version`;人工每次服务端成功保存只增加该 Version 内的 `Revision`,不增加面向用户的版本号。
2. **high/critical 候选**:风险达到 `high` 或 `critical` 的 agent candidate,必须经编制负责人二次确认后才能 `CommitAgentVersion`。
3. **首发范围**:Wave 1–5 仅覆盖受控文档;自由文档统一读模型与 UI 语义切换放在 Wave 6。
4. **根表指针列**:统一 `ledger_*` / `head_*` 前缀;禁止与 `freeform_documents.current_version_id`(00008 每-save+1 legacy)同名承载新语义;旧列迁移时改名为 `legacy_version_id`。
5. **Goose**:从 **00028** 起递增;不得硬占用并行分支可能冲突的旧号。
6. **保留策略**:受控文档随项目/法规保留;自由文档默认 365 天可配置,禁止静默硬删。
7. **发布 blocker**:方案评审与 Wave 落地阶段不擅自写入 gap-matrix;纳入发布范围后再新增行。
## 后果
- 实施必须按 Wave 0→6 顺序;禁止先上前端颜色标记再补快照事实源。
- `document_records.version` / `content_sha256` 在兼容期由 ledger 同事务投影,稳定后退役。
- 详细表结构、API、状态机见 [../system-design/document-revision-management.md](../system-design/document-revision-management.md)。
@@ -0,0 +1,62 @@
# ADR:以纵向绞杀方式实施模块化单体解耦
## 状态
已接受(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))
## 背景
`internal/server`、`internal/bizdev`、共享 `UserProjectContext`、工作区路径和多表写入形成隐式耦合。
历史受控正文 404/409、刷新后投影缺失和任务终态不完整说明,单纯搬包不会修复事实源、事务与恢复边界。
## 决策
1. **保持模块化单体**:不拆微服务;进程内调用使用窄端口,跨进程可靠性只用于持久事件和 FAV。
2. **纵向绞杀**:先在现有包边界插入端口和适配器,迁完一条业务链并验证后再移动或重命名包;禁止“先全量搬包、以后再接口化”。
3. **契约分层**:外部 API DTO 归 `server/api`;持久 schema、公共事件和稳定共享词汇进入按领域划分的 contracts;一对一内部接口由消费者拥有。
4. **命令与事务同属一个应用用例**:一个业务命令只有一个事务 owner;跨表属主通过同一不透明事务作用域协作,业务状态、账本、当前指针、staging 和 outbox 原子提交。
5. **单一写者不等于单独事务**:表属主控制 SQL 和不变量;应用 UnitOfWork 控制跨属主提交边界。属主端口不得私自嵌套提交。
6. **并发正确性以数据库为准**:用户编辑使用乐观版本/ETag;状态转换使用行锁和条件更新;项目级不变量可使用事务级 advisory lock;进程内 mutex 只能优化,不能作为多副本正确性依据。
7. **锁顺序固定**:同一事务按 project/workflow instance → document record → document version/snapshot → task run → outbox/staging 的顺序取锁;事务内禁止 LLM、对象存储、网络调用和长文件 I/O。
8. **可靠事件采用 transactional outbox**:事件按至少一次投递设计,具有稳定 ID、schema version、环境/项目范围、聚合序号、因果链和幂等键;逐消费者记录 delivery、重试、租约和死信。
9. **工作区是可清理投影**:跨模块只传不可伪造 Workspace ID 和受限 artifact key;物理路径只在 workspace/squadrun 适配器内解析和校验。
10. **最终成果进入 FAV**:PostgreSQL 保存业务关系和授权,FAV 只保存已确认终态的精确 payload、manifest、回执和删除状态,workspace 不承担最终成果事实源。
11. **授权逐动作校验**:认证适配器构造不可由请求覆盖的 Principal;HTTP、CLI、后台订阅者和恢复流程都按 action/resource/current state fail closed。
12. **先完成文档可靠性试点**:只有受控正文刷新、重启、并发提交、投影缺失降级和授权负例通过后,才批准 chat、squad、编排层和传输层扩展。
13. **迁移采用 expand/migrate/contract**:允许新增 Goose migration;不得修改已发布迁移;回滚只保证回到最近的兼容阶段,不能任意独立 revert 早期依赖。
14. **协议改造独立立项**:统一错误信封和 PI Runner `result.json` 不作为核心模块解耦前置条件;它们使用独立兼容与 E2E 验收。
## 并发与失败语义
- 普通聚合状态转换默认 `READ COMMITTED` + 明确行锁/条件更新;涉及跨聚合唯一不变量时才使用 Serializable,并对 `40001`/`40P01` 重跑完整事务。
- outbox worker 使用小批次 `FOR UPDATE SKIP LOCKED` 认领,处理发生在事务外;完成、续租和失败回填使用 fencing token 防止过期 worker 覆盖新 owner。
- 每个写命令必须同时有 idempotency key、expected version 或两者;相同 key 不同 payload 返回 typed conflict。
- 锁等待、事务时长、重试次数、队列积压和死信必须可观测;超过预算时失败返回,不无限等待。
## 授权与恢复语义
- Principal 至少携带 actor、环境、认证来源和请求关联 ID;项目、会话、文档、阶段与 duty 从数据库权威关系重新解析。
- 持久事件中的 actor 只用于审计,不能替代订阅者对当前资源状态的授权检查。
- FAV 降级读取要求运行库授权图完整;授权图缺失时禁止面向用户返回内容。
- 恢复只允许进入 scratch identity;promotion 需要系统管理员与数据责任人确认,并通过各属主端口提交,禁止恢复 CLI 直写运行表。
## 后果
- 首个实现里程碑的改动面小于原 Wave 1–6,但会先增加 UnitOfWork、事件投递和授权基础设施。
- “单表唯一写者”检查改为生产 SQL 写权限检查,并允许 migration、测试和经批准运维脚本存在表名。
- `feature/final-artifact-vault` 是候选依赖,不直接假定可合入;必须先按当前 dev 重放测试、迁移和权限审计。
- 包物理移动、错误信封、SSE 和 PI Runner 协议可延后,不阻塞文档一致性整改。
## 替代方案
- **一次性横向搬包**:拒绝。冲突面大,不能先证明用户故障减少。
- **仅增加 arch-check**:拒绝。门禁不能替代事务、锁和授权契约。
- **拆微服务**:拒绝。当前问题是模块边界和数据一致性,不需要引入分布式事务与跨服务部署成本。
- **继续把 workspace 作为恢复来源**:拒绝。工作区属于可清理计算现场,不能成为最终事实源。
## 相关文档
- [模块解耦架构](../system-design/2026-09-14-module-decoupling-architecture.md)
- [模块解耦整改与重构计划](../remediation/2026-09-14-module-decoupling-refactor-plan.md)
- [方案复核](../audit/2026-09-14-module-decoupling-plan-review.md)
- [文档版本边界 ADR](./2026-09-13-document-version-boundary.md)
@@ -0,0 +1,30 @@
---
title: "事件连续性采用 consumer checkpoint + 首事件 bootstrap"
status: accepted
created: 2026-09-15
updated: 2026-09-15
---
# ADR:事件连续性采用 consumer checkpoint + 首事件 bootstrap
## 状态
接受(E0A)。在独立 FAV 审计或明确的无缺口 event sequence 迁移完成前不得改为 gap blocking。
## 背景
`event_envelopes` 已有 `UNIQUE (aggregate_type, aggregate_id, aggregate_version)`。受控文档的首次持久事件常常从较高 `aggregate_version`(账本 version_no)开始,中间版本从未发事件。若把领域版本号当成无缺口事件序号并在缺号时等待,会永久阻塞 delivery。MemoryBus 的 `TestGapDoesNotSkipVersion` 只是 characterization,不得搬到 PostgreSQL dispatcher。
## 决策
1. Track E 选择 **consumer checkpoint + 首事件 bootstrap**。
2. 每个 `(consumer, aggregate_type, aggregate_id)` 记录已成功处理的 `event_id` 与可选 `aggregate_version`。该 aggregate 上的第一件 **safe** 事件即为 bootstrap,不要求 version=1。
3. 同一版本多个不同类型事件:当前唯一约束禁止。E0A 审计后保持该约束;需要同版本多事件时另立 additive 迁移,把序号改到独立 `event_seq`,不在本 ADR 启用。
4. **禁止** 在 dispatcher 启用 gap wait / `ErrGapWait` 阻塞,直到另有 ADR 选择独立无缺口 event sequence 且完成回填。
5. 未知 schema、project 0、错误 environment、未知 consumer 的记录进入 inventory,不得 live claim。
## 后果
- E0B checkpoint 表随 dispatcher migration 增加。
- Projection 以 `document_id + source_snapshot_id + digest` no-replace,不依赖连续 version。
- poison 事件 quarantine 后不静默跳号;其他 aggregate 继续。
@@ -0,0 +1,85 @@
# ADR:纯软件工作流 key 与领域边界(SWBOOT-00)
## 状态
已接受(2026-09-16)
## 背景
工作流引擎已声明 `non_medical_software` 产品域,但正式目录、创建入口与模板仍以医疗器械三工作流(`main` / `product_manager` / `test_manager`)为硬编码白名单。继续复用医疗 manifest 会造成临床/注册/CDO 语义污染;直接改写既有三 key 会破坏已激活医疗实例。
详细设计见 [software-project-bootstrap-workflow](../system-design/2026-09-14-software-project-bootstrap-workflow.md)。
## 决策
### 1. 新增正式可选工作流 key
| key | 定位 | 默认产品域 | 可重复实例 |
|-----|------|------------|------------|
| `software_bootstrap` | 一次性建立项目事实、需求、架构、风险、路线与验证基线 | `non_medical_software` | 否(默认一次;终止后可重建并保留旧证据) |
| `software_delivery` | 按里程碑/发布重复交付,承接 change brief → 证据 → 验证 → 发布 → 复盘 | `non_medical_software` | 是 |
医疗三 key **保持不变**,仍为正式可选;不得在其 published hash 上替换为软件语义。
### 2. 目录策略:published + selectable,而非“仅三 key”
项目可选工作流 = 已发布 (`latest_published_version > 0`) ∩ `project_selectable=true` ∩ 策略白名单。
白名单扩展为:
```text
main | product_manager | test_manager | software_bootstrap | software_delivery
```
固定文档数量校验 **仅** 继续约束医疗三 key;软件工作流按 manifest 自身完整性校验,不强制医疗文档数。
### 3. 领域与合规分离
- `product_domain=non_medical_software` 只说明非医疗器械,不关闭鉴权/审计/安全基线。
- `compliance_profile` / `governance_profile` / `execution_mode` / `team_mode` 为项目级独立字段。
- 首期默认:`governance=standard`,`compliance=internal_control+security_baseline`,`execution_mode=docs_only`。
- `controlled_patch` 在 SWBOOT-10 受控执行器就绪前 **不可真正启用**;仅保留 allowlist stub。
### 4. 串联而非回环
```text
software_bootstrap(完成 + 创建者确认)
→ 仅建议 software_delivery
→ 创建者确认后新建 planning/激活实例
```
bootstrap 完成不得自动创建或激活 delivery。
### 5. Solo 审批策略(契约)
- `collaborative`:独立三权(author/reviewer/approver 不同人)。
- `solo`:`creator_acknowledgement`;页面与审计持续标注“未独立评审”。
- `controlled` 或要求独立审查的 compliance profile:**禁止 solo**。
### 6. 错误码(首期)
| code | 含义 |
|------|------|
| `ERR_WORKFLOW_NOT_SELECTABLE` | key 不在正式可选白名单或未 published |
| `ERR_DOMAIN_INCOMPATIBLE` | 工作流与项目 `product_domain` / `project_type` 不兼容 |
| `ERR_COMPLIANCE_PROFILE` | 合规配置非法或与治理冲突(如 controlled+solo) |
| `ERR_EXECUTION_MODE_DISABLED` | 请求 `controlled_patch` 但受控执行器未启用 |
| `ERR_REPO_PATH_NOT_ALLOWLISTED` | 仓库路径不在管理员 allowlist(SWBOOT-10 stub) |
| `ERR_CREATION_PREVIEW_STALE` | creation token / plan_hash 过期或不匹配(409) |
### 7. 运行时权威不变
继续遵守 [workflow-runtime-authority](./2026-09-12-workflow-runtime-authority.md):任务只能从冻结 `doc_task_instance` 启动;禁止客户端 `task_key`/duty/stage 旁路。
## 后果
- Bootstrap seed 与 catalog API 必须同时暴露软件两 key,且按 `product_domain` 过滤时不把医疗默认话术塞进软件项目。
- 项目表 additive 增加 `project_type_key` / `compliance_profile_key` 等字段;旧项目不自动分类为医疗或软件。
- SWBOOT-10 仅落地 allowlist stub:任何真实 patch/merge/push 必须 fail closed,直到独立 Epic 验收。
- 医疗三工作流黄金用例与固定文档数门禁保持回归基线。
## 关联
- 实施任务:`.doc/ops/short-term/2026-09-16-software-project-bootstrap.md`
- Backlog:`.doc/ops/long-term/2026-09-14-software-project-bootstrap-implementation.md`
- 验收清单:`.doc/ops/checklists/2026-09-14-software-project-bootstrap-acceptance.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 的当前可观测能力。
@@ -1,9 +1,9 @@
---
title: "修复对话刷新恢复与授权统计不一致"
status: planned
status: done
created: 2026-09-13
updated: 2026-09-13
owner: unassigned
updated: 2026-09-15
owner: Cursor
branch: fix/chat-history-refresh
worktree: ".worktrees/fix-chat-history-refresh"
mutex: chat
@@ -32,26 +32,27 @@ mutex: chat
## 步骤
1. [ ] 先补可稳定复现本缺陷的 PG 集成与前端恢复测试
2. [ ] 实现统一消息作用域解析与写入
3. [ ] 实现统一会话/消息授权查询及统计同集
4. [ ] 实现历史 dry-run/backfill 与对账
5. [ ] 完善前端恢复状态及用户隔离缓存
6. [ ] 执行全量门禁、真实 PI 刷新 E2E 和双用户负例
1. [x] 先补可稳定复现本缺陷的 PG 集成与前端恢复测试
2. [x] 实现统一消息作用域解析与写入
3. [x] 实现统一会话/消息授权查询及统计同集
4. [x] 实现历史 dry-run/backfill 与对账
5. [x] 完善前端恢复状态及用户隔离缓存
6. [x] 执行全量门禁、真实 PI 闲聊刷新 E2E 和双用户负例(编制任务激活链 save 400 未纳入本轮)
## 验收标准
- [ ] [整改方案](../../remediation/2026-09-13-chat-history-refresh-remediation.md) 的验收项全部有证据
- [ ] `CHAT-HISTORY-REFRESH` 在 gap-matrix 中由 FAIL 更新为 PASS
- [ ] 测试报告归档并回链
- [x] [整改方案](../../remediation/2026-09-13-chat-history-refresh-remediation.md) 的验收项(除真实 PI E2E)有证据
- [x] `CHAT-HISTORY-REFRESH` 在 gap-matrix 中由 FAIL 更新为 PASS
- [x] 测试报告归档并回链
## 相关链接
- Checklist: 实施开始时复制模板建立
- Handoff: [../handoffs/2026-09-13-chat-history-refresh-diagnosis.md](../handoffs/2026-09-13-chat-history-refresh-diagnosis.md)
- Test report: 待实施
- Test report: [../../test-reports/2026-09-13-chat-history-refresh-test-report.md](../../test-reports/2026-09-13-chat-history-refresh-test-report.md)
## 证据 / 备注
- Audit: [../../audit/2026-09-13-chat-history-refresh-disappears.md](../../audit/2026-09-13-chat-history-refresh-disappears.md)
- Remediation: [../../remediation/2026-09-13-chat-history-refresh-remediation.md](../../remediation/2026-09-13-chat-history-refresh-remediation.md)
- Live: [../../test-reports/assets/2026-09-15-chat-history-refresh-live/live.json](../../test-reports/assets/2026-09-15-chat-history-refresh-live/live.json)(项目 6252,window=categories=2,guest 403)
@@ -0,0 +1,59 @@
---
title: "修复查询误触发写任务与任务状态刷新退化"
status: done
created: 2026-09-13
updated: 2026-09-15
owner: Cursor
branch: docs/conversation-intent-dual-tab
worktree: "-"
mutex: intent
---
# 修复查询误触发写任务与任务状态刷新退化
## 目标
修复只读查询误启动文档、刷新丢失任务卡片能力及文档编辑状态不可见,并建立诊断数据隔离门禁。
## 范围
- 模板任务动作识别及负例测试
- 任务错误/进度/恢复上下文持久化与历史重建
- 文档租约/运行态的 UI 展示和重复启动前置拦截
- 隔离 fixture 验收与真实 PI 刷新 E2E
## 非目标
- 未经项目创建者确认,不软删除已污染消息或删除误启动产物
- 不放宽文档租约与工作流权限规则
## 步骤
1. [x] 核对真实会话、任务运行、事件和文档租约证据
2. [x] 补只读意图与刷新恢复失败测试
3. [x] 收紧写任务动作识别并修复 busy 错误分型
4. [x] 实现任务/租约状态刷新恢复与统一提示
5. [x] 实现命名文档的服务端鉴权只读总结(“总结”不止是不写入)
6. [x] 执行前端、Go、PG 与真实 PI 双标签页验收
- [x] Go、前端、构建、dev 重建与真实 PI 只读总结
- [x] 服务端 busy 预检不创建 run,并持久化无重试状态卡
- [x] 浏览器刷新恢复与双标签页 busy 可见性(项目 6275;禁止项目 143)
## 验收标准
- [x] [整改方案](../../remediation/2026-09-13-conversation-intent-runtime-state-remediation.md) 全部验收项有证据
- [x] `CHAT-INTENT-STATE` 由 FAIL 更新为 PASS
- [x] test-report 归档并回链
## 相关链接
- Checklist: 本任务验收标准
- Handoff: [../../ops/handoffs/2026-09-15-conversation-intent-dual-tab.md](../../ops/handoffs/2026-09-15-conversation-intent-dual-tab.md)
- Test report: [../../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md](../../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md)
## 证据 / 备注
- Audit: [../../audit/2026-09-13-conversation-intent-runtime-state.md](../../audit/2026-09-13-conversation-intent-runtime-state.md)
- Remediation: [../../remediation/2026-09-13-conversation-intent-runtime-state-remediation.md](../../remediation/2026-09-13-conversation-intent-runtime-state-remediation.md)
- 双标签活验:项目 **6275** / `sess-p6275-u10` / `run_1789452602295343365`;产物 `.doc/test-reports/assets/2026-09-15-conversation-intent-dual-tab/`
- 未改写项目 143,未删除 `sess-p143-u9` 探针
@@ -0,0 +1,47 @@
---
title: "当前受控文档指示语优先于领域关键词路由"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-active-doc-routing
worktree: "-"
mutex: docgov
---
# 当前受控文档指示语优先于领域关键词路由
## 目标
用户说「当前受控文档/当前文档/本文件/这份文档」且已选中服务端注册的 `doc_proj*` 时,任务 payload 为该文档 `taskKey`+`docId`;UI-05 提示须为 `intake` + `doc_proj6109_intake`。
## 范围
- `web/src/engine/templateMatch.ts` + App 发送/重试链
- 单测与边界;服务端 mismatch 复核(不信任客户端 doc_id 改 task)
- 文档:audit / gap-matrix / CURRENT
## 非目标
- 不改弱 E2E UI-05 断言;不操作容器;不触碰/提交 test-report assets
- 生产 `templateMatch.ts` 不导出用例编号/E2E 专属提示词;测试提示词留在 test 文件
## 步骤
1. [x] 认领 CURRENT;写 audit/short-term
2. [x] 指示语钉住 active 受控文档;显式点名可切换;只读不启动;模板槽不钉
3. [x] App 传入 activeDoc;payload 用一致 taskKey/docId
4. [x] 单测 + 门禁 + 原子提交
## 验收标准
- [x] UI-05 原文 + active intake → `intake` / `doc_proj6109_intake`
- [x] 只读「查看当前受控文档」不启动任务
- [x] 显式点名另一交付物可切换;模板-only 不钉住
- [x] 服务端 task_key 与已注册 doc 不一致仍拒绝
- [x] `go vet` / `go test -short` / web 242+27 / build / `git diff --check`
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-active-doc-routing.md](../../audit/2026-09-13-document-revision-active-doc-routing.md)
- Evidence: [../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui05-active-doc-routing-failure](../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui05-active-doc-routing-failure)
@@ -0,0 +1,55 @@
---
title: "职责单元格精确断言"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-duty-cell-assertion
worktree: "-"
mutex: document-revision-duty-cell-assertion
---
# 职责单元格精确断言
## 目标
堵住第16轮 UI-13a:权限矩阵已打开,整行 `innerText` 含全部 select option,误命中「编制负责人」。改为读控件 value/badge,且 USER_B 必须精确 `reviewer`,不得接受 viewer 降级。
## 范围
- `web/src/lib/dutyCellAssertion.ts` 与单测
- `UserProjectRightsModal` 职责控件可访问语义
- `web/e2e/document-revision-runtime.spec.ts` UI-13a
- audit / remediation / CURRENT
## 非目标
- 不放宽 reviewer 只读;不删双击/无编辑提示检查
- 不碰证据;不合 dest;不启停容器;不 E2E;不 push
## 步骤
1. [x] 从 `dev@dd5671e` 开分支并登记 mutex
2. [x] 精确角色解析 + option 文案不得误判测试
3. [x] 产品控件 data-* + UI-13a 接线
4. [x] `npm test` + `npm run build` 并原子提交
5. [x] 独立审查收紧:只接受 reviewer;viewer 与 canAssignLead=true 拒绝
## 验收标准
- [x] select/badge 必须精确 `reviewer`;viewer/author/approver 拒绝
- [x] 整行 option 文案不得推断职责
- [x] select 必须不可配置且 disabled
- [ ] 现场 UI-13a(未跑)
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-duty-cell-assertion.md](../../audit/2026-09-13-document-revision-duty-cell-assertion.md)
- Remediation: [../../remediation/2026-09-13-document-revision-duty-cell-assertion.md](../../remediation/2026-09-13-document-revision-duty-cell-assertion.md)
## 证据 / 备注
- mutex:`document-revision-duty-cell-assertion`(新 mutex)
- 基线:`dev@dd5671e`
- 验证(收紧后):`npx tsx --test src/lib/dutyCellAssertion.test.ts` PASS(6);`cd web && npm test` PASS;`npm run build` PASS
- **未跑真实 UI-13a,不得标 done**;**不得 merge / 启停容器 / E2E / push**
@@ -0,0 +1,51 @@
---
title: "E2E:给真实文档块加稳定寻址并修正 UI-06/13b"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-e2e-block-selector
worktree: "-"
mutex: document-revision-block-selector
---
# E2E:给真实文档块加稳定寻址并修正 UI-06/13b
## 目标
第六轮 UI-06 首错:`pure` 模式下块 wrapper 无 `data-overlay-kind`、正文也不是 `p`/`h1`。为每个真实 `DocumentBlock` wrapper 增加与 overlay 无关的稳定 DOM 标识;E2E 只在 `active-document-pane` 内定位该标识。不改视觉/权限/双击行为。不得将本任务标 `done`。
## 范围
- `web/src/lib/documentBlockDom.ts` + 契约单测
- `web/src/components/doc/BlockRenderer.tsx`
- `web/e2e/document-revision-runtime.spec.ts`(`openFirstPaneEditorAndFill`;UI-06/13b 复用,UI-13a 同步)
- 文档:audit / CURRENT
## 非目标
- 不改编辑/权限/overlay 视觉
- 不降低已有断言;不伪造、不直接打 API
- 不触碰/提交 `.doc/test-reports/assets`;不操作容器;本轮不重跑 E2E
- 不改 FEATURE-MATRIX
## 步骤
1. [x] 认领 CURRENT(mutex `document-revision-block-selector`);前序 reject-routing 保持 in_progress
2. [x] 真实块 wrapper 增加 `data-testid=document-block` + block id
3. [x] E2E 仅在 active pane 内按该标识双击
4. [x] 契约单测:pure 模式也有块标识,且不依赖 `data-overlay-kind`
5. [ ] 占槽后真实 UI 重跑(本轮不做)
## 验收标准
- [x] 块标识与 overlay 无关;带 block id
- [x] `openFirstPaneEditorAndFill` 不使用 overlay/`p`/`h1`/`h2`
- [x] web tests + `tsc`/build + `git diff --check`
- [ ] 真实 UI-06/13b PASS 后才可将本任务标 `done`
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-block-selector.md](../../audit/2026-09-13-document-revision-block-selector.md)
- Evidence: [../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui06-block-selector-failure](../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui06-block-selector-failure)
- 前序: [2026-09-13-document-revision-e2e-reject-routing.md](./2026-09-13-document-revision-e2e-reject-routing.md)
@@ -0,0 +1,51 @@
---
title: "E2E:纯净阅读按 document-block 取样 overlay"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-e2e-overlay-selector
worktree: "-"
mutex: document-revision-overlay-selector
---
# E2E:纯净阅读按 document-block 取样 overlay
## 目标
第八轮 UI-07 首错:pure 模式用 `[data-overlay-kind],[class*=block]` 找不到真实块。在 `active-document-pane` 内对全部 `document-block` 取样真实样式/hunk;manual/all 不保证两两不同。不得将本任务标 `done`。
## 范围
- `web/e2e/document-revision-runtime.spec.ts`(UI-07 取样;UI-10 历史自动关闭;UI-16 text 选择器)
- `web/src/features/documentRevision/overlayMode.test.ts`(同一 human hunk 不保证 pairwise)
- 文档:audit / CURRENT
## 非目标
- 不新建 policy 抽象;不改 overlay 视觉/业务
- 不人为换块制造 manual≠all
- 不触碰/提交 `.doc/test-reports/assets`;不操作容器;本轮不重跑 E2E
- 不改 FEATURE-MATRIX
## 步骤
1. [x] 认领 CURRENT(mutex `document-revision-overlay-selector`)
2. [x] UI-07 在 pane `document-block` 上取样
3. [x] 按 checklist 校正三模式断言
4. [x] UI-10 按抽屉自动关闭比较
5. [ ] 占槽后真实 UI 重跑(本轮不做)
## 验收标准
- [x] 禁止 `[class*=block]` / 全页 overlay 取样
- [x] 纯净阅读必须无装饰;人工/全部必须有真实 hunk 装饰
- [x] web tests + `tsc`/build + `git diff --check`
- [ ] 真实 UI-07/08/09 PASS 后才可将本任务标 `done`
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-overlay-selector.md](../../audit/2026-09-13-document-revision-overlay-selector.md)
- Evidence: [../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui07-pure-selector-failure](../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui07-pure-selector-failure)
- Checklist: [../checklists/2026-09-13-document-revision-runtime-ui-acceptance.md](checklists/2026-09-13-document-revision-runtime-ui-acceptance.md)
- 前序: [2026-09-13-document-revision-e2e-save-selector.md](./2026-09-13-document-revision-e2e-save-selector.md)
@@ -0,0 +1,46 @@
---
title: "E2E:等 overlay CSS transition 结束后再取样"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-e2e-overlay-transition
worktree: "-"
mutex: document-revision-overlay-transition
---
# E2E:等 overlay CSS transition 结束后再取样
## 目标
第九轮 UI-07 首错:`data-overlay-kind` 已空,但采样落在 200ms transition 中间帧。用 Playwright 轮询 computed style 直到稳定且达到无装饰目标后再取样。不得将本任务标 `done`。
## 范围
- `web/e2e/document-revision-runtime.spec.ts`(pure/manual/all 均等样式 settle)
- 文档:audit / CURRENT
## 非目标
- 不禁用产品 `transition`;不固定极短 sleep;不放宽纯净无装饰断言
- 不触碰/提交 `.doc/test-reports/assets`;不操作容器;本轮不重跑 E2E
- 不改 FEATURE-MATRIX;不合 `dev`
## 步骤
1. [x] 认领 CURRENT(mutex `document-revision-overlay-transition`)
2. [x] `expect.poll` 连续两帧相同且达到 mode 目标后再采样
3. [ ] 占槽后真实 UI 重跑(本轮不做)
## 验收标准
- [x] 纯净阅读仍要求透明底 + `box-shadow:none` + 无 overlay-kind
- [x] manual/all 也等 transition 完成
- [x] web tests + `tsc`/build + `git diff --check` + Go 门禁
- [ ] 真实 UI-07/08/09 PASS 后才可将本任务标 `done`
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-overlay-transition.md](../../audit/2026-09-13-document-revision-overlay-transition.md)
- Evidence: [../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui07-css-transition-sampling-failure](../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui07-css-transition-sampling-failure)
- 前序: [2026-09-13-document-revision-e2e-overlay-selector.md](./2026-09-13-document-revision-e2e-overlay-selector.md)
@@ -0,0 +1,49 @@
---
title: "E2E:待确认报告必须真实打开再确认/拒绝"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-e2e-pending-flow
worktree: "-"
mutex: pending-report-ui
---
# E2E:待确认报告必须真实打开再确认/拒绝
## 目标
第四轮 UI-05a 首错修复:验收脚本按真实用户路径关闭首轮报告、打开「待确认报告」,在面板内断言 high(critical 允许)与 pending 动作后再确认/拒绝。不改产品业务逻辑。
## 范围
- `web/e2e/document-revision-runtime.spec.ts` UI-04 / UI-05a / UI-05b
- 文档:audit / CURRENT 认领(mutex `pending-report-ui`;与 reject-routing 的 `document-revision-runtime-ui` 分开,避免虚报 done)
## 非目标
- 不改 `ChangeReportPanel` / Toolbar / decision API
- 不降低已有业务断言或超时;不伪造、不直接打 API
- 不触碰/提交 `.doc/test-reports/assets`;不操作容器;本轮不重跑 E2E
- 不改 FEATURE-MATRIX
## 步骤
1. [x] 认领 CURRENT;写 audit/short-term
2. [x] UI-04 用弹窗内「关闭」并断言 dialog 消失
3. [x] UI-05a 点击「待确认报告」,断言 risk/pending-actions/确认提交后确认
4. [x] UI-05b 新 pending 后同样打开面板,断言 pending-actions/拒绝后再拒绝
5. [ ] 占槽后真实 UI 重跑(本轮不做)
## 验收标准
- [x] UI-04 不再使用无效 Escape
- [x] UI-05a/05b 不靠全局 count 代替打开待确认报告
- [x] web tests + `tsc`/build + `git diff --check`
- [ ] 真实 UI-05a/05b PASS 后才可将本任务标 `done`
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-pending-report-selection.md](../../audit/2026-09-13-document-revision-pending-report-selection.md)
- Evidence: [../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui05a-pending-report-selection-failure](../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui05a-pending-report-selection-failure)
- Checklist: [../checklists/2026-09-13-document-revision-runtime-ui-acceptance.md](checklists/2026-09-13-document-revision-runtime-ui-acceptance.md)
@@ -0,0 +1,62 @@
---
title: "E2E:UI-05b 钉住 intake 并收紧 UI-10/12/13/14"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-e2e-reject-routing
worktree: "-"
mutex: document-revision-runtime-ui
---
# E2E:UI-05b 钉住 intake 并收紧 UI-10/12/13/14
## 目标
第五轮 UI-05b 首错修复:拒绝用例 prompt 必须带「当前受控文档《用户初始需求收集表》」,并在本轮 `POST /tasks/runs` 上严格断言 `task_key==='intake'` 且 `doc_id===controlledDocId`。同步收紧 UI-10/12/13/14 真实用户路径。本轮追加产品修复:权威文档职责 + 打开时基线 ETag。
## 范围
- `internal/docgov/project_docs.go`(summary 职责投影)
- `web/src` 职责字段、`resolveCurrentDocRole`、hydrate/PATCH ETag
- `web/e2e/document-revision-runtime.spec.ts`(UI-13b 真实竞争)
- 文档:audit / remediation / CURRENT(mutex `document-revision-runtime-ui`)
## 非目标
- 不降低已有业务断言或超时;不伪造、不直接打 API
- 不触碰/提交 `.doc/test-reports/assets`;不操作容器;本轮不重跑 E2E
- 不改 FEATURE-MATRIX
## 步骤
1. [x] 认领 CURRENT;前序 pending-flow 保持 in_progress,mutex 改为 `pending-report-ui`(仅 UI-05a 实战 PASS,UI-05b 尚未拒绝,不得虚报 done)
2. [x] UI-05b prompt + tasks/runs 契约断言 + 真实打开拒绝
3. [x] UI-10 历史 dialog 内选 A/B 比较并关闭;UI-12 项目不可见;UI-13 拆成审核人只读 + 双 A 冲突;UI-14 同时锁 v/r
4. [x] 仅修 05a/05b/10 遗留弹窗对 UI-06 的确切遮挡
5. [x] 产品修复:权威职责 + viewer fail-closed + hydrate 基线 ETag
6. [x] UI-13b:A1 保存前 A2 编辑器已打开并填入文本;两窗口同一 r/etag
7. [x] 审查补强:controlled 缺 ETag fail-closed;viewer 只读批注;服务端零 id 不按 name 提权
8. [ ] 占槽后真实 UI 重跑(本轮不做)
## 验收标准
- [x] UI-05b 发送前等待 POST `/api/v1/tasks/runs`,`task_key`/`doc_id` 不符即 FAIL
- [x] UI-10 不点全局工具条「比较」
- [x] UI-12 不接受「项目可见但只查 marker」
- [x] UI-13a/13b 结果分别记录;B 不作正文编辑者
- [x] B/陌生人不会变 author;A 仍 author(Go + 前端单测)
- [x] stale hydrate ETag 用于 PATCH(不能用最新 ETag 掩盖冲突)
- [x] controlled 缺打开时 ETag 不得 PATCH 0:0;hydrate 5xx 进加载失败屏障
- [x] viewer 无新增批注入口
- [x] 服务端受控 duty id=0 不按 name 提权
- [x] web tests + `tsc`/build + `git diff --check`
- [ ] 真实 UI-05b+ 后段及 UI-13a/13b PASS 后才可将本任务标 `done`
## 相关链接
- Audit (05b 路由): [../../audit/2026-09-13-document-revision-e2e-reject-routing.md](../../audit/2026-09-13-document-revision-e2e-reject-routing.md)
- Audit (职责/ETag): [../../audit/2026-09-13-document-revision-duty-etag-overwrite.md](../../audit/2026-09-13-document-revision-duty-etag-overwrite.md)
- Remediation: [../../remediation/2026-09-13-document-revision-duty-etag-overwrite.md](../../remediation/2026-09-13-document-revision-duty-etag-overwrite.md)
- Evidence: [../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui05b-reject-routing-failure](../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui05b-reject-routing-failure)
- 前序: [2026-09-13-document-revision-e2e-pending-flow.md](./2026-09-13-document-revision-e2e-pending-flow.md)
@@ -0,0 +1,51 @@
---
title: "E2E:块编辑 dialog 内精确保存"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-e2e-save-selector
worktree: "-"
mutex: document-revision-save-selector
---
# E2E:块编辑 dialog 内精确保存
## 目标
第七轮 UI-06 首错:双击已打开编辑器,但全页模糊「保存」点到聊天私密库按钮,未 PATCH。给 `BlockEditorModal` 可访问 dialog + 稳定 aria-label;保存只在该 dialog 内 `exact: true` 点「保存修改」。不得将本任务标 `done`。
## 范围
- `web/src/lib/blockEditorDialog.ts` + 契约单测
- `web/src/components/doc/BlockEditorModal.tsx`
- `web/e2e/document-revision-runtime.spec.ts`(UI-06/13b 复用;UI-13a dialog=0)
- 文档:audit / CURRENT
## 非目标
- 不改视觉/保存业务
- 不降低已有断言
- 不触碰/提交 `.doc/test-reports/assets`;不操作容器;本轮不重跑 E2E
- 不改 FEATURE-MATRIX
## 步骤
1. [x] 认领 CURRENT(mutex `document-revision-save-selector`)
2. [x] dialog `role` + `aria-label=编辑受控块`
3. [x] E2E 在 dialog 内精确点「保存修改」
4. [x] UI-13a 断言编辑 dialog 不出现
5. [ ] 占槽后真实 UI 重跑(本轮不做)
## 验收标准
- [x] 契约单测钉住 dialog label 与 exact 保存文案
- [x] 禁止全页 `/保存/`
- [x] web tests + `tsc`/build + `git diff --check`
- [ ] 真实 UI-06/13b PASS 后才可将本任务标 `done`
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-save-selector.md](../../audit/2026-09-13-document-revision-save-selector.md)
- Evidence: [../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui06-save-selector-failure](../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui06-save-selector-failure)
- 前序: [2026-09-13-document-revision-e2e-block-selector.md](./2026-09-13-document-revision-e2e-block-selector.md)
@@ -0,0 +1,61 @@
---
title: "编辑弹窗 hydration 竞态修复"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-editor-hydration-race
worktree: "-"
mutex: document-revision-editor-hydration-race
---
# 编辑弹窗 hydration 竞态修复
## 目标
堵住第十二轮 UI-06:编辑弹窗打开期间后台 hydration 换块 ID,保存静默关窗且不发 PATCH。用户编辑期间与 PATCH 成功后,迟到 hydration 不得覆盖基线;找不到块 fail-closed。
## 范围
- `web/src/lib/controlledDocHydrate.ts`:`fetchRevisionState` 保留 `head_block_map`,hydrate 后 `applyHeadBlockMap`
- `web/src/lib/editorHydrationGate.ts` 与单测(迟到响应不得覆盖 PATCH 成功正文)
- `web/src/lib/blockSavePolicy.ts` 与单测(stale-id / doc 绑定 / 切文档 fail-closed)
- `web/src/lib/saveControlledBlockEdit.ts`:App 真实调用的 PATCH 编排(可注入 patch API)
- `web/src/App.tsx`:`editorSession`、关窗续跑、切文档 fail-closed
- audit / remediation / CURRENT 认领
## 非目标
- 不修改、移动、删除或提交 `.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui/`
- 不合 `dev`、不 push、不启动/重建 Docker
- 不运行或伪造真实 UI/E2E;不得声称 UI-06 已通过
- 不改 FEATURE-MATRIX 完成度;不削弱 ETag/409
## 步骤
1. [x] 从 `dev@4c465d2` 开 `fix/document-revision-editor-hydration-race`,mutex 不与现有 in_progress 冲突
2. [x] 定位全部会在弹窗打开期间替换 AST 的路径(effect / 选文档 / 重试;lease 改 deliverables 触发 effect)
3. [x] hydrate 对齐 `head_block_map` + generation token / 编辑门闩 + stale-id fail-closed
4. [x] 单测:同 map ID 稳定、缺 map 仍随机、deferred hydrate、stale id、迟到 hydrate、PATCH ETag、409
5. [x] `web` npm test / build(首轮)
6. [x] 独立审查补强:真实 PATCH 编排测试、editorDocId 绑定、关窗续跑、切文档 fail-closed
7. [ ] 真实 UI-06 重跑(本轮不做)
## 验收标准
- [x] 编辑中不因后台 hydration 换 ID 而静默丢稿(逻辑门闩 + 单测)
- [x] 找不到目标块保留编辑器并提示
- [ ] 现场 r0→r1(未跑 E2E,保持未勾选)
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-editor-hydration-race.md](../../audit/2026-09-13-document-revision-editor-hydration-race.md)
- Remediation: [../../remediation/2026-09-13-document-revision-editor-hydration-race.md](../../remediation/2026-09-13-document-revision-editor-hydration-race.md)
- 失败证据(勿提交): `.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui06-r-bump-noop-failure/`
## 证据 / 备注
- mutex:`document-revision-editor-hydration-race`(新 mutex,未占用 `document-revision-save-selector` 等 in_progress 行)
- 基线:`dev@4c465d2`
- 验证:补强后全量 `npm test` + `npm run build` 通过;`saveControlledBlockEdit` 断言一次 PATCH
- **未跑真实 UI-06,不得标 done**
@@ -0,0 +1,54 @@
---
title: "UI-11 快速完成观测契约"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-fast-completion-observation
worktree: "-"
mutex: document-revision-fast-completion-observation
---
# UI-11 快速完成观测契约
## 目标
堵住第14轮 UI-11:助手已 `completed`,验收脚本仍硬等处理中 60s,把成功终态误判为失败。只改测试契约,不降真实性。
## 范围
- `web/src/lib/squadCompletionObservation.ts` 与单测
- `web/e2e/document-revision-runtime.spec.ts` 的 `waitForSquadCompletion`
- audit / remediation / CURRENT
## 非目标
- 不改产品运行时、不放宽上传/对应关系/终态/无错误
- 不碰证据目录;不合 dest;不启动/重启容器;不 E2E;不 push
- 不把 stub 或伪造页面当验收
## 步骤
1. [x] 从 `dev@339e871` 开分支并登记 mutex
2. [x] 观测谓词 + 直接 completed / 经历 inflight 测试
3. [x] 接线 `waitForSquadCompletion`,保留 UI-11 上传断言
4. [x] 跑相关单测并原子提交
## 验收标准
- [x] 已 completed 直接接受,不要求 inflight
- [x] 经历 inflight 再到终态仍接受
- [x] 错误终态与错位消息拒绝
- [ ] 现场 UI-11(未跑)
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-fast-completion-observation.md](../../audit/2026-09-13-document-revision-fast-completion-observation.md)
- Remediation: [../../remediation/2026-09-13-document-revision-fast-completion-observation.md](../../remediation/2026-09-13-document-revision-fast-completion-observation.md)
## 证据 / 备注
- mutex:`document-revision-fast-completion-observation`(新 mutex)
- 基线:`dev@339e871`
- 验证:`npx tsx --test src/lib/squadCompletionObservation.test.ts` PASS;`cd web && npm test` PASS(306 + 29)
- **未跑真实 UI-11,不得标 done**;**不得 merge / rebuild / E2E / push**
@@ -0,0 +1,61 @@
---
title: "文档修改、版本差异与智能体变更说明设计"
status: done
created: 2026-09-13
updated: 2026-09-13
owner: Codex
branch: feature/document-revision-management
worktree: "-"
mutex: docgov
---
# 文档修改、版本差异与智能体变更说明设计
## 目标
基于当前 DocGov、任务、块编辑器与通知实现,形成一套可直接评审和拆分实施的文档修改管理方案,覆盖人工修改标记、智能体/小队修改归属、版本边界、任意版本比较、AI 变更说明及负责人通知。
## 范围
- 交叉核对现有文档数据模型、保存链路、Agent 产物落盘、前端块编辑器、权限和通知机制。
- 明确定义“智能体基线 + 后续人工修改”的工作副本与正式版本语义。
- 设计数据模型、事务边界、API、前端交互、通知、权限、迁移兼容及验收矩阵。
- 产出 audit、system-design、remediation 文档并同步文档索引与 FEATURE-MATRIX。
## 非目标
- 本任务不修改业务代码、数据库迁移或运行环境。
- 本任务不执行共享容器重建、真实 PI E2E 或合入 `dev`。
- 本任务不替用户决定版本保留周期、强监管电子签名策略等产品决策;方案给出推荐默认值和决策点。
## 步骤
1. [x] 完成当前实现与既有设计的证据核对。
2. [x] 形成领域模型、版本状态机与一致性边界设计。
3. [x] 形成前端展示、API、权限、通知与验收设计。
4. [x] 形成分波次整改方案和实施任务拆分。
5. [x] 更新文档索引、FEATURE-MATRIX、CURRENT 并执行文档质量检查。
## 验收标准
- [ ] 方案能逐条映射用户提出的版本边界与显示规则。
- [ ] 能区分用户、单智能体、智能体小队及系统迁移等修改主体。
- [ ] 并发、失败恢复、权限、审计、通知去重和大文档性能均有确定性方案。
- [ ] API、表结构、UI 状态、迁移顺序与测试用例足以供开发直接拆单。
- [ ] 仅产生方案文档变更,无业务代码和环境变更。
## 相关链接
- Audit: `../../audit/2026-09-13-document-revision-management-gap-analysis.md`
- System design: `../../system-design/document-revision-management.md`
- Remediation: `../../remediation/2026-09-13-document-revision-management-implementation-plan.md`
- Test report: 实施阶段补充
## 证据 / 备注
- 用户评审通过前保持 `in_progress`;本轮交付的是可评审方案,不代表能力已实现。
- 2026-09-13:`git diff --check` PASS;新增文档及新增链接均可解析。
- 索引文件中另有 3 个与本任务无关的既有失效链接(两个历史 `.tmp` 目录、一个 `architecture-design.md` 相对路径),本任务未扩大范围修改。
- 2026-09-13:独立复审(Cline)通过,结论待用户最终拍板:①三项决策(智能体/模板开 Version、high/critical 强制编制负责人二次确认、首发只覆盖受控文档)均确认可行,理由与既有 `document_change_proposals` 认领授权机制一致;②抽查 DOCREV-01~09 全部 9 项源码证据属实(含 `bizdev/service.go:499-502` 通用提案文案、`:694-705` 忽略错误写哈希、`handlers.go:1027` 客户端 holder 直通、`BlockEditorModal.tsx:104` 硬编码“张工”、`saveDocumentContent` 无调用者、Goose 基线 00027);③补强 2 处设计缺口——根表指针列与既有 `freeform_documents.current_version_id` 同名冲突(改为 `ledger_*` 命名并明确旧列退役)、状态机把文档生命周期误并入版本状态(已拆为正交状态图);同步修订 system-design §4/§6.7、remediation §3/§5.2/§5.7。
- 2026-09-13:用户确认 DOCREV 实施计划选项 1;设计任务归档,进入 Wave 0。
@@ -0,0 +1,57 @@
---
title: "文档账本 PG ID 与计数器重映射"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-pg-id-remap
worktree: "-"
mutex: document-revision
---
# 文档账本 PG ID 与计数器重映射
## 目标
堵住 schema31-round19:首次生成 PG 已写入 snapshot/version/candidate,但 `CommitAgentVersion` 因内存 map 误删 baseline 而 `not found`。
## 范围
- `internal/docrevision` ID 分配、adopt、PG persist
- 确定性单测 + 隔离 PG 回归
- audit / remediation / CURRENT / FEATURE-MATRIX / gap-matrix
## 非目标
- 本任务编码阶段不 merge / 不启停容器 / 不 push;Round20 验收见运行时 UI 报告
- 不删不改证据目录
- 不忽略 `ErrNotFound`,不伪造基线/报告
## 步骤
1. [x] 从 `dev@fa6a033` 开分支并登记 mutex
2. [x] 独立验证 openTemplate 不推进 counter + 无条件 delete 误删
3. [x] 统一 helper + 全路径 adopt
4. [x] `gofmt` / `go vet` / `go test -short` / 相关包测试
5. [x] 原子提交
## 验收标准
- [x] 占用 ID 不覆盖;adopt 只删同一对象
- [x] 高序列首次生成:自动提交、V2、candidate committed、baseline 未丢、重启 hydration
- [x] 现场 UI-03:Round20 项目 6159 首次生成 V2/r0,任务 `run_1789343479579646533` 成功(相对 6158 candidate id=175 / output snapshot 250 的 not found)
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-pg-id-remap.md](../../audit/2026-09-13-document-revision-pg-id-remap.md)
- Remediation: [../../remediation/2026-09-13-document-revision-pg-id-remap.md](../../remediation/2026-09-13-document-revision-pg-id-remap.md)
- Checklist: [../checklists/2026-09-13-document-revision-pg-id-remap.md](checklists/2026-09-13-document-revision-pg-id-remap.md)
- Handoff: [../handoffs/2026-09-13-document-revision-pg-id-remap.md](handoffs/2026-09-13-document-revision-pg-id-remap.md)
## 证据 / 备注
- 基线:`dev@fa6a033`
- 验证:`gofmt`/`go vet` PASS;`go test -short ./...` PASS;隔离临时库 `HighSequenceFirstGen` PASS(拒绝 `agent_system_dev`,测完 DROP)
- 失败归档(只读):`.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui/schema31-round19-ui03-advisor-briefing-docrevision-not-found/`
- 验收:Round20 UI-03 PASS,见 [../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md](../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md)
- 工程修复已合入 `dev@b258ab8`
@@ -0,0 +1,56 @@
---
title: "post-restart 期望正文须为最终持久 marker"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-post-restart-final-snippet
worktree: "-"
mutex: document-revision-post-restart-final-snippet
---
# post-restart 期望正文须为最终持久 marker
## 目标
第二次 post-restart 已恢复 login/项目/文档/`revision-state` 200/`V3`/`r2`/正文,但 `phase-state.bodySnippet` 仍是 UI-06 marker,断言旧文失败。UI-13b A1 成功保存后须把最终持久正文写入 phase-state;不得放宽 post body 断言。
## 范围
- `web/src/lib/durableBodySnippet.ts` 纯函数契约
- UI-06 / UI-13b / UI-15-pre 同步 `latestDurableBodySnippet` → `phase-state.bodySnippet`
- audit / checklist / handoff / CURRENT
## 非目标
- 不改生产业务代码、不重跑真实 UI、不动容器、不 merge、不 push
- 不改删 assets
- 不改删历史失败 assets;不声称全仓 `production_ready=yes`
## 步骤
1. [x] 从 `dev@eb85b8a` 认领分支并登记 mutex
2. [x] 成功修订覆盖旧 snippet;冲突失败稿不成为期望正文
3. [x] UI-13b 完成后与 UI-15-pre 写入最终 marker
4. [x] `npm test` / `npm run build`
5. [x] 原子提交
6. [x] Round20 `UI_PHASE=post-restart` PASS(V3/r2 / `A1-win-mu0gwiez`)
## 验收标准
- [x] 契约测试:A1 覆盖 UI06;A2 conflict 不覆盖 A1
- [x] post-restart 仍断言 `st.bodySnippet` 可见
- [x] 真实 UI-15 post-restart:Round20 1 passed / 18 skipped;页面恢复 V3/r2/正文
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-post-restart-final-snippet.md](../../audit/2026-09-13-document-revision-post-restart-final-snippet.md)
- Checklist: [../checklists/2026-09-13-document-revision-post-restart-final-snippet.md](checklists/2026-09-13-document-revision-post-restart-final-snippet.md)
- Handoff: [../handoffs/2026-09-13-document-revision-post-restart-final-snippet.md](handoffs/2026-09-13-document-revision-post-restart-final-snippet.md)
## 证据 / 备注
- 基线:`dev@eb85b8a`
- 失败归档(只读):`.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui/schema31-postrestart-stale-body-snippet-failure/`(当时 `bodySnippet=UI06-mu0eq020`)
- Round20 `phase-state`:`versionText=V3` `revisionText=r2` `bodySnippet=A1-win-mu0gwiez`
- 报告:[../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md](../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md)
@@ -0,0 +1,59 @@
---
title: "post-restart 项目名 selector 与阶段产物隔离"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-post-restart-selector
worktree: "-"
mutex: document-revision-post-restart-selector
---
# post-restart 项目名 selector 与阶段产物隔离
## 目标
第18轮 main 18 PASS 后,post-restart 在页面已恢复项目时因项目名同时出现在顶栏与侧栏而 strict violation。改为 banner 内唯一 exact 断言,点击仍走可见项目入口;Playwright output/report 与结果 JSON 按 `UI_PHASE` 分离(main 仍用 `ui-acceptance-results.json`)。
## 范围
- `web/e2e/document-revision-runtime.spec.ts` post-restart 项目恢复断言
- `web/src/lib/currentProjectRestore.ts` 与契约测试
- `web/playwright.config.ts` + `playwrightPhaseArtifacts` 按阶段分目录
- audit / checklist / handoff / CURRENT
## 非目标
- 不改业务逻辑、不重跑真实 UI、不动容器、不 merge、不 push
- 不改删 `.doc/test-reports/assets/` 证据
- 不声称 post-restart / UI-15 通过
## 步骤
1. [x] 从 `dev@b824948` 认领分支并登记 mutex
2. [x] 项目入口 click + banner exact 断言;禁 `.first()` 弱化
3. [x] `UI_PHASE` 分离 `playwright-output-*` / `playwright-report-*`
4. [x] 结果 JSON:main 保持 `ui-acceptance-results.json`;post-restart 写 `ui-acceptance-results-post-restart.json`
5. [x] `npm test` / `npm run build`
6. [x] 原子提交
7. [ ] 占槽后重跑 post-restart(本轮不做)
## 验收标准
- [x] 页面级 `getByText(项目名)` 在 2 命中时契约判定失败
- [x] 入口为 complementary exact title;当前项目为 banner exact text
- [x] main / post-restart 产物目录不同
- [x] post-restart `recordPass` 不覆盖 main 的 `ui-acceptance-results.json`
- [ ] 真实 UI-15 post-restart(未跑)
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-post-restart-selector.md](../../audit/2026-09-13-document-revision-post-restart-selector.md)
- Checklist: [../checklists/2026-09-13-document-revision-post-restart-selector.md](checklists/2026-09-13-document-revision-post-restart-selector.md)
- Handoff: [../handoffs/2026-09-13-document-revision-post-restart-selector.md](handoffs/2026-09-13-document-revision-post-restart-selector.md)
## 证据 / 备注
- 基线:`dev@b824948`
- 失败归档(只读):`.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui/schema31-postrestart-project-title-selector-failure/`
- **未跑真实 post-restart,不得标 done**
@@ -0,0 +1,62 @@
---
title: "prelim_design 缺 output.md 产物契约修复"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-pi-runner-module
worktree: "-"
mutex: document-revision-prelim-output
---
# prelim_design 缺 output.md 产物契约修复
## 目标
第11轮 UI-11:202 + `prelim_design` 已正确,但 `step_01_draft` 缺真实 `output.md`。embed 官方模板、归一化 runner 路径、缺产物 fail-closed;对「进程 0 + settled failure / 缺产物」的**瞬时**失败做有界全新 step 重试。不得标 `done`。
## 范围
- `internal/template` embed + loader
- `internal/agent` 路径映射、目标强制、瞬时/永久分类、`Result.Retryable`
- `internal/squad` `runOneStep` 有界全新 invocation
- `deploy/pi-agent/runner.mjs` + `settle-policy.mjs`
- `deploy/pi-agent/Dockerfile` 必须 COPY runner 的全部相对 import 到 `/app`
- `deploy/app/Dockerfile` `COPY templates` / `COPY configs` 到 `/app`;`.dockerignore` 放行官方 markdown
- Docker build context / `/app/templates/docs` 读路径实测(不执行 env-service 重建)
- 文档:audit / remediation / CURRENT
## 非目标
- 不伪造 `output.md`;不执行截断 `write` 参数;不改 E2E prompt;不放宽缺失校验
- 不触碰/提交证据目录;不执行 env-service 重建/重启;本轮不重跑 E2E
- 不改 FEATURE-MATRIX;不合 `dev`;不 push
- 不对永久缺失(干净 settle 后无产物、`prompt_empty`、治理)无限重试
## 步骤
1. [x] 从 `dev@2a58674` 开 `fix/document-revision-prelim-output` 并认领 mutex
2. [x] 定位:stub 模板 + `agent_settled` 假成功 + 只认精确 `output.md` 键
3. [x] embed / 映射 / runner fail-closed + 单测 + 门禁
4. [x] 纳入现场时序:write 已流出但 `terminated`;SDK retry 1–3 Connection error;`auto_retry_end success=false`;仍 `agent_settled`;trace `success=true`
5. [x] settle-policy + Go 分类 + `runOneStep` 有界全新重试 + 单测
6. [x] `.dockerignore` 放行 `templates/**/*.md`;Docker context 实测 `/app/templates/docs/prelim_design.md`
7. [x] 本次写入的目标不覆盖、不再调用;backend 明确失败仍 FAIL(不把文件存在当成功);上一轮残留不当成功
8. [x] `dev@55a4f39` 重建后 runner `ERR_MODULE_NOT_FOUND settle-policy.mjs`:Dockerfile COPY 齐相对模块 + COPY 契约测试
9. [ ] 占槽后真实 UI 重跑(本轮不做)
## 验收标准
- [ ] 无盘模板时 `prelim_design` 仍为官方「系统初步设计方案」
- [ ] 绝对/`./`/重复子目录 `rel_path` 能落到目标文件
- [ ] `ok:true` 但无非空目标 → 失败,不发明正文
- [x] 瞬时 settled failure → 最多一次全新 step;永久缺失不重试;耗尽 fail-closed
- [x] pi-agent 镜像 COPY 含 runner 全部相对 import(含 `settle-policy.mjs`)
- [ ] intake 工作流单测仍绿
- [ ] 真实 UI-11 PASS 后才可标 `done`
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-prelim-output.md](../../audit/2026-09-13-document-revision-prelim-output.md)
- Remediation: [../../remediation/2026-09-13-document-revision-prelim-output.md](../../remediation/2026-09-13-document-revision-prelim-output.md)
- Evidence: [../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui11-prelim-design-missing-output-failure](../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui11-prelim-design-missing-output-failure)
@@ -0,0 +1,46 @@
---
title: "质量门禁:行动计划表状态「待续」窄豁免"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-quality-context
worktree: "-"
mutex: docgov
---
# 质量门禁:行动计划表状态「待续」窄豁免
## 目标
结构化行动计划表中独立状态单元格「待续」不再误报;正文/标题/列表/普通表中的「待续」仍 FAIL。禁词表不得删除「待续」。
## 范围
- `internal/squad/quality_gate.go` 窄 Markdown 表结构识别
- 敌意单测 + 既有自检豁免 / 投影 / repair 隔离不回归
- 文档:audit / gap-matrix / CURRENT / FEATURE-MATRIX
## 非目标
- 不删除「待续」禁词;不放宽普通正文/任意同行表格
- 不触碰 assets / E2E;不操作容器
## 步骤
1. [x] 认领 CURRENT;写 audit/short-term
2. [x] 仅豁免行动计划表「阶段/状态/进度」列独立单元格(去粗体精确等于「待续」+ 表头列索引对齐 + 实质行动 + 负责/触发完整)
3. [x] 敌意用例:正文「后续章节待续」、`| 内容 | 待续 |`、待续说明、残行/空动作、负责方/触发=待续仍 FAIL;列重排仅状态列可 PASS
4. [x] 门禁 + 原子提交
## 验收标准
- [x] 现场同构行动表 PASS,且不触发 repair
- [x] 敌意上下文仍记录 `待续`
- [x] `ProhibitedPhrases` 仍含「待续」
- [x] targeted / `go vet` / `go test -short` / `go test -race ./internal/taskrun` / web test+build / `git diff --check`
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-quality-status-false-positive.md](../../audit/2026-09-13-document-revision-quality-status-false-positive.md)
- Evidence: [../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui03-quality-status-false-positive](../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui03-quality-status-false-positive)
@@ -0,0 +1,57 @@
---
title: "质量修复子工作区契约"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-quality-repair-workspace-contract
worktree: "-"
mutex: document-revision-quality-repair-workspace-contract
---
# 质量修复子工作区契约
## 目标
堵住第13轮 UI-03:repair 步 TASK 引导 `../../output.md`,模型越界改根文件,本地目标缺失导致 `quality_failed` 停在 70。门禁判定保持,修复契约改为本地快照 + containment。
## 范围
- `internal/squad/repair_workspace.go` 与单测
- `EnsureQualityOrRepair` / `buildSubWorkspaces` snapshot 布局
- audit / remediation / CURRENT
## 非目标
- 不放宽必填章节;不把越界根文件当成功;不隐藏 `quality_failed`
- 不改默认步骤的 `../../` context 导航
- 不碰证据目录;不合 dev;不 rebuild Docker;不 E2E;不 push
## 步骤
1. [x] 从 `dev@8b1a531` 开分支并登记 mutex
2. [x] 快照契约 + containment + 测试
3. [x] 独立审查 fail-open:`runErr` / containment 不得提升;restore 失败硬返回;创建/删除计入 mutation
4. [x] gofmt / vet / `go test -short ./...` / `-race` squad+agent / settle-policy.test.mjs / `git diff --check`
5. [ ] 真实 UI-03(本轮不做)
## 验收标准
- [x] 仅 `runErr==nil` ∧ 无 containment ∧ `TrustedLocalDeliverable=true` 才覆盖根并重验
- [x] 越界(含创建/删除受保护父级)恢复后不提升,报告 FAIL
- [x] backend 失败/超时即使留下本地目标也不提升
- [x] restore 失败立即返回,可测策略能断言错误传播
- [ ] 现场 UI-03(未跑)
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-quality-repair-workspace-contract.md](../../audit/2026-09-13-document-revision-quality-repair-workspace-contract.md)
- Remediation: [../../remediation/2026-09-13-document-revision-quality-repair-workspace-contract.md](../../remediation/2026-09-13-document-revision-quality-repair-workspace-contract.md)
## 证据 / 备注
- mutex:`document-revision-quality-repair-workspace-contract`(新 mutex,不与现有 in_progress 冲突)
- 基线:`dev@8b1a531`
- 验证(fail-closed 追加):`gofmt` / `go vet ./...` / `go test -short ./...` / `go test -short -race ./internal/squad/ ./internal/agent/` / `node --test deploy/pi-agent/settle-policy.test.mjs` / `git diff --check` PASS
- 保护范围仅 `output.md` / `template.md` / `blackboard.json`;其它父级文件是剩余风险
- **未跑真实 UI-03,不得标 done**;**不得 merge / rebuild / E2E / push**
@@ -0,0 +1,68 @@
---
title: "项目 reviewer 同步到受控文档职责"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-reviewer-duty-sync
worktree: "-"
mutex: document-revision-reviewer-duty-sync
---
# 项目 reviewer 同步到受控文档职责
## 目标
堵住第17轮 UI-13a:UI-01 已把 USER_B 设为 reviewer,但 `doc_proj6145_intake` 矩阵为 viewer。项目创建时的 reviewer 必须成为后续每份受控文档的权威 `reviewerId`。
## 范围
- `project_members.document_duty` 迁移与成员 upsert
- 任务生成/账本创建解析项目职责;禁止硬编码 2/3
- 已有文档缺失/非成员占位的服务端自愈
- 前端立项 persist `document_duty` + 职责互斥
- audit / remediation / CURRENT
## 非目标
- 不 merge、不启停/重建容器、不跑/声称真实 UI E2E、不 push
- 不删不改证据目录
- 不向用户索要 token;不提交账号密码
## 步骤
1. [x] 从 `dev@639969f` 开分支并登记 mutex
2. [x] RED/GREEN:解析、自愈、成员 duty、前端映射
3. [x] `gofmt` / `go vet` / `go test -short` / 相关 `-race` / `npm test` / `npm run build`
4. [x] 原子提交
5. [x] 独立审查收紧(暂不合入):Heal 以 assigned 为权威;成员变更带 duty 并同步文档;缺 role 不降 owner;写权精确断言;迁移多 owner 确定回填;并发 upsert PG 用例;自愈失败不假成功
6. [x] 最后一轮:移出成员 sync + 前端刷新;空 assigned 只清失效 holder;显式 revoke 再 heal;账本创建失败不成功
7. [x] 补充审查:lock + 读旧/冲突 holder + 成员写 + 精确清槽同事务;提交后 heal;失败仍 `ERR_DUTY_SYNC`
8. [x] Heal 与成员写共用 `pg_advisory_xact_lock(project_id)`;解析与文档读写同事务;确定性并发 PG 证明旧 reviewer 不复活
## 验收标准
- [x] A=author、B=reviewer、C=none;第二文档继承;重复执行幂等;旧文档缺失回填
- [x] 服务端写操作仍按权限拒绝
- [x] 前端不按名字提升
- [ ] 现场 UI-13a(未跑)
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-reviewer-duty-sync.md](../../audit/2026-09-13-document-revision-reviewer-duty-sync.md)
- Remediation: [../../remediation/2026-09-13-document-revision-reviewer-duty-sync.md](../../remediation/2026-09-13-document-revision-reviewer-duty-sync.md)
- Checklist: [../checklists/2026-09-13-document-revision-reviewer-duty-sync.md](checklists/2026-09-13-document-revision-reviewer-duty-sync.md)
- Handoff: [../handoffs/2026-09-13-document-revision-reviewer-duty-sync.md](handoffs/2026-09-13-document-revision-reviewer-duty-sync.md)
## 证据 / 备注
- mutex:`document-revision-reviewer-duty-sync`(新 mutex,不占用已有 in_progress)
- 基线:`dev@639969f`
- 证据(只读):`.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui13a-reviewer-duty-sync-failure/`
- 验证(原子清槽轮):`gofmt`/`go vet` PASS;`go test -short ./...` PASS;相关 `-race` PASS;`npm test`/`build` PASS;隔离 PG PASS
- 原子性:成员写与 `HealProjectDocuments` 均先 `pg_advisory_xact_lock(project_id)`,再在同一事务内读成员/文档并更新;旧 heal 不能在转移提交后把 reviewer A 写回
- PG 集成已写 heal/空 assigned/多 owner 回填/并发 upsert;`-short` 或无 `TEST_DATABASE_URL` 时跳过
- 隔离跑法:`scripts/run-isolated-duty-sync-pg-tests.sh`(`TEST_DATABASE_URL` 或 `PG_ADMIN_URL` 建临时库)。拒绝 `agent_system_dev`
- 本轮已在已运行的 context Postgres 上 `CREATE DATABASE agent_duty_sync_itest_*`,串行跑通后 `DROP`;未 `env-service`、未动共享库数据
- **兼容**:旧二进制不读 `document_duty` 仍可运行;新代码在 assigned 为空时不臆造 reviewer。6145 的 B 仍是空 duty,须再走成员 API
- **未跑真实 UI-13a,不得标 done**;**不得 merge / 启停容器 / E2E / push**
@@ -0,0 +1,107 @@
---
title: "文档版本账本运行时整改"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-runtime-ui03
worktree: "-"
mutex: docgov
---
# 文档版本账本运行时整改
## 目标
消除 revision-state 404、重启丢账本、人工保存无效、overlay 无效;接通首轮/二轮可见确定性 change report;PATCH 权限→账本→投影顺序正确;停在 fix 分支待集成。
## 范围
- `internal/docrevision` PG hydrate/persist + bootstrap + `MaterializeAgentOutput`
- `internal/server` 授权、PATCH 顺序、orphan 不静默建账
- `internal/bizdev` 小队成功走 Materialize(禁止仅 OpenTemplate)
- `cmd/document-revision-backfill` gofmt
- `web` 保存链路与 overlay 三模式
- 工程测试 + 扩展 UI 验收计划(分栏)
## 非目标
- 不占 CURRENT 集成槽、不 `env-service rebuild`、不 push、不 merge `dev`
- 不伪造 PI 叙事 change report;不把 fallback 说成完整 PI 分析
- 不把 stub 输出写入最终用户验收报告
## 步骤
1. [x] 审计 / 整改 / 本任务 + CURRENT 认领
2. [x] 分支 `fix/document-revision-runtime`
3. [x] PG store + bootstrap + backfill
4. [x] Handler / agent / 前端
5. [x] 首轮报告 Materialize + PATCH 顺序 + 单测
6. [x] gofmt + UI checklist 扩展 + 文档证据
7. [x] 分层 commit,输出哈希与剩余 blocker(不 merge/push)
## 验收标准
- [x] 工程门禁与 UI 实战计划分栏
- [x] Round20 真实 UI **PASS**(见 [../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md](../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md))
- [x] 剩余开放:PI 叙事仍为 fallback;orphan 禁止假 V1(UI-16 验证已注册路径);不可用假数据掩盖
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-runtime-404.md](../../audit/2026-09-13-document-revision-runtime-404.md)
- Remediation: [../../remediation/2026-09-13-document-revision-runtime-remediation.md](../../remediation/2026-09-13-document-revision-runtime-remediation.md)
- Checklist/UI: [../checklists/2026-09-13-document-revision-runtime-ui-acceptance.md](checklists/2026-09-13-document-revision-runtime-ui-acceptance.md)
## 证据 / 备注
### 工程门禁(非 UI 验收)
```text
gofmt -l cmd/document-revision-backfill/main.go internal/docrevision/risk.go
go vet ./...
go test -short ./...
cd web && npm test && npm run build
```
本轮门禁(2026-09-13 10:11 UTC 独立复跑):`go vet ./...` PASS;`go test -short ./... -count=1` PASS(含 Materialize 首/二轮 change_report_id、PATCH 顺序、Materialize 失败透出、Assert 先职责后租约、SaveDocumentContent 审计、pending 事实源不越权、同步/异步待确认文案、完成活动仅 committed、pending 活动标明待确认、MarkProposalApplied 失败显式可重试);`web npm test` 199+27 PASS;`npm run build` PASS。使用 dev PostgreSQL(schema 28)执行 `TestPGPersistSurvivesNewServiceInstance` PASS,证明新 Service 实例可恢复账本。上述均为工程门禁,不能替代 UI 验收。
UI-01 目录同步补丁门禁(2026-09-13):`node --test adminUserDirectorySync.test.ts` 3 PASS;`web npm test` 219+27 PASS;`npm run build` PASS;`go vet ./...` + `go test -short ./...` PASS。未提交 `web/e2e/*` 与 `test-reports/assets/`。
UI-01/02 访问与成员落库门禁(2026-09-13):`go test ./internal/projectinstance -short` PASS;`TEST_DATABASE_URL=… go test ./internal/projectinstance -run TestPG_GoverningAccess` PASS;`TEST_DATABASE_URL=… go test ./internal/server -run TestChatProjectAccess` PASS;`go vet ./...` + `go test -short ./...`;`web npm test` + `npm run build`。未提交 e2e/assets。
复核补强(同日):
- A:`MaterializeAgentOutput` 错误写入 `TaskRunResult.Success=false` + `ErrorReason`,不再空白忽略
- B:cand 非空且 report invalid/unassessed 时禁止自动提交(候选标 needs_confirmation)
- C:`AssertHumanCanEdit` 先职责/生命周期再租约;受控投影改 `SaveDocumentContent` 保留 author_last_edited/审计;失败 `DOCUMENT_PROJECTION_FAILED` 可幂等重试
- D:ChangeReportPanel 完整展示风险条目/项目影响/文档影响建议/开放问题;加载失败显式错误
- E:revision-state 暴露 `pending_candidate_id` / `pending_change_report_id` / `pending_risk_level` + `can_decide_pending`;工具条「待确认报告」确认/拒绝调 decision API(不绕过确认)
- F:**高风险事实源门禁**:Materialize 后仅 committed 才 MarkDocumentContentUpdated / MarkProposalApplied;`needs_confirmation` 立即 `ProjectOutputMarkdown` 恢复 ledger head,候选仅留 immutable blob;decision=commit 投影后再 Mark;decision=reject 保持旧 head;投影失败显式错误
- G:**对话可见状态**:`TaskRunResult` 带 `pending_agent_candidate_id` / report / risk;`RequiresAuthorApproval` 可复用但用 `PendingProposal` vs `PendingAgentCandidateID` 区分 DocGov 提案;terminal=`pending_author_confirmation`;同步 coordinator 与异步 `CompletionSummary` 显示「文档候选已生成,待编制人确认」+ artifact 元数据;确认并投影后才「已完成」
- H:**活动与提案收口**:`RecordActivity(完成交付物)` 仅在 committed 投影成功后;pending 记「候选待编制人确认」;落盘/投影失败不记完成。`MarkProposalApplied` 失败返回显式错误(bizdev / `DOCUMENT_GOVERNANCE_FAILED`)可重试
- I:**阶段链防传播**:`ExecuteStage` 遇 `PendingAgentCandidateID` 立即停阶段(Success=false + 待确认文案),SubArtifacts 保留候选,**不**吸收 ExtractedData / PriorDoc;确认后由用户重新发起阶段
- J:**前端历史映射**:`pending_author_confirmation` 显式映射为气泡状态(不再默认 completed);刷新窗口显示「待编制人确认」标签
- K:**决策幂等收口**:`CommitAgentVersion` 已 committed 且 expected hashes 一致时返回当前 state(可继续投影/MarkProposalApplied);已 committed 禁止 reject。`MarkProposalApplied` 先写 DB 再改内存;已 applied 幂等(包内 Propose+Decide 验证)。decision 失败 hint 指向同决策重试;**不**暴露内存补种 helper(避免内存/DB 分叉)
- L:**Playwright 骨架**:`web` 增加 `@playwright/test` + `playwright.config.ts` + `e2e/document-revision-runtime.spec.ts`(`RUN_UI_ACCEPTANCE=1` 才跑;无 mock/route/API/DB fixture)
- M:**上传注册事实源**:发送前 `await registerUploadAttachments` → `POST /api/v1/freeform-documents`(`client_key` 幂等);失败 UI 显式错误且不发消息、不生成本地 `doc-upload` orphan;成功使用 `doc-free-*` 写入 deliverable/fileStore 并挂 toolbar
- N:**Auth 契约映射(UI-00 实战)**:Go `UserAccount` 为 snake_case;前端在 API 边界 `mapUserAccount`/`mapLoginResult`/`mapMeResult` 统一转 camelCase(login/me/admin users/create/role/status);`BootstrapAdminFromConfig` 的 `UpdateUserRole` 错误不再静默。详见 [../../audit/2026-09-13-auth-useraccount-snake-case-mapping.md](../../audit/2026-09-13-auth-useraccount-snake-case-mapping.md)
- O:**全局用户目录同步(UI-01 实战)**:管理员创建/角色/状态成功后必须经 `syncAdminUserDirectories` 调用父级 `onRefreshUsers`(禁止死 prop / 静默 catch);同浏览器立项候选可立即看到新账号。跨设备/清缓存缺口见 audit 残留风险,**不**下放 admin users API。详见 [../../audit/2026-09-13-admin-user-directory-sync-ui01.md](../../audit/2026-09-13-admin-user-directory-sync-ui01.md)
- P:**无 live 访问 + chat 项目门禁 + 立项成员落库(UI-01/02)**:`GetGoverningInstanceForAccess` 区分从未激活 vs completed/terminated;chat/chatStream 先 `RequireProjectAccess` 再 stage(SSE 拒绝不得先 200);`createProject` 后持久化非创建者成员。详见 [../../audit/2026-09-13-workflow-access-chat-members-ui01-02.md](../../audit/2026-09-13-workflow-access-chat-members-ui01-02.md)
- Q:**立项确认双击竞态**:`handleCreateProjectConfirm` 加同步 in-flight `useRef` 锁 + `createProjectBootstrapIdRef`(取代 state);`createProjectSubmitting`/`submitPhase` 驱动 Modal「立项中/同步成员中」、禁用确认与关闭;失败可串行幂等重试,成功清 bootstrap。证据:`createProjectSubmitGuard.test.ts`
- R:**UI-02 任务作用域契约**:`ResolveMessageScopeForTask` 三态(preactivation / live stage / closed→Err);handler 无 live 创建 202 非 409;E2E UI-02 以 `POST /api/v1/tasks/runs` 2xx 为硬门禁(409/连接异常 FAIL)。证据:`message_scope_test.go`、`TestCreateTaskRun_PreActivationAcceptedNot409`、`document-revision-runtime.spec.ts` UI-02
- S:**UI-03 客户端同步 + 任务幂等(本分支)**:`templateMatch` intake 标记优先;任务终态后 `postTaskDeliverableSync` merge `doc_proj*`;goose `00030` 放行 `pending_author_confirmation` + `idempotency_key` 部分唯一;`ClaimRun` 先占键再写 chat;FE reconnect 同 run 订阅。审计:[../../audit/2026-09-13-controlled-doc-client-sync-ui03.md](../../audit/2026-09-13-controlled-doc-client-sync-ui03.md)。门禁:`go test -short ./internal/taskrun ./internal/server`;`web npm test` 232+27;`npm run build`。**schema30 真实现卷迁移合入前独立验证**;真实 UI-03 待占槽重跑。
### 用户 UI 实战验收
Round20 **PASS**。见 [checklist](checklists/2026-09-13-document-revision-runtime-ui-acceptance.md) 与 [test-report](../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md)。项目 6159;UI-03 V2/r0;终态 V3/r2;post-restart 恢复最终正文 `A1-win-mu0gwiez`。
### Blockers
- **DOCREV-RT-PI-NARRATIVE**(仍开放):真实 PI 业务叙事摘要/风险解释未替代确定性 fallback;Round20 已可见 fallback 字段,不得宣称为完整 PI
- **DOCREV-RT-UPLOAD-ORPHAN**(约束仍在,UI-16 PASS):仅 IndexedDB、无服务端正文 → 禁止假 V1
- **DOCREV-RT-UI-E2E**:**PASS**(Round20)
- **DOCREV-RT-SCHEMA30-VOLUME**:goose 00030 对既有重复卷的迁移仍属合入前独立验证残留
- **DOCREV-RT-USER-DIR-CROSS-DEVICE**:跨设备/新浏览器可能仍缺成员候选(本轮同浏览器未暴露)
### Commits(历史)
- `7ea686e` … `ec8a45a`(见 git log);本轮追加见会话结束提交号
@@ -0,0 +1,55 @@
---
title: "UI-11 点名优先路由 + PATCH 请求级释租"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-second-doc-routing-lease
worktree: "-"
mutex: document-revision-second-doc-routing-lease
---
# UI-11 点名优先路由 + PATCH 请求级释租
## 目标
第十轮 UI-11 首错:否定句「需求」压过「系统设计输入」,且 PATCH 残留 human lease 使小队 DOC_BUSY。点名优先 + 请求级 defer 释租 + E2E 202 门闩。不得将本任务标 `done`。
## 范围
- `web/src/engine/templateMatch.ts` + 单测
- `internal/server/document_revision_handlers.go` + `document_revision_patch_order_test.go`
- `web/e2e/document-revision-runtime.spec.ts` UI-11 waiter
- 文档:audit / remediation / CURRENT
## 非目标
- 不改 E2E prompt;不改 `SaveDocumentContent` 内部释租
- 不触碰/提交 `.doc/test-reports/assets`;不操作容器;本轮不重跑 E2E
- 不改 FEATURE-MATRIX;不合 `dev`;不 push
## 步骤
1. [x] 认领 CURRENT(mutex `document-revision-second-doc-routing-lease`)
2. [x] 点名优先 +「系统设计输入」别名 + 单测
3. [x] PATCH 已授权后 defer 释租(成功 / 409 / 投影失败)+ 服务端测试
4. [x] UI-11 send 前 `tasks/runs` waiter,断言 202 后再 wait completion
5. [ ] 占槽后真实 UI 重跑(本轮不做)
## 验收标准
- [x] UI-11 原文 / 混合句 → `prelim_design`;当前文档钉住、UI-05 pin、首轮摸底仍 intake
- [x] PATCH 后无 human lease,squad 可获取
- [x] UI-11 非 202 即 fail;`requireInflight` 拒绝同步 busy
- [ ] 真实 UI-11 PASS 后才可将本任务标 `done`
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-second-doc-routing-lease.md](../../audit/2026-09-13-document-revision-second-doc-routing-lease.md)
- Remediation: [../../remediation/2026-09-13-document-revision-second-doc-routing-lease.md](../../remediation/2026-09-13-document-revision-second-doc-routing-lease.md)
- Evidence: [../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui11-second-doc-routing-human-lease-failure](../../test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui11-second-doc-routing-human-lease-failure)
## 证据 / 备注
- Prompt 别名「系统设计输入」≠ 卡片标题。真实 UI / 模板 / squad 标题均为「系统初步设计方案」。
- UI-11 打开第二份文档必须用已注册 `doc_proj{n}_prelim_design`(`data-doc-id`),禁止 `/设计输入|系统设计/`:既匹配不到真实标题,也容易误命中其他设计类文案或同标题模板槽。
@@ -0,0 +1,57 @@
---
title: "任务 SSE 幂等 + 质量门禁自污染与 auto_repair 产品契约"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-sse-idempotency
worktree: "-"
mutex: docgov
---
# 任务 SSE 幂等 + 质量门禁自污染与 auto_repair 产品契约
## 目标
1. 同 turn 在 SSE 断线重连时返回既有 run 202、不重复聊天、不误 409 DOC_BUSY;长任务 events SSE 不被 120s WriteTimeout 切断;前端 EOF 按 after_seq 重订阅同一 run。
2. 受控文档小队任务质量门禁:**服务端启用修复预算**;否定性自检引用不误报;`quality_failed` UI 保持失败且不激活未过门禁稿。
## 范围
- SSE/幂等:`task_run_handlers`、SSE write deadline、FE subscribe 重连
- 质量 A–D:`repairBudgetForSquadTask`、`quality_gate` 语境检测、prompt 去原词、Materialize/`TerminalStatus`、FE `quality_failed`、单测
- 证据:`data/dev/workspaces/bizdev/intake_1789308825666278807`(output.md:204;events seq10)
## 非目标
- 不改全局 HTTP 超时为「无超时」;不 rebuild Docker;不 push/merge;不删证据 assets
## 步骤
1. [x] 从 `dev` 开 `fix/document-revision-sse-idempotency`;CURRENT 认领
2. [x] 幂等先查 + 属主校验
3. [x] SSE write deadline + heartbeat
4. [x] FE subscribe 重连
5. [x] A 服务端修复预算产品契约
6. [x] B 门禁否定/元语境 + prompt 去原词
7. [x] C quality_failed UI/Materialize 契约
8. [x] D 真实问题单测 + 门禁回归
9. [x] E 质量失败在 SetDocumentWorkDir/Materialize 前短路(无正式投影副作用)
10. [x] 豁免收窄为同行 meta+否定紧邻/引号;handlers 阶段请求字段边界单测锁定
11. [x] ExecuteStage 质量失败停链:不吸收事实、不追加 PriorDoc
12. [x] 小队 AutoRepair/Success 语义恢复;受控修复仅在 bizdev docRec 与 HTTP 边界强制
13. [x] 补强:quality projection / 阶段停链 / 非受控不强制 repair 单测;全量 Go+Web 门禁 PASS
## 验收标准
- [x] 同 turn + 活跃租约 → 同 run 202、仅一对消息;不同 turn → 仍 409
- [x] SSE 心跳/写期限可测;FE EOF/after_seq 单测
- [x] TaskKey 任务 AutoRepair=false 仍有 DefaultMaxRepairRounds;L204 自检引用不误报;真敷衍仍 FAIL
- [x] quality_failed ≠ completed;Materialize 跳过未过门禁稿
- [x] `go test -short ./...`、`go vet`、`npm test`/`build`、`git diff --check`
## 相关链接
- Audit SSE: [../../audit/2026-09-13-document-revision-sse-idempotency.md](../../audit/2026-09-13-document-revision-sse-idempotency.md)
- Audit 质量: [../../audit/2026-09-13-document-revision-quality-gate-self-pollution.md](../../audit/2026-09-13-document-revision-quality-gate-self-pollution.md)
- Evidence: [../../test-reports/assets/2026-09-13-document-revision-runtime-ui/](../../test-reports/assets/2026-09-13-document-revision-runtime-ui/)
@@ -0,0 +1,49 @@
---
title: "DOCREV Wave 0:契约冻结"
status: done
created: 2026-09-13
updated: 2026-09-13
owner: Cursor
branch: feature/document-revision-management
worktree: "-"
mutex: docgov
---
# DOCREV Wave 0:契约冻结
## 目标
冻结 Version/Revision/Snapshot/Candidate/Report 契约、黄金 diff fixture、前后端类型与先红契约测试。
## 范围
- ADR 决策门落盘
- `internal/docrevision` 契约类型、schema、testdata、契约测试
- `web/src/features/documentRevision/types.ts`
## 非目标
- 不写生产写路径;不跑容器重建;不合入 `dev`
## 步骤
1. [ ] 写入 ADR 与决策门
2. [ ] 实现契约类型、change-report schema、黄金 fixture
3. [ ] 契约测试先红后绿(随 Wave 1 内核实现变绿)
4. [ ] 前端 types 对齐
## 验收标准
- [ ] ADR 已接受且与实施计划冻结表一致
- [ ] 黄金 diff 覆盖中文段落/表格/列表/Mermaid/移动块/no-op
- [ ] 契约测试可独立运行
## 相关链接
- ADR: `../../adr/2026-09-13-document-version-boundary.md`
- Design: `../../system-design/document-revision-management.md`
- Remediation: `../../remediation/2026-09-13-document-revision-management-implementation-plan.md`
## 证据 / 备注
实施中。
@@ -0,0 +1,45 @@
---
title: "DOCREV Wave 1–6:ledger 实施"
status: done
created: 2026-09-13
updated: 2026-09-13
owner: Cursor
branch: feature/document-revision-management
worktree: "-"
mutex: docgov
---
# DOCREV Wave 1–6:ledger 实施
## 目标
在 feature 分支交付快照内核、人工 PATCH、Agent candidate、比较 UI、通知与自由文档兼容。
## 范围
- Goose 00028、`internal/docrevision`、HTTP API、前端工具条、bizdev/freedoc/notification 接线
## 非目标
- 本任务不占集成槽位合入 `dev`;真实 PI 全链路补录另开集成窗口
## 步骤
1. [x] Wave 0 契约与 ADR
2. [x] Wave 1 迁移与内核
3. [x] Wave 2 人工编辑 API/UI
4. [x] Wave 3 Agent candidate/commit
5. [x] Wave 4 比较 UI
6. [x] Wave 5 通知
7. [x] Wave 6 自由文档兼容
## 验收标准
- [x] `go test -short ./internal/docrevision/...` PASS
- [x] 相关包回归 PASS
- [ ] 真实 PI + Playwright 双用户(集成槽位)
## 相关链接
- Test report: `../../test-reports/2026-09-13-document-revision-management-test-report.md`
- ADR: `../../adr/2026-09-13-document-version-boundary.md`
@@ -0,0 +1,52 @@
---
title: "受控文档分类导航契约"
status: done
created: 2026-09-13
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-workflow-category-navigation
worktree: "-"
mutex: document-revision-workflow-category-navigation
---
# 受控文档分类导航契约
## 目标
堵住第15轮 UI-13a:UI-11 后停在「我的私密」,未切「流程受控」就展开文档菜单,找不到 `doc_proj*_intake`。只改验收导航,不降真实性。
## 范围
- `web/src/lib/workflowCategoryNavigation.ts` 与单测
- `web/e2e/document-revision-runtime.spec.ts` 三个 opener
- audit / remediation / CURRENT
## 非目标
- 不改产品分类状态机;不用 API/内存规避 UI
- 不碰证据;不合 dest;不启停容器;不 E2E;不 push
## 步骤
1. [x] 从 `dev@48a4dcb` 开分支并登记 mutex
2. [x] 导航谓词 + private→workflow / 缺失 fail-closed 测试
3. [x] 三个 opener 先真实切分类
4. [x] `npm test` + `npm run build` 并原子提交
## 验收标准
- [x] 从私密分类可恢复到精确受控文档
- [x] 目标缺失 fail-closed
- [ ] 现场 UI-13a(未跑)
## 相关链接
- Audit: [../../audit/2026-09-13-document-revision-workflow-category-navigation.md](../../audit/2026-09-13-document-revision-workflow-category-navigation.md)
- Remediation: [../../remediation/2026-09-13-document-revision-workflow-category-navigation.md](../../remediation/2026-09-13-document-revision-workflow-category-navigation.md)
## 证据 / 备注
- mutex:`document-revision-workflow-category-navigation`(新 mutex)
- 基线:`dev@48a4dcb`
- 验证:`npx tsx --test src/lib/workflowCategoryNavigation.test.ts` PASS;`cd web && npm test` PASS(309 + 29);`npm run build` PASS
- **未跑真实 UI-13a,不得标 done**;**不得 merge / 启停容器 / E2E / push**
@@ -0,0 +1,62 @@
---
title: "Herdr Agent 角色、备援与自动审批治理"
status: done
created: 2026-09-13
updated: 2026-09-13
owner: Codex
branch: feature/herdr-agent-governance
worktree: .worktrees/feature-herdr-agent-governance
mutex: ops-governance
---
# Herdr Agent 角色、备援与自动审批治理
## 目标
建立可审计的 Herdr Agent 能力分工、额度保护、故障接管和免人工工具审批入口,并明确 Herdr PI 与产品容器 PI Agent Runner 不是同一执行体。
## 范围
- 持久化主责、备份顺序、任务泳道和接管条件。
- 为已安装的 Claude、Codex、Cursor、Antigravity、PI、Kimi、Cline CLI 提供统一启动入口。
- 自动审批仍受仓库、worktree、mutex、集成槽和破坏性操作红线约束。
- 提供保守的自动派发:只向同工作目录、空闲的规范命名实例投递;明确失败时降级,超时停止重复投递。
## 非目标
- 不重启或接管当前正在执行 DOCREV/CHAT/INTENT 的实例。
- 不修改容器内 PI Agent Runner 的模型、凭证、配置或运行状态。
- 不操作共享 Docker 或推送远端。
- 不将删库、强推、密钥读取/外传等不可逆动作纳入无条件许可。
## 步骤
1. [x] 盘点 Herdr 0.9.0、在线实例、集成状态、CLI 版本和审批参数。
2. [x] 写入项目级角色与备援 SSOT,并在 AGENTS/PROJECT 建立入口。
3. [x] 实现统一自动审批启动脚本和保守派发脚本。
4. [x] 完成静态检查、脚本 dry-run 与路由验收。
5. [x] 更新任务状态、提交 feature 分支并合入 `dev`。
## 验收标准
- [x] 每种当前可调用 CLI 都有明确角色、主备关系和自动审批启动参数。
- [x] Codex/Claude 的高成本推理与 Cursor/Flash 模型的实施负载分离。
- [x] 明确禁止因 timeout/unknown 状态盲目重复派发。
- [x] Herdr PI 与产品容器 PI 在名称、职责和动作上不会混淆。
- [x] 启动和派发脚本通过 `bash -n`,dry-run 不启动实例、不执行任务。
## 相关链接
- Agent roster: [../../ops/2026-09-13-herdr-agent-roster.md](../../ops/2026-09-13-herdr-agent-roster.md)
- Handoff: [../../ops/handoffs/2026-09-13-herdr-agent-governance.md](../../ops/handoffs/2026-09-13-herdr-agent-governance.md)
- Test report: 本任务文“证据 / 备注”
## 证据 / 备注
- `herdr status`: client/server 0.9.0,protocol 22,兼容。
- `herdr integration status`: Claude/Codex/Cursor/Antigravity/PI/Kimi integration current;Cline CLI 3.0.61 可调用。
- CLI 版本:Claude 2.1.270、Codex 0.154.0、Cursor 2026.09.10、Antigravity 1.2.2、PI 0.85.1、Kimi 0.41.0、Cline 3.0.61。
- `bash -n scripts/herdr-agent-start.sh scripts/herdr-agent-dispatch.sh`: PASS。
- 七种启动 profile dry-run:PASS;未启动或重启实例。
- 七条 lane `--explain`:PASS。
- 非法标准名:exit 2;无在线标准实例:逐级跳过并 exit 69,未误投任务。
@@ -0,0 +1,37 @@
---
title: "受控文档正文修复真实 UI 实战验收"
status: done
owner: verifier_antigravity
branch: fix/controlled-content-ui-acceptance
mutex: document-content-ui-acceptance
created: 2026-09-14
updated: 2026-09-14
---
# 目标
仅通过真实浏览器页面操作,验证项目 143 历史文档恢复,并以真实产品 PI Agent Runner / 智能体小队完成新项目文档全链路。API、数据库和 stub 不能替代 UI 验收结果。
# 范围
- 项目 143:登录、打开正文、30 秒空闲、双击编辑保存、三种变更视图、刷新与重新登录持久化。(clean-run3 已全部 PASS)
- 新项目:从 UI 创建,真实对话触发工作流/小队生成文档,再次对话触发修改;页面查看助手回复、文档正文、版本账本、影响、风险、开放问题。(full-chain-final UI-00..UI-16 全部 18 项 PASS)
- 冲突与权限:双页面并发编辑、审核人/无关用户访问边界均通过;宿主容器重启后 post-restart 复验通过。
- Ubuntu Server 浏览器:统一使用 Playwright 官方 `mcr.microsoft.com/playwright:v1.63.0-noble` 容器。
# 红线
- 不用 API 直建用户、项目、会话、文档或测试数据。
- 不注入/伪造 assistant 消息、文档、账本、change report 或通过结果。
- 所有通过项必须有页面可见证据;失败如实记录为 FAIL。
- 测试账号凭证只读本机既有 secrets/phase 文件,不输出、不提交。
# 阶段判据与进展
- [x] 项目 143 页面正文可见且无 content/revision 404(UI-143-01..06 全 PASS,产物在 `clean-run3/`)。
- [x] 人工编辑、视图切换、刷新/重登持久化通过(项目 143 回归)。
- [x] 新项目真实 PI/小队链路及文档影响风险报告页面可见(UI-00..05b 通过,首轮 toolbar V2/r0,UI-05 pending 保持 V2,UI-05a 确认后晋升 V3,UI-05b 拒绝后保持 V3)。
- [x] UI-06 硬刷新正文保留通过(合入 08bf615 修复后 1.1 秒内秒级通过)。
- [x] 并发、权限、重启前凭据生成有真实 UI 判定(UI-12/13a/13b/15/16 全 PASS)。
- [x] 容器重启后恢复核验通过(UI-15 post-restart 2.8 秒秒级通过,V3/r2 与标记完好呈现,目标 404=0)。
- [x] 测试报告落盘至 `.doc/test-reports/2026-09-14-controlled-content-ui-acceptance.md`。
@@ -0,0 +1,42 @@
---
title: "运行时 UI 证据计数与 race 秒数纠错"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/document-revision-evidence-count
worktree: "-"
mutex: document-revision-evidence-count
---
# 运行时 UI 证据计数与 race 秒数纠错
## 目标
把顶层截图写成 21(20 main/pre + 1 post),并把全包 race 写成 `FAIL 109.279s`,不与 21 条 results 混淆。
## 范围
- 最终报告、UI checklist、CURRENT
- 本短任务登记后即关闭
## 非目标
- 不改业务代码、assets、容器,不 push
- 不改 UI PASS 判定,不提交 secrets
## 步骤
1. [x] 从 `dev@5d79da6` 开 `fix/document-revision-evidence-count` 并登记
2. [x] 截图 21 = 20 main/pre + 1 post;race `FAIL 109.279s`
3. [x] `git diff --check`;只提交文档
## 验收标准
- [x] 报告/清单不再把 20 张截图与 21 条 JSON 混写
- [x] 全包 race 不再写成 `ok ... 110.723s`
- [x] assets 未 stage
## 相关链接
- Test report: [../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md](../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md)
@@ -0,0 +1,45 @@
---
title: "文档账本运行时 UI 最终报告收口"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Cursor-Auto
branch: feature/document-revision-runtime-ui-final-report
worktree: "-"
mutex: document-revision-runtime-ui
---
# 文档账本运行时 UI 最终报告收口
## 目标
在 `dev@b258ab8` 上只写文档,把 Round20 真实 UI 验收收口为 test-report,并释放运行时集成槽。
## 范围
- `.doc/test-reports/2026-09-14-document-revision-runtime-ui-test-report.md`
- management report、UI checklist、runtime / PG-id 文档、FEATURE-MATRIX、gap-matrix、CURRENT
## 非目标
- 不改业务代码、不跑容器、不 push、不提交 assets
- 不引用 `phase-secrets.local.json` 内容
- 不把全仓标 `production_ready=yes`
## 步骤
1. [x] 从 `dev@b258ab8` 开 `feature/document-revision-runtime-ui-final-report`
2. [x] 按 results JSON 写 Input/Actual/Verdict/Duration
3. [x] 同步任务文档并释放集成槽
4. [x] 原子 docs commit
## 验收标准
- [x] 运行时范围 PASS/done
- [x] `production_ready` 仍为 no;`CHAT-INTENT` 保留
- [x] 历史失败资产未改删
## 相关链接
- Test report: [../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md](../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md)
- Checklist: [../checklists/2026-09-13-document-revision-runtime-ui-acceptance.md](checklists/2026-09-13-document-revision-runtime-ui-acceptance.md)
@@ -0,0 +1,47 @@
---
title: "文档账本运行时会话关闭归档"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Cursor-Auto
branch: feature/document-revision-session-close
worktree: "-"
mutex: document-revision-session-close
---
# 文档账本运行时会话关闭归档
## 目标
按 AGENTS 会话关闭清单:把已 done 的 document-revision short-term / checklist / handoff 迁入 archive,并修好相对链接。
## 范围
- `.doc/ops/short-term/*document-revision*`
- 4 个专项 checklist + runtime-ui-acceptance
- 4 个 document-revision handoff
- `.doc` 内因移动失效的相对链接
- 本任务完成后一并归档
## 非目标
- 不改业务代码、assets、容器,不 push
- 不改 `production_ready=no`、fallback / race 结论
- 不改非 document-revision 任务
## 步骤
1. [x] 从 `dev@4bf8b6d` 开 `feature/document-revision-session-close` 并登记
2. [x] short-term / checklist / handoff 标 done 后 `git mv` 入 archive
3. [x] 扫描并重写失效相对链接;`git diff --check`
## 验收标准
- [x] CURRENT 焦点仅非 DOCREV;槽位 idle
- [x] 本次移动文件的相对 Markdown 链接可解析
- [x] assets 未 stage
## 相关链接
- Test report: [../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md](../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md)
- CURRENT: [CURRENT](../../ops/CURRENT.md)
@@ -0,0 +1,61 @@
---
title: "可靠事件与 FAV 集成 M2–M3"
status: cancelled
created: 2026-09-14
updated: 2026-09-15
owner: TBD
branch: refactor/durable-event-fav-integration
worktree: "-"
mutex: event-delivery
---
# 可靠事件与 FAV 集成 M2–M3
> 2026-09-15:本任务把 durable event 与未审计 FAV 绑成同一关闭条件,且步骤状态已与 U8/U9 后续交付漂移。任务停止使用;持久事件由 [Track E](../../ops/short-term/2026-09-15-durable-event-track-e.md) 接续,FAV subscriber 继续走独立审计,不把本条已勾选步骤视为生产 dispatcher 验收。
## 目标
完成 U5–U9,使投影、通知、RunManifest 和最终成果在多 worker、崩溃、重放和 workspace 清理后仍可恢复且不越权。
## 范围
- opaque workspace capability、lease 和 fencing。
- durable outbox、逐消费者 delivery/inbox、重试和 dead letter。
- 审计并集成 `feature/final-artifact-vault` 的适用实现。
- taskrun finalize、RunManifest 持久化、FAV coverage 和迁移 corpus。
## 非目标
- 不盲目整分支 cherry-pick FAV。
- 不启用跨授权图的 vault 读取。
- 不自动销毁 dev/main 数据。
- 不执行 U10–U12。
## 步骤
1. [x] 读取 M1 test report,确认继续 M2 的 go/no-go 已通过。
2. [x] 重新分配 Goose 序号并审计 U6/FAV schema 组合。
3. [x] 实现 U5–U6,多 app/worker 和 crash matrix 先通过。
4. [x] 逐文件审计 FAV 分支,按 U7 边界迁移合格实现。
5. [ ] 实现 U8,收敛 taskrun terminal finalize 与 RunManifest。
6. [ ] 实现 U9 的 checkpoint backfill、corpus、quarantine 和 cleanup gates。
7. [ ] 完成真实 PI、浏览器、workspace 清理、scratch recovery 和 rebuild 演练。
## 验收标准
- [ ] 多订阅者有独立 delivery,失败者不阻塞其他订阅者。
- [ ] worker crash/retry/replay 不造成重复可见副作用。
- [ ] workspace 清空后,verified 最终文档/回复仍可定位并校验。
- [ ] 授权图缺失、跨项目、tombstone、坏 digest 和 stale fencing 全部拒绝。
- [ ] clean/oldest/previous/hazard/import/reload/rollback/artifact recovery 八轨有独立证据。
- [ ] 任何数据销毁仍需完整备份、corpus、FAV coverage 和用户批准。
## 相关链接
- Checklist: [../checklists/2026-09-14-module-decoupling-refactor-acceptance.md](../../ops/checklists/2026-09-14-module-decoupling-refactor-acceptance.md)
- Handoff: 实施时创建
- Test report: 实施后按 M2、M3 分开创建
- Plan: [../../remediation/2026-09-14-module-decoupling-refactor-plan.md](../../remediation/2026-09-14-module-decoupling-refactor-plan.md)
## 证据 / 备注
本任务依赖 M1,不得与 M1 同时修改 docgov/docrevision 的事务主链。
@@ -0,0 +1,81 @@
---
title: "治理鉴权升级:职责-动作严格对应 + 未激活拦截 + 关闭创建直通"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: implementer_cursor
branch: fix/governance-action-level-authz
worktree: ".worktrees/fix-governance-action-level-authz"
mutex: workflow
---
# 治理鉴权升级:职责-动作严格对应 + 未激活拦截 + 关闭创建直通
## 目标
采纳 [MVP 治理规则评审](../../ops/research/2026-09-14-mvp-governance-rules-review.md) 修正版原则:**允许零治理创建与普通对话;禁止零治理激活与执行文档任务(审批流动作)**。文档动作按职责鉴权,创建者不隐式越权,`initial_workflow_key` 不再直通 active。
## 决策记录(已定,不再开放)
- **A(用户拍板 2026-09-14)**:`DutyModeNone` 文档 = 不走人工审批但**可生成**(创建者触发,维持已实施 D4);「不可发起任务」收窄为不可发起**审批流动作**(submit/review/approve)。
- **B(按评审建议采纳)**:pre-activation 保留 202 契约——`POST /tasks/runs` 仍 202 创建 run,但置 blocked 状态、不启动小队、不取文档租约,chat 流内返回自然语言治理提示。
- **C(按评审建议采纳)**:移除 `isCreator` 对 full 文档的隐式全通行;`view` 豁免阶段收窄(项目访问成员可查看);创建者保留:配置成员/职责 + none 文档生成触发。
- **D(按评审建议采纳)**:关闭 `initial_workflow_key` 直通 active(仅挂载目录);后端/前端 types 字段废弃标注;E2E legacy 用例语义更新;dev 库 81 个 planning+with_wf 异态项目**只审计分类,不改库**。
## 采纳版职责-动作矩阵
| 动作 | full 文档 | none 文档 | 未激活(gov==nil) |
|------|-----------|-----------|--------------------|
| view | 项目访问成员 | 项目访问成员 | 项目访问成员 |
| run(首次生成/重生成) | 编制负责人 | **创建者**(无审批链) | 202 + blocked 状态,chat 内提示,不启小队/不取租约 |
| edit/submit(编辑/提交审核) | 编制负责人 | 拒绝(无审批链) | 拒绝 |
| review(审核/退回) | 审核负责人 | 拒绝 | 拒绝 |
| approve(批准/拒绝批准) | 批准负责人 | 拒绝 | 拒绝 |
| 配置成员/文档职责 | 创建者 | 创建者 | 创建者(planning 期配置正是本阶段语义) |
退回后形成「待编制人修订」;审核人不得直接启动重编(由编制负责人发起修订)。
## 范围
- `internal/projectinstance/document_access.go`(动作-职责映射、creator 例外移除、gov==nil 未激活拦截)
- `internal/projectinstance/stage_access.go`(view 豁免语义;`docTaskDutyForUser` 拆分为按职责判定)
- `internal/projectinstance/message_scope.go` + taskrun/chat handler(blocked 状态 + 自然语言提示)
- `internal/projectworkflow/service.go`(关闭 `initial_workflow_key` 直通)+ `types.go` 前后端字段废弃
- 受影响单测重写(`access_governing_pg_test.go` creator 断言、`TestCreateTaskRun_PreActivationAcceptedNot409` 语义细化)与 E2E legacy 用例
## 非目标
- 不改三权互斥与 DutyMode 校验(Wave 2 已完成)
- 不做运行中动态补配职责 / 按文档单独激活(冻结语义维持,激活页提示「留空文档不参与、不可补配」)
- 不做成员 role 枚举演进(MVP 维持创建者=项目管理员;role 演进留 backlog)
- 不改 dev 库存量数据(仅审计)
## 步骤
1. [x] 评审落盘 + 决策 A–D 收敛 + 本任务登记(Wave 5 已合入本地 `dev@19f6df5`,G0 已开工)
2. [x] G1 后端:`CheckDocTaskAccess` 动作-职责映射 + creator 例外移除(保留 none 生成触发)+ gov==nil 未激活拦截(202 契约保留);重写受影响单测
3. [x] G2 关闭 `initial_workflow_key` 直通 + 前后端字段废弃 + E2E legacy 用例更新
4. [x] G3 前端:chat 治理拦截自然语言提示、按钮级职责禁用、激活确认页冻结提示补强
5. [x] G4 dev 库 planning+with_wf 异态审计分类(只读报告,现测 83 条均为测试夹具)
6. [x] G5 集成验证 + 测试报告归档(新项目全链路:零治理创建→对话→配置→激活→职责动作负例)
## 验收标准
- [x] full 文档 API 负例:author 不可 review/approve;reviewer 不可 run/edit/submit;approver 不可 run/edit/review;creator 不可任一审批动作(view 除外)
- [x] none 文档:创建者可触发生成;submit/review/approve 全拒
- [x] 未激活项目编制类输入:消息正常显示、run 202 且 blocked、无小队/租约、chat 内明确治理提示文案(页面用「请编制用户初始需求收集表」命中任务 API)
- [x] `POST /projects` 带 `initial_workflow_key`:不再置 active,工作流目录仍自动挂载
- [x] `go vet ./...`、`go test -short ./...`、`cd web && npm test && npm run build` 全绿
- [x] 异态审计报告与测试报告归档并回链
## 相关链接
- Research(评审与决策记录): [2026-09-14-mvp-governance-rules-review.md](../../ops/research/2026-09-14-mvp-governance-rules-review.md)
- 前序 Remediation(已实施 Wave 1–4): [2026-09-14-workflow-plan-409-frozen-and-optional-duties-remediation.md](../../remediation/2026-09-14-workflow-plan-409-frozen-and-optional-duties-remediation.md)
- 202 契约来源: [2026-09-13-workflow-access-chat-members-ui01-02.md](../../audit/2026-09-13-workflow-access-chat-members-ui01-02.md)
## 证据 / 备注
- Wave 5 已合入本地 `dev@19f6df5`;本任务 worktree 已从该 `dev` 创建,mutex `workflow` 进入 `in_progress`。
- G4 只读复测:141 active / 209 planning;**83** 个 planning 带非空 `active_workflow_key`,全部为 `PROJ_MGR_*`/`TEST_PROJ_*` 夹具。见 [audit](../../audit/2026-09-14-planning-with-workflow-key-anomaly.md)。
- G5 验收:[2026-09-14-governance-action-level-authz-test-report.md](../../test-reports/2026-09-14-governance-action-level-authz-test-report.md)。
@@ -0,0 +1,55 @@
---
title: "模块解耦架构与重构计划修订"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Codex
branch: feature/module-decoupling-remediation
worktree: .worktrees/feature/module-decoupling-remediation
mutex: architecture-docs
---
# 模块解耦架构与重构计划修订
## 目标
把模块解耦方案修订为可以分段实施、验证和回滚的架构与重构计划,补齐事务、并发互斥、授权、可靠事件、FAV、数据迁移和真实页面验收。
## 范围
- 修订模块化单体架构设计与 ADR。
- 新增详细整改与重构计划。
- 建立首个文档可靠性纵向试点及后续里程碑任务。
- 更新 CURRENT、FEATURE-MATRIX 和相关索引。
## 非目标
- 本任务不修改业务代码、数据库迁移或部署配置。
- 本任务不合并 `feature/final-artifact-vault`,只定义其集成依赖和边界。
- 本任务不执行共享容器验证,也不占用集成槽位。
## 步骤
1. [x] 对照当前源码、已接受 ADR、FAV 分支和外部权威资料复核原方案。
2. [x] 修订架构设计与 ADR。
3. [x] 编写详细整改计划、里程碑任务和验收清单。
4. [x] 更新协作 SSOT 与索引并完成文档一致性检查。
## 验收标准
- [x] 计划明确事务所有权、锁顺序、事件投递语义、授权主体和恢复边界。
- [x] 首个独立交付边界直接覆盖受控文档刷新、重启、投影缺失和授权负例。
- [x] 每个后续里程碑有依赖、文件范围、并发风险、测试矩阵、停走门和回滚边界。
- [x] FAV、迁移语料库和完整备份的职责不重叠,工作区不再承担最终成果事实源。
## 相关链接
- Checklist: [../../ops/checklists/2026-09-14-module-decoupling-refactor-acceptance.md](../../ops/checklists/2026-09-14-module-decoupling-refactor-acceptance.md)
- Handoff: 不需要;实现阶段使用两个 planned short-term 接续
- Test report: 本任务仅产出计划,不生成业务验收报告
## 证据 / 备注
- 原方案位于主工作区未跟踪文件;本任务在独立 worktree 重建并修订,未覆盖原工作区。
- `feature/final-artifact-vault` 已有实现与测试证据,但尚未合入本任务基线,实施前必须重新审计分支差异。
- 文档校验:本地相对链接、R/KTD/U ID 唯一性、Mermaid fence 和 `git diff --check` 均通过。
@@ -0,0 +1,48 @@
---
title: "项目 143 受控文档正文 404 现场诊断"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Codex
branch: fix/project143-controlled-content-404-diagnosis
worktree: "-"
mutex: docgov-content-diagnosis
---
# 项目 143 受控文档正文 404 现场诊断
## 目标
定位已登录用户打开项目 143 时 `doc_proj143_intake` 正文接口返回 404 的当前根因,并形成可复核的整改边界。
## 范围
- 对照当前 dev 源码、数据库、工作区文件与既有真实 UI 证据。
- 分析服务端 404 条件、前端 hydration 与重复请求条件。
- 形成审计记录和整改建议;本轮不修改业务代码。
## 非目标
- 不恢复或覆盖用户文档数据。
- 不以 API 探针或伪造数据替代后续真实浏览器验收。
- 不继续纯软件项目自举方案实施。
## 步骤
1. [x] 核对项目 143 的项目、文档记录、账本与工作区事实源。
2. [x] 核对正文 handler 的 404 分支和前端 hydration 重试条件。
3. [x] 记录根因、影响范围、整改顺序和验收要求。
## 验收标准
- [x] 404 的直接原因与数据/代码证据相互印证。
- [x] 明确区分历史项目数据缺口、当前能力回归和前端错误放大。
- [x] 不宣称未执行的浏览器或真实 PI 结果。
## 相关链接
- Audit: [../../audit/2026-09-14-project143-controlled-content-404.md](../../audit/2026-09-14-project143-controlled-content-404.md)
## 证据 / 备注
结论:文件存在;raw/canonical 哈希因 5 处 Markdown 双空格硬换行产生 10-byte 差异。该空格具有渲染语义,须保全原文修复。详见 Audit 与 Remediation。
@@ -0,0 +1,51 @@
---
title: "纯软件项目自举工作流方案"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Codex
branch: feature/software-project-bootstrap-plan
worktree: "-"
mutex: workflow-design
---
# 纯软件项目自举工作流方案
## 目标
基于当前 Agent-System 的真实能力,设计一套可创建、可配置、可冻结、可执行、可验收的纯软件项目自举工作流,并明确复用智能体小队、文档模板、权限与阶段门禁的实施路线。
## 范围
- 当前项目创建、工作流、阶段、文档、智能体小队和 UI 能力盘点
- 纯软件项目的创建选项、阶段模型、交付物、门禁、角色与小队设计
- 从最小可用版本到完整自举闭环的实施拆分、数据迁移、API/UI 与验收计划
## 非目标
- 本轮不修改 Go、React、数据库迁移、模板或智能体配置
- 不把医疗器械合规要求默认带入纯软件项目
- 不宣称尚未实现的方案已经可用
## 步骤
1. [x] 盘点当前实现与可复用能力
2. [x] 完成详细系统设计和创建向导设计
3. [x] 给出分阶段实施与真实验收计划
4. [x] 更新 FEATURE-MATRIX、CURRENT 并完成文档校验
## 验收标准
- [x] 方案覆盖工作流、文档、智能体小队、角色权限、项目创建选项、状态机、API/UI、迁移和验收
- [x] 清楚区分已实现、可复用、需新增和暂缓项
- [x] 自举机制有边界、有人工确认点且不会让智能体自行修改治理规则
## 相关链接
- Research: [../../ops/research/2026-09-14-software-project-bootstrap-current-state.md](../../ops/research/2026-09-14-software-project-bootstrap-current-state.md)
- Design: [../../system-design/2026-09-14-software-project-bootstrap-workflow.md](../../system-design/2026-09-14-software-project-bootstrap-workflow.md)
- Checklist: [../../ops/checklists/2026-09-14-software-project-bootstrap-acceptance.md](../../ops/checklists/2026-09-14-software-project-bootstrap-acceptance.md)
## 证据 / 备注
本轮为设计任务;所有当前态结论已回链源码、迁移或现有测试报告。主方案 599 行,验收计划 207 行;`git diff --check` 通过,相关文档 84 条相对链接校验无坏链。未运行产品功能测试,验收清单全部保持 `NOT RUN`。
@@ -0,0 +1,40 @@
---
title: "Vite 允许 FRP Host(frp-mix.com)"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: Cursor-Auto
branch: fix/vite-frp-allowed-hosts
worktree: "-"
mutex: web-devserver
---
# Vite 允许 FRP Host(frp-mix.com)
## 目标
通过 FRP 映射访问 `:3100` 时,Vite 不再拦截 `Host: frp-mix.com`。
## 范围
- `web/vite.config.ts`:`server.allowedHosts` 增加 `.frp-mix.com`
## 非目标
- 不改生产 nginx / 反向代理配置
- 不放开全部任意 Host(保持显式白名单)
## 步骤
1. [x] 在 `fix/vite-frp-allowed-hosts` 上改 `allowedHosts`
2. [x] 重启本地 Vite `:3100`
## 验收标准
- [x] 通过 `frp-mix.com`(FRP→3100)可打开开发页,不再出现 `Blocked request. This host is not allowed`
## 相关链接
- Checklist: —
- Handoff: —
- Test report: —
@@ -0,0 +1,71 @@
---
title: "workflow-plan 409 冻结态守卫 + 文档职责可选治理"
status: done
created: 2026-09-14
updated: 2026-09-14
owner: implementer_cursor
branch: fix/workflow-plan-409-frozen-and-optional-duties
worktree: ".worktrees/fix-workflow-plan-409-frozen-and-optional-duties"
mutex: workflow
---
# workflow-plan 409 冻结态守卫 + 文档职责可选治理
## 目标
已激活项目的设置页进入明确的冻结只读态;非必需且允许裁剪的文档可选择“不纳入人工审批”,部分职责、必需文档空职责、非成员职责和零治理激活由服务端拒绝;门禁、权限、快照与页面语义保持一致。
## 范围
- `web/src/components/project/ProjectSettingsModal.tsx`:frozen 视图、逐文档审批开关、内联/sticky 错误、并发恢复。
- `web/src/api/projectSettings.ts`:保留 status/code/message/issues 的 typed error。
- `internal/projectinstance/validator.go`:统一 DutyMode、工作流定义约束、结构与成员校验。
- `internal/projectinstance/service.go`:保存/预览/激活重复复核 active members。
- `internal/projectinstance/gate.go`、`stage_access.go`、`document_access.go`:none/full/disabled 一致语义。
- `internal/projectinstance/store.go`、`internal/workflow/runtime/orchestrator.go`:快照清理、零 assignment rows、零职责运行时契约。
- 激活预览统计与相应前后端测试。
## 非目标
- 不修改项目 143 的现有工作流配置,不在验收中终止项目 143。
- 不支持部分指派或自动补齐职责。
- 不允许项目配置降低工作流定义中必需/阻断文档的治理要求。
- 不把“无需人工审批”文档改成无版本、无审计的非受控文档。
- 不迁移历史 active 实例;冻结快照继续作为历史 SSOT。
## 步骤
1. [x] 定位项目 143 的 409 `PLAN_FROZEN` 根因并落盘 audit。
2. [x] 完成方案审核:补齐定义优先、零治理拦截、成员有效性、权限、快照清理和真实 UI 边界。
2b. [x] 用户批准最终方案,开工登记(Wave 0)
3. [x] Wave 1:typed API error + frozen 独立只读视图 + sticky/可访问错误 + 两标签竞态恢复。
4. [x] Wave 2:DutyMode、强制/可选任务策略、partial/成员/零治理校验、服务端规范化。
5. [x] Wave 3:门禁、readiness、阶段/文档访问、运行时和预览统计统一。
6. [x] Wave 4:前端逐文档“纳入人工审批”开关及 full/none/partial 交互测试。
7. [x] Wave 5:合 dev、rebuild、真实浏览器设置页矩阵;项目 143 只读回归;归档 test report。真实 PI 生成/审批长链路未跑,见报告。
## 验收标准
- [x] active 项目设置无编辑控件,页面显示冻结原因、工作流/阶段/职责快照和受控终止影响入口。
- [x] 允许裁剪的非必需文档 full/none 均合法;partial 精确拒绝。
- [x] 必需/阻断/不可裁剪文档全空被服务端拒绝(单测 + 定义优先)。
- [x] 保存和激活均拒绝非 active project member;预览后成员退出也 fail closed(单测)。
- [x] 所有文档 none 时可走预览拒绝「至少一份纳入人工审批」(页面 C)。
- [ ] none 文档仍生成和入账本、项目成员只读可见、创建者可生成/编辑,但无 review/approve 且不阻塞阶段(**本轮未跑真实 PI,单测已覆盖门禁/权限**)。
- [x] disabled/none 的冻结快照、plan hash 和 assignment rows 不残留旧职责(Wave 3 单测)。
- [x] 两标签陈旧保存的 409 在当前视口可见、草稿保留并转 frozen。
- [x] 设置页真实 UI 用例有截图证据并回链;生成/审批长链路另立项。
## 相关链接
- Audit: [2026-09-14-workflow-plan-409-frozen-and-optional-duties.md](../../audit/2026-09-14-workflow-plan-409-frozen-and-optional-duties.md)
- Remediation: [2026-09-14-workflow-plan-409-frozen-and-optional-duties-remediation.md](../../remediation/2026-09-14-workflow-plan-409-frozen-and-optional-duties-remediation.md)
- Test report: [2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md](../../test-reports/2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md)
## 证据 / 备注
- dev 项目 143:`lifecycle_status=active`、`active_workflow_key=main`、实例 89 active;409 与三名职责人选择内容无关。
- 当前 `parseError` 已读取后端 message;前端改造重点是 typed error、冻结态切换和视口内呈现。
- 当前职责校验只检查正数/互异,数据库只外键到 users;项目成员有效性必须补服务端校验。
- 当前终止实现会取消运行任务、关闭实例并退回 planning;关闭实例访问 fail closed,因此项目 143 不能作为终止测试对象。
- 方案已迁移至基于最新 dev 的 `fix/workflow-plan-409-frozen-and-optional-duties` 独立 worktree;用户已批准实施。
@@ -0,0 +1,63 @@
---
title: "M5/M6 组合根与传输门禁 U11–U12"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/app-composition-u11-u12
worktree: "-"
mutex: app
---
# M5/M6 组合根与传输门禁 U11–U12
## 目标
按整改计划四个子切片完成组合根、文档通知闭包迁出、stageflow 用例、UserProjectContext CAS;再收口 SSE 编码与已清零规则的 arch-check block。用户已明确授权继续 U11/U12(推翻 U10 报告的停止扩面)。
## 范围
- U11a:`internal/app` 唯一 composition root;幂等 Start/Stop
- U11b:文档 `OnOutbox` 通知迁到 `internal/app/docnotify`
- U11c:`internal/app/stageflow` 拥有 ExecuteTask / ExecuteStage
- U11d:`ContextUpdate` 版本 CAS,禁止跨模块字段级直改
- U12:SSE 中性 frame 编码;`import`/`event` 转 block;不改错误信封与 PI Runner 协议
## 非目标
- 不碰 `intent` 包行为(编码阶段 mutex 仍由 Codex 占用;合入后浏览器门另开 handoff)
- 不整支 merge `feature/final-artifact-vault`;不启用 `FAV_DEGRADED_READ`
- 不终止或改写项目 143
- 不删除未到期的 sql_write/path 例外(U3/U5 残留)
- 不在 worktree 内 `env-service`
## 步骤
1. [x] 认领 CURRENT + 本任务
2. [x] U11a composition root
3. [x] U11b docnotify
4. [x] U11c stageflow
5. [x] U11d ContextUpdate
6. [x] U12 SSE + arch-check block_kinds
7. [x] 短测 / 目标包 race / 报告
8. [x] 占槽 `--no-ff` 合入 `dev` + 主仓 `dev rebuild`
## 验收标准
- [x] 重复 Start 不重复注册 subscriber;Stop 后再 Start worker 仍在
- [x] server 生产代码不再赋值 `OnOutbox`
- [x] HTTP 与 CLI 走同一 stageflow 用例
- [x] ContextUpdate 并发 stale version 不丢更新赢家
- [x] `arch-check --mode block` 对已清零的 import/event 通过
- [x] 测试报告回链 U11/U12
- [x] 合入后 `/health` `/ready` schema 38、`pi-agent`、新镜像 digest
## 相关链接
- Checklist: [../../ops/checklists/2026-09-14-module-decoupling-refactor-acceptance.md](../../ops/checklists/2026-09-14-module-decoupling-refactor-acceptance.md)
- Plan: [../../remediation/2026-09-14-module-decoupling-refactor-plan.md](../../remediation/2026-09-14-module-decoupling-refactor-plan.md)
- Test report: [../../test-reports/2026-09-15-app-composition-u11-u12-test-report.md](../../test-reports/2026-09-15-app-composition-u11-u12-test-report.md)
## 证据 / 备注
用户口头授权:「继续解耦到 U11、U12」。合入 `dev@bf59cce`。rebuild 镜像 `sha256:a8e3e940f01111c4298c67947ae9f4cd6105f13cf58134672f4a87daa19e27ab`。health/ready:`.doc/test-reports/assets/2026-09-15-app-composition-u11-u12/rebuild-health-ready.txt`。
@@ -0,0 +1,45 @@
---
title: "D4 bizdev locator 最终移除"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/bizdev-locator-removal
worktree: "-"
mutex: bizdev
---
# D4 bizdev locator 最终移除
## 目标
删除 bizdev 上 8 个 locator getter;组合根一次性 Snapshot 后由 Runtime/Server 持有端口。
## 范围
- `Pool` `DocGov` `DocRevision` `ContextManager` `CAS` `ProjectWorkflow` `FreeformDoc` `KB`
- Runtime / Server 字段
- archtest 禁止把 getter 加回去
- 调用方迁移
## 非目标
- 不删 SchemaVersion / DatabaseReady
- 不切事件 live
- 不实现 Track P
## 步骤
1. [x] Snapshot + Runtime 端口
2. [x] 迁移 server/cmd/tests
3. [x] 同批删除 8 getter
4. [x] 报告合入
## 验收标准
- [x] 生产无 8 个 getter
- [x] [S1 报告](../../test-reports/2026-09-15-bizdev-locator-removal-test-report.md)
## 相关链接
- Phase 2 D4
@@ -0,0 +1,39 @@
---
title: "D7b chat 编排剩余批次"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/chatflow-orchestration-boundary
worktree: "-"
mutex: chat
---
# D7b chat 编排剩余批次
## 目标
`internal/chat` 生产代码不再 import bizdev;任务请求走 stageflow 类型别名。
## 范围
- action_executor 去掉 Bizdev 字段
- 收紧 chat import allowlist
- 表征测试保留
## 非目标
- 不搬空测试 import
- 不把 taskrun 签名从 bizdev 别名拷成独立结构
- 不切事件 live
## 步骤
1. [x] action_executor 改 stageflow 类型
2. [x] 收紧 yaml
3. [x] 报告合入
## 验收标准
- [x] chat 生产无 bizdev import
- [x] [S4b 报告](../../test-reports/2026-09-15-chatflow-orchestration-boundary-test-report.md)
@@ -0,0 +1,59 @@
---
title: "U10 chatlog/contextasm 原地端口化"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/chatlog-contextasm-u10
worktree: "-"
mutex: chat
---
# U10 chatlog/contextasm 原地端口化
## 目标
在不物理拆包的前提下,为对话读取与 prompt 装配建立带 Principal 的消费者端口,使正文、分类、计数、导出、摘要和恢复使用同一授权可见集合。
## 范围
- `internal/app/chatflow` ChatLog / ContextAssembler 端口
- ctxmgr 表所有权不变;adapter 内做可见性过滤
- server 历史读取 handler 改走 ChatLog;忽略 query/body 中的 user_id 身份
- 会话 restore / 记忆召回只注入允许集合
- 不碰 `intent` mutex,不物理搬到 `chatlog`/`contextasm` 包
## 非目标
- U11–U12
- 整支 merge `feature/final-artifact-vault`
- 启用 `FAV_DEGRADED_READ`
- 纯搬包
## 步骤
1. [x] 核实 `chat` mutex:`fix/chat-history-refresh` 已是 `dev` 祖先;剩余真实 PI 刷新与 U10 同批收口
2. [x] 从最新 `dev` 开 `feature/chatlog-contextasm-u10` 并登记 CURRENT
3. [x] 定义 chatflow 端口与 ctxmgr adapter
4. [x] 迁移 window/day/stats/search/unread/export/digest/history/restore/memory
5. [x] 合同测试:同集计数、非 owner 403、restore/digest 不放大不可见消息
6. [x] 验收报告;最后一句 **停止扩面**
## 验收标准
- [x] 刷新前后同一授权集合的正文与分类计数一致(adapter 合同测试)
- [x] 跨用户负例 fail closed(guest 非 owner)
- [x] context assembly / digest 只使用允许集合
- [x] 真实 PI 闲聊刷新 E2E 证据(与对话刷新活验同批;编制任务链 save 400 未纳入停走)
- [x] 未物理拆包;DTO 转换为 0,拆包收益不成立
## 相关链接
- Checklist: [../checklists/2026-09-14-module-decoupling-refactor-acceptance.md](../checklists/2026-09-14-module-decoupling-refactor-acceptance.md)
- Plan: [../../remediation/2026-09-14-module-decoupling-refactor-plan.md](../../remediation/2026-09-14-module-decoupling-refactor-plan.md)
- Chat refresh: [../../test-reports/2026-09-13-chat-history-refresh-test-report.md](../../test-reports/2026-09-13-chat-history-refresh-test-report.md)
- Test report: [../../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md](../../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md)
## 证据 / 备注
U9 最后一句 **继续 U10** 只批准进入 M4。禁止 U11–U12。`intent` 认领仍 `in_progress`,本单元不改意图分类。活验项目 6252 / `sess-p6252-u10`;产物 `.doc/test-reports/assets/2026-09-15-chat-history-refresh-live/live.json`。未占槽 rebuild。
@@ -0,0 +1,59 @@
---
title: "M3 U9 存量回填、migration corpus 与数据生命周期"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/dataset-lifecycle-u9
worktree: "-"
mutex: dataset
---
# M3 U9 存量回填、migration corpus 与数据生命周期
## 目标
只保留可解释的演示/回归数据,并持续验证旧数据迁移、重载和受控恢复。backfill 可暂停续跑,异常进 quarantine;八条轨道可重复;销毁默认 fail closed。
## 范围
- dataset registry(pinned / demo / regression / migration_baseline / ephemeral / quarantine)
- checkpoint 分批 backfill:只枚举 snapshot、approved/commit event、completed chat turn
- SKIP LOCKED 多 worker;禁止扫描 workspace
- 销毁门禁:FAV coverage + 完整备份 restore + corpus + 精确 manifest + 双人批准 + quarantine 观察窗
- restore 拒绝共享 env DSN;只允许 scratch
- 八轨:clean / oldest-supported / previous / hazard / import / reload / rollback / artifact recovery
## 非目标
- U10–U12;不碰 `chat` / `intent` mutex
- 不整支 merge `feature/final-artifact-vault`;不启用 `FAV_DEGRADED_READ`
- 不修改历史 Goose;不销毁 `agent_system_dev/test/main`
- 不终止或改写项目 143;worktree 内禁止 `env-service`
## 步骤
1. [x] CURRENT 认领 `mutex=dataset`;从 `dev` 开 `feature/dataset-lifecycle-u9`
2. [x] Goose 00038 + `module-boundaries.yaml`
3. [x] `internal/artifactvault/backfill.go` + `internal/dataset` + `cmd/dataset`
4. [x] 硬化 `scripts/restore-system-db-drill.sh`
5. [x] 隔离库 + 八轨 + 目标包 `-race` + 占槽 rebuild
6. [x] 验收报告;最后一句 **继续 U10**
## 验收标准
- [x] backfill 中断、重复、并发新终态时分母/分子可复算且不重复 artifact
- [x] legacy-v0 / 旧 schema / 高 ID / projection fork / 缺 snapshot → quarantine 或升级
- [x] restore 拒绝共享 DSN、错误 storage identity、篡改 manifest、缺权限
- [x] coverage / backup / corpus 任一失败阻止 destroy
- [x] 批准 dataset 导入后关系、SHA、sequence 可复算
## 相关链接
- Checklist: `.doc/ops/checklists/2026-09-14-module-decoupling-refactor-acceptance.md`
- Plan: `.doc/remediation/2026-09-14-module-decoupling-refactor-plan.md` U9
- Test report: `.doc/test-reports/2026-09-15-dataset-lifecycle-u9-test-report.md`
## 证据 / 备注
见验收报告。Goose 00038。dev schema 38。
@@ -0,0 +1,46 @@
---
title: "D6 doccontent canonical 边界"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/doccontent-canonical-boundary
worktree: "-"
mutex: docgov
---
# D6 doccontent canonical 边界
## 目标
Markdown canonicalization 与 SHA 抽到 `internal/doccontent`;生产 `docgov` 不再 import `docrevision`。
## 范围
- `internal/doccontent`
- `docgov/lease.go` 改走 doccontent
- `docrevision` 薄封装保持旧调用方
- golden + wrapper 对账
## 非目标
- 不改 hash 语义
- 不碰项目 143 数据
- 不删 `docrevision.CanonicalizeMarkdown` 导出(兼容)
## 步骤
1. [x] 分支与 CURRENT
2. [x] 提取模块与切断 docgov→docrevision
3. [x] golden / arch-check
4. [x] 报告并合入
## 验收标准
- [x] 生产 docgov 不 import docrevision
- [x] project143 hard-break golden 仍过
- [x] [S3 报告](../../test-reports/2026-09-15-doccontent-canonical-boundary-test-report.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)
@@ -0,0 +1,53 @@
---
title: "Track E 持久事件交付"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/event-e2-hook-guard
worktree: "-"
mutex: events
---
# Track E 持久事件交付
## 目标
按 E0A→E0B→E1A→E1B→E1C 完成 notify、workflow advance、projection 的 PG 持久交付,并用授权页面刷新/重启恢复证据关闭 `DOC-RELIABILITY-PILOT` 的事件部分。
## 范围
- E0A:生产入口/UoW、event contract、runtime registry、历史数据与 sequence 门。
- E0B:PG dispatcher、attempt audit、独立进程、并发与故障注入。
- E1A/B/C:三个消费者独立 shadow、switch、rollback 和真实恢复验收。
## 非目标
- FAV consumer 激活、bizdev/chat/intent 结构重构、HTTP 错误信封、PI typed result。
- 删除或覆盖历史事件;在 E0A 通过前启动 dispatcher。
## 步骤
1. [x] E0A 单独建 short-term/分支,dispatcher 保持 off。
2. [x] E0A 报告通过后再认领 E0B。
3. [x] 依次交付 E1A notify、E1B workflow advance、E1C projection;每步独立 go/no-go。
4. [x] E2 兼容守卫:live 时闭包停写;hook API 待 live 窗口后删除。
5. [x] 同步 test report、CURRENT、FEATURE-MATRIX、gap-matrix、[复盘](../research/2026-09-15-track-e-retrospective.md)。
## 验收标准
- [ ] 满足 [Phase 2 Track E Definition of Done](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md#track-e-definition-of-done)(共享 live 与删除 hook API 仍开放)。
- [x] 每个波次拥有独立 owner、mutex、分支、报告和回滚证据。
- [x] 未把计划、MemoryBus、stub 或日志冒充生产 PG/browser/restart 验收。
## 相关链接
- Checklist: 按每个波次建立
- Audit: [Phase 2 方案审阅](../../audit/2026-09-15-module-decoupling-phase2-plan-review.md)
- Remediation: [Phase 2 修订计划](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
- Test report: [E2](../../test-reports/2026-09-15-event-e2-hook-guard-test-report.md)
- 复盘: [./research/2026-09-15-track-e-retrospective.md](../research/2026-09-15-track-e-retrospective.md)
## 证据 / 备注
本条只建立执行入口,不代表已批准 E0A 或已认领 mutex。实施前必须按 CURRENT 检查冲突并从当时最新 dev 建分支。
@@ -0,0 +1,49 @@
---
title: "E0A 事件生产、契约与历史数据门"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/event-production-scope-contract
worktree: "-"
mutex: events
---
# E0A 事件生产、契约与历史数据门
## 目标
组合根注入唯一 `docflow.Commands`;candidate-ready、downstream-impact、approved 三条链在同一 UoW 写 envelope/delivery;缺 env/project fail closed;FAV 不写入;allowlist 与 runtime registry parity;历史 inventory 分类且不删数据;dispatcher 保持 off。
## 范围
- D3 生产入口与作用域
- D10 既有 event allowlist 补全与 registry parity
- D11 inventory、sequence ADR、repair/quarantine/expire、replay 骨架、service principal 表
## 非目标
- 不实现/启动 PG dispatcher
- 不激活 FAV,不写 staging/artifact/publication
- 不删除历史事件
- 不开始 Track S/P
## 步骤
1. [x] 从最新 `dev` 开 `fix/event-production-scope-contract` 并登记 CURRENT
2. [x] 唯一 Commands、三条链同 UoW、FAV 隔离
3. [x] allowlist + registry parity + 动态 FAV 注册失败
4. [x] inventory/repair/replay/principal additive schema 与用例
5. [x] 连续性模型 ADR;gap blocking 关闭
6. [x] 隔离库 PG 证据与 test-report
## 验收标准
- [x] 见 [E0A 测试报告](../../test-reports/2026-09-15-event-e0a-production-scope-contract-test-report.md)
## 相关链接
- Remediation: [../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
- Track E: [./2026-09-15-durable-event-track-e.md](./2026-09-15-durable-event-track-e.md)
- Report: [../../test-reports/2026-09-15-event-e0a-production-scope-contract-test-report.md](../../test-reports/2026-09-15-event-e0a-production-scope-contract-test-report.md)
- ADR: [../../adr/2026-09-15-event-consumer-checkpoint.md](../../adr/2026-09-15-event-consumer-checkpoint.md)
@@ -0,0 +1,43 @@
---
title: "E0B PG dispatcher 基座"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/events-dispatcher-pg
worktree: "-"
mutex: events
---
# E0B PG dispatcher 基座
## 目标
原子 lease/attempt/heartbeat/fencing、独立 `cmd/events`、默认 mode=off、1/2/4 worker 与崩溃注入。
## 范围
- Goose 00040、ClaimLeases、cmd/events、compose events 服务
## 非目标
- 不把任何 consumer 切 live
- 不激活 FAV
- 不删除历史
## 步骤
1. [x] 从 E0A 后 `dev` 开 `feature/events-dispatcher-pg`
2. [x] additive schema + atomic claim
3. [x] worker/heartbeat/fencing/shadow scan
4. [x] cmd/events + compose
5. [x] 隔离库 PG + race + 报告
## 验收标准
- [x] [E0B 测试报告](../../test-reports/2026-09-15-event-e0b-dispatcher-pg-test-report.md)
## 相关链接
- Track E: [./2026-09-15-durable-event-track-e.md](./2026-09-15-durable-event-track-e.md)
- Report: [../../test-reports/2026-09-15-event-e0b-dispatcher-pg-test-report.md](../../test-reports/2026-09-15-event-e0b-dispatcher-pg-test-report.md)
@@ -0,0 +1,48 @@
---
title: "E1A notify shadow 与切换"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/event-notify-cutover
worktree: "-"
mutex: events
---
# E1A notify shadow 与切换
## 目标
notify 消费者具备 shadow 覆盖门、live 唯一可见结果与显式 rollback;生产集群保持 off。
## 范围
- Goose 00041、`EmitVisibleDocumentEvent`、`docnotify.EventConsumer`、Handler 与 Ack 同事务
- cmd/events 注册 notify(mode=off 时不 claim)
## 非目标
- 不把共享环境 notify 切 live
- 不删除 OnOutbox 闭包
- 不激活 FAV / workflow advance / projection live
## 步骤
1. [x] 从 E0B 后 `dev` 开 `fix/event-notify-cutover`
2. [x] additive `source_event_id` 与可见结果唯一索引
3. [x] shadow dry-run + live 同事务 ack
4. [x] fixture N=30、quarantine、correlation、rollback
5. [x] 隔离库 PG + race + 报告
## 验收标准
- [x] [E1A 测试报告](../../test-reports/2026-09-15-event-e1a-notify-cutover-test-report.md)
## 相关链接
- Track E: [./2026-09-15-durable-event-track-e.md](./2026-09-15-durable-event-track-e.md)
- Report: [../../test-reports/2026-09-15-event-e1a-notify-cutover-test-report.md](../../test-reports/2026-09-15-event-e1a-notify-cutover-test-report.md)
## 证据 / 备注
隔离库 `agent_rel_e1a` 测完已 DROP。共享 `event_consumer_modes.notify=off`。
@@ -0,0 +1,44 @@
---
title: "E1B workflow advance shadow 与切换"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/event-workflow-advance
worktree: "-"
mutex: events
---
# E1B workflow advance shadow 与切换
## 目标
workflow_advance 具备 shadow/live/rollback;并发或重放批准只产生一次阶段可推进可见结果。生产集群保持 off。
## 范围
- Goose 00042、`docadvance.EventConsumer`、`EmitVisibleStageReady`、MarkDocTaskApproved 走 fenced tx
- cmd/events 注册 workflow_advance
## 非目标
- 不把共享环境 workflow_advance 切 live
- 不删除 AddOnApprovedHook
- 不激活 FAV / projection live
## 步骤
1. [x] 从 E1A 后 `dev` 开 `fix/event-workflow-advance`
2. [x] additive source_event_id on stage_advance_requests
3. [x] consumer 重读文档并同事务 ack
4. [x] 隔离库并发/重放/quarantine/rollback
5. [x] 报告
## 验收标准
- [x] [E1B 测试报告](../../test-reports/2026-09-15-event-e1b-workflow-advance-test-report.md)
## 相关链接
- Track E: [./2026-09-15-durable-event-track-e.md](./2026-09-15-durable-event-track-e.md)
- Report: [../../test-reports/2026-09-15-event-e1b-workflow-advance-test-report.md](../../test-reports/2026-09-15-event-e1b-workflow-advance-test-report.md)
@@ -0,0 +1,41 @@
---
title: "E1C projection no-replace"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/event-projection-cutover
worktree: "-"
mutex: events
---
# E1C projection no-replace
## 目标
projection 消费者幂等只前进;共享集群保持 off。
## 范围
- Goose 00043、ProjectHeadNoReplace、docproject.EventConsumer
## 非目标
- 不把共享 projection 切 live
- 不激活 FAV
- 不删除闭包
## 步骤
1. [x] 分支与 additive schema
2. [x] no-replace SQL + consumer
3. [x] 隔离库 + race + worker 重启
4. [x] 报告
## 验收标准
- [x] [E1C 测试报告](../../test-reports/2026-09-15-event-e1c-projection-test-report.md)
## 相关链接
- Track E: [./2026-09-15-durable-event-track-e.md](./2026-09-15-durable-event-track-e.md)
@@ -0,0 +1,48 @@
---
title: "E2 闭包 live 停写与 Track E 复盘"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/event-e2-hook-guard
worktree: "-"
mutex: events
---
# E2 闭包 live 停写与 Track E 复盘
## 目标
在 dispatcher 仍默认 off 时保留 `OnOutbox` / `AddOnApprovedHook` 接线,使对应消费者切 `live` 后闭包立即停写,避免双写;并写 Track E 复盘。不关闭 `DOC-RELIABILITY-PILOT`。
## 范围
- `events.WriterLive`
- `docnotify.Subscriber.SkipWrite`
- Runtime / 遗留 HTTP hook 在 `workflow_advance` live 时 no-op
- 复盘与 E2 测试报告
## 非目标
- 不删除 hook API(须等 live 发布窗口)
- 不把共享 notify/advance/projection 切 live
- 不激活 FAV
- 不关闭 Track E 发布 blocker
## 步骤
1. [x] 从最新 `dev` 开 `fix/event-e2-hook-guard` 并登记 CURRENT
2. [x] WriterLive + 闭包守卫 + 单测
3. [x] 隔离库 mode 矩阵
4. [x] 复盘与报告
## 验收标准
- [x] live 时闭包不写;off/shadow 仍写
- [x] 生产仍保留 Bind / AddOnApprovedHook(mode=off 必需)
- [x] [E2 报告](../../test-reports/2026-09-15-event-e2-hook-guard-test-report.md)
## 相关链接
- Track E: [./2026-09-15-durable-event-track-e.md](./2026-09-15-durable-event-track-e.md)
- 复盘: [../research/2026-09-15-track-e-retrospective.md](../research/2026-09-15-track-e-retrospective.md)
@@ -0,0 +1,54 @@
---
title: "共享环境事件消费者 live 切换"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/event-shared-live-cutover
worktree: "-"
mutex: events
---
# 共享环境事件消费者 live 切换
## 目标
在共享 `agent-dev` 上按 notify → workflow_advance → projection 完成 shadow → drain → live → 回滚演练,再删除生产 hook 注册。
## 范围
- `scripts/event-consumer-mode.sh` + `cmd/eventmode`
- 共享 `agent_system_dev` inventory / quarantine
- 逐消费者 live 与授权页纵切(项目 6275;143 只读)
## 非目标
- FAV live
- test/main 环境
- 编辑 Phase 2 计划原文
- Track P(独立波次)
## 步骤
1. [x] L0 受控 SetMode 与 inventory
2. [x] L1 notify
3. [x] L2 workflow_advance
4. [x] L3 projection + 授权页
5. [x] L4 删除生产 hook 注册
## 验收标准
- [x] fav / test / main 切模式失败
- [x] 每消费者独立 live 报告
- [x] 生产代码无 `OnOutbox =` / `AddOnApprovedHook(`
## 相关链接
- Long-term: [.doc/archive/ops/2026-09-15-event-shared-live-cutover.md](../../archive/ops/2026-09-15-event-shared-live-cutover.md)
- Notify: [.doc/test-reports/2026-09-15-event-notify-shared-live-test-report.md](../../test-reports/2026-09-15-event-notify-shared-live-test-report.md)
- Advance: [.doc/test-reports/2026-09-15-event-workflow-advance-shared-live-test-report.md](../../test-reports/2026-09-15-event-workflow-advance-shared-live-test-report.md)
- Projection: [.doc/test-reports/2026-09-15-event-projection-shared-live-test-report.md](../../test-reports/2026-09-15-event-projection-shared-live-test-report.md)
## 证据 / 备注
已合入 `dev@39dc68d`。生产 hook 注册已删;方法本体保留一个窗口。
@@ -0,0 +1,34 @@
---
title: "共享环境事件消费者 live 切换"
status: done
created: 2026-09-15
updated: 2026-09-15
---
# 共享环境事件消费者 live 切换
## 动机
Track E 已在隔离库证明 notify / workflow_advance / projection 的 exactly-one visible outcome 与 E2 闭包守卫。共享集群仍为 `off`,HTTP 闭包仍是唯一真实写者。未 live 则不能删 hook API,也不能关闭 `DOC-RELIABILITY-PILOT`。
## 成功标准
- 按消费者独立:shadow coverage → drain → 原子 live;E2 守卫使对应闭包停写。
- 授权页刷新/重启正文与 head digest 一致;未授权不泄露。
- 回滚开关保留一个发布窗口后再删 `OnOutbox` / `AddOnApprovedHook`。
- FAV 保持 disabled;项目 143 只读。
## 依赖
- E0A–E2 已合入;隔离库报告已归档。
- 需要明确授权:动共享 `agent-dev` 消费者 mode。
## 暂不启动原因
已完成共享 live 与生产去注册。方法本体保留一个窗口。
## 相关链接
- [Track E 复盘](../research/2026-09-15-track-e-retrospective.md)
- [E2 报告](../../test-reports/2026-09-15-event-e2-hook-guard-test-report.md)
- [gap-matrix DOC-RELIABILITY-PILOT](../../remediation/gap-matrix.md)
@@ -0,0 +1,39 @@
---
title: "D7a intent 与 bizdev 解绑"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/intent-bizdev-boundary
worktree: "-"
mutex: intent
---
# D7a intent 与 bizdev 解绑
## 目标
intent 只依赖成熟度词汇叶子包,不再 import bizdev。
## 范围
- `internal/maturity`
- intent 生产与表征测试
- bizdev 类型别名保持兼容
## 非目标
- 不改识别规则
- 不迁 coordinator / chatflow(D5/D7b)
## 步骤
1. [x] 叶子包与别名
2. [x] intent 切断 bizdev
3. [x] 表征测试与 arch-check
4. [x] 报告
## 验收标准
- [x] intent 生产 import 无 bizdev
- [x] [S4a 报告](../../test-reports/2026-09-15-intent-bizdev-boundary-test-report.md)
@@ -0,0 +1,50 @@
---
title: "清点旁支并收口已合入本地分支"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: chore/leftover-branch-cleanup
worktree: "-"
mutex: ops
---
# 清点旁支并收口已合入本地分支
## 目标
删除 tip 已是 `dev` 祖先的本地旁支与对应 worktree;不整支合入会回归或触红线的 5 条未合并分支;主仓跑一次 short 冒烟。
## 范围
- 拆 7 个已合入 worktree
- `git branch -d` 已 `--merged` 旁支
- CURRENT 记录故意保留的 FAV / herdr-removal / diagnosis / data-root / `dev-old-linear`
- vet / short / arch-check / health+ready
## 非目标
- 不整支 merge `feature/final-artifact-vault`;不启用 `FAV_DEGRADED_READ`
- 不合入 `feature/remove-herdr-agent-settings`(会回归 U12 arch-check、删 Herdr 脚本)
- 不合入 `fix/project143-controlled-content-404-diagnosis`(会回退审计关闭结果)
- 不合入 `fix/dev-runtime-data-root-guard`、`dev-old-linear`
- 不 push;不删 `origin/*`;不从 worktree 起 docker;不碰项目 143
## 步骤
1. [x] 占 CURRENT 集成槽
2. [x] 拆已合入 worktree
3. [x] 删除已 merged 本地旁支
4. [x] 冒烟并写报告
5. [x] 槽位 idle + archive
## 验收标准
- [x] 已合入旁支 worktree 只剩 FAV 错名目录
- [x] `--merged dev` 旁支已删(31 条)
- [x] 5 条未合入分支仍在
- [x] 测试报告 + health/ready schema 38
## 相关链接
- Test report: [../../test-reports/2026-09-15-leftover-branch-cleanup-test-report.md](../../test-reports/2026-09-15-leftover-branch-cleanup-test-report.md)
@@ -0,0 +1,57 @@
---
title: "审阅并修订模块解耦 Phase 2 方案"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Codex
branch: docs/module-decoupling-ipc-assessment
worktree: "-"
mutex: architecture-docs
---
# 审阅并修订模块解耦 Phase 2 方案
## 目标
以当前代码、migration、ADR 和 Phase 1 计划为证据,修正调研与 Phase 2 方案,并补齐高并发、互斥、权限、历史数据、灰度和回滚设计;不实施业务代码。
## 范围
- 复核调研报告与原 Phase 2 方案的事实、依赖和完成边界。
- 将事件可靠性、结构解耦、HTTP/PI 协议拆成独立轨道。
- 补充 PG 状态机、fencing、幂等、顺序、连接预算、权限、replay、脱敏、迁移和 browser/restart 验收。
- 同步 audit、remediation、CURRENT、FEATURE-MATRIX 与 gap-matrix。
## 非目标
- 不实现 dispatcher、consumer、migration 或协议代码。
- 不合并、部署、重启容器、删除数据或审计/合入 FAV 分支。
- 不把文档完成写成系统能力完成。
## 步骤
1. [x] 完成仓库启动链和上位 ADR/Phase 1 证据复核。
2. [x] 完成一致性、可行性、范围、安全、产品与对抗视角审阅。
3. [x] 修正调研报告中的 PG、依赖方向、allowlist 与进程边界事实。
4. [x] 重写 Phase 2 为 Track E/S/P,补齐详细实施和停走门。
5. [x] 同步索引与状态 SSOT。
6. [x] 执行文档链接、diff、冲突标记和术语检查。
## 验收标准
- [x] 调研不再把 SELECT-only Claim、MemoryBus 测试或 allowlist 基线写成生产闭环。
- [x] Track E 可独立关闭,FAV/D8/D9 不阻塞。
- [x] 方案明确 at-least-once 与 exactly-one visible outcome、最终提交点 fencing、集群级切换和授权模型。
- [x] 历史脏数据只分类/隔离/修复,不授权删除。
- [x] 文档状态一致且没有实施或发布声明。
## 相关链接
- Audit: [方案审阅](../../audit/2026-09-15-module-decoupling-phase2-plan-review.md)
- Remediation: [Phase 2 修订计划](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
- Research: [IPC/RPC 现状评估](../../ops/research/2026-09-15-module-decoupling-ipc-assessment.md)
- Test report: 不适用(文档审阅,无业务实现)
## 证据 / 备注
本任务沿用用户已创建的 `docs/module-decoupling-ipc-assessment` 分支。该分支名早于当前 `feature/*|fix/*` 规则;未改写或重命名用户分支。起点提交为 `a3392e3` 与 `5cef856`,本轮未获授权 commit/push。
@@ -0,0 +1,47 @@
---
title: "PI typed-result-v1 P1–P4"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/pi-typed-result
worktree: "-"
mutex: pi-agent
---
# PI typed-result-v1 P1–P4
## 目标
Runner additive 输出 `result_v1`;Go typed-first fail-closed;共享 dev 真实 PI 双轨对账;去掉 stderr/legacy 明文错误。
## 范围
- `configs/schemas/pi-run-result-v1.json`
- `deploy/pi-agent/result-v1.mjs` + runner 接线
- `internal/agent` parser / 负例 / `RUN_PI_E2E=1` 双轨
## 非目标
- 不把 member 正文搬进 `result_v1`(仍走 `patches[]`)
- 不改 HTTP 状态码;不启用 FAV;不写项目 143
## 步骤
1. [x] Schema + Runner additive
2. [x] Go typed-first + handshake
3. [x] 真实 PI 双轨
4. [x] 删 stderr/隐式 legacy;报告与合入
## 验收标准
- [x] typed-present-invalid 永不 fallback
- [x] handshake downgrade 负例 PASS
- [x] `RUN_PI_E2E=1` 成功/失败/取消/超时对账
- [x] test-report 归档
## 相关链接
- Test report: `.doc/test-reports/2026-09-15-pi-typed-result-v1-test-report.md`
- Remediation: `.doc/remediation/2026-09-15-pi-typed-result-v1-remediation.md`
- P0: `.doc/ops/research/2026-09-15-pi-typed-result-p0-matrix.md`
@@ -0,0 +1,45 @@
---
title: "晋升 dev → test 并部署测试环境"
status: in_progress
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/promote-dev-to-test-2026-09-15
worktree: "-"
mutex: infra
---
# 晋升 dev → test 并部署测试环境
## 目标
把已完成的 Phase 2 代码从本地 `dev` 合入 `test`,重建并冒烟测试环境,供人工实测。不实施多意图 HITL。
## 范围
- `test` 分支 `--no-ff` 合入当前 `dev`
- `./scripts/env-service.sh test rebuild`
- test 库 notify/workflow_advance/projection 切 live(L4 去 hook 后 off 会停写);FAV 保持 off
## 非目标
- 不实施多意图 HITL U1+
- 不合入 `main`、不启用 FAV
- 不写项目 143
## 步骤
1. [x] 确认 Phase 2 已在本地 `dev`
2. [ ] occupy 集成槽并合入 `test`
3. [ ] rebuild 测试服务
4. [ ] health/ready + schema 冒烟
## 验收标准
- [ ] `:8081` health/ready PASS
- [ ] events `:8089` health PASS
- [ ] FAV 仍 off
## 相关链接
- CURRENT: `.doc/ops/CURRENT.md`
@@ -0,0 +1,40 @@
---
title: "D5 stageflow 类型归属与 D7b chatflow 首批"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: fix/stageflow-type-ownership
worktree: "-"
mutex: stageflow
---
# D5 stageflow 类型归属与 D7b chatflow 首批
## 目标
coordinator 生产代码不再 import bizdev;task/stage 请求走 stageflow 类型;chatflow assembler 改用 maturity。
## 范围
- stageflow 类型别名与状态常量
- coordinator 构造改为 StageTaskRunner + ContextServices
- chatflow 去掉 bizdev import
## 非目标
- 不复制行为方法成 DTO(身份别名 + token golden)
- 不删除 bizdev 八个 getter(D4)
- 不搬空 chat 包
## 步骤
1. [x] 类型边界与 coordinator 解绑
2. [x] chatflow assembler
3. [x] 表征测试与 arch-check
4. [x] 报告
## 验收标准
- [x] coordinator 生产 import 无 bizdev
- [x] [S2/S4b 报告](../../test-reports/2026-09-15-stageflow-type-ownership-test-report.md)
@@ -0,0 +1,60 @@
---
title: "M3 U8 TaskRun 终态与 RunManifest"
status: done
created: 2026-09-15
updated: 2026-09-15
owner: Cursor
branch: feature/taskrun-runmanifest
worktree: "-"
mutex: taskrun
---
# M3 U8 TaskRun 终态与 RunManifest
## 目标
TaskRun 终态在同一 UoW 内 CAS 写入唯一合法状态,并持久化类型化 RunManifest;重复 finalize / cancel race / SSE 断线不得产生第二条助手消息或第二份 artifact;workspace 清理仅在 verified receipt 之后。
## 范围
- Goose 00037 `task_run_manifests` + `finalizing` 状态
- `internal/taskrun` RunManifest 规范字节 / SHA / members
- `taskrun.Commands.Finalize` 唯一 finalize 命令;server 变薄
- `ctxmgr.FinalizeAssistantTaskMessage` 仅此写路径加入 UoW
- workspace 清理门禁;`ReadArtifact` 替代 `Join(workDir, "output.md")`
- BackendRef 服务端 policy;隔离库并发测试;占槽 rebuild;U8 报告
## 非目标
- U9 backfill / corpus / 八轨 / 销毁
- M4–M6;整支 merge FAV;启用 `FAV_DEGRADED_READ`
- 终止或改写项目 143
- 动 `chat` / `intent` 刷新任务
- worktree 内 `env-service`
## 步骤
1. [x] CURRENT 认领 `mutex=taskrun`;从本地 `dev` 开 `feature/taskrun-runmanifest`
2. [x] Goose 00037 Up+Down;`module-boundaries.yaml` 表属主
3. [x] Finalize 同 UoW:CAS + 助手 turn + manifest + envelope/staging
4. [x] 清理门禁与 server 去路径、BackendRef
5. [x] 隔离库双 pool / race;占槽 rebuild;报告最后一句只能「继续 U9」或「停止扩面」
## 验收标准
- [x] 重复 finalize:同一 status、同一 manifest SHA、助手消息 1 条、envelope/staging 不加倍
- [x] finalize ∥ cancel:恰好一个合法终态
- [x] SSE `done` 不出现在 TX 失败路径;commit 前断线重试不第二 turn
- [x] 无 verified receipt 则 cleanup FAIL;有 receipt 则可清 workspace 且 staging 仍能取出原 SHA
- [x] 报告最后一句为「继续 U9」或「停止扩面」;U9 清单项保持未勾
## 相关链接
- Checklist: [2026-09-14-module-decoupling-refactor-acceptance.md](../checklists/2026-09-14-module-decoupling-refactor-acceptance.md)
- Remediation: [2026-09-14-module-decoupling-refactor-plan.md](../../remediation/2026-09-14-module-decoupling-refactor-plan.md)
- 权威停走门: [2026-09-14-document-reliability-m2-test-report.md](../../test-reports/2026-09-14-document-reliability-m2-test-report.md)(继续 M3)
- Test report: [2026-09-15-taskrun-runmanifest-u8-test-report.md](../../test-reports/2026-09-15-taskrun-runmanifest-u8-test-report.md)
## 证据 / 备注
未签字前禁止 U9–U12。合入 + 容器测占集成槽,主仓 `./scripts/env-service.sh dev rebuild`。
@@ -0,0 +1,31 @@
---
title: "Track P 协议实施(信封与 typed-result)"
status: done
created: 2026-09-15
updated: 2026-09-15
---
# Track P 协议实施(信封与 typed-result)
## 动机
H0/P0 盘点后独立实施 HTTP 信封与 PI typed-result,不回退事件 live。
## 成功标准
已关闭:
- [HTTP 信封 H1–H3](../../test-reports/2026-09-15-http-error-envelope-h1-h3-test-report.md)
- [PI typed-result P1–P4](../../test-reports/2026-09-15-pi-typed-result-v1-test-report.md)
## 依赖
mutex `server`/`web`/`pi-agent` 已释放。
## 暂不启动原因
已完成。
## 相关链接
- [Phase 2 计划](../../remediation/2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md)
@@ -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,30 @@
---
title: "Wave 2 PU4 真实 PI 补证(U8 + full/none)"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor
branch: feature/wave2-real-pi-evidence
worktree: "-"
mutex: intent-plan
---
# Wave 2 PU4 真实 PI 补证(U8 + full/none)
## 目标
补齐 multi-intent U8 与工作流 full/none 的真实 PI / PG / 跨用户 / 恢复证据。
## 步骤
1. [x] 认领 + 占槽 rebuild
2. [x] U8 live 证据路径
3. [x] full/none 混合长链 live 测试
4. [x] 报告 + 矩阵更新 + 释放槽位
## 验收标准
- [x] U8 真实 PI PASS
- [x] full 跨用户审批 PASS
- [x] none 免审批且不阻塞 PASS
- [x] 报告归档 `.doc/test-reports/2026-09-16-wave2-real-pi-evidence-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,45 @@
---
title: "对话刷新恢复整改 Checklist"
status: done
created: 2026-09-13
updated: 2026-09-15
related_task: "../2026-09-13-chat-history-refresh-remediation.md"
---
# 对话刷新恢复整改 Checklist
## Wave 0 — 锁定回归
- [x] `MessageVisible` / `ScopeFromMetadata` 单测 — 证据:`internal/projectinstance/message_scope_test.go`
- [x] PG 集成:激活前 + 任务 scope + 刷新窗口 — 证据:`internal/server/chat_history_refresh_pg_test.go`
- [x] 前端:空 messages 日桶不覆盖缓存 — 证据:`web/src/hooks/useChatWindow.ts`
## Wave 1 — 写入作用域
- [x] Goose `00026` 列迁移 — 证据:`deploy/postgres/goose/00026_2026-09-13-chat-message-scope.sql`
- [x] `ResolveMessageScopeForChat/Task` — 证据:`internal/projectinstance/message_scope.go`
- [x] 任务/聊天写入接线 — 证据:`task_run_handlers.go`, `session.go`, `ctxmgr/manager.go`
## Wave 2 — 授权同集
- [x] `authorizeSessionRead` + 可见性谓词 — 证据:`internal/server/chat_history_auth.go`
- [x] window/day/search/dates/categories/unread/digest 授权 — 证据:各 `*_api.go`
## Wave 3 — 历史回填
- [x] Goose `00027` backfill SQL — 证据:`deploy/postgres/goose/00027_2026-09-13-chat-message-scope-backfill.sql`
## Wave 4 — 前端恢复态
- [x] `useChatWindow` 阶段态 + 用户隔离缓存 — 证据:`web/src/hooks/useChatWindow.ts`, `web/src/data/storage.ts`
## Wave 5 — 验收
- [x] `go test -short ./...` — 证据:本机执行输出
- [x] 真实 PI 刷新 E2E(需 dev 容器 + pi-agent)— 证据:`.doc/test-reports/assets/2026-09-15-chat-history-refresh-live/live.json`(项目 6252 闲聊刷新同集 + guest 403;编制任务链未通过)
- [x] 测试报告归档 — 证据:`.doc/test-reports/2026-09-13-chat-history-refresh-test-report.md`
## 完成定义
- [x] 全部勾选且有证据链接
- [x] gap-matrix `CHAT-HISTORY-REFRESH` → PASS
@@ -0,0 +1,23 @@
---
title: "PG ID 重映射收紧"
status: done
created: 2026-09-13
updated: 2026-09-14
related_task: "2026-09-13-document-revision-pg-id-remap.md"
---
# PG ID 重映射收紧
## Wave 0
- [x] `adopt*ID` 推进 counter,仅删同一对象
- [x] 临时 ID 跳过已占用键(snapshot/version/event/report/candidate)
- [x] openTemplate / human / candidate / commit / noop event 全走 adopt
- [x] 纯函数 + 高序列首次生成 PG 回归
- [x] `gofmt` / `go vet` / `go test -short ./...`
- [x] 真实 UI-03:Round20 PASS(6159 / `doc_proj6159_intake` / V2/r0)
## 完成定义
- [x] 上述实现项有测试证据
- [x] 现场 UI-03 Round20 已通过;Round19 失败归档不删
@@ -0,0 +1,23 @@
---
title: "post-restart 最终持久正文 snippet"
status: done
created: 2026-09-13
updated: 2026-09-14
related_task: "2026-09-13-document-revision-post-restart-final-snippet.md"
---
# post-restart 最终持久正文 snippet
## 本轮
- [x] `nextDurableBodySnippet`:后续成功修订覆盖旧 snippet
- [x] 冲突失败稿不成为期望正文
- [x] UI-13b 冲突断言完成后回写 `markerA1`;UI-15-pre 写出最终值
- [x] 不放宽/删除 post-restart body 断言
- [x] `npm test` / `npm run build`
- [x] 真实 UI-15 post-restart:Round20 PASS
## 完成定义
- [x] 上述实现项有单测或脚本证据
- [x] 现场 post-restart Round20 已通过;stale-snippet 失败归档不删
@@ -0,0 +1,23 @@
---
title: "post-restart 项目名 selector 收紧"
status: done
created: 2026-09-13
updated: 2026-09-14
related_task: "2026-09-13-document-revision-post-restart-selector.md"
---
# post-restart 项目名 selector 收紧
## 本轮
- [x] 点击来自侧栏可见项目入口(complementary exact title),不用 `.first()` 弱化
- [x] 恢复断言为 banner 内 exact 项目名
- [x] `UI_PHASE` 分离 `playwright-output-main|post-restart` 与 `playwright-report-main|post-restart`
- [x] 结果 JSON 分文件:`ui-acceptance-results.json`(main)与 `ui-acceptance-results-post-restart.json`;phase-state/secrets 仍共享
- [x] helper 契约测试 + `npm test` / `npm run build`
- [ ] 真实 UI-15 post-restart(本轮不做)
## 完成定义
- [x] 上述实现项有单测或脚本证据
- [ ] 现场 post-restart 仍开放,不得标 done
@@ -0,0 +1,25 @@
---
title: "项目 reviewer 职责同步收紧"
status: done
created: 2026-09-13
updated: 2026-09-14
related_task: "2026-09-13-document-revision-reviewer-duty-sync.md"
---
# 项目 reviewer 职责同步收紧
## 最后一轮严格修复
- [x] 移出成员后端 reconcile + `ERR_DUTY_SYNC`;前端 `afterProjectMemberPersisted` 刷新文档
- [x] Heal 空 assigned 仅清退出/非成员;在任成员保留;author 不清空
- [x] 显式 revoke:reviewer→viewer、职责转移、退出、幂等;author 不进撤销集
- [x] `CreateOrGetDocument` 失败任务不成功;fault test
- [x] 成员 upsert/退出:advisory lock、读旧/冲突 holder、成员更新、`document_records` 精确清槽同一事务;提交后 heal;失败 `ERR_DUTY_SYNC`
- [x] `HealProjectDocuments` 与成员写同锁键/顺序;解析与文档更新同事务;转移后旧 holder 不复活;第二次 heal 幂等
- [x] `gofmt` / `go vet` / `go test -short` / 相关 `-race` / `npm test` / `build` / 隔离 PG
- [ ] 真实 UI-13a(本轮不做)
## 完成定义
- [x] 上述实现项有测试或隔离 PG 证据
- [ ] 现场 UI-13a 仍开放,不得标 done
@@ -0,0 +1,149 @@
---
title: "文档版本账本运行时 — Ubuntu Server 无头浏览器真实 UI 验收计划"
status: done
created: 2026-09-13
updated: 2026-09-14
---
# 文档版本账本运行时 — Ubuntu Server 无头浏览器真实 UI 验收计划
> **与工程门禁分离**:本文件仅描述**用户限定的最终实战验收**(浏览器页面操作)。
> **严禁**用 API 直灌、DB fixture、`page.route` mock、stub 模型、或伪造 SSE 冒充小队完成。
> 工程单测 / `go vet` / `npm test` / `npm run build` 属于「工程门禁」,见 short-term 证据区,**不能替代**本计划。
## 0. 环境前置(必须占 CURRENT 集成槽位后执行)
| 项 | 要求 |
|----|------|
| OS | Ubuntu Server 22.04+(无图形桌面亦可) |
| 服务 | `./scripts/env-service.sh dev rebuild` → `curl -sf http://127.0.0.1:8080/health`;schema ≥ 28 |
| Agent | 真实 `pi-agent` + 运行中的 `MiniMax-M2.7-highspeed` 容器(禁止 stub) |
| 账号 | ≥2 名项目成员(编制人 A、协作者 B);禁止共用 token 串号;**管理员凭据仅来自 `ADMIN_USERNAME`/`ADMIN_PASSWORD` 环境变量(禁止 spec 硬编码)** |
| 认证契约 | 真实 login/me 返回 snake_case `role_id` 等;前端须映射为 `roleId`,否则管理员入口隐藏(UI-00 已踩坑,见 audit) |
| 用户目录 | 管理员开通 A/B 后,同浏览器立项成员候选须含新账号(`onRefreshUsers` 不得死 prop);跨设备缺口见 [../../audit/2026-09-13-admin-user-directory-sync-ui01.md](../../../audit/2026-09-13-admin-user-directory-sync-ui01.md) |
| 证据根 | `.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui/` |
| 报告 | `.doc/test-reports/YYYY-MM-DD-document-revision-runtime-ui-test-report.md` |
### 0.1 Ubuntu Server 无头 Playwright(Round20 实际路径)
**本轮采用官方容器,无需给 Ubuntu host 安装浏览器:**
```bash
# 测试前部署合入基线(Round20:b258ab8)
./scripts/env-service.sh dev rebuild
curl -sf http://127.0.0.1:8080/health
# 官方镜像跑页面验收(host 网络;BASE_URL 指向工作台 :3100)
docker run --rm --network host --ipc host \
-e RUN_UI_ACCEPTANCE=1 \
-e BASE_URL=http://127.0.0.1:3100 \
-v "$PWD":/work -w /work/web \
mcr.microsoft.com/playwright:v1.63.0-noble \
npx playwright test e2e/document-revision-runtime.spec.ts --project=chromium
```
**备选(本轮未走)**:宿主 `cd web && npx playwright install --with-deps chromium`。仅当不能跑官方容器时使用。
### 0.2 两阶段(验收轮)
1. `RUN_UI_ACCEPTANCE=1 UI_PHASE=main BASE_URL=http://127.0.0.1:3100` 跑主场景(写 `phase-state.json`,密码仅落本地 `phase-secrets.local.json`,不得提交)。产物:`playwright-output-main` / `playwright-report-main` / `ui-acceptance-results.json`
2. 宿主仅 `restart shuimu-agent-app-dev` 一次(PG/PI 未动;不是再次 rebuild)
3. `RUN_UI_ACCEPTANCE=1 UI_PHASE=post-restart` 仅页面登录校验 UI-15。产物:`playwright-output-post-restart` / `playwright-report-post-restart` / `ui-acceptance-results-post-restart.json`(不得覆盖 main 总账或 trace)
4. 文档收口阶段不再动容器。
证据:`.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui/`(trace/video/screenshot);结果 JSON 不得含凭证与 URL query。
---
## 1. 数据来源铁律(FAIL 即整轮作废)
| 允许 | 禁止(一票否决) |
|------|------------------|
| 页面登录后创建项目 | `INSERT`/`psql` 灌 document_records / snapshots |
| 页面上传附件 | 测试进程直连 Postgres 插 fixture |
| 对话输入框真实提问触发小队 | `page.route` 劫持 `/api/v1/chat` 或 SSE 返回假成功 |
| 等待真实 runner 完成 | `AgentBackend=stub` 或 mock MiniMax |
| 打开生成的文档 Tab 观察 UI | API-only 调用 PATCH/OpenTemplate 冒充「用户操作」 |
---
## 2. 用例矩阵(全部必须页面可见)
| ID | 步骤(仅 UI) | 期望页面现象 | 证据 | 判定 |
|----|---------------|--------------|------|------|
| UI-01 | 管理员开通 B 后,tech-lead A **页面创建**项目并勾选成员 | 立项成员候选含 B;项目工作台三栏可见 | 截图 `01-project.png` | PASS |
| UI-02 | 对话输入框发起真实任务(触发真实小队编排) | 助手流式回复;任务进度/文档 busy 可见;网络可见真实 agent 请求 | 截图 + trace | PASS |
| UI-03 | 等待小队**首轮**完成,打开生成的受控文档 Tab | 右侧出现文档;版本工具条 `Vn`/`r*`(非「账本未就绪」) | 截图 `03-first-doc.png` | PASS |
| UI-04 | 打开变更报告:工具条「变更报告」/「待确认报告」或版本历史「报告」 | **首轮**可见:摘要、**风险条目**、项目影响内容、各文档影响原因/建议、开放问题;加载失败显式错误非永久加载中;`fallback` 不得宣称为完整 PI | 截图 `04-first-report.png` | PASS |
| UI-05 | 同项目再触发**二轮**更新生成(真实对话) | 低/中风险:新版本+报告;**高风险**:工具条显示「待确认报告」与 pending 徽章,**版本历史尚无新 V**,打开报告可见完整字段 | 截图 `05-second-report.png` | PASS |
| UI-05a | 编制人对高风险候选点「确认提交」 | decision API `confirmed:true`;版本前进;pending 消失;历史出现带 `change_report_id` 的新版本 | 截图+网络 | PASS |
| UI-05b | 编制人对高风险候选点「拒绝」 | 候选拒绝;pending 消失;版本号不前进;无权用户无确认/拒绝按钮或 decision 403 | 截图+网络 | PASS |
| UI-06 | 双击块编辑 → 保存 → **硬刷新** | 无冲突时工具条 `r` **立即**递增(`revisionRefreshKey`);硬刷新后正文仍为保存内容 | 截图前后对比 | PASS |
| UI-07 | 切换「纯净阅读」 | 块无琥珀/蓝色装饰底 | 截图 | PASS |
| UI-08 | 切换「人工修改」 | 相对当前 Version 的人工修订块琥珀底+下划线暗示 | 截图 | PASS |
| UI-09 | 切换「全部变更」 | 智能体+人工差异;仅人工时允许与 UI-08 相同 | 三模式并排或连续截图 | PASS |
| UI-10 | 「版本历史」+「比较」 | 抽屉列出版本;比较视图展示 hunk | 截图 | PASS |
| UI-11 | **多文档**:同项目再生成/打开第二份受控文档 + **页面上传**附件 Tab | 多 Tab 可切换;各文档 revision-state 独立;附件可预览 | 截图 | PASS |
| UI-12 | 用户 C 打开无权限项目(非成员) | 项目不可见,**不泄漏正文** | 截图 + 网络 403/404 | PASS |
| UI-13 | 拆为 13a reviewer 只读 + 13b A/A 同 r 冲突 | B 无正文编辑;A2 `409 DOCUMENT_HEAD_CONFLICT` 保留草稿 | 双 context 截图 | PASS |
| UI-14 | A 退出 → **重登录** → 打开同一文档 | revision-state 200;正文与 `r` 与退出前一致 | 截图 | PASS |
| UI-15 | (集成槽内)**重启 app 容器**后再打开同一文档 | 账本与正文仍可恢复;非「未就绪」除非确无事实源 | 截图 + `docker restart` 日志摘录 | PASS |
| UI-16 | 页面上传经 freeform 注册后打开;禁止 `doc-upload` 假账本 | 已注册 `doc-free-*` 工具条 V 可见;无 orphan revision-state | 截图 | PASS |
---
## 3. 证据要求(归档规范)
| 类型 | 路径约定 | 最低要求 |
|------|----------|----------|
| 截图 | `assets/.../screenshots/UI-XX-*.png` | 每用例 ≥1;UI-07/08/09 必须能看出三模式差异 |
| Trace | `assets/.../traces/UI-XX.zip`(Playwright trace) | 失败用例必留;PASS 建议全留 |
| 录像 | `assets/.../videos/*.webm` | 首轮生成 + 二轮报告 + 双人冲突 必留 |
| 网络摘录 | 报告正文粘贴关键响应 | `revision-state` 200;`change-reports` 含 summary/risk/open_questions;禁止贴 token |
报告正文每个用例必须含:**Input(页面操作)** / **Actual(可见文本+状态码)** / **Verdict PASS|FAIL** / **Duration**。
---
## 4. 失败标准(任一即 FAIL)
1. 使用 stub / `page.route` mock / DB fixture / 纯 API 灌库冒充 UI 路径
2. 首轮成功生成后仍无变更报告入口,或报告摘要为固定假句「智能体交付物已生成」;或报告面板缺少风险条目/项目影响/文档影响原因建议/开放问题
2b. 高风险二轮仅有小队成功文案但工具条无「待确认报告」、或未确认就静默进版本历史、或 `confirmed:false` 仍提交成功
3. 把 `analysis_status=fallback` 文案写成「PI 完整分析」或隐瞒开放问题
4. 人工保存返回成功但刷新丢正文,或投影失败仍 200
5. 三 overlay 视觉无差异(截图无法区分)
6. 双上下文后写静默覆盖
7. 无权限用户可见正文片段
8. 容器重启后受控已落盘文档仍永久「账本未就绪」(在确有 output.md / 记录的前提下)
9. 证据目录缺失或无法打开 trace/截图复盘
---
## 5. 通过标准
- UI-01…UI-16 全部 PASS,证据归档完整
- 工程门禁另栏 PASS(不记入本计划勾选)
- 已知 blocker `DOCREV-RT-PI-NARRATIVE`:允许 fallback,但必须可见真实 diff 摘要 + 开放问题标明叙事待补
- `DOCREV-RT-UPLOAD-ORPHAN`:UI-16 按空状态 PASS,不得伪造成功账本
---
## 6. 与工程门禁对照
| 类型 | 命令/产物 | 可否代替 UI 验收 |
|------|-----------|------------------|
| 工程 | `go vet ./...`;`go test -short ./...`;`cd web && npm test && npm run build` | **否** |
| PG 可选 | `TEST_DATABASE_URL=... go test ./internal/docrevision -run TestPGPersist` | **否** |
| 本计划 | Playwright 无头真实页面 + 真实小队 | **是(唯一最终)** |
## 7. 本轮状态
- Round20(2026-09-14)真实页面验收 **PASS**:results JSON 21/21;Playwright main 18 passed / 1 post skipped;仅 `restart shuimu-agent-app-dev` 后 post 1 passed / 18 skipped。
- 测试前 `env-service.sh dev rebuild` 部署 `b258ab8`;文档收口不再动容器。
- 项目 `UI验收-超声微创系统-mu0gwiez`(6159);intake `doc_proj6159_intake`;终态 V3/r2 / `A1-win-mu0gwiez`。
- 报告:[../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md](../../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md)
- Ubuntu 无头:`mcr.microsoft.com/playwright:v1.63.0-noble`(`--network host --ipc host`,`BASE_URL :3100`);本次无需给 host 装浏览器。宿主 `npx playwright install` 仅备选。
- 顶层截图 **21** 个文件:主阶段 20 张(含 UI-15-pre)+ post-restart 1 张;与 results JSON 21 条不是同一计数。
- 工程门禁另栏:`go test -short` / `go vet` / web 333+30 / build PASS;`-race` 全包并行 **NOT PASS**(`TestCreateTaskRun_PreActivationAcceptedNot409` TempDir cleanup)。
- 全仓仍 `production_ready=no`(`CHAT-INTENT` 等)。
@@ -0,0 +1,57 @@
---
title: "PG ID 重映射:Round20 后关闭"
created: 2026-09-13
updated: 2026-09-14
from: Cursor-Auto
to: next-agent
status: done
---
# 交接:PG ID 重映射(已合入并经 Round20 验证)
## 目标(下一位 Agent 应完成什么)
- 不要重开本缺陷,除非新现场再次出现 `CommitAgentVersion` not found
- 不要改删 Round19 失败归档
- 全仓焦点已离开文档运行时 UI;勿占用已释放的 DOCREV-RT 集成槽,除非新任务登记
## 已完成
- 统一 `advanceID` / `nextFreeID` / `adopt*ID`
- 隔离 PG 高序列首次生成:baseline 不丢、重启 hydration
- 合入 `dev@b258ab8`
- Round20 真实 UI-03:项目 6159 首次生成 V2/r0,不再 `docrevision: not found`
## 未完成
- 无(本缺陷)。PI 叙事 fallback 与 `CHAT-INTENT` 属其他条目
## 认领 / 槽位状态
| 项 | 值 |
|----|-----|
| mutex 已释放 | yes |
| 集成槽位 holder | idle(运行时 UI 收口后释放) |
| branch | 已合入 `dev`(`merge: fix/document-revision-pg-id-remap`) |
| worktree | - |
## 关键文件
| 路径 | 说明 |
|------|------|
| `internal/docrevision/ids.go` | counter / adopt |
| `internal/docrevision/pg_mutate.go` | PG 写入后 adopt |
| `internal/docrevision/pg_id_remap_test.go` | 隔离 PG 碰撞 |
## 如何验证
见 [../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md](../../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md)。不要把 output snapshot 250 写成 candidate 250(6158 现场:candidate id=175、output snapshot id=250、report id=175)。
## 风险 / Blocker
- 不得把 `ErrNotFound` 改成忽略
## 相关链接
- CURRENT: [../CURRENT.md](../../../ops/CURRENT.md)
- Task: [../short-term/2026-09-13-document-revision-pg-id-remap.md](../2026-09-13-document-revision-pg-id-remap.md)
@@ -0,0 +1,40 @@
---
title: "post-restart 最终正文 snippet:Round20 后关闭"
created: 2026-09-13
updated: 2026-09-14
from: Cursor-Auto
to: next-agent
status: done
---
# 交接:post-restart 最终正文 snippet(已验证)
## 目标(下一位 Agent 应完成什么)
- 不要改删 `schema31-postrestart-stale-body-snippet-failure`
- 不要删除 post-restart `bodySnippet` 可见断言
- 新 UI 轮次必须继续把 UI-13b A1 成功正文写入 phase-state
## 已完成
- `durableBodySnippet`:成功修订覆盖;冲突稿不入账
- UI-13b / UI-15-pre 同步最终 marker
- Round20 post-restart:login / 项目 6159 / `revision-state` 200 / V3/r2 / `A1-win-mu0gwiez`
## 未完成
- 无(本缺陷)
## 认领 / 槽位状态
| 项 | 值 |
|----|-----|
| mutex 已释放 | yes |
| 集成槽位 holder | idle |
| branch | 已合入 `dev` |
| worktree | - |
## 相关链接
- Test report: [../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md](../../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md)
- Task: [../short-term/2026-09-13-document-revision-post-restart-final-snippet.md](../2026-09-13-document-revision-post-restart-final-snippet.md)
@@ -0,0 +1,70 @@
---
title: "post-restart 项目名 selector:编码后交接"
created: 2026-09-13
from: Cursor-Auto
to: next-agent
status: done
updated: 2026-09-14
---
# 交接:post-restart 项目名 selector(暂不合入)
## 目标(下一位 Agent 应完成什么)
- 不要在本分支继续改职责/业务语义
- 合入前占 CURRENT 集成槽位;本轮禁止 merge / 重建容器 / 声称 post-restart 通过
- 占槽后重跑 `UI_PHASE=post-restart`,确认 UI-15 走到 revision-state
## 已完成
- post-restart:侧栏 exact title 点击 + banner exact 项目名断言
- Playwright 产物按 `UI_PHASE` 分目录,避免第二阶段覆盖主阶段
- 结果 JSON:main 仍写 `ui-acceptance-results.json`;post-restart 写 `ui-acceptance-results-post-restart.json`;`phase-state` / secrets 共享
- helper 契约测试;`npm test` / `npm run build`
## 未完成
- 真实 UI-15 post-restart
- 合入 `dev`
## 认领 / 槽位状态
| 项 | 值 |
|----|-----|
| mutex 已释放 | no(`document-revision-post-restart-selector` 仍 `in_progress`) |
| 集成槽位 holder | 他人 e2e;本任务未占槽 |
| branch | `fix/document-revision-post-restart-selector` |
| worktree | - |
> 若 mutex 未释放,下一位须先在 CURRENT 认领或写 blocker。
## 关键文件
| 路径 | 说明 |
|------|------|
| `web/src/lib/currentProjectRestore.ts` | 入口 / banner locator 契约 |
| `web/src/lib/playwrightPhaseArtifacts.ts` | 阶段目录名 |
| `web/e2e/document-revision-runtime.spec.ts` | post-restart UI-15 |
| `web/playwright.config.ts` | 分阶段 outputDir / HTML report |
## 如何验证
```bash
cd web && npm test && npm run build
# 真实 UI(本轮不做):
# RUN_UI_ACCEPTANCE=1 UI_PHASE=post-restart npx playwright test e2e/document-revision-runtime.spec.ts
```
产物:`playwright-output-main` / `playwright-report-main` / `ui-acceptance-results.json` 与 `playwright-output-post-restart` / `playwright-report-post-restart` / `ui-acceptance-results-post-restart.json`。`phase-state.json` 与 `phase-secrets.local.json` 跨阶段共享;`UI-15-post-restart.png` 可与主阶段截图同目录。
## 风险 / Blocker
- 侧栏折叠时 complementary 入口不可见,应 FAIL 而非 `.first()` 跳过
- 不得改删 schema31 失败归档
## 相关链接
- CURRENT: [../CURRENT.md](../../../ops/CURRENT.md)
- Task: [../short-term/2026-09-13-document-revision-post-restart-selector.md](../2026-09-13-document-revision-post-restart-selector.md)
- Checklist: [../checklists/2026-09-13-document-revision-post-restart-selector.md](../checklists/2026-09-13-document-revision-post-restart-selector.md)
@@ -0,0 +1,73 @@
---
title: "reviewer 职责同步:heal 同事务锁后交接"
created: 2026-09-13
from: Cursor-Auto
to: next-agent
status: done
updated: 2026-09-14
---
# 交接:reviewer 职责同步(暂不合入)
## 目标(下一位 Agent 应完成什么)
- 不要在本分支继续改职责语义,除非新审查点
- 合入前占 CURRENT 集成槽位,再 `--no-ff` 合 `dev`;本轮禁止 merge / 重建容器 / 声称 E2E
- 6145 的 B 仍是空 `document_duty`,须再走成员 API 写成 reviewer 后自愈才会对齐文档
## 已完成
- Heal 以 assigned 为权威;空 assigned 只清失效审核/批准 holder
- 成员增改/移出:同一事务内 advisory lock + 读旧/冲突 holder + 成员写 + 精确清 reviewer/approver 槽;提交后服务层 heal 新 holder
- `HealProjectDocuments` 与成员写共用 `pg_advisory_xact_lock(project_id)`;解析与文档读写同事务;错误回滚
- 确定性并发 PG:成员写持锁未提交时 heal 进入 `pg_locks` 等待;提交后旧 reviewer 不复活;第二次 heal 幂等
- 同步失败仍显式 `ERR_DUTY_SYNC`;author 不因普通成员变更清空
- 账本创建失败任务失败
## 未完成
- 真实 UI-13a
- 合入 `dev` 与共享容器 schema 31 晋升
## 认领 / 槽位状态
| 项 | 值 |
|----|-----|
| mutex 已释放 | no(`document-revision-reviewer-duty-sync` 仍 `in_progress`) |
| 集成槽位 holder | 他人 e2e;本任务未占槽 |
| branch | `fix/document-revision-reviewer-duty-sync` |
| worktree | - |
> 若 mutex 未释放,下一位须先在 CURRENT 认领或写 blocker。
## 关键文件
| 路径 | 说明 |
|------|------|
| `internal/docduty/revoke.go` | `AcquireProjectDutyLock`(与成员写同键) |
| `internal/docduty/store.go` | heal lock + 解析 + 回填同事务 |
| `internal/authz/authorizer.go` | upsert / setStatus 走同一 lock helper |
| `scripts/run-isolated-duty-sync-pg-tests.sh` | 隔离 PG 入口 |
## 如何验证
```bash
go test -short ./...
go test -short -race ./internal/docduty ./internal/authz ./internal/bizdev ./internal/server
cd web && npm test && npm run build
# 隔离库,禁止 agent_system_dev:
./scripts/run-isolated-duty-sync-pg-tests.sh
```
## 风险 / Blocker
- 旧项目未写 `document_duty` 时,在任成员仍留在文档槽位(有意兼容)
- 显式降级/退出才会撤 reviewer/approver;author 永不被 revoke
- 6145 B 不会被臆造为 reviewer
## 相关链接
- CURRENT: [../CURRENT.md](../../../ops/CURRENT.md)
- Task: [../short-term/2026-09-13-document-revision-reviewer-duty-sync.md](../2026-09-13-document-revision-reviewer-duty-sync.md)
- Checklist: [../checklists/2026-09-13-document-revision-reviewer-duty-sync.md](../checklists/2026-09-13-document-revision-reviewer-duty-sync.md)
@@ -0,0 +1,49 @@
---
title: "FEATURE-MATRIX 深度测试 + 晋升部署 test"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
branch: feature/matrix-deep-test-promote-test
worktree: "-"
mutex: infra
---
# FEATURE-MATRIX 深度测试 + 晋升部署 test
## 目标
按 FEATURE-MATRIX 对已实现模块做分层深度回归,通过后将本地 `dev` 晋升到 `test`(`rc-v1.0.0-beta.2`)并 rebuild/冒烟 `:8081`。
## 范围
- Wave 1:vet/short/arch/npm/bundle + 模块定向 + 隔离治理 PG
- Wave 2:dev `:8080` live API 抽检
- Wave 3:真实 PI 抽样(失败再升格三链)
- Wave 4:`dev` → `test` + rebuild + smoke
- Wave 5:测试报告 + SSOT
## 非目标
- 不实现纯软件项目自举
- 不默认 28min 三工作流 PI;不合 `main`;不改项目 143;不启用 FAV
## 步骤
1. [x] 认领占槽
2. [x] 自动化深度回归
3. [x] live `:8080` 抽检
4. [x] PI 抽样
5. [x] 晋升 test 并冒烟
6. [x] 报告与归档
## 验收标准
- [x] 矩阵已实现行均有 PASS 证据
- [x] `:8081` health/ready schema=47;`test-env-smoke.sh` PASS
- [x] tag `rc-v1.0.0-beta.2`;报告归档
## 相关链接
- Plan: matrix_deep_test_promote
- FEATURE-MATRIX / CURRENT / gap-matrix
@@ -0,0 +1,47 @@
---
title: "发布门禁闭环 → production_ready"
status: done
created: 2026-09-16
updated: 2026-09-16
owner: Cursor-Auto
branch: docs/production-ready-flip
worktree: "-"
mutex: ci
---
# 发布门禁闭环 → production_ready
## 目标
按 gap-matrix 发布门禁勾选 B1–B4,对齐环境 schema 后翻 `production_ready=yes`。
## 范围
- B1 CI TEST_DATABASE_URL + 治理 PG(已完成)
- B2 真实 PI 三工作流 E2E(已完成)
- B3 对话全链路恢复(已完成)
- B4 版本冲突/终止 preview(已完成)
- B5 SSOT 翻旗 + main schema 对齐(已完成)
## 非目标
- 多意图 U9–U12、软件项目自举、FAV、完整 PI change-report 叙事
## 步骤
1. [x] B1 BUG-08
2. [x] B2 PI E2E
3. [x] B3 chat refresh + restart
4. [x] B4 conflict + termination-preview + envelope unwrap
5. [x] B5 merge/smoke、main rebuild 迁库、翻旗
## 验收标准
- [x] gap 门禁四框可勾(含对话与前端)
- [x] FEATURE-MATRIX / gap / CURRENT `production_ready: yes`
- [x] main/dev/test health schema_version=47
## 相关链接
- Test reports: `2026-09-16-ci-governance-pg-bug08`、`pi-three-workflow-e2e`、`chat-refresh-gate`、`frontend-gate-b4`
- gap-matrix / FEATURE-MATRIX / CURRENT

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