迭代批量安排酒店
This commit is contained in:
1 parent
4cfbefffe8
commit
c2c71d35af
48 files changed
+5670
-57
No files matched your search
@@ -189,7 +189,7 @@ test('versioned sanitized gold corpus replays deterministically', async () => {
|
||||
const corpus = JSON.parse(await readFile(
|
||||
new URL('../../samples/business-parser-gold-corpus.json', import.meta.url), 'utf8'
|
||||
));
|
||||
assert.equal(corpus.version, 'ltjt-program-parser-v1.0.14');
|
||||
assert.equal(corpus.version, 'ltjt-program-parser-v1.0.15');
|
||||
assert.ok(corpus.cases.length >= 28);
|
||||
for (const candidate of corpus.cases) {
|
||||
const parse = () => parseProgramInput({
|
||||
@@ -863,3 +863,22 @@ test('mode orchestration keeps AI authority in Shadow and enforces the Auto fall
|
||||
assert.equal(affinity.decision.authoritativeEngine, 'ai');
|
||||
assert.equal(aiCalls, 3);
|
||||
});
|
||||
|
||||
|
||||
test('repeated hotel blocks always use their deterministic batch contract even with AI affinity', async () => {
|
||||
let aiCalls = 0;
|
||||
const orchestrator = new ParserOrchestrator({ async parse() { aiCalls++; return {}; } });
|
||||
const rawText = '安排酒店\n' + [26,27].map(day => `团号:LW-SAMPLE\n入住日期:2026-09-${day}\n离店日期:2026-09-${day+1}\n酒店搜索:示例酒店TWN\n间数:1`).join('\n');
|
||||
for (const mode of ['ai','shadow','auto','program'] as const) {
|
||||
const claim = orchestrationClaim(mode, rawText, 'ai');
|
||||
claim.task.parser.route_id = 'arrangement_hotel_create';
|
||||
const parsed = await orchestrator.parse(claim);
|
||||
assert.equal(parsed.decision.authoritativeEngine, 'program');
|
||||
assert.equal((parsed.result as any).operation.data.arrangements.length, 2);
|
||||
claim.messageText = '间数:2';
|
||||
claim.history = [{ turnNo: 1, rawText }];
|
||||
const incomplete = await orchestrator.parse(claim);
|
||||
assert.equal((incomplete.result as any).error_code, 'program_hotel_batch_invalid');
|
||||
}
|
||||
assert.equal(aiCalls, 0);
|
||||
});
|
||||
Reference in new issue
Block a user