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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Update gap-matrix CHAT-HISTORY-REFRESH to PASS, sync CURRENT and
short-term checklist with implementation evidence.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
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>
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>
Replay 358 linear commits as 14 feature/fix epics with merge --no-ff;
include manifest, rewrite script, SHA map, and git-workflow-helper alignment.
Co-authored-by: Cursor <cursoragent@cursor.com>
Align AGENTS, Cursor rule, PROJECT, README, templates, and CURRENT with
strategy A: no direct commits on dev/test/main; all work branches from dev.
Co-authored-by: Cursor <cursoragent@cursor.com>
Move docs/superpowers to archive/design/superpowers with stubs;
archive workflow rules to PROJECT SSOT; separate test-report assets.
Update Go doc path references.
Co-authored-by: Cursor <cursoragent@cursor.com>