Commit Graph
363 Commits
Author SHA1 Message Date
weichenandCursor 2fbb0b29a6 docs(audit): 以 gap-matrix 与 ops 对齐 Codex 再审计结论
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 0547bd58a8 fix(ops): HTTP 超时、env status 只读;test/dev 镜像重建 schema 25
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichen 3d09bd6d7d fix(quality): 闭环 Go 质量门禁(鉴权富化/V0.5/vet/health/KB gate/记忆轮询) 2026-09-13 02:50:23 +00:00
weichenandCursor ac9fe7f09b chore(ops): 新增退休非正式工作流定义脚本
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 8c5dd97d63 feat(db): 同步种子用户与项目序列避免冷启动主键冲突
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 3b7b49c624 fix(api): 任务同步与SSE入口补齐项目成员鉴权
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 0d10c9adfe docs(ops): 建立通用 AGENTS 手册与本仓 PROJECT/CLAUDE 入口
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichen 185c42fc94 test(governance): 补跑 product_manager PG+PI 全链路并通过
抽取 runPiAgentGovernanceE2E 共用 harness,新增 system_reqs 真实 Agent 验收并更新测试报告。
2026-09-13 02:50:23 +00:00
weichen 390c0e3c71 docs(test): 更新 gap matrix MISSING-04 为 PASS 2026-09-13 02:50:23 +00:00
weichen 784d852ac0 test(governance): PI Agent PG 全链路实测通过并固化运行条件
修复 runner 鉴权与 data/dev 工作区挂载,使用正式 main 工作流完成 intake→批准→推进。
2026-09-13 02:50:23 +00:00
weichen d6f5e0e28a feat(projectcontext): bizdev 注入项目对话并完成 PG 治理 E2E
新增 ctxmgr 项目对话采集并接入 PM/TE BuildSnapshot;PG 测试统一 TEST_DATABASE_URL 并使用三正式工作流 key。
2026-09-13 02:50:23 +00:00
weichenandClaude Sonnet 5 a6501e5b31 docs(audit): comprehensive project code review and remediation plan
Complete audit and remediation documentation for Chat-Agent-System:

- 2026-09-12-AUDIT-INDEX.md: Document index and quick navigation guide
- 2026-09-12-audit-summary-report.md: Overall project assessment (5.7/10)
  - 12 identified defects (3 critical, 4 high, 5 medium)
  - 3 incomplete features
  - Risk assessment and remediation timeline (61h total)

- 2026-09-12-comprehensive-audit-and-remediation-plan.md: Detailed analysis
  - BUG-01 to BUG-12: Root cause, code locations, impact
  - MISSING-01 to MISSING-04: New feature design
  - Phase A/B/C remediation strategy

- 2026-09-12-remediation-tasks-and-acceptance-checklist.md: Executable tasks
  - 15 detailed tasks with code snippets and test cases
  - 61 hours total effort (Phase A:15h, B:26h, C:20h)

- 2026-09-12-quick-reference-guide.md: Fast lookup and diagnostics
  - Symptom → root cause → solution matrix
  - Code hotspot map and common Q&A

Key findings:
- Project 70% complete, needs immediate remediation
- 3 critical bugs affecting project lifecycle, security, data consistency
- 0% E2E test coverage
- 88 test definitions polluting development database

Recommendation: Start Phase A immediately (critical fixes), complete all remediation within one week.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-13 02:50:23 +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 38e44a2606 docs(workflow): record three-workflow governance remediation and test report
Archive the strict governance design notes and validation report for the 2026-09-12 remediation cycle.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor ad6e38d11a test(workflow): add governance regression and activation PG coverage
Cover public auth config, catalog policy, official main workflow activation on Postgres, and conn-busy metadata writeback fixes.

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 d5a9a29eec feat(api): add workflow catalog routes and public auth config endpoint
Expose governance APIs for workflow selection/termination and allow login pages to read registration policy without admin credentials.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor f07178fa73 feat(service): enforce three-workflow governance and instance lifecycle
Wire catalog policy, v2 manifests, stage access, activation metadata fixes, and coordinator instance advance around frozen workflow snapshots.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 543ca310da feat(db): add workflow schema v2 and catalog governance migrations
Introduce catalog governance tables and extend workflow schema v2 so only the three official workflows are selectable at runtime.

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
weichen 7ffbadfaa8 merge: feature/workflow-abac-taskrun — workflow ABAC taskrun and QA 2026-09-13 02:50:23 +00:00
weichenandCursor 73bf08275b docs(test): record pi-agent E2E v5 PASS after env sync fix
Full lifecycle passed in 714s with MiniMax token, RUNNER_AUTH_TOKEN, and shared KB connected.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 037c6084c5 docs(config): align .env.example with dual-env compose layout
Document CONTEXT_DB/SYSTEM_DB aliases, pi-agent secrets sync to configs/.env.dev, and compose vs host Go variable scope.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor bb0af3873d docs(test): record pi-agent E2E v3 failure at 60m step timeout
V0.1 step_01_organize exceeded AgentTimeout after KB and timeout passthrough fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 033ef70ac9 fix(squad): propagate AgentTimeout to pi-agent step execution
E2E v2 still hit 30min runner timeout because runOneStep ignored ExecuteOptions.Timeout; inject shared KB config in pi-agent E2E test.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor f4619757e2 fix(test): extend pi-agent E2E AgentTimeout to 60m for stage runs.
V0.1 workflow steps exceeded the default 30m pi-agent /v1/run deadline; align test config with production AGENT_TIMEOUT and runner env vars.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor c6c7423ec6 docs(test): record pi-agent E2E failure at V0.1 stage timeout.
Document 33min run with dialogue steps passing and workflow ExecuteStage failing on pi-agent /v1/run deadline.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 9598705fc7 chore(ops): add test env smoke script and document test soak pass.
Provide git-push-dev helper, DEP-001 smoke checks for test compose, and update E2E/soak test report.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 72879c6e22 fix(db): enable test env cold-start migrations on empty database.
Use pgvector image with extensions-only init, seed legacy users before project/chat fixtures, and align test compose with goose-only schema bootstrap.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor f73988e567 docs(test): update report with successful push and dev soak.
Record Gitea token push, restarted dev server ready checks, and 60s soak pass.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor c1b8f23b14 docs(test): report PG fix, CI short suite, and soak/E2E progress.
Document seed user reactivation, full short test pass, readiness soak, and blocked git push pending credentials.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor c7aba86376 fix(test): stabilize PG seed users and CI short test suite.
Reactivate dev seed users after auth PG tests, use unique session tokens, fix import guard and coordinator assertions, and skip flaky E2E in short mode; add pg_restore CI drill job.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 81f118098d docs(test): archive QA-001 backup drill and penetration test report.
Record template MIME, CI gate, backup/RPO drill, and security negative case results per test report standard.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 1ebed78bf5 test(security): add automated penetration negative test matrix.
Cover anonymous admin/task access, body limits, MIME rejection, strict readiness, and CORS allowlist without legacy test principals.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor d957b05569 chore(ops): add system DB backup and restore drill scripts.
Support dev/test/main pg_dump backups with RPO manifest metadata and a restore drill that validates dump integrity and migration idempotency.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichen 0beddd9887 ci(qa): add QA-001 gate with go vet, short tests, and migration check. 2026-09-13 02:50:23 +00:00
weichenandCursor 6bc238c665 feat(upload): reuse MIME validator for workflow template uploads.
Centralize template extension, magic-byte, and HTML/script rejection in upload.ValidateTemplate so admin template POST matches project asset hardening.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 5856585d1d feat(ops): compose runner auth, upload MIME validation, and test soak
Wire RUNNER_AUTH_TOKEN through dev/test/main Compose, validate uploads
with extension whitelist and content sniffing, add readiness soak script
and short PG loop test, and require runner token in prod when URL is set.

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 3ade654256 feat(taskrun): add worker lease/heartbeat and Phase 5 fault injection tests
Introduce goose v20 lease columns with heartbeat loops so only expired
leases are marked interrupted on restart; add PG tests for concurrent
stage advance, active lease survival, and backup migration idempotency.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor aea391cdaf feat(taskrun): persist runs/events and fix finalize-before-done ordering
Add goose v19 task_runs/task_run_events tables with PG store for restart
replay, orphan interruption on startup, strict /ready checks, and strip
client work_dir from chat/SSE paths per P0 path sandbox requirements.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 12756b13e6 fix(projectworkflow): generate UTF-8 safe project codes for Chinese names
Truncate project codes by rune instead of byte to prevent invalid PostgreSQL UTF-8 sequences from mixed CJK and ASCII slugs.

test(server): add PG pi-agent governance E2E and Phase 5 acceptance matrix

Cover Chinese HTTP project create, pi-agent intake after workflow activate, authz negatives, activate idempotency, and migration version gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor c1f6830178 docs(test): fix report structure for blended ABAC and PG chain cases
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 4b168854ba feat(abac): filter blended squad context and add PG governance E2E
Route BuildBlendedSquadContext through stage access gate, and add PG integration test covering activate, doc approval hook, notifications, ABAC, and stage advance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 79811aa759 docs(test): add pi-agent E2E and bizdev ABAC acceptance report
Record real pi-agent lifecycle run (676s PASS) and stage access gate unit test results per delivery checklist.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 2795af2d09 fix(e2e): authenticate multi-role docgov steps in pi-agent lifecycle test
Align seeded user IDs and use per-role Bearer tokens so review reject/approve actions run as the assigned reviewer instead of the legacy fallback principal.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor 7c5f8deeb1 feat(abac): gate bizdev agent context by workflow stage duties
Inject stage access gate into bizdev service so task execution, project context reads, and prior docs respect live workflow ABAC.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00
weichenandCursor f6410508aa test(e2e): extend pi-agent lifecycle timeout to 1h
Allow long-running ad-hoc pi-agent steps by raising the HTTP client limit and documenting the 1h go test invocation.

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