Commit Graph
1722 Commits
Author SHA1 Message Date
chichuan c5b537c8cf fix(drive): 修正 --latest 不完整扫描建议的自相矛盾并补齐叶子 Selection
P2-1 LATEST_SCAN_INCOMPLETE 的 Suggestion 与示例自相矛盾

问题:正文让用户「去掉 --latest 重跑」看失败明细,紧跟的唯一示例却是
dws drive list --folder <子目录ID> --latest N —— 照抄必然复现同一个错误。
根因:两条互斥的出路(缩范围后仍取 Top-N / 去掉 --latest 看明细)挤在一句里,
却只给了一条命令。
修法:每个「;」子句自带与该子句正文一致的命令 —— 重取 Top-N 那条保留 --latest,
去掉 --latest 那条给 --depth 版本。同时把 partial + errors[] 的承诺显式限定在
--depth>1:单层(含知识库 maxDepth=1)去掉 --latest 会路由回普通单层 list,
本就没有 errors[] 契约,无条件承诺只是把矛盾换成另一种不准确。
LATEST_SCAN_TRUNCATED 那条只有一个子句且命令保留 --latest,本身自洽,不动。

测试:新增 assertDriveLatestSuggestion 逐子句校验自洽性,替换 5 处只断言
Suggestion != "" 的弱断言。该断言对修改前的文案是红的(3 个 INCOMPLETE 用例
精确报出矛盾子句),对未改动的 TRUNCATED 文案是绿的 —— 证明它不是为新文案量身定做。

P2-2 drive list / drive recent 的 Selection 没跟上 Agent 路由目标

问题:上一轮改了 skill 文档与 flag help,但叶子 Contract 一字未动 ——
drive list 的 UseWhen 无 --latest 正选、Examples 两条都是 --limit 分页、
AvoidWhen 仍无条件让路给 drive recent(与 skill 里的三者路由矛盾);
drive recent 也没有反向指回 drive list --latest。
修法:drive list 追加 --latest 正选,AvoidWhen 第 3 条改写成「个人访问记录 →
recent / 文件修改时间 → 本命令 --latest」的分流;drive recent 追加对应反选。
措辞与 skills/**/drive.md 的三者路由一致。

Examples 是替换而非新增:schema_agent_examples.go 硬限最多 2 条
(has %d examples; maximum is 2),加第 3 条直接挂门禁。替换第 2 条不丢覆盖面 ——
--limit 仍由第 1 条示范、--folder 由第 2 条继续示范,第 2 条顺带示范 --latest,
且无 --limit(运行时互斥)、无 --yes(门禁禁止)。

删掉 docs/drive-list-latest-design.md

设计细节收敛到 skills/**/drive.md 单一出处。本轮 P2-2 正是「文档写对了、
Contract 没跟上」造成的,两份文档并存只会让下一次再跑偏。CHANGELOG 里唯一
指向它的链接行一并删除(第 23 行本身以句号结尾,bullet 依然完整)。
2026-08-06 15:29:14 +08:00
chichuan bc56373ef2 test(drive): 补齐 --latest 拒绝产出错误的目录名回落分支覆盖
CI Coverage 门禁要求改动代码 100% 覆盖,d1c8c903 的 changed-code 覆盖率
99.1379%(232 条语句缺 2 条)。缺口是 driveLatestIncompleteError 里
folderName 为空时的两级回落:先落 folderId,再落 <root>。

这两条不是防御性死代码:BFS 的根目录入队时是 driveDepthFolder{id, depth:0},
从不携带 name,所以「根目录首页有收获、后续页读取失败」这一真实路径产出的
driveDepthError 的 folderName 必然为空 —— 若不回落,用户拿到的就是
"folder=" 空洞提示。原有的 folder-failure 测试用的是有 name 的子目录 dirA,
正好绕过了这两条。

补两个测试(共用新 fixture driveLatestRootPageFailureCaller:根目录首页 1 个
文件 + nextToken,第 2 页 403):
- 未指定 --folder:folderId 也为空,消息回落到 folder=<root>
- 指定 --folder rootFolder:回落到 folder=rootFolder 而不是 <root>

无生产代码改动。本地复现并验证:改动代码覆盖率 99.1379% → 100.0000%
(232/232),internal/helpers 包整体 99.9% → 100.0%。
2026-08-06 14:05:51 +08:00
chichuan d1c8c903f6 fix(drive): 修复 --latest 的字段泄露、不完整扫描误报与别名互斥缺口
修复 PR #885 review 提出的三个问题,均已实机复现确认真实存在。

1. [P1] 内部排序字段 sortTime 泄露进输出契约
sortTime 无条件写入每个 BFS 项,却只在 latest>0 && depth==1 时随装饰字段一起剥除,
于是普通 --depth 2 与 depth>1 --latest 的输出都带上它,违反设计文档「不新增业务字段」。
改为只在 latest>0 时写入,并在 emitDriveDepthResult 发射前无条件删除(含 SIGINT 路径),
与 depth==1 的整体剥除解耦。

2. [P1] 扫描不完整仍以退出码 0 产出「全局 Top-N」
拒绝产出的防线只看 truncated,递归途中目录读取失败只进 errors[] 并继续执行。BFS 序与
修改时间无关,未读全的区域完全可能含更新文件,这种集合上的 Top-N 不是全局最新。改为
latest>0 时 truncated 或 errors[] 非空一律拒绝产出(新 token LATEST_SCAN_INCOMPLETE,
与 LATEST_SCAN_TRUNCATED 同 code,便于消费方区分「范围太大」与「读不到」);errors[]
不再进 stdout,失败目录数与首个失败详情因此搬进错误消息。不可恢复错误(token 过期 /
网络不可达)在 latest 下不吐 partial,原样上抛根因错误。不带 --latest 的路径行为不变
(partial + truncated:true + errors[] + 退出码 0),有独立护栏测试;SIGINT 路径不动
(退出码 130 已显式标记结果不完整)。

3. [P2] RegisterCrossProductAliases 自动注册的隐藏别名逃过互斥校验
校验手写枚举 limit/max 与 cursor/next-token,漏掉自动注册的 --page-size(limit 语义组)
与 --page-token(cursor 语义组):--latest 3 --page-size 1 此前退出 0 并静默忽略该 flag。
改为从注册表按语义组取别名(新增只读查询 crossProductAliasPeers),报错点名用户实际传入
的那个 flag 而非语义组主名。string 型按值判定(保住 Agent 的 --cursor "$CURSOR" 首页空值
模板)、其余按 Changed 判定,与改造前 flagOrFallback / Changed 逐字等价,只把覆盖面扩到
全部别名。

本 PR 之外的一处主动扩围(单列说明,便于单独判断):validateDriveListDepth 有完全相同的
枚举缺口。--depth 2 --limit 50 今天已报错,而 --depth 2 --page-size 50 静默忽略、
--depth 2 --page-token X 更糟(用户以为在续页,游标实际被丢掉)。共享 helper 后是一行
改动;已确认无代码以编程方式 Set 这些别名、无文档示例这样组合,行为变化面只是「静默忽略
→ 明确报错」。

测试:sortTime 不泄露(带/不带 latest 两侧)、目录失败与不可恢复错误下拒绝产出且 stdout
为空、对应的 latest=0 partial 护栏、用真实 newDriveCommand 构造的别名互斥回归(--latest
与 --depth 两侧共 14 组)、空值游标模板不误伤、crossProductAliasPeers 单测。
文档同步:设计文档 §3.2/§4/§5/§6/§7、两份 skill 镜像、flag 帮助文案与 CHANGELOG。
2026-08-06 12:14:55 +08:00
chichuan 432b8742c4 Merge latest main into codex/sync-wukong-drive-list-latest 2026-08-06 09:26:19 +08:00
github-actions[bot] 4bcf71fb9e Merge pull request #881 from Anonymity-0/feat/chat-reply-mentions
feat(chat): support mentions in message replies
2026-08-05 23:10:42 +08:00
chichuan a9af027ed4 feat: drive list 支持 --latest 按修改时间取最新 N 个文件
同步 dws-wukong CR 28929931(feature/drive-list-latest),按本仓结构重新落地。

一条命令直达「最近改的那份 XX」,替代「拉全量再自己比时间」的既有做法:

- 钉盘单层走服务端 orderBy=modifyTime&order=desc,凑够 N 即停(无 pattern 时
  通常一次请求),最多扫描 1000 条
- 知识库(--workspace)与递归(--depth>1)复用现有 BFS 遍历 + 共享后置处理器
  客户端排序,零新增请求
- 文件夹不进 Top-N;排序 tie-break 链 sortTime desc → rel_path asc → ID asc
- 与 --order-by/--order/--limit/--cursor/--versions 互斥,报错均附等效改写
- 递归触 2000 条上限时报 LATEST_SCAN_TRUNCATED 且 stdout 为空(截断集的 Top-N
  不是全局最新);凑不满 N 不算失败,退出码 0 + stderr 提示

本仓侧的三处结构性适配:
- 时间归一化新写为独立 helper internal/helpers/drive_time.go(wukong 侧已有)
- wukong 的 pytest e2e 套件折叠进 Go 测试,全部 TestCrossPlatformCoverage* 前缀
- envelope 契约由 test/fixtures/cli-interface-baseline.txt 承接

顺带补齐遗漏已久的 --depth / --pattern / --quiet 文档(mono + multi 双份)。
2026-08-05 23:05:12 +08:00
前津 545ee17316 fix(chat): add missing reply mention placeholders 2026-08-05 21:23:12 +08:00
前津 0c62938f74 feat(chat): support mentions in message replies 2026-08-05 21:23:12 +08:00
github-actions[bot] 45b43e52bb chore: update beta formula for v1.0.57-beta.2 [skip ci] 2026-08-05 11:49:09 +00:00
chichuan 95a5cc42ce Merge pull request #879 from DingTalk-Real-AI/codex/changelog-v1.0.57-beta.2
docs: seal v1.0.57-beta.2 changelog
v1.0.57-beta.2
2026-08-05 19:36:25 +08:00
chichuan fec750b09e docs: remove duplicate beta.2 changelog entry 2026-08-05 19:26:27 +08:00
chichuan ddd5f15b91 docs: seal v1.0.57-beta.2 changelog 2026-08-05 19:19:49 +08:00
github-actions[bot] db50be868b Merge pull request #876 from DingTalk-Real-AI/codex/restore-chat-im-compat
fix(chat): restore stable send and history compatibility
2026-08-05 19:13:50 +08:00
Dennis a6220d7d8b fix(chat): preserve migration hints with legacy flags 2026-08-05 18:19:16 +08:00
Dennis 81bf0d2a6b test(coverage): stabilize drive worker cancellation branch 2026-08-05 18:05:54 +08:00
Dennis f3a95d34a3 fix(chat): restore stable send and history compatibility 2026-08-05 17:32:12 +08:00
chichuan a37e6e6847 Merge pull request #875 from DingTalk-Real-AI/codex/changelog-v1.0.57-beta.1
docs: seal v1.0.57-beta.1 changelog
v1.0.57-beta.1
2026-08-05 16:51:42 +08:00
chichuan 0ceb96c745 docs: seal v1.0.57-beta.1 changelog 2026-08-05 16:47:10 +08:00
github-actions[bot] 114503d52f Merge pull request #872 from lifeihong/feat/addUpdateUserOwnessV2A84934011
feat(contact): add update-ownness command for user personal status
2026-08-05 08:36:50 +00:00
chichuan 9de1c9c304 Merge branch 'main' into feat/addUpdateUserOwnessV2A84934011 2026-08-05 16:25:02 +08:00
github-actions[bot] 840e1d665f Merge pull request #861 from DingTalk-Real-AI/codex/sync-wukong-whiteboard
feat: add document whiteboard workflows
2026-08-05 16:17:14 +08:00
昕卉 f362c8c2a4 Merge remote-tracking branch 'upstream/main' into feat/addUpdateUserOwnessV2A84934011 2026-08-05 16:06:52 +08:00
chichuan e73a1556ce Merge latest main into codex/sync-wukong-whiteboard
冲突仅在 skills/mono/SKILL.md 的意图路由表,两侧改动正交,均保留:
- 本分支新增的 whiteboard 路由行
- main 把 event 行拆成 `event +listen-im` / `event consume` 的新表述
(下文「优先由一个 dws event +listen-im 进程表达目标」已是 main 版本,
保留旧 event 行会自相矛盾)
2026-08-05 15:59:17 +08:00
昕卉 186f2fa474 test(contact): add update-ownness tests and align confirmation with framework gate 2026-08-05 15:39:22 +08:00
github-actions[bot] d91a93c43b Merge pull request #860 from DingTalk-Real-AI/codex/multi-im-optimization
feat(im): harden Multi IM and publish complete Chat Schema
2026-08-05 15:28:29 +08:00
chichuan 08254e2a36 fix(whiteboard): fail closed when insert verification query fails
回查循环原先吞掉全部 queryErr,鉴权失败、MCP 错误与 JSONML 解析失败都
退化成 soft success 返回 whiteboardId: null,Agent 会把硬失败误判成最终
一致性并带着空 partId 继续调用 whiteboard query/update。

- 引入 errWhiteboardBlockPending sentinel,只有「块暂不可见」允许重试;
  其余错误立即返回,并把已插入的 blockId 带进错误消息供复原
- queryWhiteboardCardNode 严格校验 blocks 字段(缺失 / 非数组均为协议
  错误),避免畸形响应伪装成「块暂不可见」
- --ref-block 与 --parent-block、--where 与 --parent-block 显式互斥,
  锚点组装改用 else if 让单一定位分支在代码上自证
- 补全 mono / multi 两份 recipes.md 被截断的开篇句
- doc 根命令的命令结构清单补上 whiteboard insert 与 media upload/download
- 新增 3 个回归测试覆盖 fail-closed、soft success 与锚点互斥
2026-08-05 15:14:27 +08:00
Dennis e2c15fe9c8 fix(schema): reject breaking constraint expansion 2026-08-05 14:56:18 +08:00
Dennis 9fdf0d2cb3 fix(im): preserve incomplete read failures 2026-08-05 14:27:53 +08:00
Dennis b6325a4f8a fix(im): harden user resolution and broadcast lookup 2026-08-05 13:57:27 +08:00
昕卉 fdd9e189d6 add update ownness 2026-08-05 13:32:23 +08:00
chichuan eebdf52da9 fix: classify local whiteboard example precondition 2026-08-05 12:28:46 +08:00
chichuan 9eaee76a51 Merge origin/main into codex/sync-wukong-whiteboard 2026-08-05 11:51:35 +08:00
Dennis 2588c711a7 Merge origin/main into codex/multi-im-optimization 2026-08-05 11:24:58 +08:00
john 000bc13450 Merge pull request #830 from typefield/agent/cmdcore-phase2
feat(corecmd): unify leaf/shortcut command framework onto a shared typed base
2026-08-05 10:03:21 +08:00
Dennis 01782cd9d7 test(profilectx): cover profile selector 2026-08-05 09:35:57 +08:00
玉澜andCursor ba56b7ff78 fix(test): use testseam.Protect in InitDepsForTest coverage
Policy bans manual t.Cleanup deps restores; Protect is the required seam form.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 02:03:51 +08:00
玉澜andCursor c5c97e60f3 test(coverage): cover InitDepsForTest and StaticServers visibility
Platform coverage only selects TestCrossPlatformCoverage*; name the new
declaration-only visibility regression accordingly and exercise the ForTest
deps restore helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 01:49:37 +08:00
玉澜andCursor 6780177356 fix(test): assert non-dry-run version preflight via CallTool
Outside --dry-run, list_doc_versions uses the normal CallTool channel;
CallReadTool is reserved for the dry-run read path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 01:30:17 +08:00
玉澜andCursor 5fa40b8ada fix: keep Schema source visibility without clobbering deps
Declaration-only roots skip injectStaticServers; derive product visibility
from StaticServers directly so reverse completeness is not weakened, and
restore helpers deps via pointer snapshot instead of InitDeps(nil).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 01:22:45 +08:00
玉澜andCursor 8a7d4a7027 fix: nil-safe doc deprecation wrappers for declaration-only Schema probes
Homology Execute probes use NewSchemaSourceRootCommand (no InitDeps); skip
deps.Out when unset and InitDeps a throwaway caller on the probe path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 00:18:46 +08:00
玉澜andCursor 894e550950 fix: keep schema source root from clobbering runtime deps/endpoints
Schema assembly must mount the reviewed command tree without InitDeps or
SetDynamicServers, so a live process keeps its ToolCaller and plugin
endpoints. Also restore doc version revert dry-run short-circuit so
--dry-run skips remote version preflight.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 23:42:05 +08:00
Dennis ad4ed41559 Merge origin/main into codex/multi-im-optimization 2026-08-04 22:23:31 +08:00
玉澜andCursor bb205c0f5c ci: align macOS auth filter with main
Drop Windows-only DPAPI export/import names from the darwin -run filter;
those tests skip on macOS and already run under the Windows job.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 22:14:48 +08:00
Dennis 86f9054d5b test(chat): cover batch output failures 2026-08-04 22:13:20 +08:00
玉澜andCursor 82c6b631bf Merge origin/main into agent/cmdcore-phase2
Resolve macOS CI auth/keychain job conflicts by keeping main's focused
6m keychain/auth split and unsigned-darwin self-heal filter, while retaining
this branch's portable DPAPI export/import diagnostics coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 22:11:33 +08:00
github-actions[bot] 306c30ecad Merge pull request #857 from DingTalk-Real-AI/codex/fix-macos-auth-test-scope
ci: avoid duplicate internal/app race suite on macOS
2026-08-04 22:07:20 +08:00
玉澜andCursor f793d980b5 fix(test): align leaf BuildArgs expectations with required-after-transform
TestLeafArgsOmitsEmptyAndNonPositive called BuildArgs with unset required
CSV flags; after rejecting empty required transforms that path correctly
errors. Satisfy required flags in the omit-empty case and cover the new
RequiredError / scalar-transform branches for the macOS coverage gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 21:54:02 +08:00
玉澜andCursor 706dbb349c fix(corecmd): reject required flags that transform to empty lists
Separator-only inputs like --event-codes ',' passed pre-transform Required
checks, then BuildArgs omitted the key and ConfirmFirst write paths could
still call MCP. Enforce non-empty transform results for Required flags and
add CrossPlatformCoverage regression coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 21:38:40 +08:00
chichuan d7c28bcfef fix: complete whiteboard skill examples 2026-08-04 21:19:45 +08:00
玉澜andCursor 45d0d1cd72 test(ci): reject restoring combined macOS app race shard
Keep the darwin workflow contract from re-accepting the merged
keychain+auth+app invocation that main briefly required.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 21:06:33 +08:00