69 Commits
Author SHA1 Message Date
agent-bot 2c75dcaf69 refactor(squad): AssetProvider port replaces direct template dependency
CI / go-vet (pull_request) Successful in 13s
CI / short-tests-report (pull_request) Failing after 35s
CI / backup-restore-drill (pull_request) Successful in 36s
CI / web (pull_request) Successful in 32s
KTD1 fifth step (behavior preserved):
- squad.AssetProvider{DocTemplate,RenderDoc,AgentInstruction,
  AgentInstructionFile} injected via Options.Assets into Service,
  WorkspaceEngine and AdaptivePlanner
- bizdev templateAssetProvider maps port to internal/template (assembly side)
- nil-provider paths degrade to the same fallbacks the old error branches
  used (placeholder template, role header) — fail-visible, no guessing
- squad -> template import eliminated; arch edge moved bizdev->template
- verified: build/vet/arch green, squad+bizdev short tests pass
2026-09-29 06:29:51 +00:00
agent-bot 8c2dd49e80 refactor(squad): quote preparation moves to Core via TaskPreparer hook
CI / web (pull_request) Successful in 32s
CI / go-vet (pull_request) Successful in 14s
CI / short-tests-report (pull_request) Failing after 35s
CI / backup-restore-drill (pull_request) Successful in 33s
KTD1 fourth step:
- squad.Options.TaskPreparer + TaskPreparation (Attachment + Backfills +
  MirrorTemplateToOutput); squad stays sole writer of its workspace files
- CDO quote calc/xlsx/backfill implementation moves to bizdev
  (quote_preparer.go); squad/quote_backfill.go relocated to bizdev
- arch path rule enforced the boundary: bizdev may not name/write
  output.md; mirroring decided squad-side via flag
- squad -> quote import eliminated; engine.go delegations now local
- verified: build/vet/arch green, squad+bizdev short tests pass
2026-09-29 06:16:19 +00:00
agent-bot f034a80c09 refactor(squad): drop dead WorkspaceRefForRun adapter (zero callers)
squad -> workspace import eliminated; physical workspace refs stay
product-side per KTD1. Arch edge removed from allowlist.
2026-09-29 06:11:55 +00:00
agent-bot e47cfd8f4e refactor(extract): move text extraction to internal/textextract
CI / go-vet (pull_request) Successful in 12s
CI / short-tests-report (pull_request) Failing after 36s
CI / backup-restore-drill (pull_request) Successful in 24s
CI / web (pull_request) Successful in 32s
KTD1 third step: material parsing returns to its own capability.
- ExtractTextWithAnchors + docx/anchor helpers move from squad/extract.go
  to internal/textextract (pure stdlib, no workflowdef dep)
- squad/extract.go keeps only ExtractAdvisorBriefing (squad domain logic)
- callers updated: squad context builders, bizdev materials, server
  chat_document_reader, materialindex pipeline
- reverse dependency materialindex -> squad eliminated (KTD1 explicit goal)
- module-boundaries.yaml: textextract declared + 4 edges
- verified: build/vet clean, arch green, textextract/squad/materialindex/
  bizdev tests green; server pre-existing env-dependent failure unchanged
  (issue #2, fails with and without this change)
2026-09-29 06:11:20 +00:00
agent-bot 2cd52da85d refactor(squad): typed ProgressSink port replaces direct stream dependency
CI / go-vet (pull_request) Successful in 12s
CI / short-tests-report (pull_request) Failing after 35s
CI / backup-restore-drill (pull_request) Successful in 36s
CI / web (pull_request) Successful in 33s
KTD1 second step (behavior preserved):
- squad defines ProgressSink (EmitPhase/Detail/Deliverable/Summary/Briefing)
  with its own DetailEvent/ToolEvent types; zero internal/stream imports left
- bizdev assembly maps port to SSE streamer (squad_progress_adapter) and
  injects via ctx at the four squad entry points
- process_bridge tests rewritten as port-contract tests (captureSink)
- verified: build+vet clean, squad/bizdev/archtest green
2026-09-29 05:51:32 +00:00
agent-bot 72c0996b74 refactor(squad): inject Options + backend factory, drop config.Config dependency
CI / go-vet (pull_request) Failing after 10s
CI / short-tests-report (pull_request) Failing after 36s
CI / backup-restore-drill (pull_request) Successful in 27s
CI / web (pull_request) Successful in 30s
KTD1 first step (in-repo decoupling, behavior preserved):
- squad.Options{BackendName, BackendTimeout, DataDir, NewBackend} replaces
  *config.Config; defaults applied in withDefaults
- backend construction injected by caller (bizdev assembly): credentials,
  environment and concurrency stay product-side; nil factory fails closed
  instead of silently degrading to Stub
- verified: go vet ./... clean, squad/bizdev short tests pass
2026-09-29 05:09:54 +00:00
weichen 721af4ccb8 fix(squad): 区分未注入对话的原因并附上采集统计
占位说明不再把开关关闭、项目未绑定和本轮没有对话包混成一句,避免把未采集误写成对话已被滤掉。
2026-09-28 15:36:38 +00:00
weichen 5d762fb206 merge: candidate subagent-process-view-impl-2026-09-28 into dev
# Conflicts:
#	.doc/ops/CURRENT.md
2026-09-28 10:36:26 +00:00
weichen 3d6dcc3ae5 feat(web): 用小队子页面展示思考与工具过程
气泡只聚合过程摘要并链到 hash 子页面;成员编制来自只读 squad 端点,思考与工具默认折叠。
2026-09-28 10:30:53 +00:00
weichen 265616e997 feat(stream): 打通小队过程事件到持久化 detail 帧
pi-native 与 runner NDJSON 把推理和工具调用投影为 detail,任务流始终落库;非 200 的流式尝试回落到一次性 /v1/run,避免改变既有错误分类。
2026-09-28 10:30:52 +00:00
weichen e5c2519fea merge: candidate refresh-task-state-recovery-2026-09-28 into dev 2026-09-28 06:18:08 +00:00
weichen b820e0070d fix(taskrun): 刷新后恢复进行中任务并纠正进度问询
进行中的 run 提前写下消息锚点,并按会话列出活跃任务;进度疑问句改为查询真实状态,交付物已落盘且不是传输失败时不再被空结果否决。
2026-09-28 06:09:42 +00:00
weichen aea19f70ef fix(squad): 章节标题归一化后不再把空格和层级漂移判成缺章
聊天触发的任务同时打开质量自动修复,避免格式误报直接阻断受控投影。
2026-09-28 05:12:51 +00:00
weichen 53d1be5349 feat(quote,squad): B5 input validation + review invariants; A5 non-critical step degradation
P10 backlog triage (implement B5+A5; A6 already fixed in-tree, D5 keep shared
KB, R1 separate task, R4/R5/R6/R7 no-go with evidence):

- quote: ValidateInput (empty names/hours, negative/NaN/Inf fail-closed);
  reviewSummary invariants (line sums = total; buffer 20%/margin 40%/tax 7%
  rate self-consistency) enforced before Excel write
- squad: StepSpec.Critical *bool (nil=critical default); non-critical step
  failure marks step degraded + gov audit, workflow continues, final status
  degraded with DegradedSteps list; critical failure semantics unchanged
- tests: 5 new cases (quote 3 + squad 2), full short suite green, arch-check pass
2026-09-25 17:10:35 +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 5e8e17b96a fix(squad): strip multi-digit Chinese ordinals in quality headings
Nightly TestManager failed because cleanHeadingTitle only stripped 一…十,
leaving 十一、/十二、 unmatched against template 签署/说明.
2026-09-24 02:26:23 +00:00
WeiCHEN 4830b8ba6d fix(squad): retry settled steps that never wrote the deliverable
Classify clean settle + missing target as transient (settled-no-deliverable)
and re-invoke once with a corrective write-tool prompt, instead of permanent
MISSING_TARGET failure.
2026-09-23 19:18:05 +08:00
WeiCHEN dca33c705d refactor(boundaries): split five oversized packages by use-case
Move bizdev/freedoc/intent/projectworkflow/squad giant files into
≤800-line use-case siblings without behavior change; short tests green.
2026-09-23 09:52:16 +08:00
WeiCHEN 10c5a295a2 feat(rdev): nightly four-workflow expansion and proposal title alignment 2026-09-22 21:51:18 +08:00
weichenandCursor b4388934a0 fix(runtime): hold taskrun fanout lock, guard goroutines, and escape math XSS
Serialize appendEvent sends under the subscriber mutex, wrap worker/memory goroutines with recover, lock synchronous chat SendMessage, and escape KaTeX error HTML.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-20 10:54:18 +00:00
weichenandCursor b48a832281 fix(squad): score only the first review-minutes table
A later standards table in the same section was counted as issue rows and failed the saved P3 sample.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 15:39:49 +00:00
weichenandCursor dba8139d56 feat(workflow): namespace task keys without breaking old instances
Published manifests now use bd_/pm_/tm_/sw_ prefixes so workflows cannot share a doc id. Frozen instances keep the old keys; lookup, templates, and duty checks treat the two names as the same task.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:50:25 +00:00
weichenandCursor 2fbb5bab49 feat(intent): match rdev document names when the user asks to generate
生成项目建议书 now resolves to rd_proposal. Longer titles win, so 系统设计方案 is not mistaken for the shorter business-stage phrase, and an explicit generate command is no longer swallowed by a progress question.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:26:57 +00:00
weichenandCursor b550911667 feat(squad): load rdev overlays and enforce document gates
Each rdev step now gets a role-filtered overlay so writing discipline stays out of the template. User needs, system requirements, review minutes, and upload indexes fail the quality gate when IDs, decisions, or attachment indexes are incomplete.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:12:10 +00:00
weichenandCursor 93ee98af0e feat(squad): apply rdev stage step overrides and aliases
Stage-specific squad steps now win over the kind default, including always-on regulatory and searcher roles. Each of the 60 tasks carries its writing hint and Chinese alias so lookup and the writer accept line use them.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 10:05:26 +00:00
weichenandCursor 754cba764c feat(squad): gate rdev regulatory steps on complexity tier
Listed tasks still get a regulatory step when complexity is unset or high. Medium and low skip it, and the squad model now comes from SQUAD_MODEL_ID or MINIMAX_MODEL_ID instead of a fixed name.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:58:40 +00:00
weichenandCursor dc3aef4607 fix(squad): inject rdev_leader InstructionsFile for DHF final review
Prefer AgentSpec.InstructionsFile when building AGENTS.md so rd_* leader
steps no longer fall back to business-tone leader.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:46:37 +00:00
weichenandCursor 37b1aaa3ae feat(rdev): add medical design-control workflow (13 stages / 60 docs)
Seed rdev.v2.json, rd_ templates, catalog policy (order 40), squad
kind orchestration, and hard precheck requiring completed main (CDO).
Includes StageKey dynamicization from P0 and docs for P2–P4 skeleton.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:46:26 +00:00
weichenandCursor 11e030db30 fix(squad): stop requiring fields.json as hard PI runner target
Organizer still prompts for fields.json, but missing it must not fail
closed as MISSING_TARGET when output.md is present (FullNone flake).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 00:55:11 +00:00
weichenandCursor 18ddd0f862 feat(workspace): add WorkspaceRef fencing and hide physical paths
Cross-module callers get an opaque ref plus rotating lease tokens so stale writers fail closed, and file I/O is refused inside a unit of work.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 15:59:14 +00:00
weichenandCursor 01c5972ead fix(squad): void quality repair rounds on backend or containment failure
Promote root output.md only when the runner succeeded, protected parents
were untouched, and the local target is trusted. Restore errors abort
instead of being ignored.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 20:20:13 +00:00
weichenandCursor b7cfb28217 fix(squad): keep quality repair inside a local snapshot workspace
Repair TASK.md told the model to edit ../../output.md, so the local
target never appeared and UI-03 stayed quality_failed. Snapshot parent
inputs locally, restore them on containment violations, and promote
only a trusted repair/output.md before revalidate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 20:15:54 +00:00
weichenandCursor becd295c9d fix(service): keep explicit backend failure fail-closed
A this-invocation output.md is preserved and never retried over, but
Success=false stays a step failure so truncated writes cannot pass.
Prior-round residue without a trusted patch is also not success.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:24:47 +00:00
weichenandCursor 6fd685fd47 fix(service): retry only safe transients and keep existing targets
Fresh step invocation is limited to provider terminated/connection plus
a missing target, or an explicit runner failure. A deliverable already
on disk is accepted and never overwritten.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:21:56 +00:00
weichenandCursor ce89939cd8 feat(service): retry transient step failures with a fresh invocation
runOneStep re-executes the backend at most once when the first attempt
is a settled failure or missing target after provider errors, records
each attempt honestly, and fail-closes after the bound.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:17:09 +00:00
weichenandCursor 4a97ff5dd1 fix(agent): map runner patch paths and require real targets
Normalize absolute, ./, and duplicated step prefixes onto output.md, and fail closed when the runner reports ok without a non-empty deliverable.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:09:48 +00:00
weichenandCursor 75345431e4 fix(squad): require action-plan table separator and equal columns
Reject 待续 status-cell exemptions unless the same contiguous table has a header immediately followed by a valid separator and the data row width matches the header.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 16:10:24 +00:00
weichenandCursor dee18d7fc0 fix(squad): exempt only action-plan status cells for 待续
Treat structured 阶段/状态/进度 cells as workflow state, not hedging, while still failing body, lists, and non-status columns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 15:59:56 +00:00
weichenandCursor 2d86d330e5 fix(docgov): keep squad AutoRepair/Success semantics; force repair only on controlled docs
小队修复预算只认 AutoRepair,Success 只表示执行完成;bizdev 在解析出 docRec 后强制开启修复,投影与阶段停链仍以 QualityReport 为准。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 15:19:20 +00:00
weichenandCursor 107f898362 fix(docgov): tighten prohibited-phrase exemption; lock stage request fields
自检豁免改为同行且须 meta+否定紧邻或引号引用,避免正文「无」误放过;buildBizdevStageRequest 单测锁住身份/职责字段与 AutoRepair 契约。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 15:16:12 +00:00
weichenandCursor 900af79e14 fix(docgov): quality gate self-pollution, server repair budget, quality_failed UI
受控小队任务服务端启用修复预算;否定性自检引用不再误报;quality_failed 保持失败且不激活未过门禁稿。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 15:00:50 +00:00
weichenandCursor be9a6d4640 docs(archive): relocate superpowers, workflow, and test assets
Move docs/superpowers to archive/design/superpowers with stubs;
archive workflow rules to PROJECT SSOT; separate test-report assets.
Update Go doc path references.

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 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 238f1d9346 feat(agent): unify async task FinalizeTaskRun projection to chat and runs
Extend taskrun executors to return full TaskRunResult, finalize assistant
placeholder content with artifact metadata, and map quality_failed terminal
state instead of metadata-only updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor e139b2b267 feat(api): observer task runs decoupled from SSE lifecycle
Add POST/GET/POST cancel task run APIs, background worker with event replay,
workspace reconcile, runner child cancel, and chat message metadata updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHENandCursor 908d4bdb2e feat(agent): project asset upload and squad materials assembly
Register uploads via CAS, resolve project asset pools into task materials
with server-side extraction, and propagate asset_id through the bizdev/squad chain.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:22 +00:00
WeiCHEN f994c45d67 feat(workflow): Phase 4 智能产品经理工作流、系统需求规格书与质量门禁 2026-09-13 02:50:21 +00:00
WeiCHEN e5e80a6fc6 feat(core): update backend coordinator, docgov lease, squad workflow and web governance integration 2026-09-13 02:50:20 +00:00
WeiCHENandCursor d0c9670ebc feat(coordinator): 在贴身业务参谋决策锦囊中注入相似标杆案例自推荐
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:19 +00:00