| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #!/usr/bin/env node
- const fs = require('fs');
- const path = require('path');
- const ROOT = path.resolve(__dirname, '..');
- const FILES = [
- path.join(ROOT, 'docs', 'manual-review-handoff.md'),
- path.join(ROOT, 'skills', 'tihao', 'references', 'user-workflow.md'),
- path.join(ROOT, 'skills', 'tihao', 'references', 'output-format.md')
- ];
- function main() {
- const checks = FILES.map(file => {
- const text = fs.readFileSync(file, 'utf8');
- const summary = {
- file: path.relative(ROOT, file).replace(/\\/g, '/'),
- hasBusinessSop: text.includes('商务 SOP') || text.includes('用户工作流'),
- hasManualReviewLabels: text.includes('人工复核标签'),
- hasAttributionTypes: text.includes('归因类型'),
- hasCustomerEffectBoundary: text.includes('不得宣称命中率提升') ||
- text.includes('效果证明边界') ||
- text.includes('不能宣称客户效果'),
- hasDoubaoModel: text.includes('doubao-seed-2-0-pro') || text.includes('视频分析'),
- hasSoftwareFields: text.includes('软件端交付表') || text.includes('tihao-sourcing-client-list.csv'),
- hasCommonMojibake: /[閹荤粵閺嶉崣鐟欑拠閻╂潏闁导缂傞弬閸熸矮娑斾梗]{3,}/.test(text) ||
- /[閵嗕梗閳ユ粣绱漖]/.test(text) ||
- /\uFFFD/.test(text)
- };
- return summary;
- });
- for (const check of checks) {
- assert(check.hasManualReviewLabels, `${check.file} should expose manual review labels`);
- assert(check.hasAttributionTypes, `${check.file} should expose attribution types`);
- assert(check.hasCustomerEffectBoundary, `${check.file} should expose customer-effect proof boundary`);
- assert(check.hasCommonMojibake === false, `${check.file} should not contain common mojibake`);
- }
- assert(checks.some(item => item.hasBusinessSop), 'skill references should preserve business SOP or workflow');
- assert(checks.some(item => item.hasDoubaoModel), 'skill references should preserve Doubao video analysis guidance');
- assert(checks.some(item => item.hasSoftwareFields), 'skill references should preserve software table guidance');
- console.log(JSON.stringify({ ok: true, checks }, null, 2));
- }
- function assert(condition, message) {
- if (!condition) throw new Error(message);
- }
- if (require.main === module) main();
|