A2-A7 全部补齐到验收线;顺手把几处「门拦住却不给路」的坑填了

活动:A2 选型 / A3 寻源 / A4 定价 / A6 议价 / A7 归档五件各补成真活动包 ——
契约宽进(input.required 空,归一在活动内)、台账必填声明(含行级 requiredWhen)、
入场哨兵与 L1/L2 判据一律读基座数、两份件(在办可编辑 + 办结静态快照)、
三案例常备、包内自测。e2e 各三案例 released、行动被拒 0、发口正确、提交闸每单真拦。

基座(共享面,改一处影响所有活动,故每处都带回归):
· 重发判断走在站上场之前 —— 人答完那步常已收掉,readyToWork 先抛「不能再往它上面挂活」,
  于是「重发已答过的卡 = 无事发生」这条唯一活路在最需要时够不着,A1 基线当场熔断;
· 决策卡补幂等兜底(与执行工单同一把尺):头两次无事发生,第三次起才算被拒;
· 输出没成形先就地重问一次,原话进工作日志、不再摆上卡面;
· 工具调用读数 tool_<名>_calls —— 「机检只读基座数」这条纪律第一次覆盖到工具;
· 执行卡 steps/standard 补进出参 schema(从前能到卡面全靠厂商 JSON 模式宽松);
· 件的就地更新改逐节点 morph,保存先把新值镜像进只读那份 —— 不闪、不等回声。

A1(基线,全程守住):措辞三档对齐(必填/建议/选填)、禁止拿历史价当客户目标价、
卡骨架从步骤剧本搬进说明书(压成一拍连做时剧本没摊开,会发出没有指导书的裸卡)。

契约两处**新增可选字段**(非破坏):FieldDeclaration.requiredWhen、工单 finalHtml;
api-report 同批更新。docs/adr 与 docs/archive 的 13 份文件在工作树里不见了,
本次予以恢复而非提交删除。

门禁:typecheck / lint / depcruise / test(1366)全绿。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-03 12:28:31 +08:00
co-authored by Claude Opus 5
parent 85466e815f
commit ade0fa5a94
90 changed files with 17969 additions and 2316 deletions
@@ -9,7 +9,7 @@
* 所以归型放在写进草稿那一刻:归得了就归,归不了当场拒(理由喂回下一拍)。
*/
import { describe, expect, it } from 'vitest';
import { coerceToColumn, localStamp, missingReadings, rowReadings, rowKeyList, tallyReadings } from '../wiring/engines.ts';
import { coerceToColumn, localStamp, missingReadings, rowReadings, rowKeyList, tallyReadings, toolCallReadings } from '../wiring/engines.ts';
describe('空值 = 这一列没有值(不写)', () => {
it('空串 / 全空白 / null / undefined 一律不写 —— 「原文没写的不要补」的数据面落点', () => {
@@ -342,3 +342,42 @@ describe('按值现数:域_对象_列_值', () => {
).toBe(1);
});
});
/**
* **工具调用读数** —— 「机检只读基座数」这条纪律第一次覆盖到工具(2026-08-03)。
*
* 起因:A2 判稳偶发压根不调行情工具就把料判成「稳」转 A,而自报的那一列写得漂亮,
* 去向就此走岔(约十次一次)。工具出参本来就入痕,「调没调」是基座数得出来的事实。
*/
describe('工具调用读数', () => {
const declared = [{ name: 'crm.history-price-read' }, { name: 'mail.send' }];
it('声明过的工具一律先铺 0 —— 没调过与调了 0 次在业务上是同一件事', () => {
expect(toolCallReadings([], declared)).toEqual({
tool_crm_history_price_read_calls: 0,
tool_mail_send_calls: 0,
});
});
it('数成功返回的那几次,名字里的点号横杠一律换成下划线(S-FEEL 不认)', () => {
const trail = [
{ kind: 'result', title: 'crm.history-price-read 返回' },
{ kind: 'result', title: 'crm.history-price-read 返回(3 行)' },
{ kind: 'thought', title: 'crm.history-price-read 返回' },
];
expect(toolCallReadings(trail, declared).tool_crm_history_price_read_calls).toBe(2);
});
it('**调失败不算查过** —— 调不通等于没拿到行情,不该拿来当依据', () => {
const trail = [{ kind: 'result', title: 'crm.history-price-read 失败:端点不可达' }];
expect(toolCallReadings(trail, declared).tool_crm_history_price_read_calls).toBe(0);
});
it('没声明的工具不数 —— 声明面就是授权面,不在名单里的本来也数不着', () => {
const trail = [{ kind: 'result', title: 'erp.write 返回' }];
expect(Object.keys(toolCallReadings(trail, declared))).toEqual([
'tool_crm_history_price_read_calls',
'tool_mail_send_calls',
]);
});
});