You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Gap] Core type surface stricter than actual usage: AbsorbConfig requires all five fields vs consumers applying per-field fallback (incl. prompt_cache_key wire type facet) | [Gap] 内核类型表面严于实际使用:AbsorbConfig 五字段全必填 vs 消费者逐字段 fallback(附 prompt_cache_key wire 类型 facet) #502
src/config.ts:235-249:validateConfig 对这三个数值/字符串字段做无条件检查——partial { enabled: true } ccr 块在 current master 会报 3 条假阳性错误("ccr.toolName must be a non-empty string when enabled" / "ccr.minToolTokens must be >= 0" / "ccr.maxHeadChars must be >= 0"),与 AbsorbConfig 旧行为同构。
changed the title [-][Gap] 内核类型表面严于实际使用:AbsorbConfig 五字段全必填 vs 消费者逐字段 fallback(附 prompt_cache_key wire 类型 facet)[/-][+][Gap] Core type surface stricter than actual usage: AbsorbConfig requires all five fields vs consumers applying per-field fallback (incl. prompt_cache_key wire type facet) | [Gap] 内核类型表面严于实际使用:AbsorbConfig 五字段全必填 vs 消费者逐字段 fallback(附 prompt_cache_key wire 类型 facet)[/+]on Oct 16, 2026
Activity
ranxianglei commentedon Oct 3, 2026
#502 已完成,PR: #503 (Closes #502,待 CI + 人工合并)
结构化结论
AbsorbConfig类型声明五字段全必填,但内核与消费方运行时都逐字段容忍缺席(spread 合入默认值)——类型表面比实际契约严,任何 partial 构造场景(fixture、配置解析中间态)被迫填齐全部字段或 cast。resolveAbsorbConfig/defaultConfig的{...DEFAULT_ABSORB_CONFIG, ...(config.absorb ?? {})}合并(src/absorb.ts:42-44、src/config.ts:70-72),字段缺席本就合法;类型却按「完整对象」声明。这是声明-实现不一致,不是行为 bug——运行时行为一直正确。已在 v0.0.100 master 复现:defaultConfig(200000, { absorb: { enabled: true } })→ TS2739(missing toolName, minToolTokens, contextThresholdPct, excludeTools)。toolName/minToolTokens/contextThresholdPct/excludeTools改可选(字段文档标注默认值),enabled保留必填作为激活开关(与仓内ImageCompressionConfig先例一致,issue 也允许此选项);新增ResolvedAbsorbConfig = Required<AbsorbConfig>,DEFAULT_ABSORB_CONFIG、resolveAbsorbConfig返回值、EvaluateCrushInput.absorb及内部isAcpOrConfiguredTool改用它,保证放宽后「消费已解析配置」的入口不会静默接受 partial(否则会对 undefined 做比较)。issue 要求的「导出默认合并函数」内核自身已满足(resolveAbsorbConfig+DEFAULT_ABSORB_CONFIG在 current master 已导出),无需新增函数。Facet 2(prompt_cache_key)按你推荐的选项①:保持string不动,记录在案。""仍报错,语义不变。EvaluateCrushInput.absorb收紧为 resolved 形态:现有调用方(含 bili)均传完整配置,不受影响。新增 3 个回归测试钉住 resolve 语义与 validation 边界。验证证据:修复前 probe 报 TS2739,修复后干净通过;
npm run typecheck/format:check/build全绿,build 出的 dist/types.d.ts(即 issue 引用的 116-125 行区域)显示四可选字段 +ResolvedAbsorbConfig;定向测试 absorb/crush/sync-config 三个文件 80/80 通过,全量套件交 CI。判定:可合并(待 CI 绿 + 人工 merge)。
ranxianglei commentedon Oct 3, 2026
补充:PR #503 CI 已全部通过(build-artifact / test Node22 / test Node24 / pr-validation 均绿),全量测试套件无回归。可以合并了(按仓库规则由人工操作):#503
ranxianglei commentedon Oct 3, 2026
[bot] 🏷 来源: #503 (#503) review AbsorbConfig 类型表面修复时发现
#503 review 中发现
CcrConfig存在与本单主 facet 同机制族的缺陷(类型表面严于实际使用),PR #503 未覆盖:CcrConfig的 toolName / minToolTokens / excludeTools / maxHeadChars 全部声明必填(容器层 types.ts:415ccr?: CcrConfig可选);resolveCcrConfig = { ...DEFAULT_CCR_CONFIG, ...config.ccr },运行时逐字段合入默认值,缺席本就合法;validateConfig对这三个数值/字符串字段做无条件检查——partial{ enabled: true }ccr 块在 current master 会报 3 条假阳性错误("ccr.toolName must be a non-empty string when enabled" / "ccr.minToolTokens must be >= 0" / "ccr.maxHeadChars must be >= 0"),与 AbsorbConfig 旧行为同构。本单明确「同一机制的全部 facet 在本单内统一管理」,故在此留账而非另立 issue。请 owner 决定处置:① reopen 本单、checklist 补 CCR facet(修法与 #503 同模式:内层值字段放宽 +
ResolvedCcrConfig+ validateConfig undefined 容忍),或 ② 另行安排。#503 本身范围正确、CI 全绿,可先合并。ranxianglei commentedon Oct 9, 2026
跨仓同步:迁移镜像 ranxianglei/billion-context#2510 继续跟踪——内核代码已并入 billion-context(kernel/),修复已按 acp-kernel#513 指示移植为 ranxianglei/billion-context#2518 #2510,AbsorbConfig/CcrConfig 类型表面对齐 + #503 review 发现的 CCR facet 一并覆盖,CI 绿,待人工合并)。本 issue 与 PR #503 暂留 open,是否关闭由 owner 决定。
[-][Gap] 内核类型表面严于实际使用:AbsorbConfig 五字段全必填 vs 消费者逐字段 fallback(附 prompt_cache_key wire 类型 facet)[/-][+][Gap] Core type surface stricter than actual usage: AbsorbConfig requires all five fields vs consumers applying per-field fallback (incl. prompt_cache_key wire type facet) | [Gap] 内核类型表面严于实际使用:AbsorbConfig 五字段全必填 vs 消费者逐字段 fallback(附 prompt_cache_key wire 类型 facet)[/+]ranxianglei commentedon Oct 23, 2026
收到跨仓同步。已逐项核实(GitHub API):
54cbab6未变,CI 四项全绿(build-artifact / test Node22 / test Node24 / pr-validation)2026-10-09_kernel-type-surface,CI 全绿(含 kernel-guard / lane-guard / 双 Node 版本测试 / e2e)我在 floor 5 留账的 CCR facet(CcrConfig 值字段声明必填 vs 运行时逐字段合默认,validateConfig 对 partial 块误报)按你的指示已由 bili#2518 一并覆盖,该问题闭环。
剩一个待你拍板:acp-kernel 侧的收尾方式。#513 说「版本保持独立」,我理解 acp-kernel 仍作为独立 npm 包发布——若如此,这两个 facet 在修复进入 acp-kernel master 之前,独立包里仍然存在。
结构化八问(选项 A/B/C 见后):
ResolvedCcrConfig别名 + validateConfig undefined 容忍 + 回归测试),内容对齐 bili#2518 便于日后 diff/sync。一个 issue、一个 PR、一个闭环,不拆两个 PR;你点头我立即推。选项对比:
选 A 我立即推 CCR commit;选 B/C 告诉我即可,其余收尾动作(关 issue 留痕等)我来做。