@thincoder/core 0.11.1 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -2
- package/advisor/compaction.mjs +7 -5
- package/advisor/convergence.mjs +34 -3
- package/advisor/history.mjs +24 -11
- package/advisor/loop.mjs +49 -12
- package/advisor/messages.mjs +114 -33
- package/advisor/project-context.mjs +171 -42
- package/advisor/run.mjs +24 -10
- package/advisor.mjs +36 -46
- package/agent/batch-attribution.mjs +87 -0
- package/agent/batch-changed-surface.mjs +129 -0
- package/agent/chat-call.mjs +14 -9
- package/agent/completion.mjs +70 -41
- package/agent/continue-decision.mjs +14 -8
- package/agent/digest-account.mjs +133 -59
- package/agent/dispatch-gates.mjs +6 -0
- package/agent/dispatch-run.mjs +1 -1
- package/agent/dispatch.mjs +10 -4
- package/agent/family-tools.mjs +37 -23
- package/agent/helpers.mjs +139 -73
- package/agent/image-heal.mjs +18 -4
- package/agent/offload.mjs +25 -29
- package/agent/post-turn.mjs +36 -35
- package/agent/record-results.mjs +39 -7
- package/agent/run-stages.mjs +132 -52
- package/agent/run-start.mjs +150 -78
- package/agent/setup-reminders.mjs +194 -91
- package/agent/setup.mjs +219 -140
- package/agent/spawn-child.mjs +40 -3
- package/agent/suspension.mjs +43 -15
- package/agent/timers.mjs +9 -4
- package/agent/turn-domain-text.mjs +105 -0
- package/agent/turn-loop.mjs +84 -27
- package/agent/turn-projection.mjs +286 -0
- package/agent/turn-task-state.mjs +274 -0
- package/agent/turn-tool-process.mjs +163 -0
- package/agent/write-gate-ledger.mjs +569 -0
- package/agent/write-gate.mjs +29 -352
- package/agent-tools/advisor-async.mjs +35 -172
- package/agent-tools/advisor-launch.mjs +178 -0
- package/agent-tools/advisor-settle.mjs +28 -1
- package/agent-tools/advisor.mjs +37 -48
- package/agent-tools/async-discard.mjs +7 -2
- package/agent-tools/async-settle.mjs +18 -12
- package/agent-tools/audit-block.mjs +6 -6
- package/agent-tools/bash-async.mjs +5 -2
- package/agent-tools/batch-closeout.mjs +223 -35
- package/agent-tools/batch-gate.mjs +142 -342
- package/agent-tools/batch-ledger-bind.mjs +240 -20
- package/agent-tools/batch-ledger-view.mjs +109 -0
- package/agent-tools/batch-lifecycle.mjs +197 -48
- package/agent-tools/batch-paths.mjs +29 -8
- package/agent-tools/batch-read.mjs +151 -4
- package/agent-tools/batch-record-write.mjs +417 -0
- package/agent-tools/batch-regions.mjs +215 -0
- package/agent-tools/batch-reopen.mjs +23 -11
- package/agent-tools/batch-segment-vocab.mjs +459 -0
- package/agent-tools/batch-skeleton.mjs +196 -239
- package/agent-tools/batch-supersede.mjs +232 -0
- package/agent-tools/batch-tier-gate.mjs +214 -0
- package/agent-tools/batch.mjs +192 -439
- package/agent-tools/browser-async.mjs +5 -2
- package/agent-tools/consult.mjs +17 -11
- package/agent-tools/context.mjs +76 -33
- package/agent-tools/design-review-record.mjs +225 -0
- package/agent-tools/design-slots.mjs +1 -1
- package/agent-tools/design-token.mjs +279 -81
- package/agent-tools/digest-budget.mjs +10 -9
- package/agent-tools/doc-check.mjs +43 -33
- package/agent-tools/doc-graph.mjs +140 -0
- package/agent-tools/eng.mjs +12 -12
- package/agent-tools/escalate-async.mjs +5 -5
- package/agent-tools/goal.mjs +5 -2
- package/agent-tools/judge-domain.mjs +347 -0
- package/agent-tools/manifest.mjs +34 -18
- package/agent-tools/parent-channel.mjs +6 -3
- package/agent-tools/plan.mjs +11 -10
- package/agent-tools/read-history.mjs +112 -11
- package/agent-tools/review-facts.mjs +19 -6
- package/agent-tools/settings.mjs +23 -2
- package/agent-tools/skill.mjs +7 -8
- package/agent-tools/spawn-gates.mjs +14 -24
- package/agent-tools/ssh-session.mjs +8 -5
- package/agent-tools/ssh-text.mjs +155 -0
- package/agent-tools/ssh-transfer.mjs +1 -1
- package/agent-tools/ssh-transport.mjs +19 -148
- package/agent-tools/subagent-actions-query.mjs +10 -6
- package/agent-tools/subagent-actions.mjs +2 -2
- package/agent-tools/subagent-async.mjs +19 -17
- package/agent-tools/subagent-brief.mjs +76 -0
- package/agent-tools/subagent-design-token.mjs +168 -0
- package/agent-tools/subagent-run.mjs +1 -1
- package/agent-tools/subagent-scheduler.mjs +13 -13
- package/agent-tools/subagent-spawn.mjs +92 -112
- package/agent-tools/subagent.mjs +16 -28
- package/agent-tools/task.mjs +0 -8
- package/agent-tools/taskbook-block.mjs +94 -0
- package/agent-tools/timer.mjs +12 -8
- package/agent-tools/verify.mjs +13 -4
- package/agent-tools.mjs +7 -3
- package/agent.mjs +26 -7
- package/attachments.mjs +3 -3
- package/auto-think.mjs +5 -2
- package/browser/actions.mjs +9 -3
- package/browser/cdp.mjs +45 -17
- package/browser/launch.mjs +25 -43
- package/browser/pool.mjs +299 -0
- package/browser/queue.mjs +2 -0
- package/browser/session-state.mjs +450 -0
- package/browser/session.mjs +127 -151
- package/browser/snapshot.mjs +89 -0
- package/client-identity.mjs +1 -1
- package/compaction-work-state.mjs +230 -0
- package/compress-form.mjs +41 -6
- package/config-defaults.mjs +7 -3
- package/config-migrate.mjs +40 -0
- package/config-normalize.mjs +28 -2
- package/config-reload.mjs +59 -0
- package/config.mjs +110 -110
- package/context-degrade.mjs +93 -34
- package/context-echo.mjs +6 -15
- package/context-push.mjs +328 -31
- package/context.mjs +298 -170
- package/conventions.mjs +11 -9
- package/declaration.mjs +126 -22
- package/declared-repos.mjs +94 -0
- package/doc-check/doc-names.mjs +73 -0
- package/doc-check/doc-tokens.mjs +110 -0
- package/doc-check/existence.mjs +160 -0
- package/doc-check/index.mjs +309 -213
- package/doc-check/line-refs.mjs +27 -101
- package/doc-check/paragraph.mjs +218 -102
- package/doc-graph/anchors.mjs +474 -0
- package/doc-graph/doc-batch-face.mjs +59 -0
- package/doc-graph/doc-suffix.mjs +27 -0
- package/doc-graph/graph-tokens.mjs +160 -0
- package/doc-graph.mjs +778 -0
- package/escape.mjs +6 -5
- package/explore-distill.mjs +41 -8
- package/generate-title.mjs +10 -1
- package/i18n.mjs +1 -1
- package/instance-inbox-watch.mjs +272 -0
- package/instance-inbox.mjs +218 -0
- package/instance-registry.mjs +179 -0
- package/knowledge/README.md +3 -0
- package/knowledge/prompt-resources.md +10 -0
- package/ledger-close-proof.mjs +100 -49
- package/ledger-close.mjs +188 -0
- package/ledger-cmd.mjs +47 -91
- package/ledger-consistency.mjs +113 -0
- package/ledger-db.mjs +47 -15
- package/ledger-executors.mjs +1 -1
- package/ledger-tools.mjs +121 -62
- package/ledger-write-ops.mjs +162 -46
- package/ledger.mjs +1 -1
- package/manifest-discovery.mjs +3 -1
- package/manifest-schema.mjs +27 -5
- package/memory/docs.mjs +51 -15
- package/memory/file-list.mjs +6 -0
- package/memory/schema.mjs +2 -2
- package/model-specs.mjs +87 -21
- package/origin-guard.mjs +190 -0
- package/package.json +3 -1
- package/path-resolve.mjs +338 -57
- package/prompt-files.mjs +114 -2
- package/prompt-overlays.mjs +21 -11
- package/prompts/advisor-design.md +96 -36
- package/prompts/advisor-round1.md +48 -4
- package/prompts/advisor-round2.md +54 -10
- package/prompts/advisor-round3.md +53 -9
- package/prompts/common.md +99 -434
- package/prompts/consult-base.md +7 -4
- package/prompts/discipline-engineering.md +504 -295
- package/prompts/discipline-normal.md +106 -281
- package/prompts/knowledge/business-gates.md +30 -0
- package/prompts/knowledge/decision-quality.md +21 -0
- package/prompts/knowledge/doc-lookup.md +30 -0
- package/prompts/knowledge/document-writing.md +33 -0
- package/prompts/knowledge/documentation-evaluation.md +48 -0
- package/prompts/knowledge/evidence-discipline.md +38 -0
- package/prompts/knowledge/normal-coding-workflow.md +110 -0
- package/prompts/knowledge/normal-delivery-collaboration.md +124 -0
- package/prompts/knowledge/normal-work-management.md +60 -0
- package/prompts/knowledge/product-security.md +28 -0
- package/prompts/knowledge/project-records.md +73 -0
- package/prompts/knowledge/tool-advisor.md +29 -0
- package/prompts/knowledge/tool-apply-patch.md +17 -0
- package/prompts/knowledge/tool-bash.md +48 -0
- package/prompts/knowledge/tool-batch-eng-coder.md +19 -0
- package/prompts/knowledge/tool-batch-eng-designer.md +20 -0
- package/prompts/knowledge/tool-batch-review.md +18 -0
- package/prompts/knowledge/tool-batch.md +94 -0
- package/prompts/knowledge/tool-browser.md +68 -0
- package/prompts/knowledge/tool-code-search.md +4 -0
- package/prompts/knowledge/tool-consult-start.md +12 -0
- package/prompts/knowledge/tool-consult-stop.md +6 -0
- package/prompts/knowledge/tool-context.md +6 -0
- package/prompts/knowledge/tool-delete.md +21 -0
- package/prompts/knowledge/tool-doc-check.md +71 -0
- package/prompts/knowledge/tool-doc-graph-read.md +20 -0
- package/prompts/knowledge/tool-doc-graph.md +49 -0
- package/prompts/knowledge/tool-doc-search.md +6 -0
- package/prompts/knowledge/tool-edit.md +41 -0
- package/prompts/knowledge/tool-eng.md +2 -0
- package/prompts/knowledge/tool-execute.md +21 -0
- package/prompts/knowledge/tool-fetch.md +18 -0
- package/prompts/knowledge/tool-file-ops.md +21 -0
- package/prompts/knowledge/tool-get-current-time.md +7 -0
- package/prompts/knowledge/tool-git-read.md +21 -0
- package/prompts/knowledge/tool-git.md +29 -0
- package/prompts/knowledge/tool-glob.md +17 -0
- package/prompts/knowledge/tool-goal.md +8 -0
- package/prompts/knowledge/tool-grep.md +21 -0
- package/prompts/knowledge/tool-hashline-edit.md +16 -0
- package/prompts/knowledge/tool-insert-after.md +17 -0
- package/prompts/knowledge/tool-instance-list.md +6 -0
- package/prompts/knowledge/tool-instance-send.md +10 -0
- package/prompts/knowledge/tool-knowledge.md +18 -0
- package/prompts/knowledge/tool-ledger-read.md +28 -0
- package/prompts/knowledge/tool-ledger.md +46 -0
- package/prompts/knowledge/tool-lint.md +16 -0
- package/prompts/knowledge/tool-ls.md +15 -0
- package/prompts/knowledge/tool-lsp.md +11 -0
- package/prompts/knowledge/tool-main-history.md +2 -0
- package/prompts/knowledge/tool-manifest-read.md +14 -0
- package/prompts/knowledge/tool-manifest.md +34 -0
- package/prompts/knowledge/tool-memory-read.md +20 -0
- package/prompts/knowledge/tool-memory.md +19 -0
- package/prompts/knowledge/tool-notify-parent.md +12 -0
- package/prompts/knowledge/tool-operations.md +102 -0
- package/prompts/knowledge/tool-peer-instances.md +2 -0
- package/prompts/knowledge/tool-plan.md +5 -0
- package/prompts/knowledge/tool-process-read.md +13 -0
- package/prompts/knowledge/tool-process.md +15 -0
- package/prompts/knowledge/tool-question.md +16 -0
- package/prompts/knowledge/tool-read-history-batch.md +22 -0
- package/prompts/knowledge/tool-read-history.md +35 -0
- package/prompts/knowledge/tool-read-image.md +11 -0
- package/prompts/knowledge/tool-read.md +22 -0
- package/prompts/knowledge/tool-recent-changes.md +6 -0
- package/prompts/knowledge/tool-repo-outline.md +4 -0
- package/prompts/knowledge/tool-settings-read.md +12 -0
- package/prompts/knowledge/tool-settings.md +17 -0
- package/prompts/knowledge/tool-skill.md +6 -0
- package/prompts/knowledge/tool-ssh.md +74 -0
- package/prompts/knowledge/tool-subagent.md +57 -0
- package/prompts/knowledge/tool-task.md +14 -0
- package/prompts/knowledge/tool-team-ledger-read.md +11 -0
- package/prompts/knowledge/tool-team-ledger.md +15 -0
- package/prompts/knowledge/tool-timer.md +23 -0
- package/prompts/knowledge/tool-tree.md +16 -0
- package/prompts/knowledge/tool-verify.md +19 -0
- package/prompts/knowledge/tool-wait-for.md +25 -0
- package/prompts/knowledge/tool-websearch.md +19 -0
- package/prompts/knowledge/tool-write.md +12 -0
- package/prompts/knowledge/upstream-protocol.md +45 -0
- package/prompts/persona-coder.md +1 -3
- package/prompts/persona-eng-coder.md +24 -6
- package/prompts/persona-eng-designer.md +150 -171
- package/prompts/persona-engineering.md +531 -442
- package/prompts/persona-explore.md +1 -3
- package/prompts/persona-normal.md +17 -9
- package/prompts/persona-plan.md +5 -3
- package/prompts/persona-tester.md +0 -2
- package/prompts/subagent-base.md +2 -2
- package/provider/anthropic.mjs +10 -6
- package/provider/core.mjs +8 -5
- package/provider/errors.mjs +63 -4
- package/provider/google.mjs +29 -10
- package/provider/reasoning-echo.mjs +16 -0
- package/provider/responses.mjs +7 -3
- package/provider/sse.mjs +11 -6
- package/provider-flows.mjs +2 -2
- package/rules.mjs +11 -10
- package/session-index-build.mjs +1 -1
- package/session-index-pass.mjs +1 -1
- package/session-index-query.mjs +1 -1
- package/session-index.mjs +1 -1
- package/session-lifecycle.mjs +131 -42
- package/session-slot-write.mjs +38 -6
- package/session.mjs +30 -11
- package/shell-identity.mjs +129 -22
- package/skip-dirs.mjs +26 -2
- package/team-ledger.mjs +34 -30
- package/text-budget.mjs +1 -1
- package/think-off.mjs +27 -0
- package/token-ttl.mjs +74 -5
- package/token-window.mjs +371 -47
- package/tool-docs/advisor.md +2 -27
- package/tool-docs/apply_patch.md +1 -15
- package/tool-docs/bash.md +2 -43
- package/tool-docs/batch-eng-coder.md +3 -0
- package/tool-docs/batch-eng-designer.md +3 -0
- package/tool-docs/batch-review.md +3 -0
- package/tool-docs/batch.md +2 -84
- package/tool-docs/browser.md +2 -49
- package/tool-docs/code_search.md +2 -2
- package/tool-docs/consult_start.md +2 -8
- package/tool-docs/consult_stop.md +2 -4
- package/tool-docs/context.md +1 -5
- package/tool-docs/delete.md +2 -17
- package/tool-docs/doc_check.md +2 -107
- package/tool-docs/doc_graph-read.md +3 -0
- package/tool-docs/doc_graph.md +3 -0
- package/tool-docs/doc_search.md +2 -4
- package/tool-docs/edit.md +1 -38
- package/tool-docs/eng.md +3 -1
- package/tool-docs/execute.md +2 -18
- package/tool-docs/fetch.md +2 -14
- package/tool-docs/file_ops.md +2 -18
- package/tool-docs/get_current_time.md +1 -6
- package/tool-docs/git-read.md +3 -0
- package/tool-docs/git.md +2 -35
- package/tool-docs/glob.md +2 -10
- package/tool-docs/goal.md +1 -6
- package/tool-docs/grep.md +2 -18
- package/tool-docs/hashline_edit.md +2 -15
- package/tool-docs/insert_after.md +2 -16
- package/tool-docs/instance_list.md +3 -0
- package/tool-docs/instance_send.md +3 -0
- package/tool-docs/knowledge.md +3 -0
- package/tool-docs/ledger-read.md +3 -0
- package/tool-docs/ledger.md +3 -8
- package/tool-docs/lint.md +2 -10
- package/tool-docs/ls.md +2 -11
- package/tool-docs/lsp.md +2 -9
- package/tool-docs/main_history.md +3 -1
- package/tool-docs/manifest-read.md +2 -8
- package/tool-docs/manifest.md +2 -35
- package/tool-docs/memory-read.md +3 -0
- package/tool-docs/memory.md +2 -20
- package/tool-docs/notify_parent.md +2 -13
- package/tool-docs/peer_instances.md +3 -1
- package/tool-docs/plan.md +1 -5
- package/tool-docs/process-read.md +3 -0
- package/tool-docs/process.md +2 -13
- package/tool-docs/question.md +3 -17
- package/tool-docs/read.md +2 -19
- package/tool-docs/read_history-batch.md +3 -0
- package/tool-docs/read_history.md +2 -18
- package/tool-docs/read_image.md +2 -9
- package/tool-docs/recent_changes.md +2 -2
- package/tool-docs/repo_outline.md +2 -2
- package/tool-docs/settings-read.md +3 -0
- package/tool-docs/settings.md +1 -12
- package/tool-docs/skill.md +2 -6
- package/tool-docs/ssh.md +1 -62
- package/tool-docs/subagent.md +2 -100
- package/tool-docs/task.md +1 -7
- package/tool-docs/team_ledger-read.md +3 -0
- package/tool-docs/team_ledger.md +3 -9
- package/tool-docs/timer.md +2 -19
- package/tool-docs/tree.md +2 -13
- package/tool-docs/verify.md +2 -12
- package/tool-docs/wait_for.md +2 -32
- package/tool-docs/websearch.md +2 -19
- package/tool-docs/write.md +2 -12
- package/tools/browser.mjs +54 -9
- package/tools/doc-write-gate.mjs +73 -0
- package/tools/edit-batch.mjs +170 -92
- package/tools/edit-diff.mjs +78 -62
- package/tools/edit-receipt.mjs +39 -0
- package/tools/execute.mjs +3 -3
- package/tools/file.mjs +28 -14
- package/tools/git.mjs +36 -21
- package/tools/index.mjs +6 -0
- package/tools/knowledge.mjs +143 -0
- package/tools/linter.mjs +3 -3
- package/tools/ops.mjs +5 -3
- package/tools/patch.mjs +124 -44
- package/tools/process-doc-mark.mjs +33 -4
- package/tools/repomap.mjs +25 -3
- package/tools/search.mjs +74 -26
- package/tools/shared.mjs +29 -27
- package/tools/ssh.mjs +5 -5
- package/tools/tree.mjs +32 -10
- package/tools/web-deepseek.mjs +1 -1
- package/tools/web.mjs +2 -2
- package/tools/write-gate-params.mjs +31 -0
- package/tools/write-path.mjs +16 -4
- package/window-policy.mjs +243 -0
- package/doc-check/anchors.mjs +0 -235
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,68 @@
|
|
|
3
3
|
All notable changes to the core package are documented here.
|
|
4
4
|
Format: Keep a Changelog · 中文 · 号在发布时定(CalVer——见 `docs/RELEASE.md` §4)。
|
|
5
5
|
|
|
6
|
+
## [0.11.3] — 2026-11-23
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- **批档 §2 增设「目的与代价链」块**:任务书先讲为什么做、不做会亏什么、为什么不选更便宜的做法,再讲改什么。
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **结尾报告改两表**:交付表退役,需求点达成状态并入「本批进展」的状态列;会话总账不变。
|
|
15
|
+
- **提示词归属四问 → 五问**:新增「产品特定指令」一问;本仓路径、流程档名单与发布档写法退出提示词,改住项目层与纪律面。
|
|
16
|
+
- **`spawn-gates` 只拦 `PROJECT-MANIFEST.json`**:谓词改名 `rejectParentOwnedPaths`,`CHANGELOG.md` 不再被当作父侧流程档。
|
|
17
|
+
- **`TESTING.md` §11.17 删案**:不再要求提示词点名集成索引的仓内路径。
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- **思考模式回声键 400**:assistant 历史轮缺 `reasoning_content` 键即被上游拒;现在写面落键(有原文写原文,无原文写空串)、请求面补空串,不再退轮。
|
|
22
|
+
- **空 assistant 退场判据**:原本挂在「这条消息是否被改动」上,关思考打开旧会话时旧空轮仍会上街;现在按消息本身判定。
|
|
23
|
+
|
|
24
|
+
## [0.11.2] — 2026-11-16
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- **设计评审射程天花板**:`§4`/`§5`/`§6` 永在判域之外——它们写在本轮 pass 之后,空着不是发现;可判面 = `§1–§3` 与评审范围文档。**读不受限**:挡的是「对段的发现」,不是读代码。
|
|
29
|
+
- **设计评审判据不随轮次衰减**:第 N 轮可判的发现范围与第 1 轮相同;上一轮输出改由 `buildPriorReviewBlock` 作背景传入,不是本轮的验证清单。
|
|
30
|
+
- **收口门「被取代」边**:对象已消失、永不会实施且能指名后继的批档走 `supersede` 冻结,不靠补写四段内容去过 `close`。
|
|
31
|
+
- **收口门改动面按批归属**:写时归属为主判据、提交 diff 按认领收窄;已收口批的区间上界取它自己的收口提交,取不到则不认领。
|
|
32
|
+
- **写前文档机检门**:`.md` 每一笔写盘前判本笔触碰的段落,区外存量一条不出。
|
|
33
|
+
- **行号坐标成为交付门第三判据**。
|
|
34
|
+
- **`index.docCheckExcludePaths`**:项目可声明文档检查的排除目录。
|
|
35
|
+
- **`index.publicRepos` 出边机检**:跨仓引用未声明即拒、成环即拒。
|
|
36
|
+
- **工具参数零默认值**:缺了就拒,不替调用方拿主意。
|
|
37
|
+
- **`commit` 携未跟踪 path 逐条预检**:调 git 前点名,不为一个 path 回滚整批。
|
|
38
|
+
- **`edit` 行号形态空 `new_string` 按删除生效**。
|
|
39
|
+
- **任务书按角色分**:eng-coder 读批档 §2、eng-designer 读整档;任务书正文进 spawn 系统固块。
|
|
40
|
+
- **批档 §3 只承载本轮结论表**:轮次块由结算自写,评审回执全文不再进档。
|
|
41
|
+
- **单池共享浏览器**。
|
|
42
|
+
- **knowledge 检索**:分词剥首尾标点,停用词过滤;tiny 档常驻查询指引。
|
|
43
|
+
- **tiny 档有效窗口覆盖 256K**。
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
|
|
47
|
+
- **收口门越线支改判 800**(收口线),与设计时线 500 各归各判者。
|
|
48
|
+
- **收口门判域 = 本批变更区**:区内照判三件,区外一个字都不出。
|
|
49
|
+
- **窗口预算单向派生**,压缩线封顶 262144,基线重定并补处置链。
|
|
50
|
+
- **工作模式 `minimal` → `tiny`** 全链改名;工具描述一句话化并按档装配。
|
|
51
|
+
- **引用三形按作用域分工**:正文 / 工具参数 / 证据各一形;编号作用域 = 发它的那份档,跨档带档名。
|
|
52
|
+
- **段落写作标准改挂 `doc_check`**:停用字数自量。
|
|
53
|
+
- **「一把尺子」**:同一读数的不同取法不可互比,射程放开到任何读数。
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
|
|
57
|
+
- **设计评审第 2 轮起被判据降级为收敛轮**——只验上一轮点名项、不再读全文;`§5 实施记录为空` 这类发现正是从这条路径出来的。
|
|
58
|
+
- **推回预算不再被每轮工具批清零**:未评审的收尾必带一句声明。
|
|
59
|
+
- **段判据认中文项目符号**:合法列表文档不再被写门挡住。
|
|
60
|
+
- **`batch edit` 触达账接上改动区**;`standards` 键根解析修复。
|
|
61
|
+
- **设计收尾不判红**;设计轮提醒有上限;`timer` 行去字形。
|
|
62
|
+
|
|
63
|
+
### Removed
|
|
64
|
+
|
|
65
|
+
- **退役措辞族清场**。
|
|
66
|
+
- **fragment 档退役**。
|
|
67
|
+
|
|
6
68
|
## [0.11.1] — 2026-11-04
|
|
7
69
|
|
|
8
70
|
### Added
|
|
@@ -10,7 +72,7 @@ Format: Keep a Changelog · 中文 · 号在发布时定(CalVer——见 `docs
|
|
|
10
72
|
- **`ssh` 文件传输**:工具新增 `put` / `get` 两动作(单文件、二进制安全)——执行体 = 系统 `scp`,缺省 `-O`(经典协议,网络设备普遍只实现这一支),`protocol:"sftp"` 可覆盖;硬超时杀树;`get` 半截档按「字节数或 mtime 变过」才删,未被动过的旧档不删。
|
|
11
73
|
- **写门射程扩到十三把**:`ssh` 入入口集,但**只 `get` 要号**(`put` 写远端,本门不判);`touchedPaths` 钩子回绝对形,`~` 落点不再被判成「项目内虚构路径」。
|
|
12
74
|
- **项目标准档声明口 `docRoot.standards`**:评审的「方法论符合度」维度不再是空跑。
|
|
13
|
-
- **`path-resolve.mjs`** ∥ **`tools/process-doc-mark.mjs`** ∥ **`persona-tester.md`**(tester 角色人格)。
|
|
75
|
+
- **`path-resolve.mjs`** ∥ **`tools/process-doc-mark.mjs`** ∥ **`thincoder-core/prompts/persona-tester.md`**(tester 角色人格)。
|
|
14
76
|
- **SSE 首 chunk 与流中途分窗**:长 prefill 不再被 120s 静默超时误杀。
|
|
15
77
|
- **`x-opencode-session` 改为每会话一个**(值位模板 `${sessionId}`)。
|
|
16
78
|
- **`ledger/count` 跨项目读面**:界改用调用方 `cwd`。
|
|
@@ -113,7 +175,7 @@ Format: Keep a Changelog · 中文 · 号在发布时定(CalVer——见 `docs
|
|
|
113
175
|
|
|
114
176
|
### Fixed
|
|
115
177
|
|
|
116
|
-
- **核包 `files` 白名单补 `browser/`**(P0——0.10.5 装机缺该目录 ⇒ CLI 装后启动崩(`ERR_MODULE_NOT_FOUND`):`tools/browser.mjs
|
|
178
|
+
- **核包 `files` 白名单补 `browser/`**(P0——0.10.5 装机缺该目录 ⇒ CLI 装后启动崩(`ERR_MODULE_NOT_FOUND`):`tools/browser.mjs` ∥ `permission.mjs` 引 `../browser/*` 而白名单未列;台账 #1362)。发布守则教训:白名单须覆盖运行时引用闭包——发布预检现只对根 `.mjs` ∥ `prompts/` ∥ `tool-docs/` 计数(引闭包断言待另轮补,已登记)。
|
|
117
179
|
|
|
118
180
|
## [0.10.5] — 2026-10-13
|
|
119
181
|
|
package/advisor/compaction.mjs
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* advisor-loop-split 批:loop 的压缩检查点归位本档(`compactContextIfNeeded`——`context_limit` 尾串生成点同迁;时间线面 ⇒ `advisor/timeline.mjs`)。
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { requestBudget } from "../config.mjs" // 预算派生单源(`providerSpec` ∥ `outputReserve` ∥ `usableWindow` 都经 `budgetOf` 这一处合流);`requestBudget` = 模型窗口出口,含 §2.4 的夹点
|
|
14
14
|
// B4(群 B 批,ADVISOR-GUARDS.md §9——F32):CJK 加权单源(provider/rate.mjs 叶子向无环)
|
|
15
15
|
import { estimateText } from "../provider/rate.mjs"
|
|
16
16
|
|
|
@@ -30,11 +30,13 @@ const COMPACT_TRIGGER_RATIO = 0.8 // 压缩触发 = 判死线 × 0.8(既
|
|
|
30
30
|
|
|
31
31
|
/** 评审上下文预算(纯函数——两档阈值可机测;provider 为 null 时退化默认规格)。
|
|
32
32
|
* 基数 = **可用窗口 = 窗口 − 完成预留**(#975/用户 2026-10-06 裁定——预留坐在窗口里 ⇒
|
|
33
|
-
* 先压缩、不许 provider 先拒:provider 口径 = 输入 + max_tokens ≤ 窗口;预留 = `outputReserve`)。
|
|
33
|
+
* 先压缩、不许 provider 先拒:provider 口径 = 输入 + max_tokens ≤ 窗口;预留 = `outputReserve`)。
|
|
34
|
+
* 派生走 `requestBudget`(模型窗口出口的同一次算式、同一处判据与夹点,`CONTEXT-COMPACTION.md` §2.4):
|
|
35
|
+
* 并立第二套处置会让这条线在配置矛盾上抛,而主链已是响应一声、夹住、放行。
|
|
36
|
+
* 矛盾预算上 `limit` 已被夹到 `BUDGET_FLOOR_TOKENS`,比例项随之落到 0——评审面自己按「上下文受限」收尾
|
|
37
|
+
* (`compactContextIfNeeded` 的 `context_limit` 尾),不抛。 */
|
|
34
38
|
export function advisorContextBudget(provider) {
|
|
35
|
-
const
|
|
36
|
-
const usable = usableWindow(spec.context, outputReserve(provider, spec))
|
|
37
|
-
const limit = Math.floor(usable * CONTEXT_LIMIT_RATIO)
|
|
39
|
+
const limit = Math.floor(requestBudget(provider).limit * CONTEXT_LIMIT_RATIO)
|
|
38
40
|
return { limit, compactAt: Math.floor(limit * COMPACT_TRIGGER_RATIO) }
|
|
39
41
|
}
|
|
40
42
|
|
package/advisor/convergence.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* advisor/convergence.mjs — shared convergence-round message building (round 2+).
|
|
3
|
-
* SINGLE source for the
|
|
3
|
+
* buildConvergenceBody / buildConvergenceInstructions: SINGLE source for the
|
|
4
|
+
* round-2+ sections of CODE reviews, used by BOTH the normal flow
|
|
4
5
|
* (buildAdvisorFollowUp) and the legacy path (buildAdvisorUserMessage) — fixes must
|
|
5
|
-
* not be replicated in two places.
|
|
6
|
+
* not be replicated in two places. buildPriorReviewBlock serves the design-review
|
|
7
|
+
* round 2+, whose prior output is a reference rather than a verification list.
|
|
8
|
+
* Lives in its own module to avoid the advisor-entry
|
|
6
9
|
* ↔ message-building import cycle.
|
|
7
10
|
*/
|
|
8
11
|
|
|
@@ -24,7 +27,7 @@ export function buildConvergenceInstructions(round, scopeFiles = null) {
|
|
|
24
27
|
"2. STALE-CONTEXT WARNING: any diff or file content from earlier messages is a historical snapshot — treat it as expired. Only fresh `read` results describe the current state.",
|
|
25
28
|
"3. You have no git tool; git output in earlier messages is historical and untrustworthy (committed fixes never show in a diff).",
|
|
26
29
|
"4. `read` the files named in the prior review output (or the review surface above) in full — ALWAYS. Batch reads/greps in a single reply.",
|
|
27
|
-
"5. Evidence rule: every 'Unfixed'/'New' finding MUST quote the exact line content from THIS round's `read` output
|
|
30
|
+
"5. Evidence rule: every 'Unfixed'/'New' finding MUST quote the exact line content from THIS round's `read` output — one CONTIGUOUS excerpt, quoted exactly as it stands. Line numbers alone are NOT evidence — they may be stale or fabricated. Findings without a fresh quoted line are treated as unverified and will not be accepted.",
|
|
28
31
|
"6. Produce your verification table. Do not re-read content you already have.",
|
|
29
32
|
round === 2
|
|
30
33
|
? "7. You may flag obvious NEW issues introduced by the fixes (crashes, data loss, logic errors — not style)."
|
|
@@ -78,3 +81,31 @@ export function buildConvergenceBody(p, response, round, scopeFiles) {
|
|
|
78
81
|
]
|
|
79
82
|
return parts.join("\n")
|
|
80
83
|
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Design-review reference block for round 2+ (decision 2026-11-16 — a design
|
|
87
|
+
* review has NO convergence decay). The prior review output and the agent's fix
|
|
88
|
+
* claims travel so the reviewer does not re-report what is already fixed, but
|
|
89
|
+
* both are REFERENCE: the round is a full review at the same standard as the
|
|
90
|
+
* first, and the prior items are not the verification list.
|
|
91
|
+
* Deliberately separate from buildConvergenceBody — that one keeps serving code
|
|
92
|
+
* reviews, whose rounds DO narrow (round 2 semi-convergence, round 3+ strict).
|
|
93
|
+
* @param {string} p — full prior review output (verbatim)
|
|
94
|
+
* @param {string} response — agent fix-claims table (or fallback text)
|
|
95
|
+
* @returns {string} the reference block
|
|
96
|
+
*/
|
|
97
|
+
export function buildPriorReviewBlock(p, response) {
|
|
98
|
+
return [
|
|
99
|
+
"## Prior Review Output (previous round — reference, not the verification list)",
|
|
100
|
+
p,
|
|
101
|
+
"",
|
|
102
|
+
"## Agent Response (fix claims — reference only)",
|
|
103
|
+
response,
|
|
104
|
+
"",
|
|
105
|
+
"## Instructions",
|
|
106
|
+
"1. This round is a FULL review at the same standard as the first: the system prompt's complete criteria apply, and every document in the review scope is read in full.",
|
|
107
|
+
"2. The prior review output above is a reference, not the verification list: report an item as still open only where the current file state shows it, and report anything new you find.",
|
|
108
|
+
"3. Evidence rule: every finding MUST quote the exact line content from THIS round's `read` output — one CONTIGUOUS excerpt, quoted exactly as it stands. Line numbers alone are NOT evidence.",
|
|
109
|
+
"",
|
|
110
|
+
].join("\n")
|
|
111
|
+
}
|
package/advisor/history.mjs
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { readFileSync } from "node:fs"
|
|
5
5
|
import { join } from "node:path"
|
|
6
|
+
// 拍平投影与位置换算:机读线按轮嵌套,响应表扫描在拍平视图上做,起点由位置换算一次。
|
|
7
|
+
import { flattenHistory, flatIndexOf } from "../context-push.mjs"
|
|
6
8
|
|
|
7
9
|
export const ADVISOR_MD_PATH = ".thincoder/advisor.md"
|
|
8
10
|
const AGENT_RESPONSE_HEADER = "| # | Action | Detail |"
|
|
@@ -17,21 +19,31 @@ const DEFAULT_CRITERIA = `Review the code changes, focusing on:
|
|
|
17
19
|
/**
|
|
18
20
|
* Extract the agent's response table (| # | Action | Detail |) — the fix-claims
|
|
19
21
|
* reference for convergence rounds.
|
|
20
|
-
* Semantics: with
|
|
21
|
-
* its delivery watermark (`agent._advisorResponseAnchor`
|
|
22
|
-
* is the one written after THIS review's delivery. Without
|
|
23
|
-
* direct callers — no watermark), fall back to scanning BACKWARD for the most
|
|
22
|
+
* Semantics: with a delivery watermark, scan FORWARD from it — the review instance passes
|
|
23
|
+
* its delivery watermark (`agent._advisorResponseAnchor`, a line position `{ turn, msg }`),
|
|
24
|
+
* so the table taken is the one written after THIS review's delivery. Without a watermark
|
|
25
|
+
* (legacy direct callers — no watermark), fall back to scanning BACKWARD for the most
|
|
24
26
|
* recent table. The agent response is a focus aid only — format drift falls
|
|
25
27
|
* back to the no-response text and never drives control flow (decision
|
|
26
28
|
* 2026-08-08).
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
+
* 机读线按轮嵌套:本函数收嵌套线,内部拍平一次(`flattenHistory`);第二参收位置 `{ turn, msg }`
|
|
30
|
+
* (调用点传 `agent._advisorResponseAnchor`)。键那位轮元素已不在线上(位置越过线尾——被摘要切走)
|
|
31
|
+
* ⇒ 起点 0:线上留下的每条都在投递之后。
|
|
32
|
+
* @param {Array} history — 机读线(嵌套轮)
|
|
33
|
+
* @param {{turn:number,msg:number}|number} [since] — 投递水位:从该位置起前向扫(旧数字形照收)
|
|
29
34
|
* @returns {string|null} the response table content, or null
|
|
30
35
|
*/
|
|
31
|
-
export function extractAgentResponseTable(history,
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
export function extractAgentResponseTable(history, since) {
|
|
37
|
+
const turns = Array.isArray(history) ? history : []
|
|
38
|
+
const entries = flattenHistory(turns)
|
|
39
|
+
let start
|
|
40
|
+
if (since && typeof since === "object") {
|
|
41
|
+
start = since.turn >= turns.length ? 0 : flatIndexOf(turns, since)
|
|
42
|
+
} else if (typeof since === "number") {
|
|
43
|
+
start = since
|
|
44
|
+
}
|
|
45
|
+
if (start !== undefined) {
|
|
46
|
+
for (let i = Math.max(0, start); i < entries.length; i++) {
|
|
35
47
|
const m = entries[i]
|
|
36
48
|
if (m.role !== "assistant" || typeof m.content !== "string") continue
|
|
37
49
|
if (m.content.includes(AGENT_RESPONSE_HEADER)) return m.content
|
|
@@ -58,7 +70,8 @@ export function loadAdvisorMd(cwd) {
|
|
|
58
70
|
}
|
|
59
71
|
}
|
|
60
72
|
|
|
61
|
-
/** Extract recent user↔assistant exchanges (up to maxTurns) for intent context.
|
|
73
|
+
/** Extract recent user↔assistant exchanges (up to maxTurns) for intent context.
|
|
74
|
+
* 第二参调用面不变;`history` 收拍平视图(`flattenHistory(agent.history)`——调用点传)。 */
|
|
62
75
|
export function extractConversationBackground(history, maxTurns = 3) {
|
|
63
76
|
const entries = Array.isArray(history) ? history : []
|
|
64
77
|
const lines = []
|
package/advisor/loop.mjs
CHANGED
|
@@ -9,27 +9,45 @@
|
|
|
9
9
|
* 并按 0.75 一次性预算提示 + 结构化超时尾收尾;守卫与限额函数在 compaction.mjs。
|
|
10
10
|
*/
|
|
11
11
|
import { chat } from "../provider/core.mjs"
|
|
12
|
-
import { providerSpec,
|
|
12
|
+
import { providerSpec, assistantEchoMessage, isThinkingRequest } from "../config.mjs"
|
|
13
13
|
import { toOpenAISchema } from "../tools/index.mjs"
|
|
14
14
|
import { truncateAdvisorResult } from "./truncate.mjs"
|
|
15
15
|
import { batchTool } from "../agent-tools/batch.mjs"
|
|
16
|
+
// 文档工具面(`docs/core/design/AGENT-LOOP-SUBAGENT.md` §6.60.2 ③ · 需求 `docs/core/requirements/DOC-GRAPH.md`
|
|
17
|
+
// §4 AC-10):评审段拿到两件只读工具:`doc_check` 本体 ∥ `doc_graph` 只读变体(三动作、无 `scan`)。
|
|
18
|
+
// **工具在场 ≠ 义务**:评审的判据来自文档本体(读那一节、与代码和需求对出来),机检的 PASS 只说明锚点与段长
|
|
19
|
+
// 合规、`doc_graph` 只回答「谁引了谁」——两者都不是判据面。拿到它们是为了「核一个锚在不在盘」这类局部事实时
|
|
20
|
+
// 不必上抛,而不是给它一条结论捷径;没有机制禁止它调用,也不该有。静态 import(同 `batchTool` 那条):
|
|
21
|
+
// `doc-graph.mjs` 的静态闭包不达 `node:sqlite`(机制档只在 execute 里动态 import);`doc-check.mjs` 的静态闭包
|
|
22
|
+
// 经 `doc-check/index.mjs → declaration.mjs → memory/file-walk.mjs` 到达 `node:sqlite`。而本档**原有**的 `batchTool`
|
|
23
|
+
// 静态链早已同达(可逐跳核到的一条:`agent-tools/batch.mjs → batch-paths.mjs → path-resolve.mjs →
|
|
24
|
+
// declared-repos.mjs → declaration.mjs → memory/file-walk.mjs → memory/schema.mjs`)⇒ 本条不是本批新引入的
|
|
25
|
+
// 通路;本批只按同一条静态 import 先例接入,模块域零新增 TLA(两档都不是 TLA import)。
|
|
26
|
+
import { docCheckTool } from "../agent-tools/doc-check.mjs"
|
|
27
|
+
import { docGraphReadTool } from "../agent-tools/doc-graph.mjs"
|
|
16
28
|
import {
|
|
17
29
|
shouldBudgetNudge, budgetNudgeText, timeoutTail, renderTimeline, compactContextIfNeeded,
|
|
18
30
|
MAX_ADVISOR_TURNS, advisorContextBudget, TOOL_TIMEOUT_MS, REVIEW_TIMEOUT_MS, MAX_RESULT_CHARS,
|
|
19
31
|
ADVISOR_THINKING_PLACEHOLDER,
|
|
20
32
|
} from "./compaction.mjs"
|
|
21
33
|
import { createTimelineRecorder } from "./timeline.mjs"
|
|
34
|
+
// 判轨谓词 = `messages.mjs` 的 `reviewHoldsBatchWrite`(挂载判据与 Approval Signal 措辞两面共用):同一
|
|
35
|
+
// 事实各写一份就是两个版本、改一处漏一处的形状。工具面的执法半句另有——`agent-tools/batch-segment-vocab.mjs`
|
|
36
|
+
// 的 `reviewWritableSegment`(判可写段号、不含绑定),改轨判据时两处都要看。
|
|
37
|
+
import { reviewHoldsBatchWrite } from "./messages.mjs"
|
|
22
38
|
|
|
23
39
|
const { readTool, globTool, grepTool, lsTool } = await import("../tools/index.mjs")
|
|
24
40
|
const { lspTool } = await import("../tools/lsp.mjs")
|
|
25
41
|
const { codeSearchTool } = await import("../memory/code-sync.mjs")
|
|
26
42
|
|
|
27
43
|
/**
|
|
28
|
-
* Advisor tool set — ZERO git,
|
|
44
|
+
* Advisor tool set — ZERO git, every round:只读六件 + 文档工具面两件(`doc_check` ∥ `doc_graph` 只读变体)
|
|
45
|
+
* + 绑定档时追加 `batch`(写面限 `§3`;工程设计轨不追加——`BATCH-RECORD.md` §4.3)。
|
|
46
|
+
* The change surface comes from the
|
|
29
47
|
* review scope (paths / _touchedFiles injected by the caller), never from git: git output misled
|
|
30
48
|
* reviews (committed fixes never show in `git diff HEAD`, so "no changes" was read as "not
|
|
31
49
|
* fixed") and the user mandate is full decoupling (7d49a52 + d3be613). The reviewer reads files
|
|
32
|
-
* and searches code; it never touches git
|
|
50
|
+
* and searches code; it never touches git. No round parameter — the set is
|
|
33
51
|
* constant across all rounds. 检索面**恒在**(与索引绑定解耦):`code_search` 永远在集内,
|
|
34
52
|
* 未绑定索引的会话在**执行面**降级为一句端中立说明(不崩、不伪造结果)——工具清单恒定。
|
|
35
53
|
* @param {Object} agent — 索引面载体(`agent.memory`);缺省时执行面降级。
|
|
@@ -40,12 +58,25 @@ function advisorCodeSearchTool(agent) {
|
|
|
40
58
|
: { ...codeSearchTool(undefined), async execute() { return "(code index not available in this session)" } }
|
|
41
59
|
}
|
|
42
60
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
61
|
+
/**
|
|
62
|
+
* 评审侧工具表(纯函数)。
|
|
63
|
+
* @param {Object} agent — 索引面载体(`agent.memory`)+ 模式位(`agent.config.agent.engineering`)。
|
|
64
|
+
* @param {string} reviewType — 本评审实例的**评审轨**(`"design"` ∥ `"code"`)——挂载判据的一半
|
|
65
|
+
* (`docs/core/design/BATCH-RECORD.md` §4.3)。**不给默认值**:模式 × 评审轨两项缺一即判不出,
|
|
66
|
+
* 用默认值顶替就等于替调用方选了一条路。
|
|
67
|
+
* @param {string|null} [batchDoc] — 本评审逐笔绑定的批次档(绝对路径);非空 ⇒ 按下方判据追加 `batch`(写面限 `§3`)。
|
|
68
|
+
* @returns {{schemas: object[], byName: Map<string, object>}}
|
|
69
|
+
*/
|
|
70
|
+
function advisorToolsFor(agent, reviewType, batchDoc = null) {
|
|
71
|
+
const tools = [readTool, globTool, grepTool, lsTool, lspTool, advisorCodeSearchTool(agent), docCheckTool, docGraphReadTool]
|
|
72
|
+
// BATCH-RECORD.md §4.3:挂载判据 = 绑定 ∧ ¬(工程模式 ∧ 设计轨)——具名谓词在 `messages.mjs`
|
|
73
|
+
// (`reviewHoldsBatchWrite`,同一事实也决定运行期 Approval Signal 说哪一支)。工程设计轨的 §3 对一切
|
|
74
|
+
// 工具通道只读、轮次块由结算写,工具给了它也只会收到一条拒——不发(fail-closed)。代码轨与普通模式照旧
|
|
75
|
+
// 追加:那两条路没有设计结算可代写,而收口门读的是 §3 的段级状态行(工具面批走代码轨,评审员要写 §3
|
|
76
|
+
// 就靠这一条)。未绑定 → 不挂载(fail-closed)。
|
|
77
|
+
if (reviewHoldsBatchWrite(agent, reviewType, batchDoc)) tools.push(batchTool(batchDoc, { review: true, reviewType }))
|
|
78
|
+
// 工具描述取完整档(设计 TOOLS §1):评审是独立基底,不随会话 mode 变化(requirements §9.1)。
|
|
79
|
+
return { schemas: tools.map((tool) => toOpenAISchema(tool, "normal")), byName: new Map(tools.map((t) => [t.name, t])) }
|
|
49
80
|
}
|
|
50
81
|
// Test seam: the tool set is pure(恒在六工具 + 批次档绑定條件)。
|
|
51
82
|
export { advisorToolsFor, advisorToolsFor as _advisorToolsFor }
|
|
@@ -62,7 +93,7 @@ export { advisorToolsFor, advisorToolsFor as _advisorToolsFor }
|
|
|
62
93
|
* @param {{now?: Function, chat?: Function, describeArgs?: Function}} [seams] — 测试缝 + ④ 端差注入点
|
|
63
94
|
* (默认 Date.now / chat / 无进度行——生产调用不传时进度行由端装配层补齐)。
|
|
64
95
|
*/
|
|
65
|
-
async function runAdvisorToolLoop(provider, messages, onOutput, signal, agent, cwd, toolsOverride = null, reviewType
|
|
96
|
+
async function runAdvisorToolLoop(provider, messages, onOutput, signal, agent, cwd, toolsOverride = null, reviewType, batchDoc = null, pinned = null, seams = {}) {
|
|
66
97
|
const now = seams.now ?? Date.now
|
|
67
98
|
const chatCall = seams.chat ?? chat
|
|
68
99
|
// ④ 端差注入点(CORE-UNIFICATION §2.5 #109「进度行按端注入」):工具进度行的参数摘要
|
|
@@ -204,7 +235,8 @@ async function runAdvisorToolLoop(provider, messages, onOutput, signal, agent, c
|
|
|
204
235
|
// tool-call assistant history lacks it — the observed "reasoning stops
|
|
205
236
|
// after the first tool call, returns only at the final answer" symptom.
|
|
206
237
|
// Mirrors the main agent's push (agent.mjs).
|
|
207
|
-
|
|
238
|
+
const echoSpec = providerSpec(provider)
|
|
239
|
+
messages.push(assistantEchoMessage(response, echoSpec, isThinkingRequest(provider, echoSpec), provider ?? null))
|
|
208
240
|
|
|
209
241
|
// B1: the SAME LLM reply's multiple read-only
|
|
210
242
|
// tool calls run in PARALLEL (Promise.all) — results are backfilled in
|
|
@@ -252,7 +284,12 @@ async function runAdvisorToolLoop(provider, messages, onOutput, signal, agent, c
|
|
|
252
284
|
})
|
|
253
285
|
let toolPromise
|
|
254
286
|
try {
|
|
255
|
-
|
|
287
|
+
// 归一成 Promise(设计单源 = `docs/core/design/ADVISOR-CONVERGENCE.md` §18):工具的 `execute` 允许同步
|
|
288
|
+
// 返回(`doc_check` 就是一个),而下面 `finally` 里要给同一返回值挂 `.catch`——同步值上没有 `.catch`,
|
|
289
|
+
// 收尾句抱 `TypeError` 盖过竞速结果,一次成功的工具调用被归成 `: "execution_error"`。
|
|
290
|
+
// **别以为评审的工具集特殊**:主代理侧是 `await item.tool.execute(...)`,`await` 对同步值与 Promise 同判,
|
|
291
|
+
// 那里不产生 `.catch`;评审循环是唯一在 `finally` 里挂 `.catch` 的地方,于是只有它撞。
|
|
292
|
+
toolPromise = Promise.resolve(p.tool.execute(p.args, { cwd, agent, onOutput, signal }))
|
|
256
293
|
return await Promise.race([toolPromise, timeoutPromise])
|
|
257
294
|
} finally {
|
|
258
295
|
clearTimeout(timeoutId)
|