Reject cross-jurisdiction face update requests

This commit is contained in:
Meta Vens 2026-05-21 01:30:11 +01:00
commit a9671616ff
6 changed files with 80 additions and 3 deletions

View file

@ -11,6 +11,7 @@ import {
buildVoidMcpServerConfig,
createStateStorage,
applyVoidSelfStateOperation,
findCrossRepoJurisdictionMentions,
findRepoDiscordIdentity,
isRepoDiscordIdentityAllowedInChannel,
type JobQueue,
@ -973,6 +974,21 @@ async function enqueueRepoIdentityUpdateRequestIntent(
throw new Error(`No registered repo identity matched "${identityId}" for update request intent on job ${job.id}.`);
}
const crossRepoMentions = findCrossRepoJurisdictionMentions(
identity,
registry,
`${intent.title}\n${intent.content}`,
);
if (crossRepoMentions.length > 0) {
const conflicts = crossRepoMentions
.map((match) => `${match.repoName} (${match.identityId}, matched "${match.matched}")`)
.join(", ");
throw new Error(
`Repo Face UPDATE REQUEST from ${identity.id}/${identity.repoName} crosses registered jurisdiction: ${conflicts}. ` +
"Immediate UPDATE REQUEST is repo-local; use BIFROST TOPIC handoff/consultation or let the owning Face dispatch the work.",
);
}
const contentFile = await writeBifrostPayloadFile(
job,
`${identity.id}-bifrost-update-request.md`,