Fix Persona source index routing
This commit is contained in:
parent
5849717d8b
commit
25be0251aa
4 changed files with 38 additions and 19 deletions
|
|
@ -39,6 +39,7 @@ const faceIdentitySchema = z.object({
|
|||
identityKind: z.enum(["repo_face", "native_persona"]).default("repo_face"),
|
||||
displayName: z.string().trim().min(1).max(80),
|
||||
repoName: z.string().trim().min(1).optional(),
|
||||
sourceRepoName: z.string().trim().min(1).optional(),
|
||||
repoPath: z.string().trim().min(1).optional(),
|
||||
roleId: z.string().trim().min(1).optional(),
|
||||
allowedChannelIds: z.array(z.string().trim().min(1)).default([]),
|
||||
|
|
@ -122,6 +123,7 @@ export function faceToRepoDiscordIdentity(face: ResolvedFaceIdentity): RepoDisco
|
|||
id: face.id,
|
||||
identityKind: face.identityKind,
|
||||
repoName,
|
||||
sourceRepoName: face.sourceRepoName,
|
||||
displayName: face.displayName,
|
||||
repoPath: face.repoPath,
|
||||
roleId: face.roleId,
|
||||
|
|
@ -186,6 +188,7 @@ function repoIdentityToEpiphany(identity: RepoDiscordIdentity): EpiphanyIdentity
|
|||
id: identity.id,
|
||||
displayName: identity.displayName,
|
||||
repoName: identity.repoName,
|
||||
sourceRepoName: identity.sourceRepoName,
|
||||
repoPath: identity.repoPath,
|
||||
roleId: identity.roleId,
|
||||
identityKind: identity.identityKind,
|
||||
|
|
@ -240,6 +243,7 @@ function normalizeEpiphanies(epiphanies: EpiphanyIdentity[]): EpiphanyIdentity[]
|
|||
id: face.id.trim(),
|
||||
displayName: face.displayName.trim().slice(0, 80),
|
||||
repoName: face.repoName?.trim(),
|
||||
sourceRepoName: face.sourceRepoName?.trim(),
|
||||
repoPath: face.repoPath?.trim(),
|
||||
roleId: face.roleId?.trim(),
|
||||
identityKind: face.identityKind,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ const repoDiscordIdentitySchema = z.object({
|
|||
id: z.string().trim().min(1),
|
||||
identityKind: z.enum(["repo_face", "native_persona"]).default("repo_face"),
|
||||
repoName: z.string().trim().min(1),
|
||||
sourceRepoName: z.string().trim().min(1).optional(),
|
||||
displayName: z.string().trim().min(1).max(80),
|
||||
repoPath: z.string().trim().min(1).optional(),
|
||||
roleId: z.string().trim().min(1).optional(),
|
||||
|
|
@ -154,6 +155,16 @@ export function resolveRepoFaceStatePath(
|
|||
return resolve(storageRoot, "private", "repo-faces", `${sanitizePathSegment(identity.id)}.cc`);
|
||||
}
|
||||
|
||||
/**
|
||||
* The searchable source corpus is explicit. A native Persona's public label
|
||||
* must never accidentally become a repository-index filter.
|
||||
*/
|
||||
export function getRepoFaceSourceRepoName(identity: RepoDiscordIdentity): string | undefined {
|
||||
return identity.identityKind === "repo_face"
|
||||
? identity.sourceRepoName ?? identity.repoName
|
||||
: undefined;
|
||||
}
|
||||
|
||||
export function findCrossRepoJurisdictionMentions(
|
||||
identity: RepoDiscordIdentity,
|
||||
registry: RepoDiscordIdentityRegistry,
|
||||
|
|
@ -208,6 +219,7 @@ function normalizeRepoDiscordIdentities(
|
|||
id: identity.id.trim(),
|
||||
identityKind: identity.identityKind,
|
||||
repoName: identity.repoName.trim(),
|
||||
sourceRepoName: identity.sourceRepoName?.trim(),
|
||||
displayName: identity.displayName.trim().slice(0, 80),
|
||||
repoPath: identity.repoPath?.trim(),
|
||||
roleId: identity.roleId?.trim(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue