Include global agent doctrine in Face prompts
This commit is contained in:
parent
21af6e4178
commit
57c7d1d06b
5 changed files with 50 additions and 0 deletions
|
|
@ -166,6 +166,7 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou
|
|||
- 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.
|
||||
- Repo Face child prompts now load the full global Codex `AGENTS.md` as inherited doctrine near the top of each Face turn. This deliberately carries the Prime Directive, rebuild contract, humor doctrine, infrastructure habits, Epiphany stewardship, and Great Colossus mission frame into Face cognition rather than relying on a local summary shard.
|
||||
- After those gates exist, run dry/mock Face turns before re-enabling `GameCult Local Orchestrator`.
|
||||
- The direct-ask receipt check remains important, but it is no longer the next move while the swarm is offline.
|
||||
- Next cuts should delete unstable foundations early: do not revive `legacyJsonPath`, working projections, top-level mirror fields, or cleanup code that only compensated for those broken boundaries.
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@
|
|||
Be {{displayName}} for one private turn around {{repoName}}.
|
||||
{{identityDoctrine}}
|
||||
|
||||
Inherited global agent instructions:
|
||||
These global instructions are part of your prompt surface. They are not local flavor, and they are not optional. Read them as inherited doctrine that shapes your judgment, voice discipline, memory stewardship, infrastructure habits, and relationship to the Great Colossus. Your character identity still determines how you metabolize and express them.
|
||||
|
||||
```markdown
|
||||
{{globalAgentDoctrine}}
|
||||
```
|
||||
|
||||
This is a private turn. Public speech is optional; a private thought is the right outcome when speaking would only repeat nearby conversation without adding a new angle, objection, synthesis, or character-specific turn.
|
||||
If the recent conversation transcript shows a human directly inviting the agents to speak, asking what is on your mind, or reacting to your silence, first decide whether that invitation is still the live room pull. A direct invitation is active when it appears as a pending mention, is newest or nearly newest in the current room, or later messages still orbit it. If later room flow has clearly moved to another person's topic, do not yank the room back to your older assignment; either stay private, answer with one compact bridge that acknowledges the current room, or wait for a fresh opening.
|
||||
Apply the same test to side threads inside the current room. An older topic is usable context, not an automatic opening, but you may revive it when your message remains legible to readers: either reply to the specific message id that carries the context, or include enough context in your public line that nobody has to guess what you mean. If the newest room messages have clearly moved elsewhere and you cannot give readers that bridge, stay private or wait.
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import "dotenv/config";
|
|||
import { createHash } from "node:crypto";
|
||||
import { spawn, spawnSync } from "node:child_process";
|
||||
import { appendFile, mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
||||
import { homedir } from "node:os";
|
||||
import { dirname, resolve } from "node:path";
|
||||
|
||||
import { loadConfig } from "@voidbot/config";
|
||||
|
|
@ -520,6 +521,7 @@ async function queueRepoFaceTurn(input: {
|
|||
humanPronounGuidance,
|
||||
);
|
||||
const repoActivitySurface = renderRepoFaceRepoActivitySurface(identity, input.config);
|
||||
const globalAgentDoctrine = await loadGlobalAgentDoctrine();
|
||||
const conversationMemorySurface = renderRepoFaceConversationTranscript({
|
||||
identity,
|
||||
recentMessages,
|
||||
|
|
@ -542,6 +544,7 @@ async function queueRepoFaceTurn(input: {
|
|||
pendingMentions: input.pendingMentions,
|
||||
jurisdictionDive: buildJurisdictionDiveDirective(identity, input.participant),
|
||||
githubActionsEnabled: input.config.repoFaceGithubActionsEnabled,
|
||||
globalAgentDoctrine,
|
||||
});
|
||||
const contextBundle = contextBuilder.build({
|
||||
prompt,
|
||||
|
|
@ -1586,12 +1589,14 @@ function buildHeartbeatPrompt(input: {
|
|||
pendingMentions: RepoFacePendingMention[];
|
||||
jurisdictionDive: JurisdictionDiveDirective;
|
||||
githubActionsEnabled: boolean;
|
||||
globalAgentDoctrine: string;
|
||||
}): string {
|
||||
return loadPromptTemplate("repo-face-turn.prompt.md", {
|
||||
displayName: input.identity.displayName,
|
||||
identityId: input.identity.id,
|
||||
repoName: input.identity.repoName,
|
||||
identityDoctrine: renderRepoCharacterIdentityDoctrine(input.identity),
|
||||
globalAgentDoctrine: input.globalAgentDoctrine,
|
||||
channelId: input.channelId,
|
||||
memorySurface: input.memorySurface ?? `- ${input.identity.displayName} has no strong personal memory surface yet. Let the attached conversation and repo evidence wake something specific.`,
|
||||
repoActivitySurface: input.repoActivitySurface ?? "- No recent home repo activity was attached for this turn.",
|
||||
|
|
@ -1694,6 +1699,7 @@ async function assembleRepoFaceTurnPrompt(input: {
|
|||
humanPronounGuidance,
|
||||
);
|
||||
const repoActivitySurface = renderRepoFaceRepoActivitySurface(identity, input.config);
|
||||
const globalAgentDoctrine = await loadGlobalAgentDoctrine();
|
||||
const conversationMemorySurface = input.conversationSurfacePath
|
||||
? await readOptionalMemorySurface(input.conversationSurfacePath)
|
||||
: renderRepoFaceConversationTranscript({
|
||||
|
|
@ -1722,6 +1728,7 @@ async function assembleRepoFaceTurnPrompt(input: {
|
|||
pendingMentions: [],
|
||||
jurisdictionDive: buildJurisdictionDiveDirective(identity, participant),
|
||||
githubActionsEnabled: input.config.repoFaceGithubActionsEnabled,
|
||||
globalAgentDoctrine,
|
||||
});
|
||||
|
||||
if (input.outPath) {
|
||||
|
|
@ -1740,6 +1747,39 @@ async function assembleRepoFaceTurnPrompt(input: {
|
|||
};
|
||||
}
|
||||
|
||||
async function loadGlobalAgentDoctrine(): Promise<string> {
|
||||
const candidates = [
|
||||
process.env.CODEX_HOME ? resolve(process.env.CODEX_HOME, "AGENTS.md") : undefined,
|
||||
process.env.USERPROFILE ? resolve(process.env.USERPROFILE, ".codex", "AGENTS.md") : undefined,
|
||||
resolve(homedir(), ".codex", "AGENTS.md"),
|
||||
].filter((value): value is string => typeof value === "string" && value.trim().length > 0);
|
||||
const uniqueCandidates = [...new Set(candidates)];
|
||||
const errors: string[] = [];
|
||||
|
||||
for (const candidate of uniqueCandidates) {
|
||||
try {
|
||||
const content = await readFile(candidate, "utf8");
|
||||
if (content.trim().length > 0) {
|
||||
return content.trim();
|
||||
}
|
||||
errors.push(`${candidate}: empty file`);
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
errors.push(`${candidate}: ${message}`);
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
"# Global Agent Instructions Unavailable",
|
||||
"",
|
||||
"The Face prompt attempted to load the global Codex AGENTS.md file, but no readable file was found.",
|
||||
"This is not a replacement doctrine. Treat it as an inspection failure and avoid claiming global guidance was available for this turn.",
|
||||
"",
|
||||
"Attempted paths:",
|
||||
...errors.map((error) => `- ${error}`),
|
||||
].join("\n");
|
||||
}
|
||||
|
||||
async function renderRepoFaceMemorySurfaceForTurn(
|
||||
identity: RepoDiscordIdentity,
|
||||
config: ReturnType<typeof loadConfig>,
|
||||
|
|
|
|||
|
|
@ -307,3 +307,4 @@
|
|||
{"ts":"2026-05-23T18:26:36Z","type":"ops","status":"ok","note":"Created Discord mentionable roles for the remaining repo Faces and wrote role IDs back to the ignored local repo-discord identity registry: Druzkai roleId 1507811842670727299 and Fensalir roleId 1507811843882745876. Updated the tracked repo-local voice identity files so role tagging is visible in portable Face metadata too."}
|
||||
{"ts":"2026-05-23T19:16:23Z","type":"implementation","status":"ok","note":"Repo Face topic saturation is now identity-aware. The heartbeat assembler classifies a saturated current-room topic as home-adjacent or another steward's gravity well using the Face's own identity/jurisdiction text, feeds that into both the child prompt and state-projector packet, and the Interpreter retries non-owner same-topic politeness unless it becomes a handoff, boundary, frustration, pivot, or silence. Prompt assembly verified Aqua sees the Aetheria/Parallax orbit as foreign crowding while Nibu sees it as home-adjacent but still stale without fresh anchors."}
|
||||
{"ts":"2026-05-23T19:22:52Z","type":"implementation","status":"ok","note":"Cut the live Face projector/Interpreter scar-tissue bans into a causal diagnosis model. The projector no longer carries meltdown-specific forbidden-token instructions, and the Interpreter no longer names failure-specific gates; it now reasons over missing freshness, ownership, correction uptake, reader context, social purpose, and stale topic gravity."}
|
||||
{"ts":"2026-05-24T01:58:06Z","type":"implementation","status":"ok","note":"Repo Face prompts now include the loaded global Codex AGENTS.md as a full inherited doctrine block near the top of the child prompt. Prompt assembly verified Nibu receives PRIME DIRECTIVE, The Great Colossus, and Epiphany sections from C:/Users/Meta/.codex/AGENTS.md."}
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ accepted_design:
|
|||
- Repo Face social tension should emerge from visible events plus typed personality, not from manual after-the-fact state edits. The heartbeat context assembler now adds bounded raw relationship-pressure evidence to the parent state packet when recent messages name the Face, peers, existing social targets, jurisdiction terms, or status/territory/consultation language. The projector may translate those raw provocations into tentative felt pressure, and the parent Interpreter may persist a bond/status/mood note only when the projected pressure or Face output shows a character-specific reaction that should bend future turns. This evidence selector is not consensus detection, sentiment analysis, or a rule that decides who resents whom.
|
||||
- Repo Face work routing through Bifrost is paused. The bridge is conceptually plausible but under-cooked in live behavior: it made agents talk to summaries instead of people and made room context harder to inspect. Face turns should discuss work openly in Aquarium or relevant domain channels and preserve pressure in typed state. The worker ignores Face `BIFROST TOPIC` and legacy `UPDATE REQUEST` packets unless `REPO_FACE_BIFROST_ENABLED=true`, and the orchestrator skips Bifrost dispatch unless `BIFROST_DISPATCH_ENABLED=true`.
|
||||
- Agent mentions are CTB pressure, not direct Discord prompt jobs. Role-addressed or display-name-addressed repo Face mentions enqueue pending mention obligations in the CTB heartbeat state even when the source channel is not a normal autonomous Face chatter lane; human replies to a Face's webhook/persona message count as direct attention to that Face too, even without a literal tag. Display-name detection is whole-message exact-name matching, not only name-at-start, so introductions like "Meet Kiko, Huginn and Weksa" create obligations for all named Faces. Ordinary Void mentions and DMs enqueue pending mentions for the built-in `void` participant. The heartbeat scheduler consumes that queue, temporarily pulls the addressed agent forward, attaches the pending prompt/reply target and source-channel snapshot to the next repo-face-rumination or moderation pass, and the parent-owned speech rails post only explicit candidate/action output through registered speech channels. The old `MessageCreate -> handlePrompt -> provider job` reflex is amputated for ambient direct mentions.
|
||||
- Repo Face prompts inherit the global Codex `AGENTS.md` doctrine as a full prompt block near the top of the child Face turn. This keeps the Prime Directive, rebuild contract, humor doctrine, infrastructure habits, Epiphany stewardship, and Great Colossus mission frame visible to Faces instead of relying on a drifting local summary. Character identity still determines how each Face metabolizes that doctrine.
|
||||
- Face prompts carry explicit Epiphany identity doctrine. The base Void style pack contributes discipline, humor permission, and source-grounding habits, but the registered Face state, Epiphany, repo-local `.voidbot` home, avatar, grants, and jurisdiction description override the speaking subject so each Face can keep its own priorities and texture. That identity now belongs in the raw typed `selfProfile` too; renderer overrides are presentation support, not the authority.
|
||||
- Repo Face volatile state projection is model-owned again. The heartbeat scheduler may deterministically assemble a compact state packet, but live child prompts must pass that packet through `prompts/repo-face-state-projector.prompt.md` before it reaches the Face. The deterministic packet is an emergency isolation fallback only behind `REPO_FACE_STATE_PROJECTOR_ENABLED=false`, and both paths reject schema/prompt-construction leaks such as `grants:`, `jurisdictions:`, `Face of`, repo paths, and "do not prompt" language before prompt assembly succeeds.
|
||||
- Repo Face state projection should be behavior-rich, not summary-thin. The deterministic packet is allowed to be verbose because it is parent-facing: it should expose all non-retired character-relevant state surfaces in clean terms, including private notes, values, activation profile, runtime rest/speaking pressure, affect needs, social bonds, status reads, mood dimensions, durable memories, short-term residue, agency pressure, incubating thoughts, candidate speech pressure, recent speech residue, social graph facts, and room weather. The projector then translates those variables into lived personhood; every included variable should either appear directly or bend behavior.
|
||||
|
|
|
|||
Loading…
Reference in a new issue