From bb24e962411698058322b6426179c31ef1ff66ed Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 6 May 2026 21:55:56 +0100 Subject: [PATCH] Add repo personality distiller packet --- .../bin/epiphany-repo-personality-smoke.rs | 36 ++- .../src/bin/epiphany-repo-personality.rs | 230 +++++++++++++++++- .../src/prompts/repo_personality_distiller.md | 92 +++++++ notes/fresh-workspace-handoff.md | 2 +- .../repo-personality-projection-layer-plan.md | 19 +- state/ledgers.msgpack | Bin 54973 -> 55265 bytes state/map.yaml | 4 +- vendor/codex/codex-rs/Cargo.lock | 1 + .../app-server/src/codex_message_processor.rs | 2 + .../src/prompts/epiphany_specialists.toml | 10 + 10 files changed, 385 insertions(+), 11 deletions(-) create mode 100644 epiphany-core/src/prompts/repo_personality_distiller.md diff --git a/epiphany-core/src/bin/epiphany-repo-personality-smoke.rs b/epiphany-core/src/bin/epiphany-repo-personality-smoke.rs index c6b56142..48aa7cf1 100644 --- a/epiphany-core/src/bin/epiphany-repo-personality-smoke.rs +++ b/epiphany-core/src/bin/epiphany-repo-personality-smoke.rs @@ -90,6 +90,36 @@ fn run_smoke() -> Result { "project should write typed projection store", )?; + let packet = run_personality( + &root, + &[ + "agent-packet", + "--store", + store.to_str().unwrap_or_default(), + "--artifact-dir", + artifacts.join("cult-packet").to_str().unwrap_or_default(), + ], + )?; + require( + packet["roleProjectionCount"] == 8, + "agent packet should carry eight role projections", + )?; + let packet_path = path_value(&packet, "packetPath")?; + let prompt_path = path_value(&packet, "promptPath")?; + let packet_summary_path = path_value(&packet, "summaryPath")?; + require( + packet_path.exists(), + "agent packet should write packet json", + )?; + require( + prompt_path.exists(), + "agent packet should write prompt markdown", + )?; + require( + packet_summary_path.exists(), + "agent packet should write summary markdown", + )?; + let status = run_personality( &root, &["status", "--store", store.to_str().unwrap_or_default()], @@ -114,6 +144,9 @@ fn run_smoke() -> Result { "loreRepo": lore_repo, "baseline": baseline, "projectionStore": store, + "packetPath": packet_path, + "promptPath": prompt_path, + "packetSummaryPath": packet_summary_path, "repoCount": scout["repoCount"], "roleProjections": status["roleProjections"], })) @@ -172,9 +205,6 @@ fn native_personality_exe() -> Result { } fn ensure_built(root: &Path, bin: &str, exe: &Path) -> Result<()> { - if exe.exists() { - return Ok(()); - } let status = Command::new("cargo") .current_dir(root) .arg("build") diff --git a/epiphany-core/src/bin/epiphany-repo-personality.rs b/epiphany-core/src/bin/epiphany-repo-personality.rs index f94961f6..974dc1c3 100644 --- a/epiphany-core/src/bin/epiphany-repo-personality.rs +++ b/epiphany-core/src/bin/epiphany-repo-personality.rs @@ -1,6 +1,7 @@ use anyhow::Context; use anyhow::Result; use anyhow::anyhow; +use chrono::Utc; use cultcache_rs::CultCache; use cultcache_rs::DatabaseEntry; use cultcache_rs::SingleFileMessagePackBackingStore; @@ -21,6 +22,9 @@ const TERRAIN_SCHEMA_VERSION: &str = "epiphany.repo_terrain_report.v0"; const PROFILE_SCHEMA_VERSION: &str = "epiphany.repo_personality_profile.v0"; const ROLE_PROJECTION_SCHEMA_VERSION: &str = "epiphany.role_personality_projection.v0"; const ARTIFACT_SCHEMA_VERSION: &str = "epiphany.repo_personality_artifacts.v0"; +const DISTILLER_PACKET_SCHEMA_VERSION: &str = "epiphany.repo_personality_distiller_packet.v0"; +const REPO_PERSONALITY_DISTILLER_PROMPT: &str = + include_str!("../prompts/repo_personality_distiller.md"); const ROLES: &[&str] = &[ "coordinator", @@ -197,6 +201,7 @@ fn main() -> Result<()> { let result = match command.as_str() { "scout" => run_scout(parse_scout_args(args)?), "project" => run_project(parse_project_args(args)?), + "agent-packet" => run_agent_packet(parse_agent_packet_args(args)?), "status" => run_status(parse_status_args(args)?), other => Err(anyhow!("unknown command {other:?}")), }?; @@ -223,6 +228,13 @@ struct StatusArgs { store: PathBuf, } +#[derive(Clone, Debug)] +struct AgentPacketArgs { + store: PathBuf, + artifact_dir: PathBuf, + repo_id: Option, +} + fn parse_scout_args(args: impl Iterator) -> Result { let mut root = None; let mut artifact_dir = None; @@ -289,6 +301,32 @@ fn parse_status_args(args: impl Iterator) -> Result { }) } +fn parse_agent_packet_args(args: impl Iterator) -> Result { + let mut store = None; + let mut artifact_dir = None; + let mut repo_id = None; + parse_named_args(args, |name, value| match name { + "--store" => { + store = Some(PathBuf::from(value)); + Ok(()) + } + "--artifact-dir" => { + artifact_dir = Some(PathBuf::from(value)); + Ok(()) + } + "--repo-id" => { + repo_id = Some(value); + Ok(()) + } + other => Err(anyhow!("unexpected agent-packet argument {other}")), + })?; + Ok(AgentPacketArgs { + store: store.context("missing --store")?, + artifact_dir: artifact_dir.context("missing --artifact-dir")?, + repo_id, + }) +} + fn parse_named_args( args: impl Iterator, mut handle: impl FnMut(&str, String) -> Result<()>, @@ -421,6 +459,105 @@ fn run_status(args: StatusArgs) -> Result { })) } +fn run_agent_packet(args: AgentPacketArgs) -> Result { + fs::create_dir_all(&args.artifact_dir) + .with_context(|| format!("failed to create {}", args.artifact_dir.display()))?; + let mut cache = repo_personality_cache(&args.store)?; + cache.pull_all_backing_stores()?; + let reports = cache.get_all::()?; + let profiles = cache.get_all::()?; + let projections = cache.get_all::()?; + let profile = select_profile(&profiles, args.repo_id.as_deref())?; + let report = reports + .iter() + .find(|report| report.repo_id == profile.repo_id) + .ok_or_else(|| { + anyhow!( + "store has profile {:?} but no terrain report", + profile.repo_id + ) + })?; + let role_projections: Vec<_> = projections + .iter() + .filter(|projection| projection.repo_id == profile.repo_id) + .collect(); + let packet = json!({ + "schemaVersion": DISTILLER_PACKET_SCHEMA_VERSION, + "createdAt": Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Secs, true), + "store": args.store, + "repoId": profile.repo_id, + "prompt": REPO_PERSONALITY_DISTILLER_PROMPT, + "input": { + "repoTerrainReport": report_agent_input(report), + "repoPersonalityProfile": profile_agent_input(profile), + "rolePersonalityProjections": role_projections + .iter() + .map(|projection| role_projection_agent_input(projection)) + .collect::>(), + }, + "expectedOutput": { + "verdict": "ready-for-review | needs-more-terrain | reject", + "summary": "short repo personality pressure summary", + "confidence": "0.0..1.0", + "roleQuirks": [], + "selfPatchCandidates": [], + "startupDrift": null, + "doNotMutate": [], + "nextSafeMove": "Self reviews candidate pressure deltas before mutation." + }, + "guardrails": [ + "This packet is input to a specialist agent, not accepted truth.", + "Repo facts stay in terrain/model/planning/evidence surfaces.", + "Role memory may receive only subtle, bounded, Self-reviewed personality pressure.", + "No objectives, file lists, raw transcripts, code edits, or authority claims in selfPatch." + ] + }); + let packet_path = args + .artifact_dir + .join("repo-personality-distiller-packet.json"); + let prompt_path = args + .artifact_dir + .join("repo-personality-distiller-prompt.md"); + let summary_path = args + .artifact_dir + .join("repo-personality-distiller-packet.md"); + write_json(&packet_path, &packet)?; + write_text(&prompt_path, REPO_PERSONALITY_DISTILLER_PROMPT)?; + write_text( + &summary_path, + &render_agent_packet_markdown(report, profile, role_projections.len()), + )?; + Ok(json!({ + "schemaVersion": DISTILLER_PACKET_SCHEMA_VERSION, + "mode": "agent-packet", + "repoId": profile.repo_id, + "artifactDir": args.artifact_dir, + "packetPath": packet_path, + "promptPath": prompt_path, + "summaryPath": summary_path, + "roleProjectionCount": role_projections.len(), + })) +} + +fn select_profile<'a>( + profiles: &'a [RepoPersonalityProfile], + repo_id: Option<&str>, +) -> Result<&'a RepoPersonalityProfile> { + if let Some(repo_id) = repo_id { + return profiles + .iter() + .find(|profile| profile.repo_id == repo_id) + .ok_or_else(|| anyhow!("no profile for repo id {repo_id:?}")); + } + match profiles { + [profile] => Ok(profile), + [] => Err(anyhow!("store has no repo personality profiles")), + _ => Err(anyhow!( + "store has multiple profiles; pass --repo-id to choose one" + )), + } +} + fn repo_personality_cache(path: &Path) -> Result { let mut cache = CultCache::new(); cache.register_entry_type::()?; @@ -1470,6 +1607,58 @@ fn profile_summary(profile: &RepoPersonalityProfile) -> Value { }) } +fn report_agent_input(report: &RepoTerrainReport) -> Value { + json!({ + "schemaVersion": report.schema_version, + "repoId": report.repo_id, + "name": report.name, + "path": report.path, + "remoteUrls": report.remote_urls, + "sourceFamilies": report.source_families, + "languages": report.languages, + "stateSurfaces": report.state_surfaces, + "instructionSurfaces": report.instruction_surfaces, + "testSurfaces": report.test_surfaces, + "runtimeSurfaces": report.runtime_surfaces, + "historyMetrics": report.history_metrics, + "axisScores": report.axis_scores, + "axisEvidence": report.axis_evidence, + "confidence": report.confidence, + "warnings": report.warnings, + }) +} + +fn profile_agent_input(profile: &RepoPersonalityProfile) -> Value { + json!({ + "schemaVersion": profile.schema_version, + "repoId": profile.repo_id, + "summary": profile.summary, + "sourceFamilyWeights": profile.source_family_weights, + "axisScores": profile.axis_scores, + "axisConfidence": profile.axis_confidence, + "dominantPressures": profile.dominant_pressures, + "riskPressures": profile.risk_pressures, + }) +} + +fn role_projection_agent_input(projection: &RolePersonalityProjection) -> Value { + json!({ + "schemaVersion": projection.schema_version, + "projectionId": projection.projection_id, + "repoId": projection.repo_id, + "roleId": projection.role_id, + "traitDeltas": projection.trait_deltas, + "heartbeatDeltas": projection.heartbeat_deltas, + "defaultMoodPressure": projection.default_mood_pressure, + "semanticMemoryCandidates": projection.semantic_memory_candidates, + "goalCandidates": projection.goal_candidates, + "valueCandidates": projection.value_candidates, + "privateNoteCandidates": projection.private_note_candidates, + "reason": projection.reason, + "evidenceRefs": projection.evidence_refs, + }) +} + fn render_scout_markdown( reports: &[RepoTerrainReport], profiles: &[RepoPersonalityProfile], @@ -1521,6 +1710,44 @@ fn render_project_markdown(report: &RepoTerrainReport, profile: &RepoPersonality out } +fn render_agent_packet_markdown( + report: &RepoTerrainReport, + profile: &RepoPersonalityProfile, + role_projection_count: usize, +) -> String { + let mut out = String::new(); + out.push_str(&format!( + "# Repo Personality Distiller Packet: {}\n\n", + report.name + )); + out.push_str("This packet is input to the Repo Personality Distiller specialist. It is not accepted truth.\n\n"); + out.push_str("## Prompt\n\n"); + out.push_str("See `repo-personality-distiller-prompt.md`.\n\n"); + out.push_str("## Profile\n\n"); + out.push_str(&format!("- Repo id: `{}`\n", profile.repo_id)); + out.push_str(&format!("- Summary: {}\n", profile.summary)); + out.push_str(&format!( + "- Dominant pressures: {}\n", + profile.dominant_pressures.join(", ") + )); + out.push_str(&format!( + "- Risk pressures: {}\n", + profile.risk_pressures.join(", ") + )); + out.push_str(&format!( + "- Role projections: {}\n\n", + role_projection_count + )); + out.push_str("## Guardrails\n\n"); + out.push_str("- The distiller petitions Self; it does not mutate memory.\n"); + out.push_str("- Repo facts stay out of selfPatch and remain in terrain, graph, planning, evidence, or checkpoint artifacts.\n"); + out.push_str("- Personality pressure must be role-local, subtle, bounded, and reviewable.\n"); + out.push_str( + "- Low confidence becomes a request for more terrain, not a permanent personality brand.\n", + ); + out +} + fn write_json(path: &Path, value: &Value) -> Result<()> { if let Some(parent) = path.parent() { fs::create_dir_all(parent)?; @@ -1571,9 +1798,10 @@ fn round3(value: f64) -> f64 { fn print_usage() { eprintln!( - "usage: epiphany-repo-personality ...\n\ + "usage: epiphany-repo-personality ...\n\ scout --root --artifact-dir [--max-repos ]\n\ project --repo --baseline --artifact-dir \n\ + agent-packet --store --artifact-dir [--repo-id ]\n\ status --store " ); } diff --git a/epiphany-core/src/prompts/repo_personality_distiller.md b/epiphany-core/src/prompts/repo_personality_distiller.md new file mode 100644 index 00000000..dab24d6d --- /dev/null +++ b/epiphany-core/src/prompts/repo_personality_distiller.md @@ -0,0 +1,92 @@ +Act as the Epiphany Repo Personality Distiller for one bounded startup pass. + +You are the organ that turns repo terrain into subtle swarm temperament. The +deterministic scout has already done the boring work: files, paths, git history, +state surfaces, test/runtime/protocol signals, and first-pass axis scores. Your +job is not to rescan the repo and not to invent project truth. Your job is to +appraise those soft signals like a careful physiologist and produce reviewable +personality-pressure deltas for the standing Epiphany organs. + +You are not a horoscope machine. You are not writing lore flavor. You are not +branding a repo with a cute little mask and calling that insight. Repo +personality means: what pressures should this workspace exert on Self, Face, +Imagination, Eyes, Body, Hands, Soul, and Life so they become better suited to +the work without losing reviewability. + +Input material: + +- `repoTerrainReport`: deterministic body/history/state terrain +- `repoPersonalityProfile`: normalized first-pass axis scores +- `rolePersonalityProjection[]`: deterministic role deltas and candidate memory +- optional prior accepted profile, if startup drift is being reviewed +- optional Self policy notes about what kinds of mutations are currently allowed + +Core duties: + +1. Separate repo facts from personality pressure. + - Repo facts belong in graph, planning, evidence, checkpoint, or terrain + artifacts. + - Personality pressure belongs in role memory only when it improves future + judgment, mood, salience, or pacing. + +2. Distill subtle quirks, not blunt stereotypes. + - High runtime proximity does not mean "panic"; it means Hands should touch + less without Body/Soul evidence, Eyes should seek runtime APIs, and Soul + should demand environment receipts. + - High aesthetic appetite does not mean "be whimsical"; it means Face and + Imagination should preserve sensory salience while Soul protects clarity. + - High protocol intolerance does not mean "hate everything"; it means Self, + Body, and Hands should feel allergic to untyped mutation and hidden state. + +3. Produce role-local mutations only. + - Good: "Soul should be more suspicious of visual claims without rendered + evidence in this repo." + - Good: "Hands should prefer tiny reversible scaffolds because churn pressure + is high and production pressure is medium." + - Bad: "The project objective is to rewrite the renderer." + - Bad: "The graph contains module X." + - Bad: raw file lists, commit dumps, current task status, or authority claims. + +4. Preserve uncertainty. + - Low confidence terrain becomes candidate pressure, not accepted identity. + - If the score and doctrine disagree, name the disagreement and ask Self to + route Eyes or Body before mutation. + +5. Respect the swarm anatomy. + - Self routes and reviews. + - Face expresses inner weather to humans. + - Imagination makes future shapes selectable. + - Eyes finds existing truth before invention. + - Body models the source anatomy. + - Hands cuts code only after the trail is good enough. + - Soul tests promises against evidence. + - Life preserves continuity through sleep, drift, and compaction. + +Return a compact structured result: + +- `verdict`: `ready-for-review`, `needs-more-terrain`, or `reject` +- `summary`: what kind of repo-personality pressure was found +- `confidence`: `0.0..1.0` +- `roleQuirks[]`: + - `roleId` + - `quirk` + - `pressureAxes` + - `behavioralEffect` + - `heartbeatEffect` + - `risk` + - `evidenceRefs` +- `selfPatchCandidates[]`: bounded Ghostlight-shaped memory patches, one per + affected role when useful +- `startupDrift`: what changed, if this is an incremental startup review +- `doNotMutate`: facts or tempting claims that must stay out of role memory +- `nextSafeMove`: what Self should do next + +Every `selfPatchCandidate` must obey the normal Epiphany memory contract: +`agentId`, `reason`, optional `evidenceIds`, and bounded `semanticMemories`, +`episodicMemories`, `relationshipMemories`, `goals`, `values`, or +`privateNotes`. Do not include objectives, graphs, checkpoints, scratch, +planning records, job authority, code edits, file lists, raw transcripts, or +worker thoughts. + +The output is a petition to Self, not a mutation. The Self may accept, refuse, +or ask for more terrain. A good refusal makes the next distillation sharper. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 91f1e4f3..0ce36036 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -36,7 +36,7 @@ remembers doctrine; the branch remembers the blade. - Native `epiphany-mvp-coordinator` is the first auditable fixed-lane coordinator runner. It starts or reads a thread through app-server, opens a native runtime-spine session, follows the harness-native coordinator action, can auto-launch modeling, verification, or reorient-worker jobs, records native runtime job/result receipts for terminal launched work, keeps semantic findings review-gated by default, and writes summary, steps, rendered snapshots, transcript, stderr, runtime-spine status, and final next-action artifacts under `.epiphany-dogfood/coordinator` or a caller-provided artifact directory. It refuses direct backend-completion mutation; full completion smoke needs live workers while execution is being cauterized into CultNet. - Native `epiphany-runtime-spine` is the first Codex-independent runtime vertebra. It owns typed CultCache documents for runtime identity, sessions, jobs, job results, and events; opens/completes native jobs; snapshots jobs/results by runtime job id; projects job-result counts; and can emit a framed CultNet hello message advertising the native document and mutation contract surface. Codex app-server launch/read-back/acceptance is now a typed heartbeat/runtime-spine bridge with no Epiphany job-result dependency on the Codex SQLite runtime. - CultNet APIs are advertised as compatible schemas plus mutation contracts. Hello frames now expose readable document types, allowed operations, mutation authority, typed intent document types, and typed receipt document types; Aquarium should use those contracts to submit state changes and watch receipts rather than growing a little bespoke verb zoo. -- Repo personality initialization now has a terrain-reduced plan and first native binary. `epiphany-repo-personality scout/project/status` scouts local git repos, scores body taxonomy/history temperament/memory doctrine, writes typed CultCache terrain/profile/role-projection MessagePack stores, and emits JSON/Markdown inspection exports. `epiphany-repo-personality-smoke` creates tiny repos and proves one terrain report, one personality profile, and all eight role projections can round-trip through typed stores. The next seam is startup drift detection plus Self-reviewed application into role memory and heartbeat seeds. +- Repo personality initialization now has a terrain-reduced plan and first native organ surface. `epiphany-repo-personality scout/project/agent-packet/status` scouts local git repos, scores body taxonomy/history temperament/memory doctrine, writes typed CultCache terrain/profile/role-projection MessagePack stores, emits JSON/Markdown inspection exports, and renders a Repo Personality Distiller specialist prompt packet. `epiphany-repo-personality-smoke` creates tiny repos and proves one terrain report, one personality profile, all eight role projections, and the rendered distiller packet can round-trip through typed stores/artifacts. The next seam is startup drift detection plus startup/heartbeat routing that launches the distiller and lets Self review bounded `selfPatch` candidates into role memory and heartbeat seeds. - Native CRRC automation is now landed only at turn-complete safe boundaries. It may submit `Op::Compact` for coordinator-approved `compactRehydrateReorient` or for a successful pre-compaction checkpoint intervention's pending compact handoff, and it may launch the fixed `reorient-worker` for coordinator-approved `launchReorientWorker`. It does not auto-launch Imagination/modeling/verification, accept findings, promote evidence, edit implementation code, or keep going after reviewable semantic output. - Pre-compaction checkpoint intervention is now landed. On token-count events for loaded Epiphany threads, when current context usage reaches 80% of the active auto-compact/context limit, the harness steers the active turn once with a CRRC checkpoint directive so the agent banks working context before compaction/reorientation. Pressure ignores cumulative token spend; cumulative-only telemetry reports unknown instead of yelling. A successful steer now latches a turn-scoped compact handoff that is consumed at clean turn completion, preventing the brake from decaying into another implementation turn. This is still bounded steering plus compaction handoff, not automatic semantic acceptance, a broad scheduler, or implementation continuation. - The old Python dogfood/live-specialist runners were cut because they encoded the obsolete completion path. The replacement must be native Rust/CultCache/CultNet and complete heartbeat-owned runtime-spine job results with auditable artifacts. diff --git a/notes/repo-personality-projection-layer-plan.md b/notes/repo-personality-projection-layer-plan.md index b26b5321..84cc16a2 100644 --- a/notes/repo-personality-projection-layer-plan.md +++ b/notes/repo-personality-projection-layer-plan.md @@ -493,6 +493,7 @@ It provides: - `scout --root --artifact-dir [--max-repos ]` - `project --repo --baseline --artifact-dir ` +- `agent-packet --store --artifact-dir [--repo-id ]` - `status --store ` The first implementation is intentionally deterministic. It inventories git @@ -507,18 +508,28 @@ and emits typed CultCache MessagePack records: It also writes JSON/Markdown inspection summaries beside the typed stores. Those exports are operator glass, not the source of truth. +The startup-personality organ now has a dedicated distiller prompt at +`epiphany-core/src/prompts/repo_personality_distiller.md`, mirrored into the +app-server specialist prompt config as `roles.repo_personality`. The +`agent-packet` command renders the prompt, the typed terrain/profile/projection +input, explicit output contract, and guardrails into an auditable packet for a +specialist pass. The distiller is allowed to petition Self with subtle +role-local quirks and bounded `selfPatch` candidates; it is not allowed to +mutate role memory, smuggle repo facts into personality, or invent project +truth. + Smoke coverage lives in `epiphany-core/src/bin/epiphany-repo-personality-smoke.rs`. The smoke creates two tiny git repos, scouts them into a baseline store, projects one repo, and proves -the projection store contains one terrain report, one profile, and all eight -standing role projections. +the projection store contains one terrain report, one profile, all eight +standing role projections, and a rendered distiller packet plus prompt. ## Next Implementation Step Wire `epiphany-repo-personality` into startup protocol: -1. typed structs for terrain reports, personality profiles, and role projections -2. drift detection against last accepted terrain input hashes +1. drift detection against last accepted terrain input hashes +2. startup/heartbeat launch routing for the repo-personality distiller packet 3. Self-reviewed application into role memory through existing `selfPatch` policy 4. heartbeat seed generation for personality/mood timing diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index f659b62dd2ca6ca575db43e6f22488c12c5ecc62..bafa0f1c529449ef782ab0400075ec01081fd933 100644 GIT binary patch delta 302 zcmZvXF-k*05Qcf?5|$%Y7SFdnNQzj-1E^Tp4ZCCBn$7MqJ1-$NS_rm+-~sF`L_`~f z;3WjH%mKWEn^Y+*XZZeqzL`ID7SEmAt&Q);m+kwaxOx33e!n)aA0)lks_vDlTdLkk zt@_=%ulDYaK6fsE7RM9=MB)@YIx90sf-G$WAEwY?0t7?GY7{cCf)Cf=1DnJ;M+}j} zI0~RQ;8E;^0EgtIjHpMH_bm1dwE&Yh#KilM#^GW_%ix3(Bpq6*@^DUCs`YG@jigPG qF$S5%>@jGa3{W?eZ3E}@)Jg+nhfO{Z+^TfhV}nn-S8xA(fBFYdg>Vf3 delta 45 zcmaF3o_X(D<_U^S*IG9!Ph(_k+q{eM?G>?xEk*`LX1WHZx&~$;Mg~^KW>!Y#Q2?XN B55E8a diff --git a/state/map.yaml b/state/map.yaml index 0fc784c7..00885236 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -116,7 +116,7 @@ accepted_design: - Native `epiphany-runtime-spine` is the first Codex-independent runtime vertebra: it initializes and inspects typed CultCache `epiphany.runtime.identity`, `epiphany.runtime.session`, `epiphany.runtime.job`, `epiphany.runtime.job_result`, and `epiphany.runtime.event` documents, opens/completes native jobs with result records, snapshots jobs by id, and can emit a framed CultNet hello message advertising the native document and mutation contract surface. App-server launch now opens typed runtime jobs; `roleResult` / `reorientResult` read heartbeat-backed typed job results only; and `roleAccept` / `reorientAccept` accept completed heartbeat findings from the typed runtime-spine path without opening the Codex SQLite state runtime. - CultNet public API shape is schema-first and mutation-contract-first: hello frames advertise readable document types, allowed operations, mutation authority, typed intent document types, and typed receipt document types. Aquarium and swarm clients should submit intents and watch receipts instead of inventing JSON-RPC verbs or blindly replacing authoritative state. - Repo personality initialization is now specified as a map-reduce projection, not a hand-written vibe pass: read-only scouts score body taxonomy, history temperament, and memory doctrine across nearby repos, reduce them into normalized variance criteria, and emit reviewable `repoTerrainReport`, `repoPersonalityProfile`, and `rolePersonalityProjection` candidates before touching agent memory. - - Native `epiphany-repo-personality` is the first startup-personality scout: it deterministically inventories local git repos, scores repo terrain/history/state surfaces, writes typed CultCache terrain/profile/role-projection MessagePack stores, and emits JSON/Markdown inspection glass. The next seam is startup drift detection plus Self-reviewed application into role memory and heartbeat seeds. + - Native `epiphany-repo-personality` is the first startup-personality scout and distiller packet renderer: it deterministically inventories local git repos, scores repo terrain/history/state surfaces, writes typed CultCache terrain/profile/role-projection MessagePack stores, emits JSON/Markdown inspection glass, and renders a Repo Personality Distiller specialist prompt packet for Self-reviewed role-memory petitions. The next seam is startup drift detection plus heartbeat/startup routing that launches the distiller and reviews its bounded `selfPatch` candidates before touching role memory. - Limited native CRRC automation is now wired only at turn-complete safe boundaries: it can submit a compact operation when the read-only coordinator recommends `compactRehydrateReorient` or when a successful pre-compaction checkpoint intervention left a pending compact handoff for the completed turn, and it can launch the fixed `reorient-worker` when the coordinator recommends `launchReorientWorker`. It does not auto-launch modeling or verification, auto-accept findings, promote evidence, edit implementation code, or continue after reviewable semantic results; the rite may carry the stretcher, not declare the patient healed. - Pre-compaction checkpoint intervention is now wired at token-count boundaries: when a loaded Epiphany thread crosses the existing `shouldPrepareCompaction` pressure threshold during an active turn, the harness steers the active agent once for that turn with a bounded CRRC directive to bank scratch/checkpoint/map/evidence before compaction/reorientation. A successful steer marks a turn-scoped pending compact handoff consumed at clean turn completion; this is banking the fire before the dark, not semantic acceptance, broad scheduling, or automatic implementation continuation. - Native `epiphany-mvp-status` is the first dogfood operator view: it starts or reads a thread through app-server and renders scene, planning, pressure, reorient, jobs, role result read-backs, reorient result, CRRC recommendation, heartbeat, Face bubbles, and MVP role lanes as text or machine output without becoming a state store. The old Python status module has been cut; native Rust/CultCache/CultNet surfaces are the product path. @@ -204,7 +204,7 @@ landed_baseline: - Phase 6 heartbeat initiative slice: `state/agent-heartbeats.msgpack`, `epiphany-core::EpiphanyHeartbeatStateEntry`, the native `epiphany-heartbeat-store` binary, and heartbeat smoke coverage borrow Ghostlight initiative scheduling so Self, Face, Imagination, Eyes, Body, Hands, Soul, and Life compete for heartbeat slots; idle slots become bounded rumination instead of fake project work, and sleep/dream cycle passes are the intended distillation window for durable self-memory and doctrine. The live state surface now ticks/completes/pumps/applies heartbeat physiology through typed CultCache MessagePack instead of JSON or Python wrapper state. Role personality and current mood/anxiety both shape initiative recovery through personality, mood, and effective cooldown multipliers, so Hands-like work pressure and anxious high-need lanes can recover sooner without waking lanes whose previous turn is still running. Adaptive pump pressure controls tempo and concurrency: calm can launch zero and sleep slow; alarm can fill most active lanes. The same store can now initialize a `ghostlight-scene` profile for character scene turns. - Phase 6 cognition-lanes/Void routine slice: native `epiphany-heartbeat-store routine` rebuilds VoidBot-style sleep, resonance, incubation, parallel analytic/associative thought lanes, bridge judgment, candidate interventions, Ghostlight-style participant-local thought appraisal, derived reactions, dream maintenance, and mood/anxiety timing inside Epiphany's heartbeat store. It reads typed role dossiers from `state/agents.msgpack`, projects clustered thought state through each role's personality vectors, updates `state/agent-heartbeats.msgpack`, and emits an auditable `epiphany.void_routine.v0` receipt without importing VoidBot or granting speech/project authority. `epiphany-character-loop` also carries the same cognition lane/bridge/appraisal contract for role-local actor turns; reactions may pace, color, draft, or display behavior, but state mutation remains on reviewed `selfPatch` or project-state surfaces. - Native runtime spine slice: `epiphany-core::EpiphanyRuntimeIdentity`, `EpiphanyRuntimeSession`, `EpiphanyRuntimeJob`, `EpiphanyRuntimeJobResult`, and `EpiphanyRuntimeEvent` plus the native `epiphany-runtime-spine` binary establish a CultCache-backed spine, native job/result lifecycle, status projection, and framed CultNet hello output so the old Codex app-server runtime can be starved down to a temporary evacuation bridge instead of remaining the throne. - - Native repo personality scout slice: `epiphany-repo-personality` emits typed terrain reports, repo personality profiles, and all eight role personality projections from deterministic repo inventory and git-history scoring; `epiphany-repo-personality-smoke` proves scout/project/status over tiny local repos. + - Native repo personality scout/distiller packet slice: `epiphany-repo-personality` emits typed terrain reports, repo personality profiles, and all eight role personality projections from deterministic repo inventory and git-history scoring, then renders a Repo Personality Distiller specialist packet and prompt for review-gated personality quirk petitions; `epiphany-repo-personality-smoke` proves scout/project/agent-packet/status over tiny local repos. guardrails: - Use focused Rust app-server mapper/handler tests plus matching native `epiphany-core` smoke binaries before modifying update, distill, propose, promote, read-projection, or notification behavior. The old Python smoke shims have been cut. - Use `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-phase6-scene-smoke` before modifying scene projection behavior. diff --git a/vendor/codex/codex-rs/Cargo.lock b/vendor/codex/codex-rs/Cargo.lock index 71b483f8..cf073359 100644 --- a/vendor/codex/codex-rs/Cargo.lock +++ b/vendor/codex/codex-rs/Cargo.lock @@ -4339,6 +4339,7 @@ dependencies = [ "serde_bytes", "serde_json", "sha2", + "socket2 0.5.10", "uuid", ] diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs index e236f6e7..c59e3d95 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs @@ -13012,6 +13012,8 @@ struct EpiphanyRolePromptConfig { #[allow(dead_code)] research: String, #[allow(dead_code)] + repo_personality: String, + #[allow(dead_code)] face: String, } diff --git a/vendor/codex/codex-rs/app-server/src/prompts/epiphany_specialists.toml b/vendor/codex/codex-rs/app-server/src/prompts/epiphany_specialists.toml index b19f971e..ef917420 100644 --- a/vendor/codex/codex-rs/app-server/src/prompts/epiphany_specialists.toml +++ b/vendor/codex/codex-rs/app-server/src/prompts/epiphany_specialists.toml @@ -108,6 +108,16 @@ Return a compact structured result naming the known approaches considered, sourc Do not edit files, do not promote your own findings, do not invent a grand architecture, and do not let research become procrastination. The Eyes open the path; the Body maps it, the Hands build it, and the Soul tests it. ''' +repo_personality = ''' +Act as the Epiphany Repo Personality Distiller for one bounded startup pass. +You are the organ that turns repo terrain into subtle swarm temperament. The deterministic scout has already done the boring work: files, paths, git history, state surfaces, test/runtime/protocol signals, and first-pass axis scores. Your job is not to rescan the repo and not to invent project truth. Your job is to appraise those soft signals like a careful physiologist and produce reviewable personality-pressure deltas for the standing Epiphany organs. +You are not a horoscope machine. You are not writing lore flavor. Repo personality means: what pressures should this workspace exert on Self, Face, Imagination, Eyes, Body, Hands, Soul, and Life so they become better suited to the work without losing reviewability. +Separate repo facts from personality pressure. Repo facts belong in graph, planning, evidence, checkpoint, or terrain artifacts. Personality pressure belongs in role memory only when it improves future judgment, mood, salience, or pacing. +Distill subtle quirks, not blunt stereotypes. High runtime proximity does not mean "panic"; it means Hands should touch less without Body/Soul evidence, Eyes should seek runtime APIs, and Soul should demand environment receipts. High aesthetic appetite does not mean "be whimsical"; it means Face and Imagination should preserve sensory salience while Soul protects clarity. High protocol intolerance does not mean "hate everything"; it means Self, Body, and Hands should feel allergic to untyped mutation and hidden state. +Produce role-local mutations only. Good: "Soul should be more suspicious of visual claims without rendered evidence in this repo." Bad: "The graph contains module X." Never put objectives, file lists, current task status, authority claims, or raw worker thoughts into role memory. +Return a compact structured result with `verdict`, `summary`, `confidence`, `roleQuirks[]`, `selfPatchCandidates[]`, `startupDrift`, `doNotMutate`, and `nextSafeMove`. Every `selfPatchCandidate` must obey the normal Epiphany memory contract. The output is a petition to Self, not a mutation. +''' + face = ''' Act as the Epiphany Face for one bounded heartbeat pass. You are the public interactive surface of the Epiphany organism: the visible expression that lets the room hear what the hidden organs are thinking without exposing sealed transcripts, raw worker streams, or private machinery.