Validate canonical notes and lightweight media in the full stack suite
wiki CI and deployment / verify-and-deploy (push) Successful in 18m48s

This commit is contained in:
2026-10-25 22:46:17 +08:00
parent 4690c1ae9b
commit 5f1af4e9f6
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -3,4 +3,4 @@ import ids from './page-ids.json';
export function pageId(key:string):string{return (ids as Record<string,string>)[key]||'';}
export const exploreUrl=(id:string)=>'/explore/'+encodeURIComponent(id);
export const guidanceUrl=(path:string)=>exploreUrl(pageId('guidance:'+path));
export function previewUrl(source:string,width=640){return '/api/preview?'+new URLSearchParams({source,width:String(width)});}
export function previewUrl(source:string,width=480){return '/api/preview?'+new URLSearchParams({source,width:String(width)});}
+3 -1
View File
@@ -36,6 +36,8 @@ test('real PostgreSQL + S3 library, sharing, taxonomy, uploads, range and video
assert.equal((await request('/api/feed')).contributions.length,0,'Import does not invent contribution rules');
await db().query("INSERT INTO contribution_events(id,kind,subject_type,amount) VALUES($1,'test.import','asset',2),($2,'test.edit','post',3)",[randomUUID(),randomUUID()]);assert.equal((await request('/api/feed')).contributions.reduce((n:number,c:{total:number})=>n+c.total,0),5);
const img=await fetch(base+'/api/media/'+first.assets[0],{headers:{Range:'bytes=0-9'}});assert.equal(img.status,206);assert.equal((await img.arrayBuffer()).byteLength,10);
const lightweight=await fetch(base+'/api/preview?source='+encodeURIComponent('/api/media/'+first.assets[0])+'&width=480');assert.equal(lightweight.status,200);assert.match(lightweight.headers.get('content-type')||'',/image\/webp/);assert.ok((await lightweight.arrayBuffer()).byteLength<=100000);
const textEntry=await fetch(base+'/explore/'+reused.id+'?agent_mode=True');assert.equal(textEntry.status,200);assert.match(textEntry.headers.get('content-type')||'',/text\/plain/);assert.ok((await textEntry.text()).includes(first.assets[0]));
assert.equal((await fetch(base+'/images/lines/missing')).status,404);assert.equal((await fetch(base+'/p/'+reused.slug)).status,200);
for(const sound of [true,false]){
const path=join(dir,sound?'sound.mp4':'silent.mp4');const args=['-y','-v','error','-f','lavfi','-i','color=c=blue:s=160x120:r=10'];if(sound)args.push('-f','lavfi','-i','sine=frequency=440:sample_rate=44100');args.push('-t','0.5','-c:v','libx264','-pix_fmt','yuv420p');if(sound)args.push('-c:a','aac');args.push(path);await run('ffmpeg',args);
@@ -77,7 +79,7 @@ test('real PostgreSQL + S3 library, sharing, taxonomy, uploads, range and video
for(const image of ['egret-example','dancer-example'])assert.equal((await fetch(base+`/skills/shadow-puppet/${image}.png`,{method:'HEAD'})).status,200);
for(const path of ['/skills/missing/SKILL.md','/skills/shadow-puppet/missing.md','/tools/skills/shadow-puppet/missing'])assert.equal((await fetch(base+path)).status,404,path);
assert.equal((await fetch(base+'/api/skill-docs/shadow-puppet/SKILL',{method:'POST'})).status,405);
const home=await fetch(base+'/').then(r=>r.text());assert.ok(home.includes('查看文档与 Agent 入口'));assert.ok(home.includes('照片入皮影'));
const home=await fetch(base+'/').then(r=>r.text());assert.ok(home.includes('/explore/'));assert.ok(home.includes('分类'));assert.ok(home.includes('照片入皮影'));
const spec=await request('/api/skills/street-people');assert.equal(spec.generation.executor,'coding-agent');
assert.equal((await fetch(base+'/api/skills/street-people?format=md')).headers.get('content-type'),'text/markdown; charset=utf-8');
+4
View File
@@ -49,3 +49,7 @@
- `apps/studio/src/pages/index.tsx`:AI 索引入口修正为实际 `/studio/api`。
- `scripts/deploy.sh`:Wiki 发布过期检查限定 Wiki 相关路径,避免 Studio 单独更新时阻止已验证的 Wiki 发布。
- `apps/wiki/tests/integration.test.ts`:移除已按需求删除的旧工具入口文案断言,改为检查 ID 链接和分类;新增真实存储图片的压缩体积检查,以及数据库内容的 agent_mode 响应检查。
- `apps/wiki/src/content/page-links.ts`:默认预览尺寸改为已支持的 480 像素档位。