Fix MindSpace deliverable link redaction and release gate impact mapping.
Memind CI / Test, build, and release guards (push) Failing after 3s

Preserve local MindSpace URLs in assistant replies during architecture term redaction, and map db.mjs and skills-registry.mjs for impact selection.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-31 08:22:54 +08:00
parent 81e63c16d3
commit 6acd79e4fa
2 changed files with 25 additions and 2 deletions
+23
View File
@@ -76,9 +76,32 @@ export const USER_FACING_ARCHITECTURE_LANGUAGE_RULE =
/** Strip or neutralize architecture terms from assistant replies shown in chat UI. */
export function redactUserFacingArchitectureTerms(text) {
let next = String(text ?? '');
const protectedSegments = [];
const protect = (match) => {
const token = `__MINDSPACE_DELIVERABLE_${protectedSegments.length}__`;
protectedSegments.push(match);
return token;
};
next = next.replace(
new RegExp(
`\\[[^\\]]+\\]\\(https?:\\/\\/${MINDSPACE_DELIVERABLE_ORIGIN_RE}\\/MindSpace\\/[^)]+\\)`,
'gi',
),
protect,
);
next = next.replace(
new RegExp(
`https?:\\/\\/${MINDSPACE_DELIVERABLE_ORIGIN_RE}\\/MindSpace\\/[^\\s)]+`,
'gi',
),
protect,
);
for (const [pattern, replacement] of USER_FACING_ARCHITECTURE_TERM_REPLACEMENTS) {
next = next.replace(pattern, replacement);
}
for (const [index, segment] of protectedSegments.entries()) {
next = next.replace(`__MINDSPACE_DELIVERABLE_${index}__`, segment);
}
return next.replace(/[ \t]{2,}/g, ' ').replace(/\n{3,}/g, '\n\n').trim();
}