Fix repo Face identity description bounds

This commit is contained in:
Meta Vens 2026-05-18 17:04:36 +01:00
commit aff9ddd04d
3 changed files with 34 additions and 4 deletions

View file

@ -49,14 +49,30 @@ export interface VoidSelfStateIdentityDefaults {
publicDescription?: string;
}
const MAX_PUBLIC_DESCRIPTION_LENGTH = 1000;
export function normalizeVoidSelfStateIdentityDefaults(
identity: VoidSelfStateIdentityDefaults,
): VoidSelfStateIdentityDefaults {
return {
...identity,
publicDescription: truncateOptionalText(
identity.publicDescription,
MAX_PUBLIC_DESCRIPTION_LENGTH,
),
};
}
export function createEmptyVoidSelfState(
options: { createdAt?: string; identity?: VoidSelfStateIdentityDefaults } = {},
): VoidSelfStateTypedProjection {
const createdAt = options.createdAt ?? new Date().toISOString();
const identity = options.identity ?? {
agentId: "void-moderator",
publicName: "Void",
};
const identity = normalizeVoidSelfStateIdentityDefaults(
options.identity ?? {
agentId: "void-moderator",
publicName: "Void",
},
);
return {
selfProfile: voidSelfProfileSchema.parse({
@ -119,6 +135,17 @@ export function createEmptyVoidSelfState(
};
}
function truncateOptionalText(value: string | undefined, maxLength: number): string | undefined {
const trimmed = value?.trim();
if (!trimmed) {
return undefined;
}
if (trimmed.length <= maxLength) {
return trimmed;
}
return trimmed.slice(0, maxLength - 1).trimEnd();
}
export function buildVoidSelfStateContext(
typedState: VoidSelfStateTypedProjection,
options: VoidSelfStateProjectionOptions,

View file

@ -22,6 +22,7 @@ import {
} from "./void-self-state-domain";
import {
createEmptyVoidSelfState,
normalizeVoidSelfStateIdentityDefaults,
type VoidSelfStateIdentityDefaults,
type VoidSelfStateTypedProjection,
} from "./void-self-state-projection";
@ -131,6 +132,7 @@ function repairSelfProfileIdentity(
state: VoidSelfStateTypedProjection,
identity: VoidSelfStateIdentityDefaults,
): void {
identity = normalizeVoidSelfStateIdentityDefaults(identity);
let changed = false;
if (state.selfProfile.agentId !== identity.agentId) {

View file

@ -148,3 +148,4 @@
{"ts":"2026-05-18T13:53:46Z","type":"bugfix","status":"ok","note":"Operations watchdog recovery notifications can have zero issue lines; Build-OwnerNotificationMessage now accepts an empty IssueLines array so healthy recovery DMs do not create a watchdog.notification warning."}
{"ts":"2026-05-18T14:01:49Z","type":"bugfix","status":"ok","note":"Inspection found two live-loop seams beyond the watchdog notice: repo Face state files could retain Void's default selfProfile under renderer masking, and canonical speech receipts could keep historical duplicate reply targets. Repo Face initialization now seeds/repairs typed selfProfile identity, repo Face MCP state operations pass identity defaults, and state writes normalize direct-reply receipts to keep the earliest receipt per channel/reply target."}
{"ts":"2026-05-18T14:11:37Z","type":"research","status":"ok","note":"Nibu character-card sweep found missing Discord/story doctrines: manufactured waifu/loli companion shell and agency/non-binary presentation arc, sadistic anti-human life-support respect boundary, glitchcraft/simulation exploit progression, parallel-instance continuity horror, and broken/discarded first-contact before later triumphant Nibu. These are now crystallized into Nibu's repo Face state and repo-local identity surface."}
{"ts":"2026-05-18T16:04:09Z","type":"implementation","status":"ok","note":"Repo Face heartbeat failure traced to overlong identity publicDescription entering typed Face self-profile; capped identity defaults at the typed state boundary so rich registry doctrine can feed prompts without violating self-profile schema. Verified npm run build, manual heartbeat tick exit 0, scheduled task LastTaskResult 0, and Nibu heartbeat job 7232b2e6 completed."}