diff --git a/apps/persona-scheduler/src/inspection-participant-factory.ts b/apps/persona-scheduler/src/inspection-participant-factory.ts new file mode 100644 index 0000000..da5cb80 --- /dev/null +++ b/apps/persona-scheduler/src/inspection-participant-factory.ts @@ -0,0 +1,35 @@ +import type { RepoDiscordIdentity } from "@voidbot/core"; +import type { InitiativeParticipant } from "./initiative-engine.js"; + +export function buildInspectionParticipant(identity: RepoDiscordIdentity, baseRecoveryMinutes: number): InitiativeParticipant { + 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:${normalize(identity.id)}`, `repo:${normalize(identity.repoName)}`], + heat: 1, + dynamicHeat: 0, + responsePressure: 0, + responsePressureEvidence: [], + semanticInterruptReceipts: [], + 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 normalize(value: string): string { + return value.trim().toLowerCase(); +} diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index b9dc714..a685f69 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -218,6 +218,7 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou - Persona Mind assembly now crosses `persona-memory-turn-coordinator.ts`. It sequences the existing typed state source, curiosity source/projector, state-packet projector, optional text-projection actuator, semantic memory source, and `persona-memory-recall-projector.ts` through narrow injected ports. Queued live turns and `--assemble-prompt` inspection now receive the same projected Mind and semantic-recall pair; the old shell accidentally omitted semantic recall from live turns. The coordinator does not select initiative, queue work, or mutate canonical Persona state. - Stored interaction-profile acquisition now enters through `readStoredPersonaHumanPronounGuidance` in `persona-social-context-source.ts`. The adapter owns opening the configured state provider and delegates visible-human selection, pronoun evidence precedence, and guaranteed close behavior to the existing source. The heartbeat shell no longer opens profile storage or manufactures a reader callback. - Repo-activity observation lowering now lives in pure `repo-activity-projector.ts`; `repo-activity-source.ts` retains exporter execution and parsing. Both live and inspection assembly use the same projector for `ok`, `unconfigured`, `unavailable`, and `malformed` evidence, and the shell's dead text helpers were deleted. +- Inspection-only initiative synthesis now lives in pure `inspection-participant-factory.ts`, including explicit zero semantic pressure and empty evidence/receipt state. The prompt-inspection CLI no longer fabricates a partial participant inside the orchestration shell. - Direct Face `UPDATE REQUEST` and `BIFROST TOPIC` packets are ignored while `REPO_FACE_BIFROST_ENABLED=false`. Do not debug missing Bifrost jobs as a live failure unless that flag has been deliberately enabled again. - Live model-facing prompt prose has started moving out of executable code. The shared loader is `packages/shared/src/prompt-template.ts`; extracted prompt surfaces live under `prompts/`, including repo Face turn/reviewer prompts, provider wrapper prompts, situational social read prompts, source-grounding reminders, consensus-feed prompts, and repo Face model-smoke scenarios. Code should project data and select prompt names; prompt files should own behavioral prose. - Identity collapse has started. Active bot, worker, MCP repo-identity tools, and Face CTB scheduler paths now load through the canonical Face registry and treat repo Discord identities as compatibility projections. Next bounded move is to finish removing remaining direct conceptual dependence on repo identities, then split the Face turn loop into scheduler, context assembler, prompt renderer, candidate parser, policy gate, and transport adapter. diff --git a/scripts/run-repo-face-heartbeats.ts b/scripts/run-repo-face-heartbeats.ts index 8f01635..f8b88c6 100644 --- a/scripts/run-repo-face-heartbeats.ts +++ b/scripts/run-repo-face-heartbeats.ts @@ -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 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) { diff --git a/scripts/smoke-persona-initiative-engine.ts b/scripts/smoke-persona-initiative-engine.ts index 77c16ff..926f00f 100644 --- a/scripts/smoke-persona-initiative-engine.ts +++ b/scripts/smoke-persona-initiative-engine.ts @@ -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({ diff --git a/state/evidence.jsonl b/state/evidence.jsonl index be1f6b7..1d258a9 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -436,3 +436,4 @@ {"ts":"2026-07-16T05:05:00Z","type":"architecture","status":"ok","note":"Persona Mind assembly moved into persona-memory-turn-coordinator.ts with injected state, curiosity, projection, and recall ports; recall text moved into persona-memory-recall-projector.ts. This exposed and repaired a live/inspection divergence: queued turns previously omitted semantic Persona recall while inspection included it. Both paths now consume the same projected Mind plus recall pair; shell fell to 718 lines and typecheck/initiative/migration smokes pass."} {"ts":"2026-07-16T05:15:00Z","type":"implementation","status":"ok","note":"Configured interaction-profile acquisition moved into persona-social-context-source.ts as readStoredPersonaHumanPronounGuidance. The shell no longer opens state storage or builds a profile-reader adapter; focused smoke proves existing pronoun policy is reused and provider close semantics survive the concrete adapter."} {"ts":"2026-07-16T05:20:00Z","type":"implementation","status":"ok","note":"Repo activity prompt lowering moved into pure repo-activity-projector.ts while repo-activity-source.ts retains exporter execution/parsing. Live and inspection paths share the projector; unavailable evidence smoke preserves failure detail and anti-stale-claim guidance. Three dead shell text/number helpers were deleted."} +{"ts":"2026-07-16T05:25:00Z","type":"implementation","status":"ok","note":"Inspection-only participant synthesis moved into inspection-participant-factory.ts with explicit zero dynamic heat/response pressure and empty evidence/receipt state. The heartbeat shell is now 618 lines and no longer fabricates a partial initiative participant for prompt inspection."} diff --git a/state/map.yaml b/state/map.yaml index f52ddd4..8128847 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -77,6 +77,7 @@ active_subgoals: - `persona-memory-turn-coordinator.ts` owns sequencing, not truth: it carries one typed Persona-state observation through curiosity evidence/projection, deterministic state-packet projection, optional text projection, and semantic recall, returning one projected Mind plus one recall surface. Each source/projector retains its own invariant and injected port. Live queued turns and inspection turns share this coordinator, so semantic recall can no longer exist only in inspection. `persona-memory-recall-projector.ts` alone lowers recall hits or unavailable evidence into prompt text. - `persona-social-context-source.ts` owns both the injected interaction-profile reader contract and the concrete configured-storage adapter. The adapter opens the provider and delegates visible-human selection, evidence precedence, and guaranteed close semantics to the source; the orchestration shell cannot open profile storage or duplicate pronoun policy. - `repo-activity-projector.ts` is the pure prompt-facing owner for typed repo-activity observations. `repo-activity-source.ts` alone executes and parses the exporter; live and inspection turns share the projector and the shell cannot reinterpret failures or raw exporter output. + - `inspection-participant-factory.ts` owns the inert synthetic initiative participant used only by `--assemble-prompt`. It explicitly carries zero dynamic heat/response pressure and empty evidence/receipt state, reads no live scheduler state, and cannot queue work. - `bifrost-governance-source.ts` owns the remaining Bifrost digest CLI adapter and converts command or parse failures into typed error topics. Persona prompt composition receives governance facts without knowing Bifrost process mechanics; `scripts/run-repo-face-heartbeats.ts` may not invoke the Bifrost CLI directly. - `initiative-engine.ts` is the only writer of scheduler state fields and history. Reconciliation, controls, pause/disabled skips, stale-turn recovery witnesses, semantic pressure, attention consumption, queue transitions, and tick finalization all cross named engine commit primitives. Queue/context actuators return results and cannot patch participants or history directly. - `turn-actuator.ts` owns lowering an assembled Persona prompt and evidence bundle into the canonical worker `ContextBundle` and approved `repo-face-rumination` job. It owns the worker actor, command, request ID, approval defaults, and `createJob` call, then returns only a queue receipt. The orchestration shell chooses no queue mechanics and the actuator cannot read Persona or initiative state. @@ -290,4 +291,4 @@ rejected_paths: current_status: summary: VoidBot's bot/worker/provider/RAG/Postgres/Qdrant/CultCache structure is live. Repo Face/persona heartbeat jobs run through the direct `openai_api` provider configured for MiMo `mimo-v2.5-pro`, with the expensive state-projector pass still disabled. The 2026-07-04 transport repair replaced the old Bifrost HTTP/token bridge shortcut with typed Bifrost CultMesh Discord command and receipt documents advertised in the Bifrost provider store at `cultmesh://asgard.starfire.bifrost/commands/discord-post`. VoidBot stores the Bifrost target as a CultMesh URI, writes command docs to `E:/Projects/Bifrost/.bifrost/provider-store.cc`, optionally pumps Bifrost's command processor, and waits for typed receipts before completing repo Face Discord delivery. Bifrost's provider advertisement exposes `discord.post` command metadata for Odin/Eve agents, and a bounded Weksa live-fire completed visibly. Eve live state now runs end to end through CultLib dev retained publications, Hermodr ordered SSE, Eve component bindings, and VoidBot typed control state. Receipts acknowledge intent only. Heat initial load, provider-driven change, and browser-command change were visibly verified without reload through the same subscription. - next_action: Keep the Yggdrasil swarm paused. Move inspection-only participant synthesis from `scripts/run-repo-face-heartbeats.ts` into a pure scheduler inspection fixture/factory, then audit the remaining shell for any authority beyond CLI parsing, top-level orchestration, neutral participant projection, and source/actuator calls. Do not unpause without an explicit controlled-live-fire decision. + next_action: Keep the Yggdrasil swarm paused. Audit the remaining 618-line `scripts/run-repo-face-heartbeats.ts` shell by authority: top-level tick coordination, participant-spec projection, participant dispatch, live Persona context coordination, prompt-inspection CLI, and argument parsing. Extract only boundaries that own a named invariant; if the remaining shell is merely orchestration, stop shaving it for line-count theater and move to the still-separate Void moderation/mood daemon ownership map. Do not unpause without an explicit controlled-live-fire decision.