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>
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>
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>
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>
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>
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>
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>
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>
Explicit aliases (including 系统设计输入) must win before keyword fallback so UI-11 does not route to intake.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>