Archived
fix(loop-engine): carded 只跳过这一笔,不收拍 —— 配方尾部的笔从前永远不跑
同一份配方 `[project, card, project]` 在两种局面下行为相反:人还在填(quiet)时 card 被 quiet 过滤 `continue` 掉,**第三笔照跑**;人交回之后(非 quiet、carded) 走到 carded 分支 `stop: true` break 掉整条 do,**第三笔不跑**。 也就是说**唯一一个「人的答案已经在草稿里」的时刻,配方的后半截偏偏不执行**; 而人还没答完时它倒是跑了。写配方的人会很自然地写「铺格 → 发卡 → 收口整理」, 然后发现第三笔从来没生效过 —— 静默,没有痕。 「收拍」留给**真发出去了卡**那一次(两条带 stop 的 return 不动)。 配套一条装包 warn:card 后面还有 N 笔时说清它们什么时候跑 —— 顺序读起来像 「一拍连做」,实际要等人交回之后的那一拍。 auto-runner 3 测(carded 跑完 / 真发卡仍收拍 / quiet 与 carded 现在一致)+ static-audit 2 测。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LKMZDwMbyKzjw6Hembwvet
This commit is contained in:
@@ -581,3 +581,45 @@ describe('createOnly + 配方:已在库的当「不用建」跳过,不抛(I2)',
|
||||
expect([...drafts.values()].find((d) => d.key['internal_pn'] === 'IN_LIB')?.landed).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* **`carded` 只跳过这一笔,不收拍**(2026-08-29 终审 I3)。
|
||||
*
|
||||
* 从前 carded 分支 `stop: true` → break 掉整条 `do`。同一份配方 `[project, card, project]`
|
||||
* 在两种局面下行为相反:人还在填(quiet)时 card 被 quiet 过滤 `continue` 掉,**第三笔照跑**;
|
||||
* 人交回之后(非 quiet、carded)走到 carded 分支 break,**第三笔不跑** ——
|
||||
* 唯一一个「人的答案已经在草稿里」的时刻,配方的后半截偏偏不执行,而且静默、没有痕。
|
||||
*/
|
||||
describe('carded:跳这一笔,不收拍(I3)', () => {
|
||||
const THREE: AutoRecipe = {
|
||||
do: [
|
||||
{ kind: 'project', into: 'sub_eval.part', from: { once: true }, fields: { eval_ref: 'W05-1', internal_pn: 'A' } },
|
||||
{ kind: 'card', as: 'execution', title: '请补齐', basis: [{ k: 'a', v: 'b' }] },
|
||||
{ kind: 'project', into: 'parts.parameter', from: { once: true }, fields: { internal_pn: 'A', param_name: '收口', param_value: '1' } },
|
||||
],
|
||||
};
|
||||
|
||||
it('人交回之后那一拍:卡不再发,**卡后面那一笔照跑**', async () => {
|
||||
const { runner, drafts, cards, ctx } = harness({});
|
||||
const out = await runner.run(THREE, { ...ctx, carded: true });
|
||||
expect(cards.issued).toHaveLength(0);
|
||||
expect(out.issuedCardId).toBeUndefined();
|
||||
expect([...drafts.values()].map((d) => d.object).sort()).toEqual(['parameter', 'part']);
|
||||
});
|
||||
|
||||
it('卡真发出去那一拍仍然收拍 —— 「收拍」留给发得出去的那一次', async () => {
|
||||
const { runner, drafts, cards, ctx } = harness({});
|
||||
const out = await runner.run(THREE, ctx);
|
||||
expect(cards.issued).toHaveLength(1);
|
||||
expect(out.issuedCardId).toBe('card-1');
|
||||
// 第一笔写了,第三笔没跑
|
||||
expect([...drafts.values()].map((d) => d.object)).toEqual(['part']);
|
||||
});
|
||||
|
||||
it('人还在填(quiet)那一拍:card 被跳过,前后两笔都跑 —— 两种局面现在一致了', async () => {
|
||||
const { runner, drafts, cards, ctx } = harness({});
|
||||
await runner.run(THREE, { ...ctx, quiet: true, carded: true });
|
||||
expect(cards.issued).toHaveLength(0);
|
||||
expect([...drafts.values()].map((d) => d.object).sort()).toEqual(['parameter', 'part']);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user