feat(mindspace): enforce PostgreSQL user data delivery

This commit is contained in:
john
2026-07-13 15:29:29 +08:00
parent b33c943b69
commit a6620fb719
57 changed files with 2779 additions and 164 deletions
+27
View File
@@ -107,9 +107,36 @@ test('buildAutoChatSkillPrefix prefers page-data-collect for survey requests', (
test('isPageDataIntent matches survey and backend keywords', () => {
assert.equal(isPageDataIntent('增加调查问卷和后台入口,密码 888'), true);
assert.equal(
isPageDataIntent('帮我做一个家庭记账页面,我每天可以记录日期、收入、支出、分类和备注,日期默认当天。再做一个管理页面,可以查看所有记录和收支汇总。'),
true,
);
assert.equal(isPageDataIntent('帮我做一个苏州攻略页面'), false);
});
test('isPageDataIntent matches implicit interactive sticky-note app requests', () => {
const text = '帮我设计一个便签提醒,可以写便签提交,时间轴来显示';
assert.equal(isPageDataIntent(text), true);
assert.match(
buildAutoChatSkillPrefix(text, ['page-data-collect', 'static-page-publish']),
/page-data-collect/,
);
});
test('isPageDataIntent does not steal a simple schedule reminder', () => {
assert.equal(isPageDataIntent('明天上午9点提醒我开会'), false);
assert.equal(isPageDataIntent('创建一个待办'), false);
});
test('buildAutoChatSkillPrefix routes ordinary household ledger language to Page Data', () => {
const text = '帮我做一个家庭记账页面,我每天可以记录日期、收入、支出、分类和备注,日期默认当天。再做一个管理页面,可以查看所有记录和收支汇总。';
const prefix = buildAutoChatSkillPrefix(text, ['page-data-collect', 'static-page-publish']);
assert.match(prefix, /page-data-collect/);
assert.match(prefix, /同一轮继续执行/);
assert.match(prefix, /禁止 localStorage/);
assert.doesNotMatch(prefix, /static-page-publish 技能/);
});
test('buildAutoChatSkillPrefix enables publish for implicit page requests', () => {
const prefix = buildAutoChatSkillPrefix('苏州攻略页面', ['static-page-publish']);
assert.match(prefix, /static-page-publish/);