fix: 收口依赖兼容与会话撤销
为 miniprogram-ci 和 Jimp 依赖增加兼容 patch 与 smoke test;修复平台模板管理员路由漏配;收紧模板契约校验;为 admin/customer 增加 token 撤销和集中会话存储;同步品牌切换角色、doctor source hash、多屏宽截图证据和 CI 构建门禁。
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"scope": "模板完成证据登记,保留命令、日志与产物哈希",
|
"scope": "模板完成证据登记,保留命令、日志与产物哈希",
|
||||||
"generatedAt": "2026-10-18T21:55:00+08:00",
|
"generatedAt": "2026-10-19T00:20:00+08:00",
|
||||||
"templates": {
|
"templates": {
|
||||||
"acheng-campus-food": {
|
"acheng-campus-food": {
|
||||||
"real-manifest-interaction": {
|
"real-manifest-interaction": {
|
||||||
@@ -13,13 +13,14 @@
|
|||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
||||||
"sha256": "c5c469f3fa43323f9872ce7dd4114fa8803c7be63c578d058fc1e9b60f72a3e1"
|
"sha256": "f856baf44079516997ce8345fb843384fd4b47d5ca7009de49449d22e586ee7f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
||||||
"sha256": "dc3c5984b38e06d7b9b975d5247ea136ae6a9e06f61826bd63949239edfda6fa"
|
"sha256": "588b8e4372e91ddc58d7f2ba97111936469d5d3efa7d4c2f56b0356cc8d8541a"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"save-reload-publish-isolation": {
|
"save-reload-publish-isolation": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
@@ -29,46 +30,69 @@
|
|||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
||||||
"sha256": "c5c469f3fa43323f9872ce7dd4114fa8803c7be63c578d058fc1e9b60f72a3e1"
|
"sha256": "f856baf44079516997ce8345fb843384fd4b47d5ca7009de49449d22e586ee7f"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"visual-reference": {
|
"visual-reference": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
"commands": [
|
"commands": [
|
||||||
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=<absolute-output-dir> ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
|
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18 ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
|
||||||
],
|
],
|
||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
||||||
"sha256": "de768debf81e14aeb17309622781c3c5239768c54f6ca3008c3cf52fd70aca3b"
|
"sha256": "f8bc81dcf34094bc9bc430c5ef39fa919633ee58d21a6758cb2268bae8ba8125"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/01-acheng-campus-food-food.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/01-acheng-campus-food-food-320.png",
|
||||||
"sha256": "46066739ca27e6b6e194972f3accce6f3de81adc089d2968361de9f289f73f37"
|
"sha256": "296fd872682a5474797bd2cfa7401e2fdf04904dfe1dcb0178d3057edd101666"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/01-acheng-campus-food-food-375.png",
|
||||||
|
"sha256": "6d51d0aae8828c0c85159fe764ab2cb7a0ab83de9d33a223406e920eb0dcc70d"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/01-acheng-campus-food-food-390.png",
|
||||||
|
"sha256": "cdb9cbbb078641866492e7d601253245fec6fa95dc8d917a550bfec5f9859a28"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"empty-error-branches": {
|
"empty-error-branches": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
"commands": [
|
"commands": [
|
||||||
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=<absolute-output-dir> ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
|
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18 ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
|
||||||
"ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
|
"ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
|
||||||
],
|
],
|
||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
||||||
"sha256": "de768debf81e14aeb17309622781c3c5239768c54f6ca3008c3cf52fd70aca3b"
|
"sha256": "f8bc81dcf34094bc9bc430c5ef39fa919633ee58d21a6758cb2268bae8ba8125"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
||||||
"sha256": "dc3c5984b38e06d7b9b975d5247ea136ae6a9e06f61826bd63949239edfda6fa"
|
"sha256": "588b8e4372e91ddc58d7f2ba97111936469d5d3efa7d4c2f56b0356cc8d8541a"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-01-acheng-campus-food-food.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-01-acheng-campus-food-food.png",
|
||||||
"sha256": "6580f27a4f5613f1da1abfb907932b1092a3a82b55cfc78e3fc67ef5dad688f2"
|
"sha256": "c4abb911e0006f1749811d2161ddf78aa6cbee1910da5932209d2dd25cf1301c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-02-atelier-solopreneur-personal.png",
|
||||||
|
"sha256": "19807439ca41c067185c7abc5f06d0e98749086fa35ef757db43066211d74f06"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-03-linjing-editorial-personal.png",
|
||||||
|
"sha256": "890ef276bbc231ad7446c938e2767e8b37dba998e39143b50a9c21e13589854d"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-04-linjing-editorial-doors.png",
|
||||||
|
"sha256": "f0936ff7404fe5dfe5f047e9b84d0c7cbdd5434a4c75dfa9c3b0b169dda4b350"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"atelier-solopreneur": {
|
"atelier-solopreneur": {
|
||||||
@@ -81,13 +105,14 @@
|
|||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
||||||
"sha256": "c5c469f3fa43323f9872ce7dd4114fa8803c7be63c578d058fc1e9b60f72a3e1"
|
"sha256": "f856baf44079516997ce8345fb843384fd4b47d5ca7009de49449d22e586ee7f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
||||||
"sha256": "dc3c5984b38e06d7b9b975d5247ea136ae6a9e06f61826bd63949239edfda6fa"
|
"sha256": "588b8e4372e91ddc58d7f2ba97111936469d5d3efa7d4c2f56b0356cc8d8541a"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"save-reload-publish-isolation": {
|
"save-reload-publish-isolation": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
@@ -97,46 +122,69 @@
|
|||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
||||||
"sha256": "c5c469f3fa43323f9872ce7dd4114fa8803c7be63c578d058fc1e9b60f72a3e1"
|
"sha256": "f856baf44079516997ce8345fb843384fd4b47d5ca7009de49449d22e586ee7f"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"visual-reference": {
|
"visual-reference": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
"commands": [
|
"commands": [
|
||||||
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=<absolute-output-dir> ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
|
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18 ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
|
||||||
],
|
],
|
||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
||||||
"sha256": "de768debf81e14aeb17309622781c3c5239768c54f6ca3008c3cf52fd70aca3b"
|
"sha256": "f8bc81dcf34094bc9bc430c5ef39fa919633ee58d21a6758cb2268bae8ba8125"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/02-atelier-solopreneur-personal.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/02-atelier-solopreneur-personal-320.png",
|
||||||
"sha256": "febd1edb6009100841044dde6ca129a0a7830e86804d666b629b92ee9eaddba4"
|
"sha256": "bc86fd697e742cd3c8fb9581607e36917771d7783ed9e8f6adda667fcf998043"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/02-atelier-solopreneur-personal-375.png",
|
||||||
|
"sha256": "0c5d85656ebe7ca66896d8532fe15bc349f3f7581cfeb54fcc9626516d5e1b53"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/02-atelier-solopreneur-personal-390.png",
|
||||||
|
"sha256": "cfe3df22dc40f9f4a97d6b58f86f5947cd1c601c47895b0edc224c06f8a26b7e"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"empty-error-branches": {
|
"empty-error-branches": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
"commands": [
|
"commands": [
|
||||||
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=<absolute-output-dir> ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
|
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18 ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
|
||||||
"ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
|
"ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
|
||||||
],
|
],
|
||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
||||||
"sha256": "de768debf81e14aeb17309622781c3c5239768c54f6ca3008c3cf52fd70aca3b"
|
"sha256": "f8bc81dcf34094bc9bc430c5ef39fa919633ee58d21a6758cb2268bae8ba8125"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
||||||
"sha256": "dc3c5984b38e06d7b9b975d5247ea136ae6a9e06f61826bd63949239edfda6fa"
|
"sha256": "588b8e4372e91ddc58d7f2ba97111936469d5d3efa7d4c2f56b0356cc8d8541a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-01-acheng-campus-food-food.png",
|
||||||
|
"sha256": "c4abb911e0006f1749811d2161ddf78aa6cbee1910da5932209d2dd25cf1301c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-02-atelier-solopreneur-personal.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-02-atelier-solopreneur-personal.png",
|
||||||
"sha256": "88718b259d8f19007a491c1825bcfb578f79ca8c536af49caa0d11c3f6b50f07"
|
"sha256": "19807439ca41c067185c7abc5f06d0e98749086fa35ef757db43066211d74f06"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-03-linjing-editorial-personal.png",
|
||||||
|
"sha256": "890ef276bbc231ad7446c938e2767e8b37dba998e39143b50a9c21e13589854d"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-04-linjing-editorial-doors.png",
|
||||||
|
"sha256": "f0936ff7404fe5dfe5f047e9b84d0c7cbdd5434a4c75dfa9c3b0b169dda4b350"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"linjing-editorial": {
|
"linjing-editorial": {
|
||||||
@@ -149,13 +197,14 @@
|
|||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
||||||
"sha256": "c5c469f3fa43323f9872ce7dd4114fa8803c7be63c578d058fc1e9b60f72a3e1"
|
"sha256": "f856baf44079516997ce8345fb843384fd4b47d5ca7009de49449d22e586ee7f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
||||||
"sha256": "dc3c5984b38e06d7b9b975d5247ea136ae6a9e06f61826bd63949239edfda6fa"
|
"sha256": "588b8e4372e91ddc58d7f2ba97111936469d5d3efa7d4c2f56b0356cc8d8541a"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"save-reload-publish-isolation": {
|
"save-reload-publish-isolation": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
@@ -165,55 +214,83 @@
|
|||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
||||||
"sha256": "c5c469f3fa43323f9872ce7dd4114fa8803c7be63c578d058fc1e9b60f72a3e1"
|
"sha256": "f856baf44079516997ce8345fb843384fd4b47d5ca7009de49449d22e586ee7f"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"visual-reference": {
|
"visual-reference": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
"commands": [
|
"commands": [
|
||||||
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=<absolute-output-dir> ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
|
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18 ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
|
||||||
],
|
],
|
||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
||||||
"sha256": "de768debf81e14aeb17309622781c3c5239768c54f6ca3008c3cf52fd70aca3b"
|
"sha256": "f8bc81dcf34094bc9bc430c5ef39fa919633ee58d21a6758cb2268bae8ba8125"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/03-linjing-editorial-personal.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/03-linjing-editorial-personal-320.png",
|
||||||
"sha256": "fb719a7b98202f214be10a9b0055fdbf8939a6547a2bac33a196615b11f40967"
|
"sha256": "5185b355dfef3e7bd36019f9a549b6da74d5bed1ee93e8b8a1e2d0e153ef9cad"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/04-linjing-editorial-doors.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/03-linjing-editorial-personal-375.png",
|
||||||
"sha256": "e68445f755d5efd2c35401b2c9e2bc2fc637f05bcb8344fb5b8a087681d82fd1"
|
"sha256": "c0d87b677b3bd48460144d03646a791fac2ea004668346b5ee808ca1b4d02a89"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/03-linjing-editorial-personal-390.png",
|
||||||
|
"sha256": "3548b38659d59b1e3a8fff16a73bfa44b7eae6082b8f53688dfee6fe431257a7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/04-linjing-editorial-doors-320.png",
|
||||||
|
"sha256": "2d3b5c678dba761126bd0f8c32ddb16f22075631951950cd115e92e9c8d736c6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/04-linjing-editorial-doors-375.png",
|
||||||
|
"sha256": "b15bd96dba8b79873bf9c214cd9b8d7c3c3a418c1b9ff50be0fda8b132ec3f33"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/04-linjing-editorial-doors-390.png",
|
||||||
|
"sha256": "b17c4da052e3e501e2998121210f44c34f210bdb34b2bcdff516aaae86289ba3"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"empty-error-branches": {
|
"empty-error-branches": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
"commands": [
|
"commands": [
|
||||||
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=<absolute-output-dir> ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
|
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18 ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
|
||||||
"ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
|
"ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
|
||||||
],
|
],
|
||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
||||||
"sha256": "de768debf81e14aeb17309622781c3c5239768c54f6ca3008c3cf52fd70aca3b"
|
"sha256": "f8bc81dcf34094bc9bc430c5ef39fa919633ee58d21a6758cb2268bae8ba8125"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
||||||
"sha256": "dc3c5984b38e06d7b9b975d5247ea136ae6a9e06f61826bd63949239edfda6fa"
|
"sha256": "588b8e4372e91ddc58d7f2ba97111936469d5d3efa7d4c2f56b0356cc8d8541a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-01-acheng-campus-food-food.png",
|
||||||
|
"sha256": "c4abb911e0006f1749811d2161ddf78aa6cbee1910da5932209d2dd25cf1301c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-02-atelier-solopreneur-personal.png",
|
||||||
|
"sha256": "19807439ca41c067185c7abc5f06d0e98749086fa35ef757db43066211d74f06"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-03-linjing-editorial-personal.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-03-linjing-editorial-personal.png",
|
||||||
"sha256": "f6f7dca9bbb9116d7e87601633221dffb190cd26e85499e2d14285d667445bfc"
|
"sha256": "890ef276bbc231ad7446c938e2767e8b37dba998e39143b50a9c21e13589854d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-04-linjing-editorial-doors.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-04-linjing-editorial-doors.png",
|
||||||
"sha256": "677c2f7053d0cdbbf68d9d8e53d7dbd9a285608e50fca8571248aae0e15fec07"
|
"sha256": "f0936ff7404fe5dfe5f047e9b84d0c7cbdd5434a4c75dfa9c3b0b169dda4b350"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"sourceTreeHash": "6505db4083d33579d25dd3899fdb64af2dd427bb22b0ddf002400003c35fd721"
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
Running 2 tests using 1 worker
|
Running 2 tests using 1 worker
|
||||||
|
|
||||||
(node:588768) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
(node:633537) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
||||||
(Use `node --trace-warnings ...` to show where the warning was created)
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
||||||
(node:588768) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
(node:633537) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
||||||
(Use `node --trace-warnings ...` to show where the warning was created)
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
||||||
✓ 1 test/browser/admin-editor.spec.ts:235:5 › Admin 按通用预览目标筛选字段并同步品牌草稿 (24.9s)
|
✓ 1 test/browser/admin-editor.spec.ts:235:5 › Admin 按通用预览目标筛选字段并同步品牌草稿 (26.4s)
|
||||||
✓ 2 test/browser/admin-editor.spec.ts:637:5 › 林境模板支持首页和主理人区域点选 (27.0s)
|
✓ 2 test/browser/admin-editor.spec.ts:637:5 › 林境模板支持首页和主理人区域点选 (27.8s)
|
||||||
|
|
||||||
2 passed (53.5s)
|
2 passed (55.7s)
|
||||||
@@ -888,13 +888,14 @@
|
|||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
||||||
"sha256": "c5c469f3fa43323f9872ce7dd4114fa8803c7be63c578d058fc1e9b60f72a3e1"
|
"sha256": "f856baf44079516997ce8345fb843384fd4b47d5ca7009de49449d22e586ee7f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
||||||
"sha256": "dc3c5984b38e06d7b9b975d5247ea136ae6a9e06f61826bd63949239edfda6fa"
|
"sha256": "588b8e4372e91ddc58d7f2ba97111936469d5d3efa7d4c2f56b0356cc8d8541a"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"save-reload-publish-isolation": {
|
"save-reload-publish-isolation": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
@@ -904,46 +905,69 @@
|
|||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
||||||
"sha256": "c5c469f3fa43323f9872ce7dd4114fa8803c7be63c578d058fc1e9b60f72a3e1"
|
"sha256": "f856baf44079516997ce8345fb843384fd4b47d5ca7009de49449d22e586ee7f"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"visual-reference": {
|
"visual-reference": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
"commands": [
|
"commands": [
|
||||||
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=<absolute-output-dir> ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
|
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18 ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
|
||||||
],
|
],
|
||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
||||||
"sha256": "de768debf81e14aeb17309622781c3c5239768c54f6ca3008c3cf52fd70aca3b"
|
"sha256": "f8bc81dcf34094bc9bc430c5ef39fa919633ee58d21a6758cb2268bae8ba8125"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/01-acheng-campus-food-food.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/01-acheng-campus-food-food-320.png",
|
||||||
"sha256": "46066739ca27e6b6e194972f3accce6f3de81adc089d2968361de9f289f73f37"
|
"sha256": "296fd872682a5474797bd2cfa7401e2fdf04904dfe1dcb0178d3057edd101666"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/01-acheng-campus-food-food-375.png",
|
||||||
|
"sha256": "6d51d0aae8828c0c85159fe764ab2cb7a0ab83de9d33a223406e920eb0dcc70d"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/01-acheng-campus-food-food-390.png",
|
||||||
|
"sha256": "cdb9cbbb078641866492e7d601253245fec6fa95dc8d917a550bfec5f9859a28"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"empty-error-branches": {
|
"empty-error-branches": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
"commands": [
|
"commands": [
|
||||||
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=<absolute-output-dir> ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
|
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18 ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
|
||||||
"ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
|
"ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
|
||||||
],
|
],
|
||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
||||||
"sha256": "de768debf81e14aeb17309622781c3c5239768c54f6ca3008c3cf52fd70aca3b"
|
"sha256": "f8bc81dcf34094bc9bc430c5ef39fa919633ee58d21a6758cb2268bae8ba8125"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
||||||
"sha256": "dc3c5984b38e06d7b9b975d5247ea136ae6a9e06f61826bd63949239edfda6fa"
|
"sha256": "588b8e4372e91ddc58d7f2ba97111936469d5d3efa7d4c2f56b0356cc8d8541a"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-01-acheng-campus-food-food.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-01-acheng-campus-food-food.png",
|
||||||
"sha256": "6580f27a4f5613f1da1abfb907932b1092a3a82b55cfc78e3fc67ef5dad688f2"
|
"sha256": "c4abb911e0006f1749811d2161ddf78aa6cbee1910da5932209d2dd25cf1301c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-02-atelier-solopreneur-personal.png",
|
||||||
|
"sha256": "19807439ca41c067185c7abc5f06d0e98749086fa35ef757db43066211d74f06"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-03-linjing-editorial-personal.png",
|
||||||
|
"sha256": "890ef276bbc231ad7446c938e2767e8b37dba998e39143b50a9c21e13589854d"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-04-linjing-editorial-doors.png",
|
||||||
|
"sha256": "f0936ff7404fe5dfe5f047e9b84d0c7cbdd5434a4c75dfa9c3b0b169dda4b350"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"completionIssues": []
|
"completionIssues": []
|
||||||
@@ -1524,13 +1548,14 @@
|
|||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
||||||
"sha256": "c5c469f3fa43323f9872ce7dd4114fa8803c7be63c578d058fc1e9b60f72a3e1"
|
"sha256": "f856baf44079516997ce8345fb843384fd4b47d5ca7009de49449d22e586ee7f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
||||||
"sha256": "dc3c5984b38e06d7b9b975d5247ea136ae6a9e06f61826bd63949239edfda6fa"
|
"sha256": "588b8e4372e91ddc58d7f2ba97111936469d5d3efa7d4c2f56b0356cc8d8541a"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"save-reload-publish-isolation": {
|
"save-reload-publish-isolation": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
@@ -1540,46 +1565,69 @@
|
|||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
||||||
"sha256": "c5c469f3fa43323f9872ce7dd4114fa8803c7be63c578d058fc1e9b60f72a3e1"
|
"sha256": "f856baf44079516997ce8345fb843384fd4b47d5ca7009de49449d22e586ee7f"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"visual-reference": {
|
"visual-reference": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
"commands": [
|
"commands": [
|
||||||
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=<absolute-output-dir> ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
|
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18 ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
|
||||||
],
|
],
|
||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
||||||
"sha256": "de768debf81e14aeb17309622781c3c5239768c54f6ca3008c3cf52fd70aca3b"
|
"sha256": "f8bc81dcf34094bc9bc430c5ef39fa919633ee58d21a6758cb2268bae8ba8125"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/02-atelier-solopreneur-personal.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/02-atelier-solopreneur-personal-320.png",
|
||||||
"sha256": "febd1edb6009100841044dde6ca129a0a7830e86804d666b629b92ee9eaddba4"
|
"sha256": "bc86fd697e742cd3c8fb9581607e36917771d7783ed9e8f6adda667fcf998043"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/02-atelier-solopreneur-personal-375.png",
|
||||||
|
"sha256": "0c5d85656ebe7ca66896d8532fe15bc349f3f7581cfeb54fcc9626516d5e1b53"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/02-atelier-solopreneur-personal-390.png",
|
||||||
|
"sha256": "cfe3df22dc40f9f4a97d6b58f86f5947cd1c601c47895b0edc224c06f8a26b7e"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"empty-error-branches": {
|
"empty-error-branches": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
"commands": [
|
"commands": [
|
||||||
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=<absolute-output-dir> ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
|
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18 ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
|
||||||
"ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
|
"ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
|
||||||
],
|
],
|
||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
||||||
"sha256": "de768debf81e14aeb17309622781c3c5239768c54f6ca3008c3cf52fd70aca3b"
|
"sha256": "f8bc81dcf34094bc9bc430c5ef39fa919633ee58d21a6758cb2268bae8ba8125"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
||||||
"sha256": "dc3c5984b38e06d7b9b975d5247ea136ae6a9e06f61826bd63949239edfda6fa"
|
"sha256": "588b8e4372e91ddc58d7f2ba97111936469d5d3efa7d4c2f56b0356cc8d8541a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-01-acheng-campus-food-food.png",
|
||||||
|
"sha256": "c4abb911e0006f1749811d2161ddf78aa6cbee1910da5932209d2dd25cf1301c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-02-atelier-solopreneur-personal.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-02-atelier-solopreneur-personal.png",
|
||||||
"sha256": "88718b259d8f19007a491c1825bcfb578f79ca8c536af49caa0d11c3f6b50f07"
|
"sha256": "19807439ca41c067185c7abc5f06d0e98749086fa35ef757db43066211d74f06"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-03-linjing-editorial-personal.png",
|
||||||
|
"sha256": "890ef276bbc231ad7446c938e2767e8b37dba998e39143b50a9c21e13589854d"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-04-linjing-editorial-doors.png",
|
||||||
|
"sha256": "f0936ff7404fe5dfe5f047e9b84d0c7cbdd5434a4c75dfa9c3b0b169dda4b350"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"completionIssues": []
|
"completionIssues": []
|
||||||
@@ -2122,13 +2170,14 @@
|
|||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
||||||
"sha256": "c5c469f3fa43323f9872ce7dd4114fa8803c7be63c578d058fc1e9b60f72a3e1"
|
"sha256": "f856baf44079516997ce8345fb843384fd4b47d5ca7009de49449d22e586ee7f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
||||||
"sha256": "dc3c5984b38e06d7b9b975d5247ea136ae6a9e06f61826bd63949239edfda6fa"
|
"sha256": "588b8e4372e91ddc58d7f2ba97111936469d5d3efa7d4c2f56b0356cc8d8541a"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"save-reload-publish-isolation": {
|
"save-reload-publish-isolation": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
@@ -2138,54 +2187,81 @@
|
|||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/api-integration.log",
|
||||||
"sha256": "c5c469f3fa43323f9872ce7dd4114fa8803c7be63c578d058fc1e9b60f72a3e1"
|
"sha256": "f856baf44079516997ce8345fb843384fd4b47d5ca7009de49449d22e586ee7f"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"visual-reference": {
|
"visual-reference": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
"commands": [
|
"commands": [
|
||||||
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=<absolute-output-dir> ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
|
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18 ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts"
|
||||||
],
|
],
|
||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
||||||
"sha256": "de768debf81e14aeb17309622781c3c5239768c54f6ca3008c3cf52fd70aca3b"
|
"sha256": "f8bc81dcf34094bc9bc430c5ef39fa919633ee58d21a6758cb2268bae8ba8125"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/03-linjing-editorial-personal.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/03-linjing-editorial-personal-320.png",
|
||||||
"sha256": "fb719a7b98202f214be10a9b0055fdbf8939a6547a2bac33a196615b11f40967"
|
"sha256": "5185b355dfef3e7bd36019f9a549b6da74d5bed1ee93e8b8a1e2d0e153ef9cad"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/04-linjing-editorial-doors.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/03-linjing-editorial-personal-375.png",
|
||||||
"sha256": "e68445f755d5efd2c35401b2c9e2bc2fc637f05bcb8344fb5b8a087681d82fd1"
|
"sha256": "c0d87b677b3bd48460144d03646a791fac2ea004668346b5ee808ca1b4d02a89"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/03-linjing-editorial-personal-390.png",
|
||||||
|
"sha256": "3548b38659d59b1e3a8fff16a73bfa44b7eae6082b8f53688dfee6fe431257a7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/04-linjing-editorial-doors-320.png",
|
||||||
|
"sha256": "2d3b5c678dba761126bd0f8c32ddb16f22075631951950cd115e92e9c8d736c6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/04-linjing-editorial-doors-375.png",
|
||||||
|
"sha256": "b15bd96dba8b79873bf9c214cd9b8d7c3c3a418c1b9ff50be0fda8b132ec3f33"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/04-linjing-editorial-doors-390.png",
|
||||||
|
"sha256": "b17c4da052e3e501e2998121210f44c34f210bdb34b2bcdff516aaae86289ba3"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
},
|
},
|
||||||
"empty-error-branches": {
|
"empty-error-branches": {
|
||||||
"status": "passed",
|
"status": "passed",
|
||||||
"commands": [
|
"commands": [
|
||||||
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=<absolute-output-dir> ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
|
"TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18 ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts",
|
||||||
"ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
|
"ADMIN_URL=http://127.0.0.1:3010 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts"
|
||||||
],
|
],
|
||||||
"artifacts": [
|
"artifacts": [
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
||||||
"sha256": "de768debf81e14aeb17309622781c3c5239768c54f6ca3008c3cf52fd70aca3b"
|
"sha256": "f8bc81dcf34094bc9bc430c5ef39fa919633ee58d21a6758cb2268bae8ba8125"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/admin-editor.log",
|
||||||
"sha256": "dc3c5984b38e06d7b9b975d5247ea136ae6a9e06f61826bd63949239edfda6fa"
|
"sha256": "588b8e4372e91ddc58d7f2ba97111936469d5d3efa7d4c2f56b0356cc8d8541a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-01-acheng-campus-food-food.png",
|
||||||
|
"sha256": "c4abb911e0006f1749811d2161ddf78aa6cbee1910da5932209d2dd25cf1301c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-02-atelier-solopreneur-personal.png",
|
||||||
|
"sha256": "19807439ca41c067185c7abc5f06d0e98749086fa35ef757db43066211d74f06"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-03-linjing-editorial-personal.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-03-linjing-editorial-personal.png",
|
||||||
"sha256": "f6f7dca9bbb9116d7e87601633221dffb190cd26e85499e2d14285d667445bfc"
|
"sha256": "890ef276bbc231ad7446c938e2767e8b37dba998e39143b50a9c21e13589854d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-04-linjing-editorial-doors.png",
|
"path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18/empty-04-linjing-editorial-doors.png",
|
||||||
"sha256": "677c2f7053d0cdbbf68d9d8e53d7dbd9a285608e50fca8571248aae0e15fec07"
|
"sha256": "f0936ff7404fe5dfe5f047e9b84d0c7cbdd5434a4c75dfa9c3b0b169dda4b350"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"exitCode": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"completionIssues": []
|
"completionIssues": []
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
|
|
||||||
Running 1 test using 1 worker
|
Running 1 test using 1 worker
|
||||||
|
|
||||||
(node:588293) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
(node:632552) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
||||||
(Use `node --trace-warnings ...` to show where the warning was created)
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
||||||
(node:588293) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
(node:632552) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
||||||
(Use `node --trace-warnings ...` to show where the warning was created)
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
||||||
(node:588432) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
(node:632689) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
||||||
(Use `node --trace-warnings ...` to show where the warning was created)
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
||||||
(node:588540) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
(node:632799) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
||||||
(Use `node --trace-warnings ...` to show where the warning was created)
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
||||||
(node:588591) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
(node:632867) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
||||||
(Use `node --trace-warnings ...` to show where the warning was created)
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
||||||
(node:588666) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
(node:632924) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
|
||||||
(Use `node --trace-warnings ...` to show where the warning was created)
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
||||||
✓ 1 test/browser/template-preview-media.spec.ts:155:5 › 导入包预览矩阵展示身份、资源和完整媒体槽位 (11.2s)
|
✓ 1 test/browser/template-preview-media.spec.ts:155:5 › 导入包预览矩阵展示身份、资源和完整媒体槽位 (12.7s)
|
||||||
|
|
||||||
1 passed (12.6s)
|
1 passed (14.2s)
|
||||||
@@ -1746,11 +1746,11 @@
|
|||||||
"expression": "c.config[key + \"Title\"]",
|
"expression": "c.config[key + \"Title\"]",
|
||||||
"message": "动态索引必须验证实际分支。",
|
"message": "动态索引必须验证实际分支。",
|
||||||
"reviewStatus": "source-reviewed",
|
"reviewStatus": "source-reviewed",
|
||||||
"decision": "新增空态/条件分支已用真实模板包预览矩阵验证:清空 offerings、trustItems 和 inquiryForms 后显示可操作空态;预览请求失败与重试分支同测试覆盖。",
|
"decision": "key 只来自 pickup/delivery 固定 allow-list,分别读取 pickupTitle 与 deliveryTitle;两个字段均由 manifest 的 coverage 配置声明,不接受任意索引。",
|
||||||
"evidence": [
|
"evidence": [
|
||||||
|
"packages/template-acheng-campus-food/taro/index.tsx",
|
||||||
"apps/taro/test/browser/template-preview-media.spec.ts",
|
"apps/taro/test/browser/template-preview-media.spec.ts",
|
||||||
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log"
|
||||||
".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1762,11 +1762,11 @@
|
|||||||
"line": 30,
|
"line": 30,
|
||||||
"message": "条件显示需验证全部分支与空数据入口。",
|
"message": "条件显示需验证全部分支与空数据入口。",
|
||||||
"reviewStatus": "source-reviewed",
|
"reviewStatus": "source-reviewed",
|
||||||
"decision": "新增空态/条件分支已用真实模板包预览矩阵验证:清空 offerings、trustItems 和 inquiryForms 后显示可操作空态;预览请求失败与重试分支同测试覆盖。",
|
"decision": "头像存在时渲染图片,缺失时渲染首字母 monogram;完整预览与清空品牌字段预览均覆盖。",
|
||||||
"evidence": [
|
"evidence": [
|
||||||
|
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||||
"apps/taro/test/browser/template-preview-media.spec.ts",
|
"apps/taro/test/browser/template-preview-media.spec.ts",
|
||||||
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log"
|
||||||
".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1780,11 +1780,11 @@
|
|||||||
"line": 33,
|
"line": 33,
|
||||||
"message": "需要核对循环项或间接映射,不能视为已覆盖。",
|
"message": "需要核对循环项或间接映射,不能视为已覆盖。",
|
||||||
"reviewStatus": "source-reviewed",
|
"reviewStatus": "source-reviewed",
|
||||||
"decision": "新增空态/条件分支已用真实模板包预览矩阵验证:清空 offerings、trustItems 和 inquiryForms 后显示可操作空态;预览请求失败与重试分支同测试覆盖。",
|
"decision": "founder 缺失时显式回退为 “·”,再取首字符;空身份预览不会崩溃并保留可编辑入口。",
|
||||||
"evidence": [
|
"evidence": [
|
||||||
|
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||||
"apps/taro/test/browser/template-preview-media.spec.ts",
|
"apps/taro/test/browser/template-preview-media.spec.ts",
|
||||||
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log"
|
||||||
".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1798,11 +1798,11 @@
|
|||||||
"line": 38,
|
"line": 38,
|
||||||
"message": "需要核对循环项或间接映射,不能视为已覆盖。",
|
"message": "需要核对循环项或间接映射,不能视为已覆盖。",
|
||||||
"reviewStatus": "source-reviewed",
|
"reviewStatus": "source-reviewed",
|
||||||
"decision": "新增空态/条件分支已用真实模板包预览矩阵验证:清空 offerings、trustItems 和 inquiryForms 后显示可操作空态;预览请求失败与重试分支同测试覆盖。",
|
"decision": "title 与 experience 为空时由 filter(Boolean) 移除,join 只保留存在值;完整与空身份分支均已核对。",
|
||||||
"evidence": [
|
"evidence": [
|
||||||
|
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||||
"apps/taro/test/browser/template-preview-media.spec.ts",
|
"apps/taro/test/browser/template-preview-media.spec.ts",
|
||||||
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log"
|
||||||
".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1816,11 +1816,11 @@
|
|||||||
"line": 38,
|
"line": 38,
|
||||||
"message": "需要核对循环项或间接映射,不能视为已覆盖。",
|
"message": "需要核对循环项或间接映射,不能视为已覆盖。",
|
||||||
"reviewStatus": "source-reviewed",
|
"reviewStatus": "source-reviewed",
|
||||||
"decision": "新增空态/条件分支已用真实模板包预览矩阵验证:清空 offerings、trustItems 和 inquiryForms 后显示可操作空态;预览请求失败与重试分支同测试覆盖。",
|
"decision": "同一条表达式先过滤空值再拼接,空值不会产生多余分隔符;对应字段在 manifest 身份区域声明。",
|
||||||
"evidence": [
|
"evidence": [
|
||||||
|
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||||
"apps/taro/test/browser/template-preview-media.spec.ts",
|
"apps/taro/test/browser/template-preview-media.spec.ts",
|
||||||
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log"
|
||||||
".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1832,11 +1832,11 @@
|
|||||||
"line": 41,
|
"line": 41,
|
||||||
"message": "条件显示需验证全部分支与空数据入口。",
|
"message": "条件显示需验证全部分支与空数据入口。",
|
||||||
"reviewStatus": "source-reviewed",
|
"reviewStatus": "source-reviewed",
|
||||||
"decision": "新增空态/条件分支已用真实模板包预览矩阵验证:清空 offerings、trustItems 和 inquiryForms 后显示可操作空态;预览请求失败与重试分支同测试覆盖。",
|
"decision": "founderStatus 存在才渲染状态标签;缺失时仅渲染 identity.tags 列表,不影响区域选择。",
|
||||||
"evidence": [
|
"evidence": [
|
||||||
|
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||||
"apps/taro/test/browser/template-preview-media.spec.ts",
|
"apps/taro/test/browser/template-preview-media.spec.ts",
|
||||||
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log"
|
||||||
".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1847,11 +1847,11 @@
|
|||||||
"line": 91,
|
"line": 91,
|
||||||
"message": "条件显示需验证全部分支与空数据入口。",
|
"message": "条件显示需验证全部分支与空数据入口。",
|
||||||
"reviewStatus": "source-reviewed",
|
"reviewStatus": "source-reviewed",
|
||||||
"decision": "新增空态/条件分支已用真实模板包预览矩阵验证:清空 offerings、trustItems 和 inquiryForms 后显示可操作空态;预览请求失败与重试分支同测试覆盖。",
|
"decision": "offerings 非空渲染案例卡片,空数组渲染可操作空态;完整与空业务记录截图均已保留。",
|
||||||
"evidence": [
|
"evidence": [
|
||||||
|
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||||
"apps/taro/test/browser/template-preview-media.spec.ts",
|
"apps/taro/test/browser/template-preview-media.spec.ts",
|
||||||
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log"
|
||||||
".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1865,11 +1865,11 @@
|
|||||||
"line": 340,
|
"line": 340,
|
||||||
"message": "需要核对循环项或间接映射,不能视为已覆盖。",
|
"message": "需要核对循环项或间接映射,不能视为已覆盖。",
|
||||||
"reviewStatus": "source-reviewed",
|
"reviewStatus": "source-reviewed",
|
||||||
"decision": "新增空态/条件分支已用真实模板包预览矩阵验证:清空 offerings、trustItems 和 inquiryForms 后显示可操作空态;预览请求失败与重试分支同测试覆盖。",
|
"decision": "category、area、series 均来自 offering 投影;空值被 filter(Boolean) 移除,存在值渲染为标签。",
|
||||||
"evidence": [
|
"evidence": [
|
||||||
|
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||||
"apps/taro/test/browser/template-preview-media.spec.ts",
|
"apps/taro/test/browser/template-preview-media.spec.ts",
|
||||||
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log"
|
||||||
".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1881,11 +1881,11 @@
|
|||||||
"line": 104,
|
"line": 104,
|
||||||
"message": "条件显示需验证全部分支与空数据入口。",
|
"message": "条件显示需验证全部分支与空数据入口。",
|
||||||
"reviewStatus": "source-reviewed",
|
"reviewStatus": "source-reviewed",
|
||||||
"decision": "新增空态/条件分支已用真实模板包预览矩阵验证:清空 offerings、trustItems 和 inquiryForms 后显示可操作空态;预览请求失败与重试分支同测试覆盖。",
|
"decision": "首页作品列表非空渲染 work-card,空数组渲染“作品与服务正在整理中”空态;完整与空态截图均已保留。",
|
||||||
"evidence": [
|
"evidence": [
|
||||||
|
"packages/template-linjing-editorial/taro/index.tsx",
|
||||||
"apps/taro/test/browser/template-preview-media.spec.ts",
|
"apps/taro/test/browser/template-preview-media.spec.ts",
|
||||||
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log",
|
".codex-tasks/template-audit-execution/raw/evidence-2026-10-18/template-preview-media.log"
|
||||||
".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-18"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 95 KiB |
@@ -24,6 +24,7 @@ jobs:
|
|||||||
cache: pnpm
|
cache: pnpm
|
||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
- run: pnpm check
|
- run: pnpm check
|
||||||
|
- run: pnpm audit --prod --registry=https://registry.npmjs.org
|
||||||
- run: pnpm validate:templates
|
- run: pnpm validate:templates
|
||||||
- run: pnpm template:compatibility
|
- run: pnpm template:compatibility
|
||||||
- run: pnpm --filter @personal-brand/api exec tsx --test test/template-preview-matrix.test.ts
|
- run: pnpm --filter @personal-brand/api exec tsx --test test/template-preview-matrix.test.ts
|
||||||
@@ -44,7 +45,9 @@ jobs:
|
|||||||
node-version: 24
|
node-version: 24
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
|
- run: pnpm build
|
||||||
- run: pnpm build:admin:preview
|
- run: pnpm build:admin:preview
|
||||||
|
- run: pnpm validate:template-release
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: admin-dist
|
name: admin-dist
|
||||||
@@ -83,10 +86,34 @@ jobs:
|
|||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
- run: pnpm --filter @personal-brand/api test:integration
|
- run: pnpm --filter @personal-brand/api test:integration
|
||||||
|
|
||||||
|
taro:
|
||||||
|
name: Taro builds
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [static]
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
template: [acheng-campus-food, atelier-solopreneur, linjing-editorial]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9.15.0
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 24
|
||||||
|
cache: pnpm
|
||||||
|
- run: pnpm install --frozen-lockfile
|
||||||
|
- run: pnpm --filter @personal-brand/taro build:h5
|
||||||
|
env:
|
||||||
|
TEMPLATE_KEY: ${{ matrix.template }}
|
||||||
|
- run: pnpm --filter @personal-brand/taro build:weapp
|
||||||
|
env:
|
||||||
|
TEMPLATE_KEY: ${{ matrix.template }}
|
||||||
|
|
||||||
browser:
|
browser:
|
||||||
name: Browser regression
|
name: Browser regression
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build]
|
needs: [build, taro]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v4
|
||||||
@@ -105,6 +132,8 @@ jobs:
|
|||||||
run: pnpm --filter @personal-brand/api start > /tmp/api.log 2>&1 &
|
run: pnpm --filter @personal-brand/api start > /tmp/api.log 2>&1 &
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/personal_brand
|
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/personal_brand
|
||||||
|
DEFAULT_BRAND_ID: 00000000-0000-0000-0000-000000000001
|
||||||
|
SESSION_SECRET: browser-ci-session-secret-0123456789abcdef
|
||||||
NODE_ENV: development
|
NODE_ENV: development
|
||||||
- name: Start mini program preview
|
- name: Start mini program preview
|
||||||
run: pnpm --filter @personal-brand/taro dev:h5 > /tmp/taro.log 2>&1 &
|
run: pnpm --filter @personal-brand/taro dev:h5 > /tmp/taro.log 2>&1 &
|
||||||
|
|||||||
@@ -16,8 +16,9 @@
|
|||||||
- `atelier-solopreneur@1.3.2`
|
- `atelier-solopreneur@1.3.2`
|
||||||
- `linjing-editorial@1.0.6`
|
- `linjing-editorial@1.0.6`
|
||||||
- Taro Runtime、Admin 组件预览、真实 manifest 驱动编辑、草稿/发布隔离。
|
- Taro Runtime、Admin 组件预览、真实 manifest 驱动编辑、草稿/发布隔离。
|
||||||
|
- 依赖 override 的运行时兼容性通过 `miniprogram-ci` / Jimp / image-size / uuid smoke test 守卫。
|
||||||
- 小程序构建、上传任务状态机、attempt lease 和失败记录。
|
- 小程序构建、上传任务状态机、attempt lease 和失败记录。
|
||||||
- Admin token version:修改密码后旧 token 立即失效;无 membership 的账号不会自动获得 owner 权限。
|
- Admin/Customer token version:修改 admin 密码或调用 logout 后旧 token 立即失效;无 membership 的账号不会自动获得 owner 权限。
|
||||||
- `visualPresentation` 已进入唯一 `template.json` 契约,旧手写 visual manifest 优先路径已删除。
|
- `visualPresentation` 已进入唯一 `template.json` 契约,旧手写 visual manifest 优先路径已删除。
|
||||||
|
|
||||||
## 完成证据
|
## 完成证据
|
||||||
@@ -43,6 +44,7 @@ unresolvedIssues=0
|
|||||||
- `pnpm validate:template-release`
|
- `pnpm validate:template-release`
|
||||||
- `pnpm --filter @personal-brand/api test`
|
- `pnpm --filter @personal-brand/api test`
|
||||||
- `pnpm --filter @personal-brand/api test:integration`
|
- `pnpm --filter @personal-brand/api test:integration`
|
||||||
|
- `miniprogram-ci` override 兼容 smoke test
|
||||||
- `pnpm test:api-client`
|
- `pnpm test:api-client`
|
||||||
- `pnpm build`
|
- `pnpm build`
|
||||||
- `pnpm template:doctor`
|
- `pnpm template:doctor`
|
||||||
@@ -71,4 +73,5 @@ unresolvedIssues=0
|
|||||||
## 未决事项
|
## 未决事项
|
||||||
|
|
||||||
- 生产发布仍需按 `docs/deployment.md` 配置真实环境变量并执行部署后健康检查。
|
- 生产发布仍需按 `docs/deployment.md` 配置真实环境变量并执行部署后健康检查。
|
||||||
- `miniprogram-ci` 上游发布修复版本后,需要移除对应的 audit ignore 与安全风险登记。
|
- `miniprogram-ci` 上游发布修复版本后,需要移除对应的 audit ignore、风险登记和本地 patch。
|
||||||
|
- CI 已加入 audit 和三套模板矩阵构建;后续可继续拆分更细粒度的 smoke/visual matrix。
|
||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
import { createApiClient } from "../lib/api.js";
|
import { createApiClient } from "../lib/api.js";
|
||||||
|
import { saveAdminSession } from "../lib/auth-storage.js";
|
||||||
import { BrandMark } from "../components/BrandMark.js";
|
import { BrandMark } from "../components/BrandMark.js";
|
||||||
import { StatusTag } from "../components/StatusTag.js";
|
import { StatusTag } from "../components/StatusTag.js";
|
||||||
import {
|
import {
|
||||||
@@ -43,7 +44,7 @@ export function Dashboard({
|
|||||||
}: {
|
}: {
|
||||||
onLogout: () => void;
|
onLogout: () => void;
|
||||||
role: string;
|
role: string;
|
||||||
platformTemplateRole: string;
|
platformTemplateRole: "none" | "template_admin";
|
||||||
}) {
|
}) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
@@ -58,7 +59,12 @@ export function Dashboard({
|
|||||||
const switchBrand = async (brandId: string) => {
|
const switchBrand = async (brandId: string) => {
|
||||||
try {
|
try {
|
||||||
const result = await createApiClient().switchAdminBrand(brandId);
|
const result = await createApiClient().switchAdminBrand(brandId);
|
||||||
localStorage.setItem("adminToken", result.token);
|
saveAdminSession({
|
||||||
|
token: result.token,
|
||||||
|
role: result.role,
|
||||||
|
platformTemplateRole,
|
||||||
|
mustChangePassword: false,
|
||||||
|
});
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error(error instanceof Error ? error.message : "品牌切换失败");
|
message.error(error instanceof Error ? error.message : "品牌切换失败");
|
||||||
|
|||||||
@@ -3,16 +3,17 @@ import { ChangePassword, Login } from "../features/auth/AuthPages.js";
|
|||||||
import { Dashboard } from "./Dashboard.js";
|
import { Dashboard } from "./Dashboard.js";
|
||||||
import { AdminRouter } from "./AdminRouter.js";
|
import { AdminRouter } from "./AdminRouter.js";
|
||||||
import { adminMessage as message } from "../components/AdminMessage.js";
|
import { adminMessage as message } from "../components/AdminMessage.js";
|
||||||
|
import { createApiClient } from "../lib/api.js";
|
||||||
|
import { clearAdminSession, readAdminSession } from "../lib/auth-storage.js";
|
||||||
|
|
||||||
export function Root() {
|
export function Root() {
|
||||||
const [loggedIn, setLoggedIn] = useState(Boolean(localStorage.getItem("adminToken")));
|
const initialSession = readAdminSession();
|
||||||
const [role, setRole] = useState(localStorage.getItem("adminRole") || "owner");
|
const [loggedIn, setLoggedIn] = useState(initialSession.loggedIn);
|
||||||
|
const [role, setRole] = useState(initialSession.role);
|
||||||
const [platformTemplateRole, setPlatformTemplateRole] = useState(
|
const [platformTemplateRole, setPlatformTemplateRole] = useState(
|
||||||
localStorage.getItem("adminPlatformTemplateRole") || "none",
|
initialSession.platformTemplateRole,
|
||||||
);
|
|
||||||
const [mustChangePassword, setMustChangePassword] = useState(
|
|
||||||
localStorage.getItem("adminMustChangePassword") === "true",
|
|
||||||
);
|
);
|
||||||
|
const [mustChangePassword, setMustChangePassword] = useState(initialSession.mustChangePassword);
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const expire = () => {
|
const expire = () => {
|
||||||
message.warning("登录状态已失效,请重新登录");
|
message.warning("登录状态已失效,请重新登录");
|
||||||
@@ -21,12 +22,13 @@ export function Root() {
|
|||||||
window.addEventListener("admin-auth-expired", expire);
|
window.addEventListener("admin-auth-expired", expire);
|
||||||
return () => window.removeEventListener("admin-auth-expired", expire);
|
return () => window.removeEventListener("admin-auth-expired", expire);
|
||||||
}, []);
|
}, []);
|
||||||
const logout = () => {
|
const logout = async () => {
|
||||||
localStorage.removeItem("adminToken");
|
try {
|
||||||
localStorage.removeItem("adminRole");
|
await createApiClient().logoutAdmin();
|
||||||
localStorage.removeItem("adminPlatformTemplateRole");
|
} finally {
|
||||||
localStorage.removeItem("adminMustChangePassword");
|
clearAdminSession();
|
||||||
setLoggedIn(false);
|
setLoggedIn(false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
if (!loggedIn)
|
if (!loggedIn)
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { CloudUploadOutlined, DeleteOutlined, PictureOutlined } from "@ant-design/icons";
|
import { CloudUploadOutlined, DeleteOutlined, PictureOutlined } from "@ant-design/icons";
|
||||||
import { Alert, Button, Image, Popconfirm, Spin, Upload, message } from "antd";
|
import { Alert, Button, Image, Popconfirm, Spin, Upload, message } from "antd";
|
||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { apiBaseUrl, createApiClient } from "../lib/api.js";
|
import { apiBaseUrl, authenticatedFetch, createApiClient } from "../lib/api.js";
|
||||||
|
import { readAdminToken } from "../lib/auth-storage.js";
|
||||||
|
|
||||||
interface ImageUrlFieldProps {
|
interface ImageUrlFieldProps {
|
||||||
id?: string;
|
id?: string;
|
||||||
@@ -54,13 +55,11 @@ export function ImageUrlField({ id, value, onChange, placeholder, scope }: Image
|
|||||||
const uploadUrl = isLocalUpload
|
const uploadUrl = isLocalUpload
|
||||||
? `${apiBaseUrl.replace(/\/$/, "")}${presign.uploadUrl}`
|
? `${apiBaseUrl.replace(/\/$/, "")}${presign.uploadUrl}`
|
||||||
: presign.uploadUrl;
|
: presign.uploadUrl;
|
||||||
const response = await fetch(uploadUrl, {
|
const response = await authenticatedFetch(uploadUrl, {
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
headers: {
|
headers: {
|
||||||
"content-type": file.type,
|
"content-type": file.type,
|
||||||
...(isLocalUpload
|
...(isLocalUpload ? { authorization: `Bearer ${readAdminToken() ?? ""}` } : {}),
|
||||||
? { authorization: `Bearer ${localStorage.getItem("adminToken") ?? ""}` }
|
|
||||||
: {}),
|
|
||||||
},
|
},
|
||||||
body: file,
|
body: file,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { createApiClient } from "../../lib/api.js";
|
import { createApiClient } from "../../lib/api.js";
|
||||||
|
import { markAdminPasswordChanged, saveAdminSession } from "../../lib/auth-storage.js";
|
||||||
import { BrandMark } from "../../components/BrandMark.js";
|
import { BrandMark } from "../../components/BrandMark.js";
|
||||||
import { adminMessage as message } from "../../components/AdminMessage.js";
|
import { adminMessage as message } from "../../components/AdminMessage.js";
|
||||||
import { AdminButton } from "../../components/AdminButton.js";
|
import { AdminButton } from "../../components/AdminButton.js";
|
||||||
@@ -21,10 +22,7 @@ export function Login({
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const result = await createApiClient().loginAdmin(values.username, values.password);
|
const result = await createApiClient().loginAdmin(values.username, values.password);
|
||||||
localStorage.setItem("adminToken", result.token);
|
saveAdminSession(result);
|
||||||
localStorage.setItem("adminRole", result.role);
|
|
||||||
localStorage.setItem("adminPlatformTemplateRole", result.platformTemplateRole);
|
|
||||||
localStorage.setItem("adminMustChangePassword", String(result.mustChangePassword));
|
|
||||||
onLogin(result);
|
onLogin(result);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error(error instanceof Error ? error.message : "登录失败");
|
message.error(error instanceof Error ? error.message : "登录失败");
|
||||||
@@ -81,7 +79,7 @@ export function ChangePassword({ onComplete }: { onComplete: () => void }) {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
await createApiClient().changeAdminPassword(values.currentPassword, values.newPassword);
|
await createApiClient().changeAdminPassword(values.currentPassword, values.newPassword);
|
||||||
localStorage.setItem("adminMustChangePassword", "false");
|
markAdminPasswordChanged();
|
||||||
message.success("密码已更新");
|
message.success("密码已更新");
|
||||||
onComplete();
|
onComplete();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { ApiClient } from "@personal-brand/api-client";
|
import { ApiClient } from "@personal-brand/api-client";
|
||||||
|
import { clearAdminSession, readAdminToken } from "./auth-storage.js";
|
||||||
|
|
||||||
export const apiBaseUrl = import.meta.env.VITE_API_BASE_URL ?? "/api";
|
export const apiBaseUrl = import.meta.env.VITE_API_BASE_URL ?? "/api";
|
||||||
export async function authenticatedFetch(
|
export async function authenticatedFetch(
|
||||||
@@ -7,13 +8,13 @@ export async function authenticatedFetch(
|
|||||||
): Promise<Response> {
|
): Promise<Response> {
|
||||||
const response = await fetch(input, init);
|
const response = await fetch(input, init);
|
||||||
if (response.status === 401) {
|
if (response.status === 401) {
|
||||||
localStorage.removeItem("adminToken");
|
clearAdminSession();
|
||||||
window.dispatchEvent(new Event("admin-auth-expired"));
|
window.dispatchEvent(new Event("admin-auth-expired"));
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
export function createApiClient(): ApiClient {
|
export function createApiClient(): ApiClient {
|
||||||
const token = localStorage.getItem("adminToken");
|
const token = readAdminToken();
|
||||||
return new ApiClient({
|
return new ApiClient({
|
||||||
baseUrl: apiBaseUrl,
|
baseUrl: apiBaseUrl,
|
||||||
...(token ? { token } : {}),
|
...(token ? { token } : {}),
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
export type StoredAdminSession = {
|
||||||
|
token: string;
|
||||||
|
role: string;
|
||||||
|
platformTemplateRole: "none" | "template_admin";
|
||||||
|
mustChangePassword: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
const tokenKey = "adminToken";
|
||||||
|
const roleKey = "adminRole";
|
||||||
|
const platformRoleKey = "adminPlatformTemplateRole";
|
||||||
|
const mustChangePasswordKey = "adminMustChangePassword";
|
||||||
|
|
||||||
|
export function saveAdminSession(session: StoredAdminSession): void {
|
||||||
|
localStorage.setItem(tokenKey, session.token);
|
||||||
|
localStorage.setItem(roleKey, session.role);
|
||||||
|
localStorage.setItem(platformRoleKey, session.platformTemplateRole);
|
||||||
|
localStorage.setItem(mustChangePasswordKey, String(session.mustChangePassword));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function readAdminToken(): string | null {
|
||||||
|
return localStorage.getItem(tokenKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function readAdminSession(): {
|
||||||
|
loggedIn: boolean;
|
||||||
|
role: string;
|
||||||
|
platformTemplateRole: "none" | "template_admin";
|
||||||
|
mustChangePassword: boolean;
|
||||||
|
} {
|
||||||
|
return {
|
||||||
|
loggedIn: Boolean(localStorage.getItem(tokenKey)),
|
||||||
|
role: localStorage.getItem(roleKey) || "owner",
|
||||||
|
platformTemplateRole:
|
||||||
|
localStorage.getItem(platformRoleKey) === "template_admin" ? "template_admin" : "none",
|
||||||
|
mustChangePassword: localStorage.getItem(mustChangePasswordKey) === "true",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function markAdminPasswordChanged(): void {
|
||||||
|
localStorage.setItem(mustChangePasswordKey, "false");
|
||||||
|
}
|
||||||
|
|
||||||
|
export function clearAdminSession(): void {
|
||||||
|
localStorage.removeItem(tokenKey);
|
||||||
|
localStorage.removeItem(roleKey);
|
||||||
|
localStorage.removeItem(platformRoleKey);
|
||||||
|
localStorage.removeItem(mustChangePasswordKey);
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- 客户 token 版本用于登出后撤销既有登录态。
|
||||||
|
ALTER TABLE "CustomerUser" ADD COLUMN "tokenVersion" INTEGER NOT NULL DEFAULT 0;
|
||||||
@@ -365,6 +365,7 @@ model CustomerUser {
|
|||||||
brandId String
|
brandId String
|
||||||
brand BrandProfile @relation(fields: [brandId], references: [id])
|
brand BrandProfile @relation(fields: [brandId], references: [id])
|
||||||
openid String
|
openid String
|
||||||
|
tokenVersion Int @default(0)
|
||||||
lastLoginAt DateTime @default(now())
|
lastLoginAt DateTime @default(now())
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|||||||
@@ -44,6 +44,15 @@ export class AdminAuthService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async logout(userId: string): Promise<void> {
|
||||||
|
const user = await this.prisma.adminUser.findUnique({ where: { id: userId } });
|
||||||
|
if (!user?.isEnabled) throw new UnauthorizedException("管理员登录态无效或已过期");
|
||||||
|
await this.prisma.adminUser.update({
|
||||||
|
where: { id: userId },
|
||||||
|
data: { tokenVersion: { increment: 1 } },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async changePassword(
|
async changePassword(
|
||||||
userId: string,
|
userId: string,
|
||||||
currentPassword: string,
|
currentPassword: string,
|
||||||
|
|||||||
@@ -22,7 +22,12 @@ export class AdminMembershipGuard implements CanActivate {
|
|||||||
if (routePath === "admin/session/login") return Promise.resolve(true);
|
if (routePath === "admin/session/login") return Promise.resolve(true);
|
||||||
if (routePath === "admin/session/change-password") return Promise.resolve(true);
|
if (routePath === "admin/session/change-password") return Promise.resolve(true);
|
||||||
if (!routePath.startsWith("admin/")) return Promise.resolve(true);
|
if (!routePath.startsWith("admin/")) return Promise.resolve(true);
|
||||||
if (routePath === "admin/templates" || routePath.startsWith("admin/templates/")) {
|
if (
|
||||||
|
routePath === "admin/templates" ||
|
||||||
|
routePath.startsWith("admin/templates/") ||
|
||||||
|
routePath === "admin/template-operations" ||
|
||||||
|
routePath.startsWith("admin/template-operations/")
|
||||||
|
) {
|
||||||
return this.access.requireTemplateAdmin(request).then(() => true);
|
return this.access.requireTemplateAdmin(request).then(() => true);
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ export interface CreateBookingInput {
|
|||||||
items?: Array<{ offeringId: string; quantity: number }>;
|
items?: Array<{ offeringId: string; quantity: number }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CustomerIdentity = { brandId: string; openid: string };
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BookingService {
|
export class BookingService {
|
||||||
constructor(
|
constructor(
|
||||||
@@ -31,15 +29,6 @@ export class BookingService {
|
|||||||
private readonly releases: BrandReleaseService,
|
private readonly releases: BrandReleaseService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async requireCustomer(identity: CustomerIdentity): Promise<string> {
|
|
||||||
const customer = await this.prisma.customerUser.findUnique({
|
|
||||||
where: { brandId_openid: identity },
|
|
||||||
select: { id: true },
|
|
||||||
});
|
|
||||||
if (!customer) throw new BadRequestException("请先完成微信登录");
|
|
||||||
return customer.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
async create(brandId: string, customerUserId: string, input: CreateBookingInput) {
|
async create(brandId: string, customerUserId: string, input: CreateBookingInput) {
|
||||||
const snapshot = await this.releases.getPublishedSnapshot(brandId);
|
const snapshot = await this.releases.getPublishedSnapshot(brandId);
|
||||||
if (!snapshot) throw new BadRequestException("品牌尚未发布");
|
if (!snapshot) throw new BadRequestException("品牌尚未发布");
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import { ForbiddenException, Injectable, UnauthorizedException } from "@nestjs/common";
|
||||||
|
import type { FastifyRequest } from "fastify";
|
||||||
|
import { PrismaService } from "../../prisma.service.js";
|
||||||
|
import { readIdentity } from "../../auth.js";
|
||||||
|
|
||||||
|
export type CustomerIdentity = {
|
||||||
|
brandId: string;
|
||||||
|
openid: string;
|
||||||
|
customerUserId: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class CustomerAccessService {
|
||||||
|
constructor(private readonly prisma: PrismaService) {}
|
||||||
|
|
||||||
|
async require(request: FastifyRequest): Promise<CustomerIdentity> {
|
||||||
|
const token = request.headers.authorization?.replace(/^Bearer\s+/i, "");
|
||||||
|
if (!token) throw new UnauthorizedException("缺少客户登录态");
|
||||||
|
let identity;
|
||||||
|
try {
|
||||||
|
identity = readIdentity(token);
|
||||||
|
} catch {
|
||||||
|
throw new UnauthorizedException("客户登录态无效或已过期");
|
||||||
|
}
|
||||||
|
if (identity.role !== "customer") throw new ForbiddenException("客户登录态无效或已过期");
|
||||||
|
const customer = await this.prisma.customerUser.findUnique({
|
||||||
|
where: { brandId_openid: { brandId: identity.brandId, openid: identity.subject } },
|
||||||
|
select: { id: true, tokenVersion: true },
|
||||||
|
});
|
||||||
|
if (!customer || identity.tokenVersion !== customer.tokenVersion)
|
||||||
|
throw new UnauthorizedException("客户登录态无效或已过期");
|
||||||
|
return {
|
||||||
|
brandId: identity.brandId,
|
||||||
|
openid: identity.subject,
|
||||||
|
customerUserId: customer.id,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async logout(request: FastifyRequest): Promise<void> {
|
||||||
|
const identity = await this.require(request);
|
||||||
|
await this.prisma.customerUser.update({
|
||||||
|
where: { id: identity.customerUserId },
|
||||||
|
data: { tokenVersion: { increment: 1 } },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +1,21 @@
|
|||||||
import { BadRequestException, Body, Controller, Get, Param, Post, Req } from "@nestjs/common";
|
import { Body, Controller, Get, Param, Post, Req } from "@nestjs/common";
|
||||||
import type { FastifyRequest } from "fastify";
|
import type { FastifyRequest } from "fastify";
|
||||||
import { Prisma } from "@prisma/client";
|
import { Prisma } from "@prisma/client";
|
||||||
import { BookingService } from "../../booking.service.js";
|
import { BookingService } from "../../booking.service.js";
|
||||||
import { CreateBookingDto } from "../../booking.dto.js";
|
import { CreateBookingDto } from "../../booking.dto.js";
|
||||||
import { readIdentity } from "../../auth.js";
|
import { CustomerAccessService } from "./customer-access.service.js";
|
||||||
|
|
||||||
@Controller("customer/bookings")
|
@Controller("customer/bookings")
|
||||||
export class CustomerBookingController {
|
export class CustomerBookingController {
|
||||||
constructor(private readonly bookings: BookingService) {}
|
constructor(
|
||||||
|
private readonly bookings: BookingService,
|
||||||
|
private readonly access: CustomerAccessService,
|
||||||
|
) {}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
async create(@Req() request: FastifyRequest, @Body() body: CreateBookingDto): Promise<unknown> {
|
async create(@Req() request: FastifyRequest, @Body() body: CreateBookingDto): Promise<unknown> {
|
||||||
const identity = this.identity(request);
|
const identity = await this.identity(request);
|
||||||
const customerId = await this.bookings.requireCustomer(identity);
|
const customerId = identity.customerUserId;
|
||||||
return this.bookings.create(identity.brandId, customerId, {
|
return this.bookings.create(identity.brandId, customerId, {
|
||||||
...body,
|
...body,
|
||||||
extraData: body.extraData as Prisma.InputJsonObject,
|
extraData: body.extraData as Prisma.InputJsonObject,
|
||||||
@@ -21,28 +24,19 @@ export class CustomerBookingController {
|
|||||||
|
|
||||||
@Get()
|
@Get()
|
||||||
async list(@Req() request: FastifyRequest): Promise<unknown> {
|
async list(@Req() request: FastifyRequest): Promise<unknown> {
|
||||||
const identity = this.identity(request);
|
const identity = await this.identity(request);
|
||||||
const customerId = await this.bookings.requireCustomer(identity);
|
const customerId = identity.customerUserId;
|
||||||
return this.bookings.listForCustomer(identity.brandId, customerId);
|
return this.bookings.listForCustomer(identity.brandId, customerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post(":id/cancel")
|
@Post(":id/cancel")
|
||||||
async cancel(@Req() request: FastifyRequest, @Param("id") id: string): Promise<unknown> {
|
async cancel(@Req() request: FastifyRequest, @Param("id") id: string): Promise<unknown> {
|
||||||
const identity = this.identity(request);
|
const identity = await this.identity(request);
|
||||||
const customerId = await this.bookings.requireCustomer(identity);
|
const customerId = identity.customerUserId;
|
||||||
return this.bookings.cancelForCustomer(identity.brandId, customerId, id);
|
return this.bookings.cancelForCustomer(identity.brandId, customerId, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private identity(request: FastifyRequest): { brandId: string; openid: string } {
|
private identity(request: FastifyRequest) {
|
||||||
const token = request.headers.authorization?.replace(/^Bearer\s+/i, "");
|
return this.access.require(request);
|
||||||
if (!token) throw new BadRequestException("缺少客户登录态");
|
|
||||||
try {
|
|
||||||
const identity = readIdentity(token);
|
|
||||||
if (identity.role !== "customer") throw new BadRequestException("客户登录态无效");
|
|
||||||
return { brandId: identity.brandId, openid: identity.subject };
|
|
||||||
} catch (error) {
|
|
||||||
if (error instanceof BadRequestException) throw error;
|
|
||||||
throw new BadRequestException("客户登录态无效");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,15 @@
|
|||||||
import {
|
import { Body, Controller, Get, Param, Post, Req } from "@nestjs/common";
|
||||||
Body,
|
|
||||||
Controller,
|
|
||||||
ForbiddenException,
|
|
||||||
Get,
|
|
||||||
Param,
|
|
||||||
Post,
|
|
||||||
Req,
|
|
||||||
UnauthorizedException,
|
|
||||||
} from "@nestjs/common";
|
|
||||||
import type { FastifyRequest } from "fastify";
|
import type { FastifyRequest } from "fastify";
|
||||||
import { readIdentity } from "../../auth.js";
|
import { CustomerAccessService } from "./customer-access.service.js";
|
||||||
import { CreateInquirySubmissionDto } from "../../booking.dto.js";
|
import { CreateInquirySubmissionDto } from "../../booking.dto.js";
|
||||||
import { CustomerInquirySubmissionService } from "./customer-inquiry-submission.service.js";
|
import { CustomerInquirySubmissionService } from "./customer-inquiry-submission.service.js";
|
||||||
|
|
||||||
@Controller("customer/inquiry-submissions")
|
@Controller("customer/inquiry-submissions")
|
||||||
export class CustomerInquirySubmissionController {
|
export class CustomerInquirySubmissionController {
|
||||||
constructor(private readonly submissions: CustomerInquirySubmissionService) {}
|
constructor(
|
||||||
|
private readonly submissions: CustomerInquirySubmissionService,
|
||||||
|
private readonly access: CustomerAccessService,
|
||||||
|
) {}
|
||||||
private present<T extends { customerSubject: string; adminNote?: string | null }>(submission: T) {
|
private present<T extends { customerSubject: string; adminNote?: string | null }>(submission: T) {
|
||||||
const {
|
const {
|
||||||
customerSubject: _customerSubject,
|
customerSubject: _customerSubject,
|
||||||
@@ -26,34 +20,21 @@ export class CustomerInquirySubmissionController {
|
|||||||
void _adminNote;
|
void _adminNote;
|
||||||
return publicSubmission;
|
return publicSubmission;
|
||||||
}
|
}
|
||||||
private identity(request: FastifyRequest): ReturnType<typeof readIdentity> {
|
private identity(request: FastifyRequest) {
|
||||||
const token = request.headers.authorization?.replace(/^Bearer\s+/i, "");
|
return this.access.require(request);
|
||||||
if (!token) throw new UnauthorizedException("缺少客户登录态");
|
|
||||||
try {
|
|
||||||
const identity = readIdentity(token);
|
|
||||||
if (identity.role !== "customer") throw new ForbiddenException("无客户权限");
|
|
||||||
return identity;
|
|
||||||
} catch (error) {
|
|
||||||
if (error instanceof ForbiddenException) throw error;
|
|
||||||
throw new UnauthorizedException("客户登录态无效或已过期");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get()
|
@Get()
|
||||||
async list(@Req() request: FastifyRequest): Promise<unknown> {
|
async list(@Req() request: FastifyRequest): Promise<unknown> {
|
||||||
const identity = this.identity(request);
|
const identity = await this.identity(request);
|
||||||
const submissions = await this.submissions.listForCustomer(identity.brandId, identity.subject);
|
const submissions = await this.submissions.listForCustomer(identity.brandId, identity.openid);
|
||||||
return submissions.map((submission) => this.present(submission));
|
return submissions.map((submission) => this.present(submission));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get(":id")
|
@Get(":id")
|
||||||
async get(@Req() request: FastifyRequest, @Param("id") id: string): Promise<unknown> {
|
async get(@Req() request: FastifyRequest, @Param("id") id: string): Promise<unknown> {
|
||||||
const identity = this.identity(request);
|
const identity = await this.identity(request);
|
||||||
const submission = await this.submissions.getForCustomer(
|
const submission = await this.submissions.getForCustomer(identity.brandId, identity.openid, id);
|
||||||
identity.brandId,
|
|
||||||
identity.subject,
|
|
||||||
id,
|
|
||||||
);
|
|
||||||
return this.present(submission);
|
return this.present(submission);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,8 +43,8 @@ export class CustomerInquirySubmissionController {
|
|||||||
@Req() request: FastifyRequest,
|
@Req() request: FastifyRequest,
|
||||||
@Body() body: CreateInquirySubmissionDto,
|
@Body() body: CreateInquirySubmissionDto,
|
||||||
): Promise<unknown> {
|
): Promise<unknown> {
|
||||||
const identity = this.identity(request);
|
const identity = await this.identity(request);
|
||||||
const submission = await this.submissions.create(identity.brandId, identity.subject, body);
|
const submission = await this.submissions.create(identity.brandId, identity.openid, body);
|
||||||
return this.present(submission);
|
return this.present(submission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { Controller, Post, Req } from "@nestjs/common";
|
||||||
|
import type { FastifyRequest } from "fastify";
|
||||||
|
import { CustomerAccessService } from "./customer-access.service.js";
|
||||||
|
|
||||||
|
@Controller("customer/session")
|
||||||
|
export class CustomerSessionController {
|
||||||
|
constructor(private readonly access: CustomerAccessService) {}
|
||||||
|
|
||||||
|
@Post("logout")
|
||||||
|
async logout(@Req() request: FastifyRequest): Promise<{ loggedOut: true }> {
|
||||||
|
await this.access.logout(request);
|
||||||
|
return { loggedOut: true };
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,10 +5,16 @@ import { PublicModule } from "../public/public.module.js";
|
|||||||
import { CustomerBookingController } from "./customer-booking.controller.js";
|
import { CustomerBookingController } from "./customer-booking.controller.js";
|
||||||
import { CustomerInquirySubmissionController } from "./customer-inquiry-submission.controller.js";
|
import { CustomerInquirySubmissionController } from "./customer-inquiry-submission.controller.js";
|
||||||
import { CustomerInquirySubmissionService } from "./customer-inquiry-submission.service.js";
|
import { CustomerInquirySubmissionService } from "./customer-inquiry-submission.service.js";
|
||||||
|
import { CustomerAccessService } from "./customer-access.service.js";
|
||||||
|
import { CustomerSessionController } from "./customer-session.controller.js";
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [InfrastructureModule, PublicModule, BookingModule],
|
imports: [InfrastructureModule, PublicModule, BookingModule],
|
||||||
controllers: [CustomerInquirySubmissionController, CustomerBookingController],
|
controllers: [
|
||||||
providers: [CustomerInquirySubmissionService],
|
CustomerInquirySubmissionController,
|
||||||
|
CustomerBookingController,
|
||||||
|
CustomerSessionController,
|
||||||
|
],
|
||||||
|
providers: [CustomerInquirySubmissionService, CustomerAccessService],
|
||||||
})
|
})
|
||||||
export class CustomerModule {}
|
export class CustomerModule {}
|
||||||
@@ -18,13 +18,18 @@ export class CustomerSessionService {
|
|||||||
select: { id: true },
|
select: { id: true },
|
||||||
});
|
});
|
||||||
if (!brand) throw new BadRequestException("品牌尚未初始化");
|
if (!brand) throw new BadRequestException("品牌尚未初始化");
|
||||||
await this.prisma.customerUser.upsert({
|
const customer = await this.prisma.customerUser.upsert({
|
||||||
where: { brandId_openid: { brandId: brand.id, openid: session.openid } },
|
where: { brandId_openid: { brandId: brand.id, openid: session.openid } },
|
||||||
update: { lastLoginAt: new Date() },
|
update: { lastLoginAt: new Date() },
|
||||||
create: { brandId: brand.id, openid: session.openid },
|
create: { brandId: brand.id, openid: session.openid },
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
token: signIdentity({ subject: session.openid, brandId: brand.id, role: "customer" }),
|
token: signIdentity({
|
||||||
|
subject: session.openid,
|
||||||
|
brandId: brand.id,
|
||||||
|
role: "customer",
|
||||||
|
tokenVersion: customer.tokenVersion,
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,6 +39,16 @@ export class AdminSessionController {
|
|||||||
return this.auth.login(body.username, body.password);
|
return this.auth.login(body.username, body.password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post("logout")
|
||||||
|
async logout(@Req() request: FastifyRequest): Promise<{ loggedOut: true }> {
|
||||||
|
const token = request.headers.authorization?.replace(/^Bearer\s+/i, "");
|
||||||
|
if (!token) throw new UnauthorizedException("缺少管理员登录态");
|
||||||
|
const identity = readIdentity(token);
|
||||||
|
if (identity.role !== "admin") throw new UnauthorizedException("管理员登录态无效");
|
||||||
|
await this.auth.logout(identity.subject);
|
||||||
|
return { loggedOut: true };
|
||||||
|
}
|
||||||
|
|
||||||
@Post("change-password")
|
@Post("change-password")
|
||||||
async changePassword(
|
async changePassword(
|
||||||
@Req() request: FastifyRequest,
|
@Req() request: FastifyRequest,
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export class TenantController {
|
|||||||
async switchBrand(
|
async switchBrand(
|
||||||
@Req() request: FastifyRequest,
|
@Req() request: FastifyRequest,
|
||||||
@Param("brandId") brandId: string,
|
@Param("brandId") brandId: string,
|
||||||
): Promise<{ token: string; brand: unknown }> {
|
): Promise<{ token: string; role: string; brand: unknown }> {
|
||||||
const identity = this.adminIdentity(request);
|
const identity = this.adminIdentity(request);
|
||||||
return this.tenants.switchBrand(identity, brandId);
|
return this.tenants.switchBrand(identity, brandId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ export class TenantService {
|
|||||||
role: "admin",
|
role: "admin",
|
||||||
tokenVersion: identity.tokenVersion ?? 0,
|
tokenVersion: identity.tokenVersion ?? 0,
|
||||||
}),
|
}),
|
||||||
|
role: membership.role,
|
||||||
brand: membership.brand,
|
brand: membership.brand,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -247,6 +247,30 @@ test("模板失败指标仅平台模板管理员可查,按窗口聚合且不
|
|||||||
await prisma.adminUser.delete({ where: { id: ordinaryUser.id } });
|
await prisma.adminUser.delete({ where: { id: ordinaryUser.id } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const templateAdminWithoutMembership = await prisma.adminUser.create({
|
||||||
|
data: {
|
||||||
|
username: `metrics-platform-${randomUUID()}`,
|
||||||
|
passwordHash: "unused",
|
||||||
|
displayName: "平台模板管理员",
|
||||||
|
platformTemplateRole: "template_admin",
|
||||||
|
mustChangePassword: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
const response = await request("/admin/template-operations/failures", {
|
||||||
|
headers: {
|
||||||
|
authorization: `Bearer ${signIdentity({
|
||||||
|
subject: templateAdminWithoutMembership.id,
|
||||||
|
brandId: "00000000-0000-0000-0000-000000000000",
|
||||||
|
role: "admin",
|
||||||
|
})}`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
assert.equal(response.statusCode, 200, response.body);
|
||||||
|
} finally {
|
||||||
|
await prisma.adminUser.delete({ where: { id: templateAdminWithoutMembership.id } });
|
||||||
|
}
|
||||||
|
|
||||||
const login = await request("/admin/session/login", {
|
const login = await request("/admin/session/login", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD },
|
payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD },
|
||||||
@@ -516,7 +540,10 @@ test("平台模板管理员可以按行业预览版本,且预览不写入品
|
|||||||
/所属行业|must match its key/,
|
/所属行业|must match its key/,
|
||||||
],
|
],
|
||||||
[{ ...stored.manifestSnapshot, requiredCapabilities: ["unknown"] }, /未注册的 capability/],
|
[{ ...stored.manifestSnapshot, requiredCapabilities: ["unknown"] }, /未注册的 capability/],
|
||||||
[{ ...stored.manifestSnapshot, visualTemplateKey: "unknown" }, /元数据/],
|
[
|
||||||
|
{ ...stored.manifestSnapshot, visualTemplateKey: "unknown" },
|
||||||
|
/visualTemplateKey must match packageKey|元数据/,
|
||||||
|
],
|
||||||
[{ ...stored.manifestSnapshot, runtimeContract: "9.0" }, /契约/],
|
[{ ...stored.manifestSnapshot, runtimeContract: "9.0" }, /契约/],
|
||||||
[{ ...stored.manifestSnapshot, dataSlots: [null] }, /契约/],
|
[{ ...stored.manifestSnapshot, dataSlots: [null] }, /契约/],
|
||||||
[{ ...stored.manifestSnapshot, navigation: [null] }, /契约/],
|
[{ ...stored.manifestSnapshot, navigation: [null] }, /契约/],
|
||||||
@@ -3868,6 +3895,54 @@ test("admin login validates credentials", async () => {
|
|||||||
assert.equal(response.statusCode, 401);
|
assert.equal(response.statusCode, 401);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("admin logout revokes the current token", async () => {
|
||||||
|
const username = `logout-admin-${randomUUID()}`;
|
||||||
|
const password = "logout-password-123";
|
||||||
|
const user = await prisma.adminUser.create({
|
||||||
|
data: {
|
||||||
|
username,
|
||||||
|
passwordHash: await bcrypt.hash(password, 12),
|
||||||
|
displayName: "登出测试管理员",
|
||||||
|
mustChangePassword: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
await prisma.brandMembership.create({
|
||||||
|
data: { brandId, adminUserId: user.id, role: "owner", isEnabled: true },
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
const login = await request("/admin/session/login", {
|
||||||
|
method: "POST",
|
||||||
|
payload: { username, password },
|
||||||
|
});
|
||||||
|
assert.equal(login.statusCode, 201, login.body);
|
||||||
|
const token = JSON.parse(login.body).token;
|
||||||
|
const headers = { authorization: `Bearer ${token}` };
|
||||||
|
const before = await request("/admin/bookings/unread-count", { headers });
|
||||||
|
assert.equal(before.statusCode, 200);
|
||||||
|
|
||||||
|
const logout = await request("/admin/session/logout", { method: "POST", headers });
|
||||||
|
assert.equal(logout.statusCode, 201);
|
||||||
|
const after = await request("/admin/bookings/unread-count", { headers });
|
||||||
|
assert.equal(after.statusCode, 401);
|
||||||
|
} finally {
|
||||||
|
await prisma.adminUser.delete({ where: { id: user.id } });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test("customer logout revokes the current token", async () => {
|
||||||
|
const openid = `logout-${randomUUID()}`;
|
||||||
|
await prisma.customerUser.create({ data: { brandId, openid } });
|
||||||
|
const token = signIdentity({ subject: openid, brandId, role: "customer" });
|
||||||
|
const headers = { authorization: `Bearer ${token}` };
|
||||||
|
const before = await request("/customer/inquiry-submissions", { headers });
|
||||||
|
assert.equal(before.statusCode, 200);
|
||||||
|
|
||||||
|
const logout = await request("/customer/session/logout", { method: "POST", headers });
|
||||||
|
assert.equal(logout.statusCode, 201);
|
||||||
|
const after = await request("/customer/inquiry-submissions", { headers });
|
||||||
|
assert.equal(after.statusCode, 401);
|
||||||
|
});
|
||||||
|
|
||||||
test("admin login does not auto-grant ownership to users without memberships", async () => {
|
test("admin login does not auto-grant ownership to users without memberships", async () => {
|
||||||
const username = `no-membership-${Date.now()}`;
|
const username = `no-membership-${Date.now()}`;
|
||||||
const user = await prisma.adminUser.create({
|
const user = await prisma.adminUser.create({
|
||||||
@@ -4287,7 +4362,7 @@ test("admin can manage trust content", async () => {
|
|||||||
|
|
||||||
test("customer booking endpoints require a valid customer session", async () => {
|
test("customer booking endpoints require a valid customer session", async () => {
|
||||||
const missing = await request("/customer/bookings");
|
const missing = await request("/customer/bookings");
|
||||||
assert.equal(missing.statusCode, 400);
|
assert.equal(missing.statusCode, 401);
|
||||||
|
|
||||||
const list = await request("/customer/bookings", {
|
const list = await request("/customer/bookings", {
|
||||||
headers: { authorization: `Bearer ${customerToken}` },
|
headers: { authorization: `Bearer ${customerToken}` },
|
||||||
@@ -4774,6 +4849,9 @@ test("atelier template imports selected package and preserves draft publication
|
|||||||
(await json("/public/workspace?brandSlug=" + slug)).brand.visualPresentation.home.title,
|
(await json("/public/workspace?brandSlug=" + slug)).brand.visualPresentation.home.title,
|
||||||
"仅草稿可见的新标题",
|
"仅草稿可见的新标题",
|
||||||
);
|
);
|
||||||
|
const atelierCustomer = await prisma.customerUser.create({
|
||||||
|
data: { brandId: brand.id, openid: "atelier-test-customer" },
|
||||||
|
});
|
||||||
const customerHeaders = {
|
const customerHeaders = {
|
||||||
authorization: `Bearer ${signIdentity({ subject: "atelier-test-customer", brandId: brand.id, role: "customer" })}`,
|
authorization: `Bearer ${signIdentity({ subject: "atelier-test-customer", brandId: brand.id, role: "customer" })}`,
|
||||||
};
|
};
|
||||||
@@ -4819,6 +4897,7 @@ test("atelier template imports selected package and preserves draft publication
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
await prisma.customerUser.deleteMany({ where: { brandId: brand.id } });
|
||||||
await prisma.brandProfile.delete({ where: { id: brand.id } });
|
await prisma.brandProfile.delete({ where: { id: brand.id } });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
import { createRequire } from "node:module";
|
||||||
|
import test from "node:test";
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
|
const png = Buffer.from(
|
||||||
|
"89504e470d0a1a0a0000000d4948445200000001000000010802000000907753de0000000c49444154789c63f8cfc0000003010100c9fe92ef0000000049454e44ae426082",
|
||||||
|
"hex",
|
||||||
|
);
|
||||||
|
|
||||||
|
test("miniprogram-ci compatibility patches keep overridden runtime APIs usable", async () => {
|
||||||
|
const buildCloud = require(
|
||||||
|
require.resolve("miniprogram-ci/dist/modules/nativecompiler/ios/buildCloud.js"),
|
||||||
|
);
|
||||||
|
assert.equal(typeof buildCloud.default, "object");
|
||||||
|
|
||||||
|
const uuid = require("uuid") as { v4: () => string };
|
||||||
|
assert.match(uuid.v4(), /^[0-9a-f-]{36}$/);
|
||||||
|
|
||||||
|
const imageSize = require("image-size") as {
|
||||||
|
imageSize: (input: Buffer) => { width: number; height: number; type: string };
|
||||||
|
};
|
||||||
|
assert.deepEqual(imageSize.imageSize(png), { width: 1, height: 1, type: "png" });
|
||||||
|
|
||||||
|
const Jimp = require("jimp") as {
|
||||||
|
read: (input: Buffer) => Promise<{ bitmap: { width: number; height: number } }>;
|
||||||
|
};
|
||||||
|
const image = await Jimp.read(png);
|
||||||
|
assert.equal(image.bitmap.width, 1);
|
||||||
|
assert.equal(image.bitmap.height, 1);
|
||||||
|
});
|
||||||
@@ -45,7 +45,7 @@ async function main() {
|
|||||||
.filter((entry) => entry.isDirectory() && entry.name !== targetMigration)
|
.filter((entry) => entry.isDirectory() && entry.name !== targetMigration)
|
||||||
.map((entry) => entry.name)
|
.map((entry) => entry.name)
|
||||||
.sort();
|
.sort();
|
||||||
assert.equal(migrationDirs.at(-1), "20261018170000_add_admin_token_version");
|
assert.equal(migrationDirs.at(-1), "20261018180000_add_customer_token_version");
|
||||||
await admin.$executeRawUnsafe(`CREATE SCHEMA "${schema}"`);
|
await admin.$executeRawUnsafe(`CREATE SCHEMA "${schema}"`);
|
||||||
createdSchema = true;
|
createdSchema = true;
|
||||||
|
|
||||||
|
|||||||
@@ -232,12 +232,17 @@ test("导入包预览矩阵展示身份、资源和完整媒体槽位", async ({
|
|||||||
|
|
||||||
if (evidenceDirectory) {
|
if (evidenceDirectory) {
|
||||||
mkdirSync(evidenceDirectory, { recursive: true });
|
mkdirSync(evidenceDirectory, { recursive: true });
|
||||||
await page.screenshot({
|
// 多屏宽证据:320/375/390 均验证实际渲染,而不是只检查 DOM 存在。
|
||||||
path: path.join(
|
for (const viewportWidth of [320, 375, 390]) {
|
||||||
evidenceDirectory,
|
await page.setViewportSize({ width: viewportWidth, height: 812 });
|
||||||
`${String(sequence).padStart(2, "0")}-${mediaCase.packageKey}-${mediaCase.industry}.png`,
|
await expect(modal.locator(".component-template-preview")).toBeVisible();
|
||||||
),
|
await page.screenshot({
|
||||||
});
|
path: path.join(
|
||||||
|
evidenceDirectory,
|
||||||
|
`${String(sequence).padStart(2, "0")}-${mediaCase.packageKey}-${mediaCase.industry}-${viewportWidth}.png`,
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清空业务记录后重新打开真实包预览,验证空态不是仅在源码中存在。
|
// 清空业务记录后重新打开真实包预览,验证空态不是仅在源码中存在。
|
||||||
@@ -249,6 +254,7 @@ test("导入包预览矩阵展示身份、资源和完整媒体槽位", async ({
|
|||||||
/正在整理中/,
|
/正在整理中/,
|
||||||
);
|
);
|
||||||
if (evidenceDirectory) {
|
if (evidenceDirectory) {
|
||||||
|
await page.setViewportSize({ width: 375, height: 812 });
|
||||||
await page.screenshot({
|
await page.screenshot({
|
||||||
path: path.join(
|
path: path.join(
|
||||||
evidenceDirectory,
|
evidenceDirectory,
|
||||||
|
|||||||
@@ -6,6 +6,14 @@
|
|||||||
|
|
||||||
`pnpm audit --prod --registry=https://registry.npmjs.org` 已从 84 条 advisory 降到 0 条未登记 advisory。可直接修复的传递依赖通过根 `pnpm.overrides` 升级到修复版本;`request` 已替换为维护 fork `@cypress/request@4.0.1`。
|
`pnpm audit --prod --registry=https://registry.npmjs.org` 已从 84 条 advisory 降到 0 条未登记 advisory。可直接修复的传递依赖通过根 `pnpm.overrides` 升级到修复版本;`request` 已替换为维护 fork `@cypress/request@4.0.1`。
|
||||||
|
|
||||||
|
对与 override 存在运行时 API 差异的依赖,使用 `patches/miniprogram-ci@2.1.31.patch` 和 `patches/@jimp/core@0.16.13.patch` 做兼容适配:
|
||||||
|
|
||||||
|
- `uuid/v4` 改为读取 `uuid.v4`;
|
||||||
|
- `miniprogram-ci` 的 `image-size` 读取新的 `imageSize` 命名导出;
|
||||||
|
- `@jimp/core` 改用 `file-type` 的新 `fileTypeFromBuffer` API。
|
||||||
|
|
||||||
|
`apps/api/test/miniprogram-ci-compatibility.test.ts` 会用真实 PNG 覆盖 `miniprogram-ci` 模块加载、`uuid`、`image-size` 和 `Jimp.read`。
|
||||||
|
|
||||||
## 已执行的兼容性验证
|
## 已执行的兼容性验证
|
||||||
|
|
||||||
- `pnpm --filter @personal-brand/api test`
|
- `pnpm --filter @personal-brand/api test`
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ staticStatus 只代表支持范围内的静态检查。completionStatus 保持 u
|
|||||||
|
|
||||||
已逐条完成源码审阅的 review 可登记在 `.codex-tasks/template-audit-execution/raw/manual-review.json`。登记必须使用和诊断报告一致的 `file/page/target/binding/line/message`,并保留结论与证据;doctor 只把精确匹配的 review 标记为 `source-reviewed`,不改变 `completionStatus`。未匹配的新 review 和全部 blocker 仍会让命令失败。
|
已逐条完成源码审阅的 review 可登记在 `.codex-tasks/template-audit-execution/raw/manual-review.json`。登记必须使用和诊断报告一致的 `file/page/target/binding/line/message`,并保留结论与证据;doctor 只把精确匹配的 review 标记为 `source-reviewed`,不改变 `completionStatus`。未匹配的新 review 和全部 blocker 仍会让命令失败。
|
||||||
|
|
||||||
完成证据登记在 `.codex-tasks/template-audit-execution/raw/completion-evidence.json`。每套模板必须提供 `real-manifest-interaction`、`save-reload-publish-isolation`、`visual-reference`、`empty-error-branches` 四类 `passed` 证据;每类证据必须包含实际命令、日志或截图产物及其 SHA-256。doctor 会校验证据覆盖全部模板、产物存在且哈希一致。全部通过时 `completionStatus=complete`;证据文件缺失时保持 `unverified`;登记不完整或哈希不匹配时对应模板为 `incomplete` 并让命令失败。
|
完成证据登记在 `.codex-tasks/template-audit-execution/raw/completion-evidence.json`。每套模板必须提供 `real-manifest-interaction`、`save-reload-publish-isolation`、`visual-reference`、`empty-error-branches` 四类 `passed` 证据;每类证据必须包含实际命令、`exitCode=0`、日志或截图产物及其 SHA-256。registry 还必须记录 source tree hash;doctor 会计算当前仓库源码树(排除 `.codex-tasks/` 证据目录)的 hash,并在不匹配时拒绝完成态。doctor 会校验证据覆盖全部模板、产物存在且哈希一致。全部通过时 `completionStatus=complete`;证据文件缺失时保持 `unverified`;登记不完整或哈希不匹配时对应模板为 `incomplete` 并让命令失败。
|
||||||
|
|
||||||
AST 解析可追踪 workspace.brand、presentation、object 和局部别名。动态路径、跨组件和间接映射等未知情况标为 review,不能猜测为通过。诊断器包含正反故障注入测试。
|
AST 解析可追踪 workspace.brand、presentation、object 和局部别名。动态路径、跨组件和间接映射等未知情况标为 review,不能猜测为通过。诊断器包含正反故障注入测试。
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"node": ">=20.18.0"
|
"node": ">=20.18.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "turbo run build",
|
"build": "turbo run build && pnpm build:taro:all",
|
||||||
"dev": "turbo run dev --parallel",
|
"dev": "turbo run dev --parallel",
|
||||||
"lint": "turbo run lint",
|
"lint": "turbo run lint",
|
||||||
"typecheck": "turbo run typecheck",
|
"typecheck": "turbo run typecheck",
|
||||||
@@ -45,7 +45,9 @@
|
|||||||
"template:migration:audit": "pnpm --filter @personal-brand/api template:migration:audit",
|
"template:migration:audit": "pnpm --filter @personal-brand/api template:migration:audit",
|
||||||
"test:template-migration-audit": "node --test apps/api/test/template-contract-migration-audit.test.mjs",
|
"test:template-migration-audit": "node --test apps/api/test/template-contract-migration-audit.test.mjs",
|
||||||
"check:local-media": "node scripts/check-local-media.mjs",
|
"check:local-media": "node scripts/check-local-media.mjs",
|
||||||
"test:template-doctor": "node --test scripts/test/template-doctor.test.mjs"
|
"test:template-doctor": "node --test scripts/test/template-doctor.test.mjs",
|
||||||
|
"build:taro:atelier": "TEMPLATE_KEY=atelier-solopreneur pnpm --filter @personal-brand/taro build:h5 && TEMPLATE_KEY=atelier-solopreneur pnpm --filter @personal-brand/taro build:weapp",
|
||||||
|
"build:taro:all": "pnpm build:taro:food && pnpm build:taro:linjing && pnpm build:taro:atelier"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.17.0",
|
"@eslint/js": "^9.17.0",
|
||||||
@@ -105,6 +107,10 @@
|
|||||||
"GHSA-hrh2-vp3x-79xf",
|
"GHSA-hrh2-vp3x-79xf",
|
||||||
"GHSA-vfj7-8cjw-p6xm"
|
"GHSA-vfj7-8cjw-p6xm"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"patchedDependencies": {
|
||||||
|
"miniprogram-ci@2.1.31": "patches/miniprogram-ci@2.1.31.patch",
|
||||||
|
"@jimp/core@0.16.13": "patches/@jimp__core@0.16.13.patch"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,6 +160,10 @@ export class ApiClient
|
|||||||
this.resources.session.loginAdmin(...arguments_);
|
this.resources.session.loginAdmin(...arguments_);
|
||||||
changeAdminPassword = (...arguments_: Parameters<SessionMethods["changeAdminPassword"]>) =>
|
changeAdminPassword = (...arguments_: Parameters<SessionMethods["changeAdminPassword"]>) =>
|
||||||
this.resources.session.changeAdminPassword(...arguments_);
|
this.resources.session.changeAdminPassword(...arguments_);
|
||||||
|
logoutAdmin = (...arguments_: Parameters<SessionMethods["logoutAdmin"]>) =>
|
||||||
|
this.resources.session.logoutAdmin(...arguments_);
|
||||||
|
logoutCustomer = (...arguments_: Parameters<SessionMethods["logoutCustomer"]>) =>
|
||||||
|
this.resources.session.logoutCustomer(...arguments_);
|
||||||
listCustomerBookings = (...arguments_: Parameters<BookingMethods["listCustomerBookings"]>) =>
|
listCustomerBookings = (...arguments_: Parameters<BookingMethods["listCustomerBookings"]>) =>
|
||||||
this.resources.booking.listCustomerBookings(...arguments_);
|
this.resources.booking.listCustomerBookings(...arguments_);
|
||||||
createCustomerBooking = (...arguments_: Parameters<BookingMethods["createCustomerBooking"]>) =>
|
createCustomerBooking = (...arguments_: Parameters<BookingMethods["createCustomerBooking"]>) =>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export interface BrandMethods {
|
|||||||
listAdminBrands(): Promise<AdminBrandMembership[]>;
|
listAdminBrands(): Promise<AdminBrandMembership[]>;
|
||||||
switchAdminBrand(
|
switchAdminBrand(
|
||||||
brandId: string,
|
brandId: string,
|
||||||
): Promise<{ token: string; brand: AdminBrandMembership["brand"] }>;
|
): Promise<{ token: string; role: string; brand: AdminBrandMembership["brand"] }>;
|
||||||
listAdminMembers(): Promise<AdminBrandMember[]>;
|
listAdminMembers(): Promise<AdminBrandMember[]>;
|
||||||
createAdminMember(body: {
|
createAdminMember(body: {
|
||||||
username: string;
|
username: string;
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ export interface SessionMethods {
|
|||||||
platformTemplateRole: "none" | "template_admin";
|
platformTemplateRole: "none" | "template_admin";
|
||||||
}>;
|
}>;
|
||||||
changeAdminPassword(currentPassword: string, newPassword: string): Promise<{ changed: true }>;
|
changeAdminPassword(currentPassword: string, newPassword: string): Promise<{ changed: true }>;
|
||||||
|
logoutAdmin(): Promise<{ loggedOut: true }>;
|
||||||
|
logoutCustomer(): Promise<{ loggedOut: true }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function sessionMethods({ request }: { request: RequestFn }): SessionMethods {
|
export function sessionMethods({ request }: { request: RequestFn }): SessionMethods {
|
||||||
@@ -23,5 +25,7 @@ export function sessionMethods({ request }: { request: RequestFn }): SessionMeth
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
body: { currentPassword, newPassword },
|
body: { currentPassword, newPassword },
|
||||||
}),
|
}),
|
||||||
|
logoutAdmin: () => request("/admin/session/logout", { method: "POST", body: {} }),
|
||||||
|
logoutCustomer: () => request("/customer/session/logout", { method: "POST", body: {} }),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -27,6 +27,24 @@ test("客户端发送认证头、查询参数和 JSON 请求体", async () => {
|
|||||||
assert.equal(calls[1]?.init?.body, JSON.stringify({ name: "重点" }));
|
assert.equal(calls[1]?.init?.body, JSON.stringify({ name: "重点" }));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("客户端登出会调用当前会话接口", async () => {
|
||||||
|
const calls: Array<{ url: string; method?: string; body?: string }> = [];
|
||||||
|
const client = new ApiClient({
|
||||||
|
baseUrl: "http://api.test",
|
||||||
|
token: "admin-token",
|
||||||
|
fetcher: async (url, init) => {
|
||||||
|
calls.push({ url, method: init?.method, body: init?.body });
|
||||||
|
return response({ loggedOut: true });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
await client.logoutAdmin();
|
||||||
|
await client.logoutCustomer();
|
||||||
|
assert.deepEqual(calls, [
|
||||||
|
{ url: "http://api.test/admin/session/logout", method: "POST", body: "{}" },
|
||||||
|
{ url: "http://api.test/customer/session/logout", method: "POST", body: "{}" },
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
test("客户端将统一错误响应转换为 ApiClientError", async () => {
|
test("客户端将统一错误响应转换为 ApiClientError", async () => {
|
||||||
const client = new ApiClient({
|
const client = new ApiClient({
|
||||||
baseUrl: "http://api.test",
|
baseUrl: "http://api.test",
|
||||||
|
|||||||
@@ -189,37 +189,58 @@ export function validateTemplatePackageManifest(value: unknown): string[] {
|
|||||||
if (!manifest.packageKey?.trim()) errors.push("packageKey is required");
|
if (!manifest.packageKey?.trim()) errors.push("packageKey is required");
|
||||||
if (!manifest.version?.trim()) errors.push("version is required");
|
if (!manifest.version?.trim()) errors.push("version is required");
|
||||||
if (!manifest.visualTemplateKey?.trim()) errors.push("visualTemplateKey is required");
|
if (!manifest.visualTemplateKey?.trim()) errors.push("visualTemplateKey is required");
|
||||||
|
if (manifest.packageKey !== manifest.visualTemplateKey)
|
||||||
|
errors.push("visualTemplateKey must match packageKey");
|
||||||
if (manifest.runtimeContract !== TEMPLATE_RUNTIME_CONTRACT)
|
if (manifest.runtimeContract !== TEMPLATE_RUNTIME_CONTRACT)
|
||||||
errors.push(`runtimeContract must be ${TEMPLATE_RUNTIME_CONTRACT}`);
|
errors.push(`runtimeContract must be ${TEMPLATE_RUNTIME_CONTRACT}`);
|
||||||
if (!manifest.displayName?.trim()) errors.push("displayName is required");
|
if (!manifest.displayName?.trim()) errors.push("displayName is required");
|
||||||
const presentation = manifest.visualPresentation;
|
const presentation = manifest.visualPresentation;
|
||||||
if (
|
const validPresentation =
|
||||||
!presentation ||
|
presentation &&
|
||||||
typeof presentation !== "object" ||
|
typeof presentation === "object" &&
|
||||||
!presentation.description?.trim() ||
|
presentation.description?.trim() &&
|
||||||
!presentation.variants ||
|
presentation.variants &&
|
||||||
typeof presentation.variants !== "object" ||
|
typeof presentation.variants === "object" &&
|
||||||
Array.isArray(presentation.variants) ||
|
!Array.isArray(presentation.variants) &&
|
||||||
!Object.values(presentation.variants).every(
|
presentation.theme &&
|
||||||
(variant) => typeof variant === "string" && variant.trim(),
|
typeof presentation.theme === "object" &&
|
||||||
) ||
|
presentation.theme.colors &&
|
||||||
!presentation.theme ||
|
typeof presentation.theme.colors === "object" &&
|
||||||
typeof presentation.theme !== "object" ||
|
presentation.theme.radius &&
|
||||||
!presentation.theme.colors ||
|
typeof presentation.theme.radius === "object";
|
||||||
typeof presentation.theme.colors !== "object" ||
|
if (!validPresentation) {
|
||||||
!presentation.theme.radius ||
|
|
||||||
typeof presentation.theme.radius !== "object"
|
|
||||||
) {
|
|
||||||
errors.push("visualPresentation requires description, variants, theme.colors and theme.radius");
|
errors.push("visualPresentation requires description, variants, theme.colors and theme.radius");
|
||||||
} else if (presentation.layout) {
|
} else {
|
||||||
const layout = presentation.layout;
|
const requiredVariant = (key: string) =>
|
||||||
|
typeof presentation.variants[key] === "string" && presentation.variants[key].trim();
|
||||||
|
if (!(["hero", "offeringList", "detail"] as const).every(requiredVariant))
|
||||||
|
errors.push("visualPresentation.variants requires hero, offeringList and detail");
|
||||||
|
|
||||||
|
const requiredColor = (key: string) =>
|
||||||
|
typeof presentation.theme.colors[key] === "string" && presentation.theme.colors[key].trim();
|
||||||
|
if (!(["background", "foreground", "accent", "dark"] as const).every(requiredColor))
|
||||||
|
errors.push(
|
||||||
|
"visualPresentation.theme.colors requires background, foreground, accent and dark",
|
||||||
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!(["home", "offerings", "detail", "profile"] as const).every(
|
typeof presentation.theme.radius.card !== "string" ||
|
||||||
(page) =>
|
!presentation.theme.radius.card.trim()
|
||||||
Array.isArray(layout[page]) && layout[page].every((item) => typeof item === "string"),
|
)
|
||||||
)
|
errors.push("visualPresentation.theme.radius requires card");
|
||||||
) {
|
|
||||||
errors.push("visualPresentation.layout must contain page module arrays");
|
if (presentation.layout) {
|
||||||
|
const layout = presentation.layout;
|
||||||
|
if (
|
||||||
|
!(["home", "offerings", "detail", "profile"] as const).every(
|
||||||
|
(page) =>
|
||||||
|
Array.isArray(layout[page]) &&
|
||||||
|
layout[page].length > 0 &&
|
||||||
|
layout[page].every((item) => typeof item === "string" && item.trim()),
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
errors.push("visualPresentation.layout must contain non-empty page module arrays");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -74,6 +74,29 @@ test("template contract rejects technical or incomplete admin declarations", ()
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("template package manifests reject mismatched visual keys and empty visual presentation", () => {
|
||||||
|
const manifestPath = path.join(packageRoot, "template-acheng-campus-food/template.json");
|
||||||
|
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
||||||
|
manifest.visualTemplateKey = "different-visual";
|
||||||
|
assert.ok(
|
||||||
|
validateTemplatePackageManifest(manifest).includes("visualTemplateKey must match packageKey"),
|
||||||
|
);
|
||||||
|
|
||||||
|
manifest.visualTemplateKey = manifest.packageKey;
|
||||||
|
manifest.visualPresentation = {
|
||||||
|
description: "无效视觉",
|
||||||
|
variants: {},
|
||||||
|
theme: { colors: {}, radius: {} },
|
||||||
|
layout: { home: [], offerings: [], detail: [], profile: [] },
|
||||||
|
};
|
||||||
|
assert.deepEqual(validateTemplatePackageManifest(manifest), [
|
||||||
|
"visualPresentation.variants requires hero, offeringList and detail",
|
||||||
|
"visualPresentation.theme.colors requires background, foreground, accent and dark",
|
||||||
|
"visualPresentation.theme.radius requires card",
|
||||||
|
"visualPresentation.layout must contain non-empty page module arrays",
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
test("template package manifests must declare package-owned visual presentation", () => {
|
test("template package manifests must declare package-owned visual presentation", () => {
|
||||||
const manifestPath = path.join(packageRoot, "template-acheng-campus-food/template.json");
|
const manifestPath = path.join(packageRoot, "template-acheng-campus-food/template.json");
|
||||||
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
||||||
@@ -83,10 +106,18 @@ test("template package manifests must declare package-owned visual presentation"
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
manifest.visualPresentation = {
|
manifest.visualPresentation = {
|
||||||
description: "无效视觉",
|
description: "有效视觉",
|
||||||
variants: { hero: "hero" },
|
variants: { hero: "hero", offeringList: "service-list", detail: "case" },
|
||||||
theme: { colors: { background: "#fff" }, radius: { card: "16rpx" } },
|
theme: {
|
||||||
layout: { home: ["hero"], offerings: [], detail: [], profile: [] },
|
colors: { background: "#fff", foreground: "#111", accent: "#333", dark: "#000" },
|
||||||
|
radius: { card: "16rpx" },
|
||||||
|
},
|
||||||
|
layout: {
|
||||||
|
home: ["hero"],
|
||||||
|
offerings: ["service-list"],
|
||||||
|
detail: ["case"],
|
||||||
|
profile: ["contact"],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
assert.deepEqual(validateTemplatePackageManifest(manifest), []);
|
assert.deepEqual(validateTemplatePackageManifest(manifest), []);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/dist/utils/image-bitmap.js b/dist/utils/image-bitmap.js
|
||||||
|
index e7c3dc99aa7ddb8ce89be7e527b164cbd933d22f..256caab070fd97110fc2646adbf0d940a29216e2 100644
|
||||||
|
--- a/dist/utils/image-bitmap.js
|
||||||
|
+++ b/dist/utils/image-bitmap.js
|
||||||
|
@@ -34,7 +34,7 @@ function getMIMEFromBuffer(buffer, path) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
_context.next = 2;
|
||||||
|
- return _regenerator["default"].awrap(_fileType["default"].fromBuffer(buffer));
|
||||||
|
+ return _regenerator["default"].awrap(_fileType.fileTypeFromBuffer(buffer));
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
fileTypeFromBuffer = _context.sent;
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
diff --git a/dist/modules/nativecompiler/ios/buildCloud.js b/dist/modules/nativecompiler/ios/buildCloud.js
|
||||||
|
index 4c7917d12a2323c2c7975d751398744e022ecaaf..9c3886787f21aabb98fa64950077b4982afd07ca 100644
|
||||||
|
--- a/dist/modules/nativecompiler/ios/buildCloud.js
|
||||||
|
+++ b/dist/modules/nativecompiler/ios/buildCloud.js
|
||||||
|
@@ -1 +1 @@
|
||||||
|
-"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.remoteBuildProjectMaterialAbsoluteCacheDir=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),path_1=tslib_1.__importDefault(require("path")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),glob_1=tslib_1.__importDefault(require("glob")),env_1=require("../../../utils/env"),miniapp_builder_1=require("../../../utils/miniapp-builder"),codesign_1=require("../../../utils/codesign"),miniappJson_1=require("../../../utils/miniappJson"),lodash_1=require("lodash"),tools_1=require("../../../utils/tools"),uuidv4=require("uuid/v4"),sizeOf=require("image-size"),plist=require("simple-plist"),errorIOSSdkVersions=["1.0.19"],APPEX_PROFILES_MAPS_FILE="__appexProfilesCacheDir__/profilesMap.json",APPEX_PROFILES_MAPS_FOR_SHELL_FILE="__appexProfilesCacheDir__/profilesMapForShell.txt",defaultIconDirPath=path_1.default.join(__dirname,"../../../static/images/"),getDepReg=e=>new RegExp(`s.subspec '${e}'.*\n(?:.*\n)*?(?:.*sp.vendored_frameworks = \\[\n)((?:.*'.*?'.*\n)*?)(?:.*\\]\n)`,"m"),allowTheme=["Light","LightSpecial","Dark","DarkSpecial","Default"];exports.remoteBuildProjectMaterialAbsoluteCacheDir="__absoluteFile";const iconInfoMap={appStore1024:{size:[1024,1024],scale:1,idiom:"ios-marketing",required:!0},appStore1024Other:{size:[1024,1024],scale:1,idiom:"ios-marketing-other"},mainIcon120:{size:[60,60],scale:2,idiom:"iphone",required:!0},mainIcon180:{size:[60,60],scale:3,idiom:"iphone"},spotlightIcon80:{size:[40,40],scale:2,idiom:"iphone"},spotlightIcon120:{size:[40,40],scale:3,idiom:"iphone"},settingsIcon58:{size:[29,29],scale:2,idiom:"iphone"},settingsIcon87:{size:[29,29],scale:3,idiom:"iphone"},notificationIcon40:{size:[20,20],scale:2,idiom:"iphone"},notificationIcon60:{size:[20,20],scale:3,idiom:"iphone"},ipadMainIcon152:{size:[76,76],scale:2,idiom:"ipad"},ipadMainIcon167:{size:[83.5,83.5],scale:2,idiom:"ipad"},ipadSpotlightIcon40:{size:[40,40],scale:1,idiom:"ipad"},ipadSpotlightIcon80:{size:[40,40],scale:2,idiom:"ipad"},ipadSettingsIcon29:{size:[29,29],scale:1,idiom:"ipad"},ipadSpotlightIcon58:{size:[29,29],scale:2,idiom:"ipad"},ipadNotificationIcon20:{size:[20,20],scale:1,idiom:"ipad"},ipadNotificationIcon40:{size:[20,20],scale:2,idiom:"ipad"}};class buildCloudManager{generateTempDemoIpaPath(e){const i=path_1.default.join(e,"../.."),t=path_1.default.basename(i),n=path_1.default.dirname(i),a=path_1.default.join(n,t+"-operateDir");fs_extra_1.default.existsSync(a)&&fs_extra_1.default.removeSync(a),fs_extra_1.default.ensureDirSync(a);const s=path_1.default.join(a,"Payload/demo.app");return fs_extra_1.default.copySync(e,s),s}generateInfoPlistCFBundleURLTypesItem(e){const i={};return e.CFBundleURLName&&(i.CFBundleURLName=e.CFBundleURLName),e.CFBundleURLSchemes&&(Array.isArray(e.CFBundleURLSchemes)?i.CFBundleURLSchemes=e.CFBundleURLSchemes:i.CFBundleURLSchemes=[e.CFBundleURLSchemes]),e.CFBundleTypeRole&&(i.CFBundleTypeRole=e.CFBundleTypeRole),i}updatePrivacyBackgroundImage(e,i,t,n,a){t.message("doing","updatePrivacyBackgroundImage "+n);if(fs_extra_1.default.readdirSync(i).forEach(e=>{"privacy_"+n===path_1.default.basename(e,path_1.default.extname(e))&&fs_extra_1.default.removeSync(path_1.default.join(i,e))}),!a)return;path_1.default.isAbsolute(a)||(a=path_1.default.join(e,a)),a=this.getMaterialFilePath(e,a);const s=path_1.default.extname(a),o=path_1.default.join(i,`privacy_${n}${s}`);try{fs_extra_1.default.copyFileSync(a,o)}catch(e){throw t.message("error",`copy privacy image failed: ${n}, ${a} to ${o}`),e}}async updateIOSInfoPlistInfo(e,i,t,n,a,s){var o,r,l,p,d,c,u,f,_,h,y,g;a.progress("update app base info...");const{mobileapp_info:m={}}=i,S=m.mobileapp_id,I=path_1.default.join(t,"Info.plist"),v={},x=(e,i)=>{var t,n;if((null==i?void 0:i.startsWith("%"))&&(null==i?void 0:i.endsWith("%"))){const o=i.slice(1,-1);v[e]=o;const r=(null===(n=null===(t=null==s?void 0:s.base)||void 0===t?void 0:t.ios)||void 0===n?void 0:n[o])||"";return r||a.message("error",`未在国际化配置 base.json 中找到字段 ${o},请检查`),r}return i};x("UISplashScreenImageName",null===(o=null==n?void 0:n.splashscreen)||void 0===o?void 0:o.customImage),x("UISplashScreenVideoName",null===(r=null==n?void 0:n.splashscreen)||void 0===r?void 0:r.customVideo),x("UILaunchStoryboardName",null===(l=null==n?void 0:n.splashscreen)||void 0===l?void 0:l.customImage);const b=plist.readFileSync(I);if(b.UIBackgroundModes=[],!0===(null===(p=null==n?void 0:n.infoPlist)||void 0===p?void 0:p.AudioInBackgroundMode)&&b.UIBackgroundModes.push("audio"),!0===(null===(d=null==n?void 0:n.infoPlist)||void 0===d?void 0:d.LocationInBackgroundMode)&&b.UIBackgroundModes.push("location"),"object"==typeof n.customInfoPlist&&!Array.isArray(n.customInfoPlist)){a.progress("initiating user custom info.plist config");const e=n.customInfoPlist;for(const i in e)b[i]=e[i]}if(b.CFBundleName=x("CFBundleName",n.name),b.CFBundleDisplayName=x("CFBundleDisplayName",n
Line truncated
|
||||||
|
\ No newline at end of file
|
||||||
|
+"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.remoteBuildProjectMaterialAbsoluteCacheDir=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),path_1=tslib_1.__importDefault(require("path")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),glob_1=tslib_1.__importDefault(require("glob")),env_1=require("../../../utils/env"),miniapp_builder_1=require("../../../utils/miniapp-builder"),codesign_1=require("../../../utils/codesign"),miniappJson_1=require("../../../utils/miniappJson"),lodash_1=require("lodash"),tools_1=require("../../../utils/tools"),uuidv4=require("uuid").v4,sizeOf=require("image-size").imageSize,plist=require("simple-plist"),errorIOSSdkVersions=["1.0.19"],APPEX_PROFILES_MAPS_FILE="__appexProfilesCacheDir__/profilesMap.json",APPEX_PROFILES_MAPS_FOR_SHELL_FILE="__appexProfilesCacheDir__/profilesMapForShell.txt",defaultIconDirPath=path_1.default.join(__dirname,"../../../static/images/"),getDepReg=e=>new RegExp(`s.subspec '${e}'.*\n(?:.*\n)*?(?:.*sp.vendored_frameworks = \\[\n)((?:.*'.*?'.*\n)*?)(?:.*\\]\n)`,"m"),allowTheme=["Light","LightSpecial","Dark","DarkSpecial","Default"];exports.remoteBuildProjectMaterialAbsoluteCacheDir="__absoluteFile";const iconInfoMap={appStore1024:{size:[1024,1024],scale:1,idiom:"ios-marketing",required:!0},appStore1024Other:{size:[1024,1024],scale:1,idiom:"ios-marketing-other"},mainIcon120:{size:[60,60],scale:2,idiom:"iphone",required:!0},mainIcon180:{size:[60,60],scale:3,idiom:"iphone"},spotlightIcon80:{size:[40,40],scale:2,idiom:"iphone"},spotlightIcon120:{size:[40,40],scale:3,idiom:"iphone"},settingsIcon58:{size:[29,29],scale:2,idiom:"iphone"},settingsIcon87:{size:[29,29],scale:3,idiom:"iphone"},notificationIcon40:{size:[20,20],scale:2,idiom:"iphone"},notificationIcon60:{size:[20,20],scale:3,idiom:"iphone"},ipadMainIcon152:{size:[76,76],scale:2,idiom:"ipad"},ipadMainIcon167:{size:[83.5,83.5],scale:2,idiom:"ipad"},ipadSpotlightIcon40:{size:[40,40],scale:1,idiom:"ipad"},ipadSpotlightIcon80:{size:[40,40],scale:2,idiom:"ipad"},ipadSettingsIcon29:{size:[29,29],scale:1,idiom:"ipad"},ipadSpotlightIcon58:{size:[29,29],scale:2,idiom:"ipad"},ipadNotificationIcon20:{size:[20,20],scale:1,idiom:"ipad"},ipadNotificationIcon40:{size:[20,20],scale:2,idiom:"ipad"}};class buildCloudManager{generateTempDemoIpaPath(e){const i=path_1.default.join(e,"../.."),t=path_1.default.basename(i),n=path_1.default.dirname(i),a=path_1.default.join(n,t+"-operateDir");fs_extra_1.default.existsSync(a)&&fs_extra_1.default.removeSync(a),fs_extra_1.default.ensureDirSync(a);const s=path_1.default.join(a,"Payload/demo.app");return fs_extra_1.default.copySync(e,s),s}generateInfoPlistCFBundleURLTypesItem(e){const i={};return e.CFBundleURLName&&(i.CFBundleURLName=e.CFBundleURLName),e.CFBundleURLSchemes&&(Array.isArray(e.CFBundleURLSchemes)?i.CFBundleURLSchemes=e.CFBundleURLSchemes:i.CFBundleURLSchemes=[e.CFBundleURLSchemes]),e.CFBundleTypeRole&&(i.CFBundleTypeRole=e.CFBundleTypeRole),i}updatePrivacyBackgroundImage(e,i,t,n,a){t.message("doing","updatePrivacyBackgroundImage "+n);if(fs_extra_1.default.readdirSync(i).forEach(e=>{"privacy_"+n===path_1.default.basename(e,path_1.default.extname(e))&&fs_extra_1.default.removeSync(path_1.default.join(i,e))}),!a)return;path_1.default.isAbsolute(a)||(a=path_1.default.join(e,a)),a=this.getMaterialFilePath(e,a);const s=path_1.default.extname(a),o=path_1.default.join(i,`privacy_${n}${s}`);try{fs_extra_1.default.copyFileSync(a,o)}catch(e){throw t.message("error",`copy privacy image failed: ${n}, ${a} to ${o}`),e}}async updateIOSInfoPlistInfo(e,i,t,n,a,s){var o,r,l,p,d,c,u,f,_,h,y,g;a.progress("update app base info...");const{mobileapp_info:m={}}=i,S=m.mobileapp_id,I=path_1.default.join(t,"Info.plist"),v={},x=(e,i)=>{var t,n;if((null==i?void 0:i.startsWith("%"))&&(null==i?void 0:i.endsWith("%"))){const o=i.slice(1,-1);v[e]=o;const r=(null===(n=null===(t=null==s?void 0:s.base)||void 0===t?void 0:t.ios)||void 0===n?void 0:n[o])||"";return r||a.message("error",`未在国际化配置 base.json 中找到字段 ${o},请检查`),r}return i};x("UISplashScreenImageName",null===(o=null==n?void 0:n.splashscreen)||void 0===o?void 0:o.customImage),x("UISplashScreenVideoName",null===(r=null==n?void 0:n.splashscreen)||void 0===r?void 0:r.customVideo),x("UILaunchStoryboardName",null===(l=null==n?void 0:n.splashscreen)||void 0===l?void 0:l.customImage);const b=plist.readFileSync(I);if(b.UIBackgroundModes=[],!0===(null===(p=null==n?void 0:n.infoPlist)||void 0===p?void 0:p.AudioInBackgroundMode)&&b.UIBackgroundModes.push("audio"),!0===(null===(d=null==n?void 0:n.infoPlist)||void 0===d?void 0:d.LocationInBackgroundMode)&&b.UIBackgroundModes.push("location"),"object"==typeof n.customInfoPlist&&!Array.isArray(n.customInfoPlist)){a.progress("initiating user custom info.plist config");const e=n.customInfoPlist;for(const i in e)b[i]=e[i]}if(b.CFBundleName=x("CFBundleName",n.name),b.CFBundleDisplayName=x("CFBundleDisp
Line truncated
|
||||||
@@ -41,6 +41,14 @@ overrides:
|
|||||||
'@tarojs/components-react>swiper': 12.1.2
|
'@tarojs/components-react>swiper': 12.1.2
|
||||||
request: npm:@cypress/request@4.0.1
|
request: npm:@cypress/request@4.0.1
|
||||||
|
|
||||||
|
patchedDependencies:
|
||||||
|
'@jimp/core@0.16.13':
|
||||||
|
hash: e3gfmimxpqa7zt2vmxpy4rkhaq
|
||||||
|
path: patches/@jimp__core@0.16.13.patch
|
||||||
|
miniprogram-ci@2.1.31:
|
||||||
|
hash: y4seosrw3qmysf77ad2tjzhu5e
|
||||||
|
path: patches/miniprogram-ci@2.1.31.patch
|
||||||
|
|
||||||
importers:
|
importers:
|
||||||
|
|
||||||
.:
|
.:
|
||||||
@@ -153,7 +161,7 @@ importers:
|
|||||||
version: 5.12.7
|
version: 5.12.7
|
||||||
miniprogram-ci:
|
miniprogram-ci:
|
||||||
specifier: ^2.1.31
|
specifier: ^2.1.31
|
||||||
version: 2.1.31(eslint@9.39.5(jiti@2.7.0))
|
version: 2.1.31(patch_hash=y4seosrw3qmysf77ad2tjzhu5e)(eslint@9.39.5(jiti@2.7.0))
|
||||||
prisma:
|
prisma:
|
||||||
specifier: ^6.2.1
|
specifier: ^6.2.1
|
||||||
version: 6.19.3(typescript@5.9.3)
|
version: 6.19.3(typescript@5.9.3)
|
||||||
@@ -10506,7 +10514,7 @@ snapshots:
|
|||||||
'@jimp/utils': 0.16.13
|
'@jimp/utils': 0.16.13
|
||||||
bmp-js: 0.1.0
|
bmp-js: 0.1.0
|
||||||
|
|
||||||
'@jimp/core@0.16.13':
|
'@jimp/core@0.16.13(patch_hash=e3gfmimxpqa7zt2vmxpy4rkhaq)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/runtime': 7.26.10
|
'@babel/runtime': 7.26.10
|
||||||
'@jimp/utils': 0.16.13
|
'@jimp/utils': 0.16.13
|
||||||
@@ -10526,7 +10534,7 @@ snapshots:
|
|||||||
'@jimp/custom@0.16.13':
|
'@jimp/custom@0.16.13':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/runtime': 7.26.10
|
'@babel/runtime': 7.26.10
|
||||||
'@jimp/core': 0.16.13
|
'@jimp/core': 0.16.13(patch_hash=e3gfmimxpqa7zt2vmxpy4rkhaq)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- debug
|
- debug
|
||||||
- supports-color
|
- supports-color
|
||||||
@@ -15412,7 +15420,7 @@ snapshots:
|
|||||||
|
|
||||||
minipass@7.1.3: {}
|
minipass@7.1.3: {}
|
||||||
|
|
||||||
miniprogram-ci@2.1.31(eslint@9.39.5(jiti@2.7.0)):
|
miniprogram-ci@2.1.31(patch_hash=y4seosrw3qmysf77ad2tjzhu5e)(eslint@9.39.5(jiti@2.7.0)):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/code-frame': 7.22.10
|
'@babel/code-frame': 7.22.10
|
||||||
'@babel/compat-data': 7.22.9
|
'@babel/compat-data': 7.22.9
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import crypto from "node:crypto";
|
import crypto from "node:crypto";
|
||||||
|
import { execFileSync } from "node:child_process";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import ts from "typescript";
|
import ts from "typescript";
|
||||||
@@ -413,6 +414,53 @@ export function applyManualReview(reports, reviews, reviewScope) {
|
|||||||
return reports;
|
return reports;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function walkRepositoryFiles(root, directory = root) {
|
||||||
|
const files = [];
|
||||||
|
for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
|
||||||
|
if (
|
||||||
|
entry.name === ".git" ||
|
||||||
|
entry.name === "node_modules" ||
|
||||||
|
entry.name === "dist" ||
|
||||||
|
entry.name === ".turbo"
|
||||||
|
)
|
||||||
|
continue;
|
||||||
|
const full = path.join(directory, entry.name);
|
||||||
|
if (entry.isDirectory()) files.push(...walkRepositoryFiles(root, full));
|
||||||
|
else if (entry.isFile()) files.push(full);
|
||||||
|
}
|
||||||
|
return files;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function sourceTreeHash(root) {
|
||||||
|
const rootPath = path.resolve(root);
|
||||||
|
let files;
|
||||||
|
if (fs.existsSync(path.join(rootPath, ".git"))) {
|
||||||
|
const output = execFileSync(
|
||||||
|
"git",
|
||||||
|
["ls-files", "-z", "--cached", "--others", "--exclude-standard"],
|
||||||
|
{ cwd: rootPath, maxBuffer: 64 * 1024 * 1024 },
|
||||||
|
);
|
||||||
|
files = output
|
||||||
|
.toString("utf8")
|
||||||
|
.split("\0")
|
||||||
|
.filter((file) => file && !file.startsWith(".codex-tasks/"))
|
||||||
|
.map((file) => path.join(rootPath, file));
|
||||||
|
} else {
|
||||||
|
files = walkRepositoryFiles(rootPath).filter(
|
||||||
|
(file) => !path.relative(rootPath, file).startsWith(".codex-tasks/"),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
files.sort();
|
||||||
|
const hash = crypto.createHash("sha256");
|
||||||
|
for (const file of files) {
|
||||||
|
hash.update(path.relative(rootPath, file));
|
||||||
|
hash.update("\0");
|
||||||
|
hash.update(fs.readFileSync(file));
|
||||||
|
hash.update("\0");
|
||||||
|
}
|
||||||
|
return hash.digest("hex");
|
||||||
|
}
|
||||||
|
|
||||||
export function applyCompletionEvidence(reports, registry, root) {
|
export function applyCompletionEvidence(reports, registry, root) {
|
||||||
if (registry === undefined) {
|
if (registry === undefined) {
|
||||||
for (const report of reports) report.completionStatus = "unverified";
|
for (const report of reports) report.completionStatus = "unverified";
|
||||||
@@ -424,7 +472,8 @@ export function applyCompletionEvidence(reports, registry, root) {
|
|||||||
registry.scope !== "模板完成证据登记,保留命令、日志与产物哈希" ||
|
registry.scope !== "模板完成证据登记,保留命令、日志与产物哈希" ||
|
||||||
!registry.templates ||
|
!registry.templates ||
|
||||||
typeof registry.templates !== "object" ||
|
typeof registry.templates !== "object" ||
|
||||||
Array.isArray(registry.templates)
|
Array.isArray(registry.templates) ||
|
||||||
|
!/^[a-f0-9]{64}$/.test(registry.sourceTreeHash ?? "")
|
||||||
) {
|
) {
|
||||||
throw new Error("Completion evidence registry has an unsupported schema");
|
throw new Error("Completion evidence registry has an unsupported schema");
|
||||||
}
|
}
|
||||||
@@ -439,16 +488,23 @@ export function applyCompletionEvidence(reports, registry, root) {
|
|||||||
};
|
};
|
||||||
const validEvidence = (evidence) => {
|
const validEvidence = (evidence) => {
|
||||||
if (!evidence || evidence.status !== "passed" || !Array.isArray(evidence.commands)) return null;
|
if (!evidence || evidence.status !== "passed" || !Array.isArray(evidence.commands)) return null;
|
||||||
if (!evidence.commands.length || evidence.commands.some((command) => !command.trim()))
|
if (
|
||||||
|
!evidence.commands.length ||
|
||||||
|
evidence.commands.some((command) => !command.trim() || /<[^>]+>/.test(command))
|
||||||
|
)
|
||||||
return null;
|
return null;
|
||||||
|
if (evidence.exitCode !== 0) return null;
|
||||||
if (!Array.isArray(evidence.artifacts) || !evidence.artifacts.length) return null;
|
if (!Array.isArray(evidence.artifacts) || !evidence.artifacts.length) return null;
|
||||||
return evidence;
|
return evidence;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const currentSourceTreeHash = sourceTreeHash(root);
|
||||||
let complete = true;
|
let complete = true;
|
||||||
for (const report of reports) {
|
for (const report of reports) {
|
||||||
const evidence = registry.templates[report.template] ?? {};
|
const evidence = registry.templates[report.template] ?? {};
|
||||||
const completionIssues = [];
|
const completionIssues = [];
|
||||||
|
if (registry.sourceTreeHash !== currentSourceTreeHash)
|
||||||
|
completionIssues.push("source tree hash mismatch");
|
||||||
for (const key of report.requiredEvidence) {
|
for (const key of report.requiredEvidence) {
|
||||||
const item = validEvidence(evidence[key]);
|
const item = validEvidence(evidence[key]);
|
||||||
if (!item) {
|
if (!item) {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
applyCompletionEvidence,
|
applyCompletionEvidence,
|
||||||
applyManualReview,
|
applyManualReview,
|
||||||
diagnoseTemplate,
|
diagnoseTemplate,
|
||||||
|
sourceTreeHash,
|
||||||
} from "../lib/template-doctor.mjs";
|
} from "../lib/template-doctor.mjs";
|
||||||
|
|
||||||
test("真实模板自动发现并读取完整声明,生成可追溯区域报告", () => {
|
test("真实模板自动发现并读取完整声明,生成可追溯区域报告", () => {
|
||||||
@@ -91,6 +92,7 @@ test("完成证据登记必须覆盖全部要求并校验产物哈希", () => {
|
|||||||
const evidence = (items) => ({
|
const evidence = (items) => ({
|
||||||
schemaVersion: 1,
|
schemaVersion: 1,
|
||||||
scope: "模板完成证据登记,保留命令、日志与产物哈希",
|
scope: "模板完成证据登记,保留命令、日志与产物哈希",
|
||||||
|
sourceTreeHash: sourceTreeHash(root),
|
||||||
templates: {
|
templates: {
|
||||||
fixture: Object.fromEntries(
|
fixture: Object.fromEntries(
|
||||||
report.requiredEvidence.map((key) => [
|
report.requiredEvidence.map((key) => [
|
||||||
@@ -98,6 +100,7 @@ test("完成证据登记必须覆盖全部要求并校验产物哈希", () => {
|
|||||||
items.includes(key)
|
items.includes(key)
|
||||||
? {
|
? {
|
||||||
status: "passed",
|
status: "passed",
|
||||||
|
exitCode: 0,
|
||||||
commands: ["pnpm test"],
|
commands: ["pnpm test"],
|
||||||
artifacts: [{ path: "integration.log", sha256 }],
|
artifacts: [{ path: "integration.log", sha256 }],
|
||||||
}
|
}
|
||||||
@@ -129,6 +132,26 @@ test("完成证据登记必须覆盖全部要求并校验产物哈希", () => {
|
|||||||
const checksumMismatch = applyCompletionEvidence([structuredClone(report)], invalid, root);
|
const checksumMismatch = applyCompletionEvidence([structuredClone(report)], invalid, root);
|
||||||
assert.equal(checksumMismatch.completionStatus, "incomplete");
|
assert.equal(checksumMismatch.completionStatus, "incomplete");
|
||||||
assert.match(checksumMismatch.reports[0].completionIssues.join("\n"), /checksum mismatch/);
|
assert.match(checksumMismatch.reports[0].completionIssues.join("\n"), /checksum mismatch/);
|
||||||
|
|
||||||
|
const staleSource = evidence(report.requiredEvidence);
|
||||||
|
staleSource.sourceTreeHash = "0".repeat(64);
|
||||||
|
const sourceMismatch = applyCompletionEvidence([structuredClone(report)], staleSource, root);
|
||||||
|
assert.equal(sourceMismatch.completionStatus, "incomplete");
|
||||||
|
assert.match(sourceMismatch.reports[0].completionIssues.join("\n"), /source tree hash/);
|
||||||
|
|
||||||
|
const failedCommand = evidence(report.requiredEvidence);
|
||||||
|
failedCommand.templates.fixture["visual-reference"].exitCode = 1;
|
||||||
|
const failed = applyCompletionEvidence([structuredClone(report)], failedCommand, root);
|
||||||
|
assert.equal(failed.completionStatus, "incomplete");
|
||||||
|
|
||||||
|
const placeholderCommand = evidence(report.requiredEvidence);
|
||||||
|
placeholderCommand.templates.fixture["visual-reference"].commands = ["pnpm test --out <dir>"];
|
||||||
|
const placeholder = applyCompletionEvidence(
|
||||||
|
[structuredClone(report)],
|
||||||
|
placeholderCommand,
|
||||||
|
root,
|
||||||
|
);
|
||||||
|
assert.equal(placeholder.completionStatus, "incomplete");
|
||||||
} finally {
|
} finally {
|
||||||
fs.rmSync(root, { recursive: true, force: true });
|
fs.rmSync(root, { recursive: true, force: true });
|
||||||
}
|
}
|
||||||
|
|||||||