Extract inspection participant factory
This commit is contained in:
parent
be3659e632
commit
b8e837ee18
6 changed files with 44 additions and 39 deletions
|
|
@ -66,6 +66,7 @@ import {
|
|||
} from "../apps/persona-scheduler/dist/bifrost-governance-source.js";
|
||||
import { submitPersonaTurn } from "../apps/persona-scheduler/dist/turn-actuator.js";
|
||||
import { launchVoidModerationTurn } from "../apps/persona-scheduler/dist/void-moderation-turn-actuator.js";
|
||||
import { buildInspectionParticipant } from "../apps/persona-scheduler/dist/inspection-participant-factory.js";
|
||||
import {
|
||||
buildPersonaChannelPlan as buildChannelPlan,
|
||||
newestPendingMentionChannel,
|
||||
|
|
@ -601,44 +602,6 @@ async function readOptionalMemorySurface(path: string | undefined): Promise<stri
|
|||
return content.length > 0 ? content : undefined;
|
||||
}
|
||||
|
||||
function buildInspectionParticipant(
|
||||
identity: RepoDiscordIdentity,
|
||||
baseRecoveryMinutes: number,
|
||||
): FaceHeartbeatParticipant {
|
||||
return {
|
||||
identityId: identity.id,
|
||||
participantKind: "repo_face",
|
||||
turnKind: "repo_face_rumination",
|
||||
repoName: identity.repoName,
|
||||
displayName: identity.displayName,
|
||||
initiativeSpeed: 1,
|
||||
reactionBias: 0.5,
|
||||
interruptThreshold: 0.6,
|
||||
currentLoad: 0,
|
||||
status: "active",
|
||||
groups: [
|
||||
"all",
|
||||
"kind:repo_face",
|
||||
"turn:repo_face_rumination",
|
||||
`identity:${normalizeKey(identity.id)}`,
|
||||
`repo:${normalizeKey(identity.repoName)}`,
|
||||
],
|
||||
heat: 1,
|
||||
effectiveSpeed: 1,
|
||||
baseRecoveryMinutes,
|
||||
nextTurnAt: 0,
|
||||
queuedCount: 0,
|
||||
constraints: [
|
||||
"Prompt assembly is deterministic inspection only.",
|
||||
"Character memory and affect prose must come from the Interpreter memory surface.",
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeKey(value: string): string {
|
||||
return value.trim().toLowerCase();
|
||||
}
|
||||
|
||||
function readArgValue(name: string): string | undefined {
|
||||
const index = process.argv.indexOf(name);
|
||||
if (index < 0) {
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ import { buildPersonaJurisdictionDiveDirective, buildPersonaTurnPrompt } from ".
|
|||
import { assemblePersonaTurn } from "../apps/persona-scheduler/dist/persona-turn-assembler.js";
|
||||
import { buildVoidModerationLaunchCommand, launchVoidModerationTurn, waitForVoidModerationHandshake } from "../apps/persona-scheduler/dist/void-moderation-turn-actuator.js";
|
||||
import { readGlobalAgentDoctrine } from "../apps/persona-scheduler/dist/global-agent-doctrine-source.js";
|
||||
import { buildInspectionParticipant } from "../apps/persona-scheduler/dist/inspection-participant-factory.js";
|
||||
import { projectGamecultPersonaState } from "../apps/persona-scheduler/dist/persona-standard-state-projector.js";
|
||||
import { projectPersonaStatePacket } from "../apps/persona-scheduler/dist/persona-state-packet-projector.js";
|
||||
import { extractLastPersonaProjectionMessage, isRetryablePersonaProjectionFailure } from "../apps/persona-scheduler/dist/persona-text-projection-actuator.js";
|
||||
|
|
@ -704,6 +705,9 @@ assert.match(conversationProjection.transcript, /Visible cross-channel chronolog
|
|||
assert.match(conversationProjection.topicAttractor ?? "", /semantic \(8\)/, "conversation projection owns topic-attractor facts");
|
||||
assert.match(renderPersonaRoomTopicSaturation(routedIdentity, saturatedMessages), /Current room topic saturation:/, "turn-facing saturation and memory-facing attractors share one conversation owner");
|
||||
const promptParticipant = participant("nibu", 0);
|
||||
const inspectionParticipant = buildInspectionParticipant(routedIdentity, 90);
|
||||
assert.deepEqual(inspectionParticipant.groups.slice(-2), ["identity:nibu", "repo:aetherialore"], "inspection participant synthesis is a pure scheduler fixture with normalized identity groups");
|
||||
assert.equal(inspectionParticipant.baseRecoveryMinutes, 90, "inspection synthesis carries explicit scheduler timing without reading live initiative state");
|
||||
const jurisdictionDive = buildPersonaJurisdictionDiveDirective(routedIdentity, promptParticipant);
|
||||
assert.equal(jurisdictionDive.cadence, 3, "the turn-prompt projector owns Nibu's jurisdiction-dive cadence");
|
||||
const projectedTurnPrompt = buildPersonaTurnPrompt({
|
||||
|
|
|
|||
Loading…
Reference in a new issue