Skip to content

[pull] main from claude-code-best:main#5

Merged
pull[bot] merged 24 commits into
uk0:mainfrom
claude-code-best:main
Apr 2, 2026
Merged

[pull] main from claude-code-best:main#5
pull[bot] merged 24 commits into
uk0:mainfrom
claude-code-best:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 2, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

claude-code-best and others added 24 commits April 1, 2026 21:19
覆盖 buildTool、toolMatchesName、findToolByName、getEmptyToolPermissionContext、
filterToolProgressMessages、parseToolPreset、parseGitCommitId、detectGitOperation
共 46 个测试用例全部通过。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
覆盖 xml, hash, stringUtils, semver, uuid, format, frontmatterParser,
file, glob, diff 共 10 个模块的纯函数测试。
json.ts 因模块加载链路过重暂跳过。
共 190 个测试用例(含已有 array/set)全部通过。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
覆盖 stripHtmlComments、isMemoryFilePath、getLargeMemoryFiles、
buildEffectiveSystemPrompt 等函数,共 25 个测试用例全部通过。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
覆盖 escapeRuleContent、unescapeRuleContent、permissionRuleValueFromString、
permissionRuleValueToString、normalizeLegacyToolName,共 25 个测试用例。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
覆盖 isModelAlias、isModelFamilyAlias、getAPIProvider、
isFirstPartyAnthropicBaseUrl、firstPartyNameToCanonical,共 40 个测试用例。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
覆盖 parseCronExpression、computeNextCronRun、cronToHuman,
包含有效/无效表达式、字段范围验证、下次运行计算、人类可读描述,
共 38 个测试用例。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
为 normalizeGitRemoteUrl 添加 18 个测试用例,覆盖 SSH、HTTPS、
ssh://、CCR 代理 URL 格式、大小写规范化及边界条件。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
为 SettingsSchema、PermissionsSchema、AllowedMcpServerEntrySchema
验证,MCP 类型守卫,设置常量函数,以及 validation 工具函数添加
62 个测试用例。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
为消息创建、查询、文本提取、规范化等函数添加 56 个测试用例,
覆盖 createAssistantMessage、createUserMessage、isSyntheticMessage、
extractTag、isNotEmptyMessage、normalizeMessages 等核心功能。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
在 testing-spec.md 新增第 11 节,按 P0/P1/P2 分类记录 25 个
测试文件的覆盖范围、测试数量及已知的重依赖限制。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- json.test.ts: 27 tests (safeParseJSON, safeParseJSONC, parseJSONL, addItemToJSONCArray)
- truncate.test.ts: 24 tests (truncateToWidth, truncateStartToWidth, truncatePathMiddle, truncate, wrapText)
- path.test.ts: 15 tests (containsPathTraversal, normalizePathForConfigKey)
- tokens.test.ts: 22 tests (getTokenCountFromUsage, getTokenUsage, tokenCountFromLastAPIResponse, etc.)

使用 mock.module() 切断 log.ts/tokenEstimation.ts/slowOperations.ts 重依赖链

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- FileEditTool/utils.test.ts: 24 tests (normalizeQuotes, stripTrailingWhitespace, findActualString, preserveQuoteStyle, applyEditToFile)
- permissions/permissions.test.ts: 13 tests (getDenyRuleForTool, getAskRuleForTool, getDenyRuleForAgent, filterDeniedAgents)
- tools.test.ts: 扩展 5 tests (filterToolsByDenyRules 过滤逻辑)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 新增 json/truncate/path/tokens/FileEditTool/permissions 测试记录
- 更新已知限制(Bun.JSONL bug, spawnMultiAgent 重依赖)
- 添加 Mock 策略总结章节

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 个阶段共计 ~213 tests / 20 files,目标从 647 提升至 ~860 tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- errors.test.ts: 28 tests (isAbortError, toError, errorMessage, getErrnoCode, isFsInaccessible, classifyAxiosError 等)
- shellRuleMatching.test.ts: 22 tests (permissionRuleExtractPrefix, hasWildcards, matchWildcardPattern, parsePermissionRule 等)
- argumentSubstitution.test.ts: 18 tests (parseArguments, parseArgumentNames, generateProgressiveArgumentHint, substituteArguments)
- CircularBuffer.test.ts: 12 tests (add, addAll, getRecent, toArray, clear, length)
- sanitization.test.ts: 14 tests (partiallySanitizeUnicode, recursivelySanitizeUnicode)
- slashCommandParsing.test.ts: 8 tests (parseSlashCommand)
- contentArray.test.ts: 6 tests (insertBlockAfterToolResults)
- objectGroupBy.test.ts: 5 tests (objectGroupBy)

总计:781 tests / 40 files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 2 (轻 Mock): envUtils, sleep/sequential, memoize, groupToolUses, dangerousPatterns, outputLimits
Phase 3 (补全): zodToJsonSchema, PermissionMode, envValidation
Phase 4 (工具模块): mcpStringUtils, destructiveCommandWarning, commandSemantics

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 删除 cli.tsx 顶部的 globalThis.MACRO / BUILD_* / feature polyfill
- 新增 scripts/defines.ts 作为 MACRO define 映射的单一来源
- 新增 scripts/dev.ts,通过 bun run -d 在转译时注入 MACRO 常量
- build.ts 引用 getMacroDefines() 实现构建时内联
- 清理 global.d.ts (移除 BUILD_*, MACRO 函数声明)
- 55 个 MACRO 消费文件零改动

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
新增覆盖: effort, tokenBudget, displayTags, taggedId,
controlMessageCompat, MCP normalization/envExpansion,
gitConfigParser, formatBriefTimestamp, hyperlink, windowsPaths, notebook

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Apr 2, 2026
@pull pull Bot added the ⤵️ pull label Apr 2, 2026
@pull pull Bot merged commit 5fda872 into uk0:main Apr 2, 2026
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant