Files
memind/page-data-collect-skill.test.mjs
john 371900bae5
Memind CI / Test, build, and release guards (pull_request) Failing after 18s
feat(mindspace): add page quota grace write and local delivery guardrails.
Centralize page HTML quota checks with grace-write semantics across page
services and workspace tools, keep localhost MindSpace links clickable in
chat display, and expand Page Data/static-page skill plus local dev docs
for quota, delivery URLs, and native Aider/OpenHands tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 10:44:26 +08:00

34 lines
1.6 KiB
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
const skillText = fs.readFileSync(new URL('./skills/page-data-collect/SKILL.md', import.meta.url), 'utf8');
test('page-data-collect skill uses PostgreSQL DDL and fails closed on private data errors', () => {
assert.match(skillText, /GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY/);
assert.match(skillText, /TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP/);
assert.doesNotMatch(skillText, /INTEGER PRIMARY KEY AUTOINCREMENT/);
assert.match(skillText, /数据层失败必须立即停止/);
assert.match(skillText, /禁止继续写 HTML、bind 或发布/);
assert.match(skillText, /平台没有延迟补执行队列/);
});
test('page-data-collect skill pins deletion to the public client API', () => {
assert.match(skillText, /client\.deleteRow\('dataset_name', rowId\)/);
assert.match(skillText, /禁止发明 `softDeleteRows`/);
assert.match(skillText, /表必须包含 `deleted_at TIMESTAMPTZ`/);
});
test('page-data-collect skill documents page quota grace and delivery URLs', () => {
assert.match(skillText, /本次写完、下次再拦/);
assert.match(skillText, /127\.0\.0\.1:8081\/MindSpace/);
assert.match(skillText, /禁止.*本地服务/);
assert.match(skillText, /pageId.*UUID/);
});
test('page-data-collect skill requires independent table per delivery task', () => {
assert.match(skillText, /每个独立交付任务必须独立建表/);
assert.match(skillText, /禁止复用已有表/);
assert.match(skillText, /禁止.*为新的独立页面复用已有 dataset/);
});