Reject cross-jurisdiction face update requests
This commit is contained in:
parent
896be9424f
commit
a9671616ff
6 changed files with 80 additions and 3 deletions
|
|
@ -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`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue