fix(wechat): repair share preview on disk for sanitized delivery artifacts
Memind CI / Test, build, and release guards (push) Failing after 6s

Production WeChat delivery strips localPath from artifacts, so share-preview
auto-repair never wrote back to HTML. Resolve paths via publishDir +
relativePath, repair at materialize and delivery prep, and pass h5Root from
Portal so page.generate can patch missing meta before sending links.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-02 08:47:51 +08:00
parent 0a71370bf4
commit 1faba62f9b
11 changed files with 238 additions and 75 deletions
+11 -12
View File
@@ -81,17 +81,16 @@ test('MindSpace prepares WeChat HTML delivery with logical artifacts only', (t)
},
});
assert.equal(
fs.readFileSync(
path.join(
publishDir,
'public',
'hello.html',
),
'utf8',
const written = fs.readFileSync(
path.join(
publishDir,
'public',
'hello.html',
),
content,
'utf8',
);
assert.match(written, /name="description"/);
assert.match(written, /data-mindspace-page-tag="platform-brand"/);
assert.equal(
result.confirmedArtifacts.length,
1,
@@ -107,12 +106,12 @@ test('MindSpace prepares WeChat HTML delivery with logical artifacts only', (t)
isStub: false,
isHtmlDocument: true,
sharePreview: {
ok: false,
reason: 'missing_description',
ok: true,
reason: null,
},
auxiliary: false,
sizeBytes:
Buffer.byteLength(content),
Buffer.byteLength(written),
},
);
assert.equal(