=== RUN   TestMultiIntentU8_RealPI_ConfirmGenerate_PG
2026/09/27 18:37:05 goose: no migrations to run. current version: 76
2026/09/27 18:37:05 goose: no migrations to run. current version: 76
2026/09/27 18:37:05 [kb] online=true dsn=postgres://regkb:***@127.0.0.1:5432/regulations?sslmode=disable
    multi_intent_u8_piagent_pg_test.go:228: ✓ [1. awaiting] plan_id=pln_109140def6593f29e80d463cc22de537 revision=1 starts=0
{"time":"2026-09-27T18:37:05.714556865Z","level":"WARN","msg":"material chunk index failed","file":"project_brief.md","project_id":6052,"err":"http 401 Unauthorized: 无效的令牌 (request id: 20260927183704422688182c14228f52SdOhQd1) (batch=1 est_tokens≈57)"}
{"time":"2026-09-27T18:42:17.865734427Z","level":"INFO","msg":"taskrun_status_transition","run_id":"run_1790534225595811661","status":"completed","workspace_id":"/home/weichen/projects/Agent-System/data/dev/workspaces/bizdev/intake_1790534225721291105","error":""}
    multi_intent_u8_piagent_pg_test.go:268: ✓ [2. real PI generate] run_id=run_1790534225595811661 status=completed elapsed=5m12s
    multi_intent_u8_piagent_pg_test.go:277: ✓ [3. idempotent replay] starts still 1
    multi_intent_u8_piagent_pg_test.go:287: ✓ [4. revoke] TaskRunAdapter denied
    multi_intent_u8_piagent_pg_test.go:310: ✓ [5. PG restart recovery] plan_id=pln_109140def6593f29e80d463cc22de537 status=executing
    multi_intent_u8_piagent_pg_test.go:321: ✓ [6. HTTP refresh] GET plan 485 bytes
--- PASS: TestMultiIntentU8_RealPI_ConfirmGenerate_PG (312.52s)
=== RUN   TestWorkflowGovernance_PiAgent_PG_FullNoneMixedChain
{"time":"2026-09-27T18:42:17.877855777Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T18:42:17.888146732Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T18:42:17.895420186Z","level":"INFO","msg":"[kb] online=true dsn=postgres://regkb:***@127.0.0.1:5432/regulations?sslmode=disable"}
    workflow_governance_full_none_piagent_pg_test.go:149: ✓ [1. activate] instance=43 full=intake none=research(disabled until stage)
{"time":"2026-09-27T18:42:18.212086593Z","level":"WARN","msg":"material chunk index failed","file":"project_brief.md","project_id":6053,"err":"http 401 Unauthorized: 无效的令牌 (request id: 20260927184216923241093c14228f5xn0VCeLb) (batch=1 est_tokens≈18)"}
    workflow_governance_full_none_piagent_pg_test.go:205: pi-agent bd_intake HTTP 500: {"task_key":"bd_intake","artifact_title":"用户初始需求收集表","markdown_body":"","extracted_data":null,"attachments":null,"work_dir":"/home/weichen/projects/Agent-System/data/dev/workspaces/bizdev/bd_intake_1790534538219730296","backend_used":"pi-agent","duration":42752775860,"success":false,"error_reason":"step step_01_organize failed: MISSING_TARGET"}
--- FAIL: TestWorkflowGovernance_PiAgent_PG_FullNoneMixedChain (43.11s)
=== RUN   TestWorkflowGovernance_PiAgent_PG_FullChain
{"time":"2026-09-27T18:43:00.983514629Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T18:43:00.994237701Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T18:43:01.002411668Z","level":"INFO","msg":"[kb] online=true dsn=postgres://regkb:***@127.0.0.1:5432/regulations?sslmode=disable"}
    workflow_governance_piagent_pg_test.go:265: ✓ [1. 项目创建] id=6054 code=pg-piagent-治-40a1667f wf=main
    workflow_governance_piagent_pg_test.go:265: ✓ [2. 工作流激活] instance_id=44
{"time":"2026-09-27T18:43:01.324082297Z","level":"WARN","msg":"material chunk index failed","file":"project_brief.md","project_id":6054,"err":"http 401 Unauthorized: 无效的令牌 (request id: 20260927184300033590564c14228f5ljOaDLM9) (batch=1 est_tokens≈102)"}
    workflow_governance_piagent_pg_test.go:265: ✓ [3. pi-agent intake] doc=doc_proj6054_bd_intake title=用户初始需求收集表 elapsed=5m9s
    workflow_governance_piagent_pg_test.go:265: ✓ [4. 文档批准] approve chain complete
    workflow_governance_piagent_pg_test.go:265: ✓ [5. 阶段推进] PG + pi-agent 治理全链路完成 wf=main
--- PASS: TestWorkflowGovernance_PiAgent_PG_FullChain (309.76s)
=== RUN   TestWorkflowGovernance_PiAgent_PG_ProductManager_FullChain
{"time":"2026-09-27T18:48:10.741906742Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T18:48:10.752444379Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T18:48:10.760924457Z","level":"INFO","msg":"[kb] online=true dsn=postgres://regkb:***@127.0.0.1:5432/regulations?sslmode=disable"}
    workflow_governance_piagent_pg_test.go:279: ✓ [1. 项目创建] id=6055 code=pg-piagent-产-fae1702b wf=product_manager
    workflow_governance_piagent_pg_test.go:279: ✓ [2. 工作流激活] instance_id=45
{"time":"2026-09-27T18:48:11.076655652Z","level":"WARN","msg":"material chunk index failed","file":"intake_summary.md","project_id":6055,"err":"http 401 Unauthorized: 无效的令牌 (request id: 20260927184809782195631c14228f539SpRont) (batch=1 est_tokens≈77)"}
{"time":"2026-09-27T18:48:11.113256095Z","level":"INFO","msg":"[kb-retriever] embed failed: http 401 Unauthorized: 无效的令牌 (request id: 20260927184809819177239c14228f5qh0GRTc0) (batch=1 est_tokens≈21)"}
    workflow_governance_piagent_pg_test.go:279: ✓ [3. pi-agent system_reqs] doc=doc_proj6055_pm_system_reqs title=系统需求规格书 elapsed=20m0s
    workflow_governance_piagent_pg_test.go:279: ✓ [4. 文档批准] approve chain complete
    workflow_governance_piagent_pg_test.go:279: ✓ [5. 阶段推进] PG + pi-agent 治理全链路完成 wf=product_manager
--- PASS: TestWorkflowGovernance_PiAgent_PG_ProductManager_FullChain (1199.90s)
=== RUN   TestWorkflowGovernance_PiAgent_PG_TestManager_FullChain
{"time":"2026-09-27T19:08:10.643334732Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T19:08:10.655267647Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T19:08:10.661666627Z","level":"INFO","msg":"[kb] online=true dsn=postgres://regkb:***@127.0.0.1:5432/regulations?sslmode=disable"}
    workflow_governance_piagent_pg_test.go:294: ✓ [1. 项目创建] id=6056 code=pg-piagent-测-3a00d5ad wf=test_manager
    workflow_governance_piagent_pg_test.go:294: ✓ [2. 工作流激活] instance_id=46
{"time":"2026-09-27T19:08:10.973231026Z","level":"WARN","msg":"material chunk index failed","file":"verification_scope.md","project_id":6056,"err":"http 401 Unauthorized: 无效的令牌 (request id: 20260927190809680227338c14228f5FJl3zDXd) (batch=1 est_tokens≈88)"}
{"time":"2026-09-27T19:08:11.008141699Z","level":"INFO","msg":"[kb-retriever] embed failed: http 401 Unauthorized: 无效的令牌 (request id: 20260927190809715440319c14228f5MSTlyNHh) (batch=1 est_tokens≈21)"}
    workflow_governance_piagent_pg_test.go:294: ✓ [3. pi-agent test_manager] doc=doc_proj6056_tm_system_verification title=系统验证方案及计划 elapsed=21m14s
    workflow_governance_piagent_pg_test.go:294: ✓ [4. 文档批准] approve chain complete
    workflow_governance_piagent_pg_test.go:294: ✓ [5. 阶段推进] PG + pi-agent 治理全链路完成 wf=test_manager
--- PASS: TestWorkflowGovernance_PiAgent_PG_TestManager_FullChain (1274.56s)
FAIL
FAIL	chat-agent-system/internal/server	3139.856s
FAIL
==> retry once after quality_failed/deadline/MISSING_TARGET flake...
=== RUN   TestMultiIntentU8_RealPI_ConfirmGenerate_PG
2026/09/27 19:29:25 goose: no migrations to run. current version: 76
2026/09/27 19:29:25 goose: no migrations to run. current version: 76
2026/09/27 19:29:25 [kb] online=true dsn=postgres://regkb:***@127.0.0.1:5432/regulations?sslmode=disable
    multi_intent_u8_piagent_pg_test.go:228: ✓ [1. awaiting] plan_id=pln_0d61966f4140bf750dcde9bf2e84252c revision=1 starts=0
{"time":"2026-09-27T19:29:26.065360678Z","level":"WARN","msg":"material chunk index failed","file":"project_brief.md","project_id":6057,"err":"http 401 Unauthorized: 无效的令牌 (request id: 20260927192924772010756c14228f52mVMawXH) (batch=1 est_tokens≈57)"}
{"time":"2026-09-27T19:34:34.933496396Z","level":"INFO","msg":"taskrun_status_transition","run_id":"run_1790537365945499577","status":"completed","workspace_id":"/home/weichen/projects/Agent-System/data/dev/workspaces/bizdev/intake_1790537366071288822","error":""}
    multi_intent_u8_piagent_pg_test.go:268: ✓ [2. real PI generate] run_id=run_1790537365945499577 status=completed elapsed=5m9s
    multi_intent_u8_piagent_pg_test.go:277: ✓ [3. idempotent replay] starts still 1
    multi_intent_u8_piagent_pg_test.go:287: ✓ [4. revoke] TaskRunAdapter denied
    multi_intent_u8_piagent_pg_test.go:310: ✓ [5. PG restart recovery] plan_id=pln_0d61966f4140bf750dcde9bf2e84252c status=executing
    multi_intent_u8_piagent_pg_test.go:321: ✓ [6. HTTP refresh] GET plan 486 bytes
--- PASS: TestMultiIntentU8_RealPI_ConfirmGenerate_PG (309.23s)
=== RUN   TestWorkflowGovernance_PiAgent_PG_FullNoneMixedChain
{"time":"2026-09-27T19:34:34.945272597Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T19:34:34.954429555Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T19:34:34.961392248Z","level":"INFO","msg":"[kb] online=true dsn=postgres://regkb:***@127.0.0.1:5432/regulations?sslmode=disable"}
    workflow_governance_full_none_piagent_pg_test.go:149: ✓ [1. activate] instance=48 full=intake none=research(disabled until stage)
{"time":"2026-09-27T19:34:35.300212097Z","level":"WARN","msg":"material chunk index failed","file":"project_brief.md","project_id":6058,"err":"http 401 Unauthorized: 无效的令牌 (request id: 20260927193434002303342c14228f5DOEKagUf) (batch=1 est_tokens≈18)"}
    workflow_governance_full_none_piagent_pg_test.go:205: ✓ pi-agent bd_intake doc=doc_proj6058_bd_intake elapsed=5m38s
    workflow_governance_full_none_piagent_pg_test.go:220: ✓ [2. full intake] cross-user approve complete
    workflow_governance_full_none_piagent_pg_test.go:232: ✓ [3. advance V0.1] ok
{"time":"2026-09-27T19:40:13.808480985Z","level":"WARN","msg":"material chunk index failed","file":"research_scope.md","project_id":6058,"err":"http 401 Unauthorized: 无效的令牌 (request id: 20260927194012513851422c14228f5LGVQWUXL) (batch=1 est_tokens≈32)"}
{"time":"2026-09-27T19:40:13.843141086Z","level":"INFO","msg":"[kb-retriever] embed failed: http 401 Unauthorized: 无效的令牌 (request id: 20260927194012548709059c14228f5vv4MlGSD) (batch=1 est_tokens≈14)"}
    workflow_governance_full_none_piagent_pg_test.go:234: ✓ pi-agent research doc=doc_proj6058_bd_research elapsed=13m34s
    workflow_governance_full_none_piagent_pg_test.go:253: ✓ [4. none research] generate ok; submit-review denied HTTP 403
    workflow_governance_full_none_piagent_pg_test.go:282: ✓ [5. readiness] none does not block
    workflow_governance_full_none_piagent_pg_test.go:308: ✓ [6. advance V0.5] none non-blocking PASS
    workflow_governance_full_none_piagent_pg_test.go:318: ✓ [7. refresh] settings still readable
--- PASS: TestWorkflowGovernance_PiAgent_PG_FullNoneMixedChain (1153.20s)
=== RUN   TestWorkflowGovernance_PiAgent_PG_FullChain
{"time":"2026-09-27T19:53:48.146973908Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T19:53:48.156873524Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T19:53:48.165357912Z","level":"INFO","msg":"[kb] online=true dsn=postgres://regkb:***@127.0.0.1:5432/regulations?sslmode=disable"}
    workflow_governance_piagent_pg_test.go:265: ✓ [1. 项目创建] id=6059 code=pg-piagent-治-6a05e634 wf=main
    workflow_governance_piagent_pg_test.go:265: ✓ [2. 工作流激活] instance_id=49
{"time":"2026-09-27T19:53:48.49578996Z","level":"WARN","msg":"material chunk index failed","file":"project_brief.md","project_id":6059,"err":"http 401 Unauthorized: 无效的令牌 (request id: 20260927195347198641783c14228f5J6TSZTg4) (batch=1 est_tokens≈102)"}
    workflow_governance_piagent_pg_test.go:265: ✓ [3. pi-agent intake] doc=doc_proj6059_bd_intake title=用户初始需求收集表 elapsed=6m4s
    workflow_governance_piagent_pg_test.go:265: ✓ [4. 文档批准] approve chain complete
    workflow_governance_piagent_pg_test.go:265: ✓ [5. 阶段推进] PG + pi-agent 治理全链路完成 wf=main
--- PASS: TestWorkflowGovernance_PiAgent_PG_FullChain (364.57s)
=== RUN   TestWorkflowGovernance_PiAgent_PG_ProductManager_FullChain
{"time":"2026-09-27T19:59:52.719259149Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T19:59:52.727973731Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T19:59:52.736926955Z","level":"INFO","msg":"[kb] online=true dsn=postgres://regkb:***@127.0.0.1:5432/regulations?sslmode=disable"}
    workflow_governance_piagent_pg_test.go:279: ✓ [1. 项目创建] id=6060 code=pg-piagent-产-629d788e wf=product_manager
    workflow_governance_piagent_pg_test.go:279: ✓ [2. 工作流激活] instance_id=50
{"time":"2026-09-27T19:59:53.045699026Z","level":"WARN","msg":"material chunk index failed","file":"intake_summary.md","project_id":6060,"err":"http 401 Unauthorized: 无效的令牌 (request id: 20260927195951750252980c14228f53SCC45YU) (batch=1 est_tokens≈77)"}
{"time":"2026-09-27T19:59:53.079992338Z","level":"INFO","msg":"[kb-retriever] embed failed: http 401 Unauthorized: 无效的令牌 (request id: 20260927195951784770762c14228f5VOgqBs70) (batch=1 est_tokens≈21)"}
    workflow_governance_piagent_pg_test.go:279: ✓ [3. pi-agent system_reqs] doc=doc_proj6060_pm_system_reqs title=系统需求规格书 elapsed=17m39s
    workflow_governance_piagent_pg_test.go:279: ✓ [4. 文档批准] approve chain complete
    workflow_governance_piagent_pg_test.go:279: ✓ [5. 阶段推进] PG + pi-agent 治理全链路完成 wf=product_manager
--- PASS: TestWorkflowGovernance_PiAgent_PG_ProductManager_FullChain (1058.94s)
=== RUN   TestWorkflowGovernance_PiAgent_PG_TestManager_FullChain
{"time":"2026-09-27T20:17:31.660650278Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T20:17:31.672257153Z","level":"INFO","msg":"goose: no migrations to run. current version: 76"}
{"time":"2026-09-27T20:17:31.679944205Z","level":"INFO","msg":"[kb] online=true dsn=postgres://regkb:***@127.0.0.1:5432/regulations?sslmode=disable"}
    workflow_governance_piagent_pg_test.go:294: ✓ [1. 项目创建] id=6061 code=pg-piagent-测-497b181b wf=test_manager
    workflow_governance_piagent_pg_test.go:294: ✓ [2. 工作流激活] instance_id=51
{"time":"2026-09-27T20:17:32.00173052Z","level":"WARN","msg":"material chunk index failed","file":"verification_scope.md","project_id":6061,"err":"http 401 Unauthorized: 无效的令牌 (request id: 20260927201730699255534c14228f53gTZpjNJ) (batch=1 est_tokens≈88)"}
{"time":"2026-09-27T20:17:32.040011273Z","level":"INFO","msg":"[kb-retriever] embed failed: http 401 Unauthorized: 无效的令牌 (request id: 20260927201730737390698c14228f53I4b1Cqz) (batch=1 est_tokens≈21)"}
    workflow_governance_piagent_pg_test.go:294: ✓ [3. pi-agent test_manager] doc=doc_proj6061_tm_system_verification title=系统验证方案及计划 elapsed=18m57s
    workflow_governance_piagent_pg_test.go:294: ✓ [4. 文档批准] approve chain complete
    workflow_governance_piagent_pg_test.go:294: ✓ [5. 阶段推进] PG + pi-agent 治理全链路完成 wf=test_manager
--- PASS: TestWorkflowGovernance_PiAgent_PG_TestManager_FullChain (1137.69s)
PASS
ok  	chat-agent-system/internal/server	4023.651s
