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();
}
+2 -2
View File
@@ -24,7 +24,7 @@ const CRITICAL_IMPACT_RULES = Object.freeze([
},
{
groups: ['AGENT', 'AUTH', 'CFG', 'CHAT', 'DATA'],
pattern: /^(?:server\.mjs|schema\.sql|(?:migrations?|database)\/)/i,
pattern: /^(?:server\.mjs|db\.mjs|schema\.sql|(?:migrations?|database)\/)/i,
},
{
groups: ['CFG', 'REL'],
@@ -78,7 +78,7 @@ const IMPACT_RULES = Object.freeze([
{ groups: ['FILE'], pattern: /(?:file|attachment|upload|document|pdf|docx|csv)/i },
{ groups: ['MS'], pattern: /mindspace/i },
{ groups: ['PAGE'], pattern: /(?:public-(?:page|finish)|published-page|publication|page-delivery|mindspace-public)/i },
{ groups: ['AGENT'], pattern: /(?:agent|capabilit|goosed|worker|aider|mcp)/i },
{ groups: ['AGENT'], pattern: /(?:agent|capabilit|goosed|worker|aider|mcp|skills-registry)/i },
{ groups: ['CHAT'], pattern: /(?:chat|conversation|message|reply|session|sse|routing|intent)/i },
{ groups: ['AUTH'], pattern: /(?:auth|access-policy|account|user-permission)/i },
{ groups: ['CFG'], pattern: /(?:config|provider|model-catalog|orchestrator|analytics|disclosure)/i },