Commit Graph
73 Commits
Author SHA1 Message Date
weichen f3f23a3018 feat(errcode): 用稳定错误码记录 HTTP 与异步失败
失败响应此前不写日志,request_id 无法对照原因。注册表不覆盖处理器已经给出的 HTTP 状态。
2026-09-28 02:27:16 +00:00
weichen 88b7c11a23 fix(auth): reseed standard roles and reject duplicate usernames as 400
Registration always writes role-guest; a deleted standard role became a masked INTERNAL. Username unique violations are now a 400 instead of an infrastructure 500.
2026-09-28 01:12:07 +00:00
weichen 88e33282db fix(freedoc): persist uploaded file metadata and text body server-side
上传文档跨端不可访问修复(ISSUE-20260927-upload-doc-cross-device):
- 迁移 00076:freeform_documents 增加 source_filename/mime/size_bytes/asset_id
- freedoc:Create/Get/List 读写源文件元数据,负值拒绝
- 前端:注册前全部附件先登记 CAS 并预读文本正文;文本正文嵌入注册
  markdown;跨端恢复 sourceType/fileMeta 路由回文件预览器
- 大小显示 formatFileSize(<512B 不再显示 0 KB)
- E2E 新增 FS-UPLOAD-02 跨浏览器上下文可访问性用例

回归:go vet/arch-check/go test -short(隔离 PG)+ web npm test/build 全绿;
存量无元数据旧文档不可恢复(重新上传即可)。
2026-09-27 07:45:15 +00:00
weichen 83561682eb feat(swboot): wire SWBOOT-10 controlled patch executor (fail-closed)
DB-backed repo_path_allowlist reader (deny-all until admin seeds), per-prefix
admin test_commands (goose 00075), execution evidence table (goose 00074),
isolated git-worktree patch executor with command allowlist/time/output caps
and failure-stops evidence; controlled_patch creation/preview unlocked only
with an allowlisted repo binding (projectworkflow gate + catalog flag);
creator-only server endpoints for bindings/executions; merge/push/deploy stay
behind a typed separate-authorization boundary. Module boundary: app->swboot
composition import registered.
2026-09-26 00:56:59 +00:00
weichen b5a782bb38 feat(chat): dialogue triggers for comments/reopen/pending-supplements with mistouch guards
Wire intent→coordinator DocResolver confirm cards→action_executor kinds for comment, reopen, pending-supplements query, and real submit-review execution.
2026-09-25 20:14:10 +00:00
weichen 2e56ba9719 feat(docgov): complete review lifecycle gaps for lock/notify/comment/reopen
Defer locked-period supplements to a pending ledger, route duty-holder
notifications, persist stage-scoped comments, and prefer Approver for reopen.
2026-09-25 20:08:56 +00:00
weichen a9c9a9182e refactor(server): remove 24 mirrored Runtime fields via nil-safe accessors; fix Shutdown-vs-background-loop DATA RACE and goose 00071 duplicate version
- Server no longer mirrors app.Runtime services (gov/svc/pwSvc/...): 574 call sites now use accessors in runtime_accessors.go
- backgroundLoop (mutex+sync.Once) stops sweeper/publisher/reminder/wsGC goroutines race-free (baseline 44161d2a reproduced DATA RACE; now green under -race)
- goose 00071 duplicate (dialogue merge 1da17a28 brought two 00071): context-conflict-adjudications renumbered to 00072; dev DB applied only through 00070 so zero data migration
- task_finalize tests build minimal app.Runtime; test injection via serverTestOverrides + setOverride* (explicit-nil markers for fail-closed cases)
2026-09-25 13:17:22 +00:00
weichen 1da17a282c merge: candidate dialogue-context-layout-fix-2026-09-25 into dev 2026-09-25 04:01:46 +00:00
weichen 86e9d3706b feat(sysadmin): admin env settings + maintenance FD handoff
Persist agent/secrets settings with masked secrets and runner hot-reload;
add maintenance windows, maintpage binary, and zero-downtime listener handoff.
2026-09-24 23:20:20 +00:00
weichen dc29b84cdf feat(ctx): inject cleaned project dialogue into squad and assistant
Add dialoguectx packaging, conflictresolve adjudication with HITL routing,
workspace context/dialogue/ injection (default on), and goose 00071.
2026-09-24 17:04:04 +00:00
weichen b812d1d30f feat(dev): single-binary no-docker runtime with managed localpg
Embed web/dist, run events in-process, manage brew PG18+pgvector, add PI host sidecar and launch --no-docker; unify MiniMax-M2.7-highspeed pins and record dev acceptance.
2026-09-24 15:53:50 +00:00
weichen 4e0e6a1418 feat(notification): digest aggregates, supplement-impact batch, and free-collab hooks
Add notification digests with ON CONFLICT DO UPDATE, migrations 00068-00070,
supplementimpact module (analyze → confirm → claim-aware split), and wire
coordinator/mutate hooks plus proposal_required digests.
2026-09-24 11:44:20 +00:00
weichen 39f8c1d134 feat(auth): admin password reset API and credential guards
Implement T20-F4-B reset-password endpoint with one-time temp password,
audit table, frontend wiring, login error envelope parsing, and
CreateUser fail-closed for empty password hashes. Recovered test chenwei
via env write (password out of band).
2026-09-24 04:18:58 +00:00
weichen 6032dbaa16 merge: integrate go-agentx runtime into local_dev candidate
Bring pinative/agentx workspace registry and A-B harness onto current
local_dev; renumber goose agentx registry 00062→00066 to avoid clash
with chat-summary/provenance migrations. Keep CURRENT/MATRIX as ours
for later docs apply; union module-boundaries agentx import tree.
Path literals use workspace constants for arch-check.
2026-09-23 13:25:32 +00:00
WeiCHEN 73e1797987 feat(sysadmin): add goose 00065 for system:* and settings audits
Restore the migration that seeds console permissions and creates
system_settings_audits so PG environments match the phase-2 API.
2026-09-23 10:15:15 +08:00
WeiCHEN d49c8f8cfc feat(sysadmin): system permission checks and settings audit list
Expose fine-grained system:* checks (admin grants all) and list
system_setting_policy_audits for settings change visibility.
2026-09-23 10:11:46 +08:00
WeiCHEN b627134c62 feat(sysadmin): add system:* permissions and settings audit log
Seed fine-grained console permissions (goose 00065), gate admin
handlers by system:* keys, and persist settings change audits for
all upserts. KB ops and whitelist consumers stay deferred.
2026-09-23 10:09:10 +08:00
WeiCHEN 6d3efdf4d7 feat(auth): show real names in duty pickers and enable profile edits
Add a login-visible user directory API and admin/self profile update
paths so project duty selectors stop falling back to "用户 N", and so
users can persist display fields with an admin-edit tip.
2026-09-23 09:39:41 +08:00
WeiCHEN 3bdd53ae35 fix(freedoc): widen freeform project_id to BIGINT for snowflake IDs
UI-11 POST /freeform-documents 500 when project_id exceeds int4.
Align Go types + goose 00063 with projects.id BIGINT.
2026-09-23 00:45:31 +08:00
WeiCHEN 056e4e5c4b feat(chat): productionize semantic summary shadow path without REPLACE 2026-09-22 21:51:20 +08:00
weichen 2de4eda16d feat(workspace): register workspaces and gate cleanup by receipts
Track workspace size and age, expose an admin list and cleanup route, and refuse TTL or quota deletion until a frozen manifest matches verified receipts.
2026-09-21 14:58:21 +00:00
weichenandCursor 1e482023b6 feat(db): add asset_parses and material_chunks tables
Cache MinerU parse results by blob hash and store project-scoped
chunk embeddings for large uploaded materials.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 08:29:10 +00:00
weichenandCursor 7bb46d9ec8 fix(db): archive coexisting legacy document task keys
正式台账 doc_proj* 上,旧键与发布键不能再并存。孤立旧键和 doc_test_db 测试残留不动,项目 143 无重复行所以不会被改写。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 06:37:10 +00:00
weichenandCursor 33ee59641f feat(trace): add the project trace ledger and bounded impact walk
Keep item revisions and edge decisions as records, and refuse to treat a missing index as no impact.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 15:35:07 +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
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 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
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 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 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 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 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 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 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 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 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
weichenandCursor f0029dffed merge: origin/feature/software-project-bootstrap
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:46:45 +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
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 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
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 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 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 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 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
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
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
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
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
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