From 2b901a61deb74d2d2b905c0073e3967763ee5c3a Mon Sep 17 00:00:00 2001 From: WeiCHEN Date: Wed, 23 Sep 2026 00:42:30 +0800 Subject: [PATCH 1/7] fix(freedoc): widen freeform project_id to BIGINT Snowflake project IDs exceed int4; upload registration failed with pgx encode errors. Align column and Go types with projects.id. --- .../2026-09-22-freeform-project-id-bigint.md | 27 +++++++++++++++++++ ..._2026-09-22-freeform-project-id-bigint.sql | 10 +++++++ internal/freedoc/create_document_test.go | 19 +++++++++++++ internal/freedoc/service.go | 2 +- internal/freedoc/types.go | 8 +++--- internal/server/freeform_doc_api.go | 6 +++-- 6 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 .doc/ops/short-term/2026-09-22-freeform-project-id-bigint.md create mode 100644 deploy/postgres/goose/00063_2026-09-22-freeform-project-id-bigint.sql diff --git a/.doc/ops/short-term/2026-09-22-freeform-project-id-bigint.md b/.doc/ops/short-term/2026-09-22-freeform-project-id-bigint.md new file mode 100644 index 00000000..b5064028 --- /dev/null +++ b/.doc/ops/short-term/2026-09-22-freeform-project-id-bigint.md @@ -0,0 +1,27 @@ +--- +title: "freeform project_id BIGINT 对齐 projects.id" +task_id: "freeform-project-id-bigint-2026-09-22" +status: in_progress +created: 2026-09-22 +owner: Cursor +task_type: implementation +branch: feature/freeform-project-id-bigint-2026-09-22 +worktree: .worktrees/freeform-project-id-bigint-2026-09-22 +write_scope: ["deploy/postgres/goose", "internal/freedoc", "internal/server", ".doc"] +allowed_environments: ["dev"] +mutex: "deploy/postgres/goose + freeform" +--- + +# freeform project_id BIGINT + +## 问题 +`POST /api/v1/freeform-documents` 在雪花 `project_id`(>int4 max)时 pgx 编码失败(OID 23),阻塞 UI-11 附件注册。 + +## 修复 +- goose `00063`:`freeform_documents.project_id` → BIGINT +- Go `ProjectID`/`ListDocuments` → int64;list query 用 `ParseInt` +- 活库已手工 ALTER(schema 仍报 61);合入后 goose 幂等加固 + +## 验证 +- `go test ./internal/freedoc/ -short` PASS(含 snowflake 回归) +- 活库 column = bigint diff --git a/deploy/postgres/goose/00063_2026-09-22-freeform-project-id-bigint.sql b/deploy/postgres/goose/00063_2026-09-22-freeform-project-id-bigint.sql new file mode 100644 index 00000000..bfc52c12 --- /dev/null +++ b/deploy/postgres/goose/00063_2026-09-22-freeform-project-id-bigint.sql @@ -0,0 +1,10 @@ +-- +goose Up +-- freeform_documents.project_id must match projects.id (BIGINT snowflake). +-- Prior INT rejected inserts once project IDs exceeded int4 max (~2.1e9). + +ALTER TABLE freeform_documents + ALTER COLUMN project_id TYPE BIGINT; + +-- +goose Down +ALTER TABLE freeform_documents + ALTER COLUMN project_id TYPE INT; diff --git a/internal/freedoc/create_document_test.go b/internal/freedoc/create_document_test.go index c1203163..8da7395a 100644 --- a/internal/freedoc/create_document_test.go +++ b/internal/freedoc/create_document_test.go @@ -59,6 +59,25 @@ func TestCreateDocument_ClientKeyIdempotentAndBootstrapsLedger(t *testing.T) { assert.NotEqual(t, detail.Document.DocID, otherUser.Document.DocID) } +func TestCreateDocument_AcceptsSnowflakeProjectID(t *testing.T) { + // projects.id is BIGINT; freeform must accept IDs above int4 max (regression: int4 encode 500). + const snowflakeProjectID int64 = 1789095399489 + svc := freedoc.NewService(nil, nil) + detail, err := svc.CreateDocument(context.Background(), 42, freedoc.CreateFreeformDocRequest{ + ProjectID: snowflakeProjectID, + Title: "upload-snowflake.txt", + ContentMarkdown: "# snowflake project id\n", + }) + require.NoError(t, err) + require.NotNil(t, detail) + assert.Equal(t, snowflakeProjectID, detail.Document.ProjectID) + + list, err := svc.ListDocuments(context.Background(), 42, snowflakeProjectID, "my_private") + require.NoError(t, err) + require.NotEmpty(t, list) + assert.Equal(t, snowflakeProjectID, list[0].ProjectID) +} + func TestCreateDocument_RejectsEmptyContent(t *testing.T) { svc := freedoc.NewService(nil, nil) _, err := svc.CreateDocument(context.Background(), 1, freedoc.CreateFreeformDocRequest{ diff --git a/internal/freedoc/service.go b/internal/freedoc/service.go index 16f9eb73..05e3b866 100644 --- a/internal/freedoc/service.go +++ b/internal/freedoc/service.go @@ -525,7 +525,7 @@ func (s *Service) GetDocument(ctx context.Context, userID int, docID string) (*F } // ListDocuments 按空间与权限列出自由文档概要 -func (s *Service) ListDocuments(ctx context.Context, userID int, projectID int, space string) ([]FreeformDocSummary, error) { +func (s *Service) ListDocuments(ctx context.Context, userID int, projectID int64, space string) ([]FreeformDocSummary, error) { if space != "my_private" && space != "project_shared" && space != "trash" { space = "my_private" } diff --git a/internal/freedoc/types.go b/internal/freedoc/types.go index 78b5cfcd..a0f0898e 100644 --- a/internal/freedoc/types.go +++ b/internal/freedoc/types.go @@ -16,7 +16,7 @@ var ( // FreeformDocument 自由私密/共享文档元数据 type FreeformDocument struct { DocID string `json:"doc_id"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` OwnerUserID int `json:"owner_user_id"` SourceMessageID *int64 `json:"source_message_id,omitempty"` SourceContentSHA256 string `json:"source_content_sha256"` @@ -53,7 +53,7 @@ type FreeformDocDetail struct { // FreeformDocSummary 列表项概要 type FreeformDocSummary struct { DocID string `json:"doc_id"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` OwnerUserID int `json:"owner_user_id"` Title string `json:"title"` Space string `json:"space"` @@ -66,14 +66,14 @@ type FreeformDocSummary struct { // CreateFromMessageRequest 从单条消息保存到私密文档请求 type CreateFromMessageRequest struct { MessageID int64 `json:"message_id"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Title string `json:"title,omitempty"` ExpectedSHA256 string `json:"expected_sha256,omitempty"` } // CreateFreeformDocRequest 直接创建空白/自定义自由文档请求(上传附件即时注册事实源) type CreateFreeformDocRequest struct { - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Title string `json:"title"` ContentMarkdown string `json:"content_markdown"` Space string `json:"space,omitempty"` // 默认 'my_private' diff --git a/internal/server/freeform_doc_api.go b/internal/server/freeform_doc_api.go index 2cf1cd27..2e272451 100644 --- a/internal/server/freeform_doc_api.go +++ b/internal/server/freeform_doc_api.go @@ -181,9 +181,11 @@ func (s *Server) handleListFreeformDocs(w http.ResponseWriter, r *http.Request) if space == "" { space = "my_private" } - projectID := 0 + var projectID int64 if pStr := r.URL.Query().Get("project_id"); pStr != "" { - projectID, _ = strconv.Atoi(pStr) + if parsed, err := strconv.ParseInt(pStr, 10, 64); err == nil { + projectID = parsed + } } list, err := s.freeDoc.ListDocuments(r.Context(), userID, projectID, space) From b6965eb0f31e8176917c200e2cb3d584dff4965d Mon Sep 17 00:00:00 2001 From: WeiCHEN Date: Wed, 23 Sep 2026 00:44:05 +0800 Subject: [PATCH 2/7] docs(ops): mark freeform project_id BIGINT task done --- .doc/ops/short-term/2026-09-22-freeform-project-id-bigint.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.doc/ops/short-term/2026-09-22-freeform-project-id-bigint.md b/.doc/ops/short-term/2026-09-22-freeform-project-id-bigint.md index b5064028..9ee47c41 100644 --- a/.doc/ops/short-term/2026-09-22-freeform-project-id-bigint.md +++ b/.doc/ops/short-term/2026-09-22-freeform-project-id-bigint.md @@ -1,7 +1,7 @@ --- title: "freeform project_id BIGINT 对齐 projects.id" task_id: "freeform-project-id-bigint-2026-09-22" -status: in_progress +status: done created: 2026-09-22 owner: Cursor task_type: implementation From 457bea8591684860bf910b559af6898f772f4313 Mon Sep 17 00:00:00 2001 From: WeiCHEN Date: Wed, 23 Sep 2026 09:09:44 +0800 Subject: [PATCH 3/7] docs(ops): note CURRENT sync completed after DOCREV UI PASS Record that the ours-merge CURRENT drop was repaired via closeout on local_dev; keep only the short-term memo on this branch. --- .doc/ops/short-term/2026-09-22-docrev-ui-rerun.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.doc/ops/short-term/2026-09-22-docrev-ui-rerun.md b/.doc/ops/short-term/2026-09-22-docrev-ui-rerun.md index ca1b0ec1..bd10c41c 100644 --- a/.doc/ops/short-term/2026-09-22-docrev-ui-rerun.md +++ b/.doc/ops/short-term/2026-09-22-docrev-ui-rerun.md @@ -61,3 +61,8 @@ prelim 常 `author_id=0`(unmanaged duties → 无认领/编辑)。冲突用 - `status=done` - `integration_state=merged_to_local_dev`(e2e tip);本批 audit/remediation docs 待再合入 - `cleanup=pending` + +## CURRENT 同步说明 + +- 曾误用 ours merge 丢掉 CURRENT 焦点;后由 closeout `docs:admin` 重放并合入 local_dev(`c24e1548` → MATRIX 收口 `8f0e31e5`)。 +- audit/remediation/密封账本与 DOCREV PASS 焦点已在 local_dev;本 worktree 仅保留短文备忘。 From 20290d03792c62ad8718be341573762abcf3fea1 Mon Sep 17 00:00:00 2001 From: WeiCHEN Date: Wed, 23 Sep 2026 09:53:30 +0800 Subject: [PATCH 4/7] docs(ops): claim CURRENT row for user-profile-display done --- .doc/ops/CURRENT.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.doc/ops/CURRENT.md b/.doc/ops/CURRENT.md index f284d9eb..a2812f55 100644 --- a/.doc/ops/CURRENT.md +++ b/.doc/ops/CURRENT.md @@ -18,6 +18,7 @@ | owner | task | branch | worktree | mutex | status | |---|---|---|---|---|---| +| Cursor | 2026-09-23-user-profile-display | feature/2026-09-23-user-profile-display | .worktrees/2026-09-23-user-profile-display | auth-profile+web-user-directory | done | | Cursor | modular-refactor-review-2026-09-23 | feature/modular-refactor-review-2026-09-23 | .worktrees/modular-refactor-review-2026-09-23 | ops-audit-modular-refactor-review | done | | Cursor | 2026-09-22-status-reconcile | feature/status-reconcile-2026-09-22 | .worktrees/status-reconcile-2026-09-22 | ops-status-reconcile | done | | Cursor | 2026-09-22-dev-prod-ready-test-promotion | feature/dev-prod-ready-test-promotion-2026-09-22 | .worktrees/dev-prod-ready-test-promotion-2026-09-22 | dev-runtime-migration+release-gate+test-promotion | done | From 9f7658515cc45d6af444ab7353889928b98036bb Mon Sep 17 00:00:00 2001 From: WeiCHEN Date: Wed, 23 Sep 2026 10:18:13 +0800 Subject: [PATCH 5/7] docs(ops): calibrate W4 matrix and close governance-automation status Mark W4 projection/deploy/recover/Darwin as landed in FEATURE-MATRIX, close the superseded governance-automation short-term, and refresh residual closeout SHAs after local_dev merges. --- .../2026-09-17-system-admin-console.md | 3 +- .../2026-09-22-governance-automation.md | 34 ++++++++++--------- .../2026-09-23-modular-decouple-residual.md | 19 ++++++----- .doc/status/FEATURE-MATRIX.md | 2 +- 4 files changed, 31 insertions(+), 27 deletions(-) diff --git a/.doc/ops/short-term/2026-09-17-system-admin-console.md b/.doc/ops/short-term/2026-09-17-system-admin-console.md index 9a561f62..48f1740d 100644 --- a/.doc/ops/short-term/2026-09-17-system-admin-console.md +++ b/.doc/ops/short-term/2026-09-17-system-admin-console.md @@ -2,11 +2,12 @@ title: "系统管理台(System Admin Console)一期" status: done created: 2026-09-17 -updated: 2026-09-17 +updated: 2026-09-23 owner: Kimi branch: feature/system-admin-console worktree: "-" mutex: web + sysadmin +phase2: "细粒度 system:* + 设置审计日志经 modular-decouple-residual-2026-09-23 合入(goose 00065);KB 运维/白名单消费方仍 deferred" --- # 系统管理台(System Admin Console)一期 diff --git a/.doc/ops/short-term/2026-09-22-governance-automation.md b/.doc/ops/short-term/2026-09-22-governance-automation.md index f0bbcf9e..ba046966 100644 --- a/.doc/ops/short-term/2026-09-22-governance-automation.md +++ b/.doc/ops/short-term/2026-09-22-governance-automation.md @@ -1,7 +1,7 @@ --- title: "W4 治理自动化剩余:持久队列与闭环" task_id: governance-automation-2026-09-22 -status: in_progress +status: done created: 2026-09-22 updated: 2026-09-23 owner: Cursor @@ -13,44 +13,44 @@ worktree: .worktrees/modular-decouple-residual-2026-09-23 base_dev_sha: 364ed7f1a3f0393ef77ec4623a9518116ed2cb87 write_scope: [".doc", "scripts"] allowed_environments: [] -head_sha: "" +head_sha: "12322b69" mutex: agent-workflow-governance-automation -review_state: pending -integration_state: pending +review_state: accepted_gates +integration_state: landed_via_modular-decouple-residual_701c565f deployment: not_required cleanup: pending cleanup_owner: "Cursor 之外的集成/维护执行者" cleanup_trigger: "合入 dev、验收通过且 owner 退出后核对清理门禁" remote_sync: not_requested -superseded_by: modular-decouple-residual-2026-09-23 +superseded_by: modular-decouple-residual-b-2026-09-23 --- # W4 治理自动化剩余:持久队列与闭环 ## 用户目标与授权 -- 原任务基线停在 `364ed7f1`;剩余工作并入 `modular-decouple-residual-2026-09-23` 从当前 local_dev tip 重做。 -- 禁止:push;强删 worktree;操作未授权环境;宣称完整 W3/W4 已关闭。 +- 原任务基线停在 `364ed7f1`;剩余工作并入 `modular-decouple-residual-b-2026-09-23` 从当时 local_dev tip 重做并已合入。 +- 禁止:push;强删 worktree;操作未授权环境;宣称完整 W3/W4 伞行已关闭(PI compose 仍 deferred)。 -## 步骤与验收(2026-09-23 更新) +## 步骤与验收(2026-09-23 终态) 1. [x] Durable queue schema + enqueue/list/cancel/tick 2. [x] Generic doc projection:行 CAS + `@document` 整文档 hash CAS;受控 `apply_projection_locally`;`docs project --mode row|document [--apply]` 3. [x] Deploy/recover 真实闭环:`execute_deploy_recover_loop` enqueue→claim→deploy(假命令)→receipt(SQLite);CLI `deploy run-loop|status|recover` -4. [ ] PI 源码镜像交付 compose profile(**deferred**:超本轮范围,见下) -5. [~] Darwin cwd 可见性:`cwd_visibility` / lsof 已在 `agentctl_w4.py`;专用 `DarwinVisibilityTests` 仍待补(本轮黑盒测覆盖投影+deploy) -6. [x] short-term landed vs deferred;`scripts/tests/test_agentctl_w4.py`(5 PASS) +4. [ ] PI 源码镜像交付 compose profile(**deferred**:超本轮范围) +5. [x] Darwin cwd 可见性:`cwd_visibility` / lsof + `DarwinCwdVisibilityTests` +6. [x] short-term landed vs deferred;`scripts/tests/test_agentctl_w4.py`(6 PASS) ## 验证与证据 | 范围 | 命令 | 实际 | |---|---|---| -| W4 单测 | `python3 -B -m unittest scripts.tests.test_agentctl_w4 -v` | 5 PASS(CAS 行/整文、deploy 成败、recover) | +| W4 单测 | `python3 -B -m unittest scripts.tests.test_agentctl_w4 -v` | 6 PASS(CAS 行/整文、deploy 成败、recover、Darwin cwd) | | ops_guards | `python3 -B -m unittest scripts.tests.test_ops_guards` | 14 PASS(Darwin) | ## Landed vs deferred -**Landed(并入 residual 任务分支)** +**Landed(经 residual 合入 local_dev)** - `scripts/agentctl_w4.py`:projection CAS helpers、deploy/recover 全链、Darwin lsof cwd - `scripts/agentctl.py`:`docs project --mode/--apply`、`deploy` 子命令、`cleanup_process_gate` 用 cwd_visibility @@ -58,10 +58,12 @@ superseded_by: modular-decouple-residual-2026-09-23 **Deferred** -- PI 镜像 compose overlay(`docker-compose.dev.pi-image.yml` 实装与共享环境验收)——超本轮「临时仓/假命令」范围,不触共享 docker +- PI 镜像 compose overlay(`docker-compose.dev.pi-image.yml` 实装与共享环境验收) - `agentctl_automation.py` 与 `agentctl_w4.py` 重复实现收敛 +- 跨机隔离与清理可见性(非本机 Darwin cwd) ## 收口 -- 状态保持 `in_progress`(PI compose 仍 deferred);实现去向:`modular-decouple-residual-2026-09-23`。 -- `integration_state` 随 residual 任务串行合入;不 push。 +- 本任务 `status=done`(授权范围内投影 + deploy/recover + Darwin 测试已完成);PI compose 记 deferred,不冒充伞行 done。 +- 实现与合入去向:`modular-decouple-residual-b-2026-09-23` → local_dev `701c565f`(及后续 goose/closeout 节点)。 +- `remote_sync=not_requested`;旧 worktree `.worktrees/governance-automation-2026-09-22` cleanup=pending。 diff --git a/.doc/ops/short-term/2026-09-23-modular-decouple-residual.md b/.doc/ops/short-term/2026-09-23-modular-decouple-residual.md index c563537c..0948aad1 100644 --- a/.doc/ops/short-term/2026-09-23-modular-decouple-residual.md +++ b/.doc/ops/short-term/2026-09-23-modular-decouple-residual.md @@ -15,14 +15,14 @@ worktree: .worktrees/modular-decouple-residual-2026-09-23 base_dev_sha: "2fae99096568a2941ea38c3fd1a38c762e455027" write_scope: ["internal", "scripts", "web", ".doc"] allowed_environments: [] -head_sha: "3337bf4a4298cc0e50b2cc867a7f39d66cdd3275" +head_sha: "f1f1846925f0253c2910245c9b5c2ca821127cee" mutex: "modular-decouple-residual" review_state: accepted_gates -integration_state: landed_8b3936ea +integration_state: landed_f1f18469 deployment: not_required cleanup: pending cleanup_owner: "独立维护者" -cleanup_trigger: "全部批次合入 local_dev 且无进程占用后 remove" +cleanup_trigger: "全部批次合入 local_dev 且无进程占用后 remove;含 feature/integrate-* residual 与旧 governance-automation worktree" remote_sync: not_requested --- @@ -70,12 +70,13 @@ go test -short ./internal//... | 项 | 值 | |---|---| -| review_state | accepted_gates(arch-check + go test -short + W4/ops unittest) | -| integration_state | landed local_dev tip 8b3936ea(主合入 701c565f + goose 8b3936ea) | +| review_state | accepted_gates(arch-check + go test -short + W4 unittest 6 PASS) | +| integration_state | landed local_dev tip f1f18469(主合入 701c565f + goose 8b3936ea + closeout ae9d44a3/f1f18469) | | deployment | not_required(本轮不重建环境;goose 00065 待共享环境迁移) | -| cleanup | pending(feature + integrate worktrees;cleanup_owner=独立维护者) | +| cleanup | pending(feature + integrate-* residual + 旧 governance-automation;cleanup_owner=独立维护者) | | remote_sync | not_requested | -| deferred | PI 镜像 compose;KB 运维动作;白名单消费方;Playwright 实跑 | +| deferred | PI 镜像 compose;KB 运维动作;白名单消费方;Playwright 实跑;automation/w4 实现收敛 | -原 W4 任务 governance-automation-2026-09-22:剩余实现并入本任务;PI compose 仍 deferred。 -原 sysadmin 一期:二期细粒度权限 + 设置审计已落地;KB/白名单仍 deferred。 +原 W4 任务 `governance-automation-2026-09-22`:授权范围已 done;PI compose 仍 deferred;见该 short-term。 +原 sysadmin 一期:二期细粒度 `system:*` + 设置审计(goose 00065)已落地;KB/白名单仍 deferred。 +FEATURE-MATRIX「Agent worktree 治理自动化」行:投影/deploy/recover/Darwin 从 deferred 挪到 landed;伞行保持 partial。 diff --git a/.doc/status/FEATURE-MATRIX.md b/.doc/status/FEATURE-MATRIX.md index 1515b0ca..5895600e 100644 --- a/.doc/status/FEATURE-MATRIX.md +++ b/.doc/status/FEATURE-MATRIX.md @@ -49,7 +49,7 @@ | 模块 | 声明范围 | 状态 | 发布关系 | 证据 | 剩余工作 / 关闭条件 | mutex | |------|----------|------|----------|------|---------------------|-------| -| Agent worktree 治理自动化 | 主目录保护、任务 worktree、机器认领、候选集成、dev 部署与安全清理 | partial | non_blocker | [方案](../remediation/2026-09-21-agent-workflow-governance-plan.md);[L1 验收](../test-reports/2026-09-21-agent-governance-test-report.md);[W1-B macOS](../ops/short-term/2026-09-22-agentctl-macos.md);[W4 剩余](../ops/short-term/2026-09-22-governance-automation.md) | L1 与 macOS `with/docs apply/validate/integrate` 已合入。W4 landed:durable queue schema + enqueue/list/cancel/tick。仍 deferred:完整 docs projection apply、真实 deploy/recover 收据、PI 源码镜像 compose、跨机隔离与清理可见性。本行不升 done | `agent-workflow-governance` | +| Agent worktree 治理自动化 | 主目录保护、任务 worktree、机器认领、候选集成、dev 部署与安全清理 | partial | non_blocker | [方案](../remediation/2026-09-21-agent-workflow-governance-plan.md);[L1 验收](../test-reports/2026-09-21-agent-governance-test-report.md);[W1-B macOS](../ops/short-term/2026-09-22-agentctl-macos.md);[W4](../ops/short-term/2026-09-22-governance-automation.md);residual `modular-decouple-residual-2026-09-23` | L1 与 macOS `with/docs apply/validate/integrate` 已合入。W4 landed:durable queue + 完整 docs projection apply(行/整文 CAS)+ deploy/recover 真实收据闭环 + Darwin cwd 可见性测试。仍 deferred:PI 源码镜像 compose、跨机隔离、automation/w4 实现收敛。本行不升 done | `agent-workflow-governance` | | 意图识别 L1 | 18 类 Intent、三分支消解、写/只读分流、双标签 `DOC_BUSY`、intent 纯依赖边界 | done | non_blocker | [intent-recognition](../system-design/intent-recognition/);[工作流作用域](../test-reports/2026-09-21-intent-workflow-scoping-test-report.md);[审计](../audit/2026-09-13-conversation-intent-runtime-state.md);[报告](../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md);[双标签](../test-reports/assets/2026-09-15-conversation-intent-dual-tab/live.json);[U1](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md)–[U3](../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md) | **边界 before**:含 U9–U12 叙事混入 → **after**:U9–U12 迁至「多意图扩面」行。关闭:纯依赖边界回归即重开 | `intent` | | 多意图持久计划(U1–U8 基线) | app/intentflow 生命周期、HITL、默认 `legacy`、U1–U8 代码与安全基线 | partial | non_blocker(默认 legacy) | [设计](../system-design/2026-09-15-multi-intent-hitl-plan.md);[U1](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md)–[U8](../test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md);[Wave2 真 PI](../test-reports/2026-09-16-wave2-real-pi-evidence-test-report.md);[Track I1](../test-reports/2026-09-22-track-i1-query-owner-test-report.md) | **after Track I1**:生产组合根已去 Fake query owner,改真实 QueryOwner;receipt 含 auth scope digest;confirm 后走既有步骤内核 dispatcher。默认仍 `MULTI_INTENT_PLAN_TIER=legacy`。升 `auto_read/confirm` 需 Track I2(项目 allowlist + 频率门)。U9–U12 仍独立 dry-run | `intent-plan` | | 多意图扩面(U9–U12) | U9 LLM 分段实验;U10 mutate;U11 docgov;U12 workflow/run-control | partial | deferred_enhancement | [设计](../system-design/2026-09-15-multi-intent-hitl-plan.md);[go/no-go GO](../ops/research/2026-09-16-wave3-pu6-pu8-go-no-go.md);[脚手架](../test-reports/2026-09-16-pu8-u9-u12-flags-test-report.md);[U9](../test-reports/2026-09-17-w4-u9-segment-test-report.md);[U10](../test-reports/2026-09-17-w4-u10-mutate-test-report.md);[U11](../test-reports/2026-09-17-w4-u11-docgov-test-report.md);[U12](../test-reports/2026-09-17-w4-u12-run-control-test-report.md);[2026-09-20 复核](../ops/research/2026-09-20-capability-enablement-impact-research.md) | U9 proposer 已实现和注入但未进入生产聊天分段调用;提议请求已带 reasoning profile。U10–U12 当前为 dry-run/validated-only adapter。历史直接调用/PI 测试继续有效,不代表 live 接线。逐域实现和验收,禁止以 `full` 一次放量 | `intent-plan` | From ee66bd009af87e6b225dac856e8739dd45b2ecf5 Mon Sep 17 00:00:00 2001 From: WeiCHEN Date: Wed, 23 Sep 2026 10:32:11 +0800 Subject: [PATCH 6/7] docs: record latest-upload promote-to-test evidence --- ...26-09-23-promote-fix-latest-upload-test.md | 57 +++++++++++++++++++ ...3-promote-fix-latest-upload-test-report.md | 46 +++++++++++++++ ...1ddc918a4f408a13ef4d2c2d5acd6e.images.json | 21 +++++++ ...a4e88b21ddc918a4f408a13ef4d2c2d5acd6e.json | 18 ++++++ 4 files changed, 142 insertions(+) create mode 100644 .doc/ops/short-term/2026-09-23-promote-fix-latest-upload-test.md create mode 100644 .doc/test-reports/2026-09-23-promote-fix-latest-upload-test-report.md create mode 100644 .doc/test-reports/assets/promotion-receipts/30fa4e88b21ddc918a4f408a13ef4d2c2d5acd6e.images.json create mode 100644 .doc/test-reports/assets/promotion-receipts/30fa4e88b21ddc918a4f408a13ef4d2c2d5acd6e.json diff --git a/.doc/ops/short-term/2026-09-23-promote-fix-latest-upload-test.md b/.doc/ops/short-term/2026-09-23-promote-fix-latest-upload-test.md new file mode 100644 index 00000000..76e51c25 --- /dev/null +++ b/.doc/ops/short-term/2026-09-23-promote-fix-latest-upload-test.md @@ -0,0 +1,57 @@ +--- +title: "晋升 latest-upload summary + parse-wait 至 test" +task_id: promote-fix-latest-upload-test-2026-09-23 +status: done +created: 2026-09-23 +updated: 2026-09-23 +owner: Cursor +task_type: ops +task_tier: multi_stage +policy_revision: "AGENTS+worktree-ops @ 30fa4e88" +branch: feature/promote-fix-latest-upload-test-2026-09-23 +worktree: .worktrees/promote-fix-latest-upload-test-2026-09-23 +base_dev_sha: "30fa4e88b21ddc918a4f408a13ef4d2c2d5acd6e" +head_sha: "54955c9d1a61f671556508ab7c89db088aaef7d7" +write_scope: [".", ".doc/"] +allowed_environments: ["test"] +mutex: git:test+env:test +review_state: not_required +integration_state: merged_local_test +deployment: test_ok +cleanup: pending +cleanup_owner: 独立维护者 +cleanup_trigger: tip 为 local_dev/origin 祖先且无进程占用后 remove +remote_sync: not_requested +--- + +# 晋升 latest-upload summary + parse-wait 至 test + +## 用户目标与授权 + +- 用户目标:合入 test,便于人工实测「总结刚刚上传的文档」与 MinerU 解析等待。 +- 授权来源:用户明确「合入 test,我来进行实际测试」(dev→local test;未要求 push/main)。 +- 交付终点:local `test` 含功能祖先、rc tag、pinned 镜像 recreate、`:8081` health。 +- 禁止:不晋升 main;不 push;不删 Volumes。 + +## 结果 + +- local `test@54955c9d` + `rc-v1.1.0-beta.3` +- 含 `30fa4e88`(local_dev tip)与实现祖先 `f6e14f97` +- test `:8081` schema_version=65;ready ok;pinned app digest `ba834cb1…` +- 报告:[../../test-reports/2026-09-23-promote-fix-latest-upload-test-report.md](../../test-reports/2026-09-23-promote-fix-latest-upload-test-report.md) + +## 步骤 + +1. [x] 登记 promote 任务 / worktree(基线 test@e217929c) +2. [x] candidate images + PASS receipt(`30fa4e88` suite=`scoped-latest-upload-summary`) +3. [x] merge local_dev → promote tip(CURRENT/FEATURE-MATRIX 保留 test 侧,走 docs apply 通道外) +4. [x] `agentctl validate` 聚焦 go test + arch-check +5. [x] 推进 local `test` + `rc-v1.1.0-beta.3`;apply pin;`env-service.sh test rebuild` +6. [x] health/ready 冒烟 + +## 验收标准 + +- [x] `test` 含 latest-upload summary / parse-wait 祖先 +- [x] `:8081` `/health` `/ready` ok,schema_version≥64 +- [x] 运行镜像 digest 与 receipt pin 一致 +- [ ] 人工:上传 PDF →「总结我刚刚上传的文档」可见 `document_parsing` / 总结结果(用户实测) diff --git a/.doc/test-reports/2026-09-23-promote-fix-latest-upload-test-report.md b/.doc/test-reports/2026-09-23-promote-fix-latest-upload-test-report.md new file mode 100644 index 00000000..d62b6e25 --- /dev/null +++ b/.doc/test-reports/2026-09-23-promote-fix-latest-upload-test-report.md @@ -0,0 +1,46 @@ +--- +title: "latest-upload summary → test 晋升报告" +date: 2026-09-23 +task_id: promote-fix-latest-upload-test-2026-09-23 +verdict: PASS +--- + +# latest-upload summary → test 晋升报告 + +## 结论 + +local `test@54955c9d` + tag `rc-v1.1.0-beta.3` 已含 latest-upload summary / parse-wait(祖先 `f6e14f97`,dev tip `30fa4e88`);test `:8081` schema_version=65;pinned 镜像 recreate 与 receipt digest 一致。人工聊天回归由用户执行。 + +## 版本矩阵 + +| 项 | 值 | +|---|---| +| local test | `54955c9d` | +| rc tag | `rc-v1.1.0-beta.3` → `54955c9d` | +| local_dev tip(merge 第二父) | `30fa4e88` | +| 功能祖先 | `f6e14f97` | +| pin commit | `30fa4e88` | +| app digest | `sha256:ba834cb1c08f44d615789940115fb7403efb476b7822b2aa3d5caeb85d35a579` | +| test health schema | 65 | +| ready | ok / kb_ready=true | + +## 验证 + +| 项 | 命令/证据 | 结果 | +|---|---|---| +| candidate validate | `agentctl validate`:intent/coordinator/materialindex + server 聚焦用例 + arch-check | PASS (`7f456e51…`) | +| receipt gate | `promotion-receipt-check.sh --commit 30fa4e88 --require-digests` | PASS | +| images apply | `candidate-images-apply.sh test --commit 30fa4e88` | PASS | +| rebuild | `env-service.sh test rebuild`(pinned,未 docker build) | PASS | +| health | `GET :8081/health` schema_version=65 | PASS | +| ready | `GET :8081/ready` status=ok | PASS | + +## 状态 + +| 字段 | 值 | +|---|---| +| review_state | not_required | +| integration_state | merged_local_test | +| deployment | test_ok | +| remote_sync | not_requested | +| cleanup | pending | diff --git a/.doc/test-reports/assets/promotion-receipts/30fa4e88b21ddc918a4f408a13ef4d2c2d5acd6e.images.json b/.doc/test-reports/assets/promotion-receipts/30fa4e88b21ddc918a4f408a13ef4d2c2d5acd6e.images.json new file mode 100644 index 00000000..641d790b --- /dev/null +++ b/.doc/test-reports/assets/promotion-receipts/30fa4e88b21ddc918a4f408a13ef4d2c2d5acd6e.images.json @@ -0,0 +1,21 @@ +{ + "commit": "30fa4e88b21ddc918a4f408a13ef4d2c2d5acd6e", + "source_tree": "f3558d25f4baa6e69d0cc50455663288069eb927", + "source_context": "git-archive", + "recorded_at": "2026-09-23T02:26:39Z", + "tags": { + "app": "shuimu-agent-app:candidate-30fa4e88b21d", + "events": "shuimu-agent-events:candidate-30fa4e88b21d", + "pi-agent": "shuimu-pi-agent:candidate-30fa4e88b21d" + }, + "image_ids": { + "app": "sha256:ba834cb1c08f44d615789940115fb7403efb476b7822b2aa3d5caeb85d35a579", + "events": "sha256:ba834cb1c08f44d615789940115fb7403efb476b7822b2aa3d5caeb85d35a579", + "pi-agent": "sha256:4482f7e5bc7719fb3ca5d6f4dea45feb02b74336e43822deddebca95e10f7c9b" + }, + "image_digests": { + "app": "shuimu-agent-app@sha256:ba834cb1c08f44d615789940115fb7403efb476b7822b2aa3d5caeb85d35a579", + "events": "shuimu-agent-app@sha256:ba834cb1c08f44d615789940115fb7403efb476b7822b2aa3d5caeb85d35a579", + "pi-agent": "shuimu-pi-agent@sha256:4482f7e5bc7719fb3ca5d6f4dea45feb02b74336e43822deddebca95e10f7c9b" + } +} diff --git a/.doc/test-reports/assets/promotion-receipts/30fa4e88b21ddc918a4f408a13ef4d2c2d5acd6e.json b/.doc/test-reports/assets/promotion-receipts/30fa4e88b21ddc918a4f408a13ef4d2c2d5acd6e.json new file mode 100644 index 00000000..e09f2495 --- /dev/null +++ b/.doc/test-reports/assets/promotion-receipts/30fa4e88b21ddc918a4f408a13ef4d2c2d5acd6e.json @@ -0,0 +1,18 @@ +{ + "verdict": "pass", + "commit": "30fa4e88b21ddc918a4f408a13ef4d2c2d5acd6e", + "recorded_at": "2026-09-23T02:26:53Z", + "runner_url": "http://127.0.0.1:18865", + "model_id": "MiniMax-M2.7-highspeed", + "protocol": "typed-result-v1", + "image_digests": { + "app": "shuimu-agent-app@sha256:ba834cb1c08f44d615789940115fb7403efb476b7822b2aa3d5caeb85d35a579", + "events": "shuimu-agent-app@sha256:ba834cb1c08f44d615789940115fb7403efb476b7822b2aa3d5caeb85d35a579", + "pi-agent": "shuimu-pi-agent@sha256:4482f7e5bc7719fb3ca5d6f4dea45feb02b74336e43822deddebca95e10f7c9b" + }, + "suite": "scoped-latest-upload-summary", + "failure_class": "none", + "evidence_refs": [ + ".doc/test-reports/assets/promotion-receipts/30fa4e88b21ddc918a4f408a13ef4d2c2d5acd6e.images.json" + ] +} From 306836006f338fc6c1acf950e89af5e102f3939e Mon Sep 17 00:00:00 2001 From: WeiCHEN Date: Wed, 23 Sep 2026 13:49:23 +0800 Subject: [PATCH 7/7] docs(ops): register closeout-worktrees task for docs merge and cleanup --- .../2026-09-23-closeout-worktrees.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .doc/ops/short-term/2026-09-23-closeout-worktrees.md diff --git a/.doc/ops/short-term/2026-09-23-closeout-worktrees.md b/.doc/ops/short-term/2026-09-23-closeout-worktrees.md new file mode 100644 index 00000000..2e8d0ab5 --- /dev/null +++ b/.doc/ops/short-term/2026-09-23-closeout-worktrees.md @@ -0,0 +1,82 @@ +--- +title: "Worktree 收口:docs 增量合入与清理" +task_id: "closeout-worktrees-2026-09-23" +status: in_progress +created: 2026-09-23 +updated: 2026-09-23 +owner: Cursor +task_type: ops +task_tier: medium +policy_revision: "agent-governance-2026-09-21-r1 @ cc91c217e7c0e4732de3923d0fa229fd4bd65798" +branch: feature/closeout-worktrees-2026-09-23 +worktree: .worktrees/closeout-worktrees-2026-09-23 +base_dev_sha: "cc91c217e7c0e4732de3923d0fa229fd4bd65798" +head_sha: "" +write_scope: [".doc"] +allowed_environments: [] +mutex: "git:dev+worktree-cleanup" +review_state: pending +integration_state: pending +deployment: n/a +cleanup: pending +cleanup_owner: "本任务完成后独立维护者复查" +cleanup_trigger: "合入 local_dev 且批次 A–D remove 成功或 cleanup_pending 已登记" +remote_sync: not_requested +--- + +# Worktree 收口:docs 增量合入与清理 + +## 用户目标 + +检查所有 worktree 分支;推进并完成可合入的 docs 增量;验证通过后合入 `dev` 并清理 worktree。避开并行会话中的 `task-bubble-bind` 系列;不 push。 + +## 授权边界 + +- 允许:`.doc` 写入;`git:dev` 集成(候选 worktree);关闭已完成 agentctl 任务;脚本入口清理 worktree。 +- 禁止:push;晋升 test/main;碰 task-bubble 系列;强制 `--force`/`-D`;修改非 `.doc` 业务代码(合入时冲突取 dev)。 + +## 待合入分支(docs 增量) + +| tip | branch | 预期增量 | 代码风险 | +|---|---|---|---| +| 20290d03 | feature/2026-09-23-user-profile-display | CURRENT done 行 | 无 | +| 457bea85 | feature/docrev-ui-rerun-2026-09-22 | short-term 备忘 +5 行 | 无 | +| 10f9a8b9 | feature/integrate-modular-decouple-closeout-docs-2026-09-23 | W4 matrix / governance 校准(3ebabc19 已在 dev) | 无 | +| 5ab034eb | feature/integrate-modular-decouple-residual-2026-09-23 | cancelled 旧候选 docs | 无 | +| b6965eb0 | feature/freeform-project-id-bigint-2026-09-22 | 任务文档;代码等价物 3bdd53ae 已在 dev | **冲突取 dev** | +| ee66bd00 | feature/promote-fix-latest-upload-test-2026-09-23 | promote evidence docs | 无 | + +## 明确跳过 + +- task-bubble-bind / integrate-task-bubble-bind / promote-task-bubble-bind(并行会话 active) +- push / origin 同步 + +## 特殊残留(预登记) + +| 路径 | 处置 | +|---|---| +| docrev worktree 锁文件 `.exclusive-run.lockdir` / `.ui-run.lock` | 删除 | +| `canonical-ui00-13a-pass.json` sha256=`dd83d656…f287` | 测试报告未引用;登记后删除 | +| `sealed-ledger-main-20260922T195858Z.json` sha256=`31ed8a36…44be` | 正式密封账本 `sealed-ledger-ui00-16-post-20260923T0400Z` 已在 dev;登记后删除 | +| integrate-user-profile-display-current 脏 CURRENT.md | 与 20290d03 行等价 → checkout 丢弃 | + +## 验证计划 + +纯文档档:diff 核对;`.doc` 链接存在性;CURRENT/MATRIX 抽查;合入后 `git diff HEAD -- ':!.doc'` 必须为空;freeform 追加 `go vet`/`go test -short ./internal/freedoc/`。 + +## 步骤 + +1. [x] 创建 worktree + 登记任务 +2. [ ] 写本任务文档并提交 +3. [ ] integrate 候选:串行 merge 六分支(冲突取 dev) +4. [ ] validate + integrate 推进 local_dev +5. [ ] agentctl task close(跳过 task-bubble) +6. [ ] 分批清理 worktree A/B/C/D +7. [ ] 特殊残留处理 + 收口状态更新 + +## 结果(执行后填) + +- `integration_state`: +- `dev_tip_after`: +- `cleanup_summary`: +- `cleanup_pending`: