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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Record MarkProposalApplied ordering, CommitAgentVersion retry contract,
and the UI acceptance skeleton paths on the short-term task.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
TaskRunResult now fails visibly when ledger/report materialization errors;
invalid or unassessed reports are never auto-committed.
Co-authored-by: Cursor <cursoragent@cursor.com>
Expand the headless UI checklist and record remaining real blockers without
claiming PI narrative or E2E completion.
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>
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>
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>
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>
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>