Repository navigation
Code2KB Agent Toolkit 2.5.1:从固定源码追到回答上下文
发行范围: 2.5.1 是下面这组功能的首次正式分发。2.5.0 因 GitHub 发布预检停止,仅保留 Git 标签,没有 GitHub Release 或 npm 包;相对该标签,本版没有新增功能。
一本已被预约的书归还时又需要修补:它去修补台,但预约备注仍保留。 只分别看“有预约”和“需修补”,可能把去向答错,或误以为备注消失。2.5.1 将这条取证线延伸到两端:开始写知识前可以先核对一行源码;回答漏了条件时,可以区分检索没找到证据,还是后续组装上下文时没保留。
- 先盘点,再写大纲。 填好配置并固定源码提交后,就能运行
analyze-candidates和evidence-snapshot,不要求知识源目录已创建,也不写入大纲。正式check仍要求知识源和大纲。脚本兼容提醒: 显式--scope不在固定提交中时,扫描现在返回非零,而不是成功的空结果;若范围存在但文件全被过滤,仍成功返回零个候选及跳过计数。 - 规则重叠时,分开核对结果和副作用。 从固定提交对比最小的条件变化,独立复核者先重追执行顺序,再对照作者结论。预约书送修样本区分两种错答;这是合成回归,不是模型准确率或生产观测。候选扫描和正式锚点都按字面 Git 路径读取普通 UTF-8 文件,使用相同的物理源码行。
- 复盘证据在哪一步缺失。 对原有的
retrieval-diagnose-context加--card CASE_ID,即可查看一题的候选顺序、出处、上下文记录与标注缺口。默认 Markdown;可选--output json、--card-language en。默认不显示片段和标注原文,但路径与标识仍可见;仅在本地需要核对原文时使用--include-excerpts。不加--card,诊断输出保持原样。卡片只核对记录,不证明模型读过证据或答对了题,也不改变检索排名。 - 展开会改变答案的计算。 对复杂规则,仅在需要时补充决策表、分段公式或流程图。按字段保留触发条件、输入与单位、运算顺序、默认与例外、下游用途、源码出处;未核对到的值明确标为未知。合成回归覆盖区间边界、空档、只改一条公式时的复核与旧快照查询;不代表生产代码或在线模型实测。
- 核对宿主实际使用的 Skill。 从工具源码检出运行
scripts/verify_installed_skill.py,将宿主使用的完整 Skill 与目标 Git 提交逐文件比较;同版号不代表内容相同。详见包内docs/plugin-installation.md。 - 改变一条规则时,只复核有依据的范围。 用
preview-upgrade --all-modules --plan --review-queue和计划摘要生成工单;无法解释的差异扩大复核范围,不沿用旧批准。独立合成盲测分别评估提取与复核,不能代替人工批准。维护者可从源码运行scripts/release_receipt.py分别核对本地构建、CI 和两端的公开发行状态。
无需迁移或重发知识项目。 文件协议、审核与知识发布规则不变。无法定位到普通文本文件的旧锚点应重新取证,不要改写历史快照。
发布流程修复。 不再用仓库权限摘要推断草稿可见性。npm 发布前和 GitHub 上传前分别用各自的短期 Actions 令牌确认能看到维护者预先准备的非公开草稿,并继续拒绝同版本草稿或正式 Release;无法证实可见性则停止。没有引入长期管理员令牌,也没有移除防重复发版检查。
按版本核对分发。 源码版号不是公开发行证明。GitHub 请在版本列表按准确标签查找并核对清单;npm 可用 npm view code2kb-dsh dist-tags --json 查看。2.5.1 的发布流程使用 release-2.5.1,不移动 latest。安装时明确选择已核实的版本,不能用裸包名代替。源码评审应按提交安装,不用版号猜测内容。
English
Distribution scope: 2.5.1 is the first distribution of the changes below. Version 2.5.0 stopped at GitHub preflight, so it has only a Git tag, not a GitHub Release or npm package. This patch adds no user-facing features relative to that tag.
A returned book has a hold and needs repair. It goes to the repair desk and keeps the hold note. Looking at either rule in isolation can get the destination or the note wrong. Version 2.5.1 also lets you inspect evidence before writing an outline and trace a missing condition from retrieval to the recorded answer context.
- Inspect first. With a configured, pinned source repository,
analyze-candidatesandevidence-snapshotno longer require a pre-created knowledge-source directory or write an outline. A fullcheckstill requires the directory and outline. Script compatibility: if an explicit--scopeis absent from the pinned commit, the scan now exits nonzero instead of succeeding with an empty result. A real scope containing only filtered files still succeeds with zero candidates and skip counts. - Trace overlapping rules. Compare the smallest change that affects the answer. Independently retrace the order of execution, side effects and skipped actions before comparing claims. The book return fixture distinguishes two wrong answers; it is a synthetic regression, not a model evaluation or production observation. Candidate scanning and evidence verification use literal Git paths, regular UTF-8 files and the same physical source lines.
- Replay one case. Add
--card CASE_IDtoretrieval-diagnose-contextfor ranked sources, recorded context and annotated gaps at each stage. Markdown is the default; use--output jsonor--card-language enas needed. Raw excerpts and annotations are hidden by default, not paths or identifiers; use--include-excerptsonly for local review. Omitting--cardpreserves the original diagnostic output. The card checks a record, not whether a model read the evidence or answered correctly. Ranking is unchanged. - Spell out calculations that change the answer. When warranted, use a decision table, conditional formulas or a flowchart. Preserve each field’s conditions, inputs and units, calculation order, defaults and exceptions, downstream use, and source. Mark unverified values as unknown. A synthetic regression covers interval boundaries, gaps, review after a one-formula change, and queries against the old snapshot. It does not test production code or a live model.
- Verify the installed skill. From the toolkit checkout, run
scripts/verify_installed_skill.pyto compare the host's entire skill tree to a Git commit. A matching version is not a content check. Seedocs/plugin-installation.mdin the package. - Review the scope you can account for. Use
preview-upgrade --all-modules --plan --review-queuewith the plan digest to dispatch rule reviews; unexplained changes broaden review and approvals do not carry over. Separate synthetic trials exercise extraction and claim review. From the source checkout,scripts/release_receipt.pydistinguishes local builds, CI and both public distributions.
No knowledge-project migration or republication is required. The file protocol, review and knowledge-publishing rules are unchanged. Recheck anchors that do not resolve to ordinary text; do not rewrite historical snapshots.
Release workflow fix. Instead of inferring draft access from repository metadata, both the npm gate and the GitHub upload gate use their own short-lived Actions tokens to verify a known private draft, then reject any draft or release for the target version. Unknown visibility fails closed. No long-lived administrator token is added.
Check the exact distribution. A source version does not establish public availability. Look up the exact tag in GitHub Releases and verify the manifest; check npm with npm view code2kb-dsh dist-tags --json. The 2.5.1 publication workflow selects release-2.5.1 without moving latest. Install an explicitly verified version, not a bare package name. For source review, install the exact commit instead.