feat(wechat): add Intent Transaction Layer with unified task schema
Introduce Draft → Confirm → Commit flow for WeChat schedule intents behind feature flags, plus h5_tasks dual-write/read aggregation and rollout scripts so reminders and automations get explicit user confirmation before persisting. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { detectQueryGuard } from './intent-query-guard.mjs';
|
||||
import { classifyUserIntent } from './intent-classifier.mjs';
|
||||
|
||||
test('detectQueryGuard treats scheduled task inventory as read-only query', () => {
|
||||
assert.equal(detectQueryGuard('有没有我的新闻定时任务'), true);
|
||||
assert.equal(detectQueryGuard('看看有没有定时自动任务'), true);
|
||||
});
|
||||
|
||||
test('detectQueryGuard does not treat cancel/manage wording as query', () => {
|
||||
assert.equal(detectQueryGuard('取消每日新闻任务'), false);
|
||||
});
|
||||
|
||||
test('classifyUserIntent routes scheduled task inventory to L0', () => {
|
||||
const result = classifyUserIntent('有没有我的新闻定时任务');
|
||||
assert.equal(result.layer, 'L0');
|
||||
assert.equal(result.kind, 'query');
|
||||
});
|
||||
Reference in New Issue
Block a user