Commit Graph
140 Commits
Author SHA1 Message Date
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 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
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 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 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
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 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 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 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 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 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
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 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
weichen 6ab8b52113 fix(taskrun): reject busy documents before run creation 2026-09-13 04:43:50 +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 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 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
weichen 77b8d07cd7 fix(governance): 统一文档访问判定与上下文快照排除计数
补齐 DocumentAccessDecider HTTP 409、projectcontext 私有对话排除统计,并更新整改 gap matrix 与测试报告。
2026-09-13 02:50:23 +00:00
weichenandCursor 574dd16546 fix(frontend): skip hash anchor navigation until session is validated
Avoid chat day fetches with empty session_id on the login page when a stale URL hash is present.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 47984f4863 fix(frontend): gate data fetches until session validated and improve workflow UX
Prevent login-page 401 noise by deferring project/chat API calls until auth is confirmed, use public-config for registration policy, and add client-side duty assignment checks before saving workflow plans.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 90f77eac93 feat(authz): implement six-phase permissions, settings and workflow v2
Close P0 auth gaps for lineage/runs, stage ABAC fail-closed, and
project:create; add IAM migrations 00021-23, me settings APIs, schema v2
manifests, orchestrator skeleton, and gate A regression coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor d7a144de26 feat(taskrun): resume interrupted runs and harden P1 security gaps
Add confirm-gated resume API with resumable flag, Phase 5 finalize fault
and rolling-restart replay tests, Mermaid strict mode, request body limits,
and optional Runner Bearer auth between app and pi-agent.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor b6035991d4 feat(notification): add 24h stage advance reminder and confirm on advance.
Poll pending requests every 15 minutes, emit deduplicated escalation notifications, and close requests when creator confirms stage advance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 69a3be5463 feat(web): poll stage ready notifications to refresh advance banner.
Poll project notifications every 15s and reload readiness when stage_ready_to_advance arrives.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor e0c39aa38c feat(service): add stage gate readiness and creator-confirmed advance.
Evaluate required document approvals before stage transition, expose readiness/advance APIs, show StageAdvanceBanner in the UI, and keep legacy workflow switch for explicit initial_workflow_key projects.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 1fa6e9aa77 feat(web): add project workflow settings wizard and replace free switcher.
Topbar shows configure/view workflow actions under governance mode with a multi-step ProjectSettingsModal for plan, duty assignment, and confirmed activation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor ebbfc2db18 feat(web): add admin workflows and template library tab
Admin console can list workflow definitions, validate/publish draft versions,
and view bootstrap template assets from the server API.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
weichenandCursor a56d033d3c feat(web): fail-closed capabilities and admin roles from server API
Stop persisting roles to localStorage as authority; AdminSettingsModal reads
and writes role matrices via /api/v1/admin/roles; hasPermission denies when
capabilities are not loaded from /auth/me.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
weichen 47b8179824 feat(web): wire project members CRUD to REST API
Add projectMembers client and role adapter; sync members from server on login and modal open; persist add/update/remove via /api/v1/projects/{id}/members.
2026-09-13 02:50:22 +00:00
weichen 844bfd2803 feat(web): consume server capabilities for RBAC decisions
Fetch and cache capabilities from /auth/me on login and session restore; hasPermission prefers server capabilities over local role definitions.
2026-09-13 02:50:22 +00:00
weichen d612c1193e fix(web): remove identity simulation and stop sending X-User-ID
Product UI no longer switches sessions locally; API clients attach Bearer
tokens only and LocalAuthClient stays test-only outside the prod bundle.
2026-09-13 02:50:22 +00:00
weichen 3145550a59 feat(security): complete P0 release blocking remediation
Unify auth middleware and remove X-User-ID trust, add project_members
authorization, sandbox workspaces via resolver, and admin-only reconcile
by run_id. Introduce goose migrations with startup schema gate, fail closed
when DB unavailable outside explicit ALLOW_IN_MEMORY, bundle web/dist in
app Dockerfile, and remove frontend pseudo-login fallback.
2026-09-13 02:50:22 +00:00
WeiCHENandCursor f4e4357ddb fix(agent): Chat Agent 全链路 P0-P5 整改
封堵鉴权旁路与导出 IDOR,DocGov 改服务端身份;对话层 PendingAction 接真实 docgov/taskrun;修复流式租约假死与会话级任务流;加固配置/doc_id/NULL;补齐 slog 与测试;前端 ErrorBoundary 与受控文档重试。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor 9d40a91f9d feat(web): sync workflow docs from server and persist task artifact in chat
Pass doc_id on task runs, merge server deliverable state by task_key,
fetch controlled document content when opening non-template docs, and
map metadata.artifact after refresh.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor bbd1218922 feat(web): asset upload, task run observer, and session lineage on tasks
Upload binary attachments as project assets, subscribe by run_id after refresh,
and pass session_id/project_id through long-task requests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor 70493a3ed5 feat(web): wire project list and create to server API
Login syncs projects from GET /api/v1/projects; create project uses POST with server-assigned id while preserving local sessions and templates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor 636eb0ccf1 fix(web): align workbench user ids with auth seed
Unify MOCK_USERS with backend auth (admin id=1), merge session identity on login, and migrate demo seeds/tests to id 2/3/4 for 张工/李/王.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor a8c8cba447 fix(web): keep draft when send preflight fails
Return accepted/error from handleSendMessage, clear InputArea only on success, and surface thinking/streaming feedback.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor f9c4f9b01b fix(web): add secure-context-safe clientTurnId helper
Provide RFC 4122 v4 fallback via getRandomValues for LAN HTTP pages where randomUUID is unavailable.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHEN eea28f0be4 feat(task): inject uploaded documents into task materials and enable LAN host access
- backend: add Materials field to TaskRunRequestDTO and forward to ExecuteTask
- backend: add TestTaskStream_MaterialsInjection test case in taskstream_test.go
- web: serialize materials in buildTaskRequest and add unit test
- web: improve isSameMessage identity comparison in messageIdentity.ts
- web: configure host: '0.0.0.0' in vite.config.ts for LAN collaboration access
2026-09-13 02:50:22 +00:00