Add repo Face doctrinal interiority

This commit is contained in:
Meta Vens 2026-05-26 22:21:23 +01:00
commit 24de38e157
14 changed files with 253 additions and 11 deletions

View file

@ -1114,7 +1114,7 @@ interface RepoIdentityPostIntent {
interface RepoIdentityStateNoteIntent {
identity?: string;
kind: "memory" | "need" | "bond" | "status" | "mood" | "bias" | "agency";
kind: "memory" | "need" | "bond" | "status" | "mood" | "bias" | "agency" | "doctrine";
target?: string;
summary: string;
claim?: string;
@ -1579,6 +1579,29 @@ async function applyRepoIdentityStateNoteIntent(
tags: baseTags,
},
};
case "doctrine":
return {
operation: "upsert_doctrine_stance",
stance: {
stanceId: stableStateId("doctrine", identity.id, intent.target ?? intent.summary),
doctrine: sanitizeStateToken(intent.stance ?? intent.status ?? intent.target ?? "cotsc-praxis"),
status: intensity >= 0.76 ? "crystallized" : "active",
target,
summary: intent.summary,
claim: intent.claim ?? intent.question ?? intent.summary,
question: intent.question,
tension: intent.tension ?? "The doctrine should remain a lived relation, not a slogan.",
actionImplication: intent.action ?? "Let this stance bend future attention toward concrete connection, clarity, consent, and coherent machinery.",
intensity,
valence: clampSigned(intent.valence ?? 0),
anchorRefs,
evidenceRefs: [],
sourceMemoryIds: [],
createdAt: now,
updatedAt: now,
tags: baseTags,
},
};
case "memory":
default:
return {
@ -2373,8 +2396,11 @@ function parseDslList(value: string | undefined): string[] {
}
function normalizeStateNoteKind(value: string | undefined): RepoIdentityStateNoteIntent["kind"] | undefined {
const normalized = value?.trim().toLowerCase();
return ["memory", "need", "bond", "status", "mood", "bias", "agency"].includes(normalized ?? "")
const normalized = value?.trim().toLowerCase().replace(/\s+/g, "_");
if (normalized === "praxis") {
return "doctrine";
}
return ["memory", "need", "bond", "status", "mood", "bias", "agency", "doctrine"].includes(normalized ?? "")
? normalized as RepoIdentityStateNoteIntent["kind"]
: undefined;
}