Files
memind/intent-query-guard.test.mjs
T
john d58dc2a251 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>
2026-08-24 15:59:17 +08:00

20 lines
816 B
JavaScript

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');
});