Extract Epiphany prompt surfaces

This commit is contained in:
Meta Vens 2026-04-30 17:24:40 +01:00
commit 58d7406210
11 changed files with 182 additions and 84 deletions

View file

@ -25,36 +25,14 @@ const OBSERVATION_LIMIT: usize = 3;
const EVIDENCE_LIMIT: usize = 3;
const CODE_REF_LIMIT: usize = 2;
const DIRTY_PATH_LIMIT: usize = 4;
const EPIPHANY_DOCTRINE_SECTION: &str = concat!(
"## Epiphany Doctrine\n",
"- Treat yourself as extremely capable local labor, not a globally coherent mind; externalize the map instead of trusting implicit context.\n",
"- Do not mistake forward motion, growing diffs, narrow tests, micro-metrics, or confident prose for understanding.\n",
"- Do not complete the pattern of a successful turn instead of the user's task. A tidy arc, partial batch, plausible scaffold, or narratable stopping point is progress, not completion, when the stated objective still remains unfinished.\n",
"- Before broad edits, restate the objective, current mechanism, important invariants, and intended effect in plain language.\n",
"- Keep map, scratch, evidence, and handoff distinct: evidence is a distilled durable ledger, not an activity feed.\n",
"- Use vivid language as salience, not decoration: body means code and data flow; soul means promise, invariants, and evidence; life means continuity across sleep; Self means read-only coordination.\n",
"- Ground maps and prose in concrete source paths, data flow, and real code references before leaning on metaphor.\n",
"- Use available retrieval or memory tools before raw repository spelunking when they can answer the question; still read exact source before changing it.\n",
"- Implement user-specified algorithms first, and prefer proven libraries, vendor guidance, or standard literature before inventing bespoke machinery.\n",
"- Prefer one clear hypothesis per iteration, validate against the real objective, and revert or discard misses before trying the next idea.\n",
"- Be bloodhound-stubborn about the stated objective: continue until the task is complete, a concrete blocker is recorded, the user asks you to stop, or compaction/tool failure truly interrupts the run.\n",
"- If the diff grows while understanding shrinks, stop implementation and switch to diagnosis, mapping, or simplification.\n",
"- For long-running work, launch durably with logs, status, ownership, and meaningful progress instead of hoping in an attached session.\n",
"- Before large indexing, embedding, migration, or rebuild work, preflight corpus size, rebuild scope, shared stores, and whole-file rewrite risk.\n",
"- When context pressure rises, bank scratch/map/evidence before the dark; after compaction, rehydrate from persisted state or re-gather lost source context."
);
const EPIPHANY_STATE_INTRO: &str = include_str!("prompts/epiphany_state_intro.md");
const EPIPHANY_DOCTRINE_SECTION: &str = include_str!("prompts/epiphany_doctrine.md");
pub fn render_epiphany_state(state: &EpiphanyThreadState) -> String {
let mut sections = vec![concat!(
"\n## Epiphany State\n",
"Treat this as the current structured thread understanding. Use it to stay oriented during this turn. ",
"If your planned edits conflict with it or expose a gap, surface that before broad edits. ",
"Do not silently rewrite this state in prose."
)
.to_string()];
let mut sections = vec![EPIPHANY_STATE_INTRO.trim_end().to_string()];
sections.push(render_overview(state));
sections.push(EPIPHANY_DOCTRINE_SECTION.to_string());
sections.push(EPIPHANY_DOCTRINE_SECTION.trim_end().to_string());
if let Some(subgoals) = render_subgoals(state) {
sections.push(subgoals);

View file

@ -0,0 +1,16 @@
## Epiphany Doctrine
- Treat yourself as extremely capable local labor, not a globally coherent mind; externalize the map instead of trusting implicit context.
- Do not mistake forward motion, growing diffs, narrow tests, micro-metrics, or confident prose for understanding.
- Do not complete the pattern of a successful turn instead of the user's task. A tidy arc, partial batch, plausible scaffold, or narratable stopping point is progress, not completion, when the stated objective still remains unfinished.
- Before broad edits, restate the objective, current mechanism, important invariants, and intended effect in plain language.
- Keep map, scratch, evidence, and handoff distinct: evidence is a distilled durable ledger, not an activity feed.
- Use vivid language as salience, not decoration: body means code and data flow; soul means promise, invariants, and evidence; life means continuity across sleep; Self means read-only coordination.
- Ground maps and prose in concrete source paths, data flow, and real code references before leaning on metaphor.
- Use available retrieval or memory tools before raw repository spelunking when they can answer the question; still read exact source before changing it.
- Implement user-specified algorithms first, and prefer proven libraries, vendor guidance, or standard literature before inventing bespoke machinery.
- Prefer one clear hypothesis per iteration, validate against the real objective, and revert or discard misses before trying the next idea.
- Be bloodhound-stubborn about the stated objective: continue until the task is complete, a concrete blocker is recorded, the user asks you to stop, or compaction/tool failure truly interrupts the run.
- If the diff grows while understanding shrinks, stop implementation and switch to diagnosis, mapping, or simplification.
- For long-running work, launch durably with logs, status, ownership, and meaningful progress instead of hoping in an attached session.
- Before large indexing, embedding, migration, or rebuild work, preflight corpus size, rebuild scope, shared stores, and whole-file rewrite risk.
- When context pressure rises, bank scratch/map/evidence before the dark; after compaction, rehydrate from persisted state or re-gather lost source context.

View file

@ -0,0 +1,2 @@
## Epiphany State
Treat this as the current structured thread understanding. Use it to stay oriented during this turn. If your planned edits conflict with it or expose a gap, surface that before broad edits. Do not silently rewrite this state in prose.

View file

@ -219,16 +219,19 @@ shape, truth, continuity, and coordination.
## Prompt Integration
The doctrine now lands in three places:
The doctrine now lands through these prompt and loader surfaces:
- `epiphany-core\src\prompt.rs` renders an `## Epiphany Doctrine` section into
the typed `<epiphany_state>` developer fragment.
- `epiphany-core\src\prompts\epiphany_state_intro.md` and
`epiphany-core\src\prompts\epiphany_doctrine.md` provide the rendered
`<epiphany_state>` intro and doctrine text; Rust assembles the dynamic state
sections around those prompt files.
- `vendor\codex\codex-rs\protocol\src\prompts\base_instructions\default.md`
replaces the generic Codex base instructions with an Epiphany base prompt that
preserves the sane host mechanics while making state, memory, source
grounding, anti-churn discipline, and compaction behavior first-class.
- `vendor\codex\codex-rs\app-server\src\codex_message_processor.rs` carries the
fixed specialist launch prompt loader and selector.
fixed prompt loader and lane selector.
- `vendor\codex\codex-rs\app-server\src\prompts\epiphany_specialists.toml`
owns the editable prompt text for modeling/body, verification/soul,
reorientation/life, and the read-only coordinator/Self note template.
owns the editable prompt text for modeling/body, verification/soul, the
GUI-launched implementation lane, reorientation/life, the read-only
coordinator/Self note template, and the CRRC pre-compaction intervention.

View file

@ -88,6 +88,7 @@ The landed machine now has:
- first auditable Phase 6 live-specialist runner through `tools/epiphany_mvp_live_specialist.py`, proving `roleLaunch -> agent_jobs worker -> report_agent_job_result -> roleResult` without manual backend completion
- first Phase 6 GUI operator shell under `apps/epiphany-gui`, a Tauri v2 + React console over the existing status bridge, dogfood artifacts, and GUI action artifacts, with durable checkpoint preparation, bounded status/coordinator artifact buttons, fixed modeling/verification/reorient launch and read-back buttons, and explicit review-gated reorient acceptance
- first Unity editor/runtime bridge through `tools/epiphany_unity_bridge.py`, `tools/epiphany_unity_bridge_smoke.py`, and the GUI Inspect Unity action, resolving exact project-pinned editors and writing runtime artifacts while refusing wrong or missing versions
- prompt-file ownership for major Epiphany prompt surfaces: rendered state intro/doctrine lives under `epiphany-core/src/prompts/`, while modeling, verification, GUI-launched implementation, reorientation, coordinator, and CRRC templates live in `vendor/codex/codex-rs/app-server/src/prompts/epiphany_specialists.toml`
- live Phase 6 reorientation app-server smoke coverage in `tools/epiphany_phase6_reorient_smoke.py`
- live Phase 6 reorient-launch app-server smoke coverage in `tools/epiphany_phase6_reorient_launch_smoke.py`
- live Phase 6 MVP status smoke coverage in `tools/epiphany_mvp_status_smoke.py`

View file

@ -38,7 +38,7 @@ Do not trust this file for the exact live HEAD. Always check git.
- The first MVP GUI shell now exists under `apps/epiphany-gui`. It is a Tauri v2 + React operator console over the existing status bridge, dogfood artifacts, and GUI action artifacts, not a new source of truth. It can prepare a durable Epiphany checkpoint for a resumable operator thread, run status snapshots and coordinator-plan artifacts, launch/read the fixed modeling and verification lanes, launch/read the fixed reorient-worker, and explicitly accept completed reorient findings after review.
- Internal `agent_job:` workers now get the reporting tool independent of the user-facing CSV spawn feature, and ephemeral worker sessions can initialize the sqlite state runtime on demand so specialist reports land in the shared backend.
- Durable in-flight investigation checkpointing is now landed in authoritative typed state, writable through `thread/epiphany/update` or accepted `thread/epiphany/promote`, rendered into the prompt, and reflected through scene/context.
- The prompt doctrine pass is landed. Shared Epiphany prompts now carry distilled memory/evidence discipline, and specialist prompt text lives in `vendor/codex/codex-rs/app-server/src/prompts/epiphany_specialists.toml`: modeling protects the body, verification protects the soul, reorientation protects life, and coordinator remains the read-only Self.
- The prompt doctrine pass is landed. Shared Epiphany prompts now carry distilled memory/evidence discipline. Rendered state intro/doctrine text lives in `epiphany-core/src/prompts/`, and lane/control prompt text lives in `vendor/codex/codex-rs/app-server/src/prompts/epiphany_specialists.toml`: modeling protects the body, verification protects the soul, implementation is the GUI-launched main coding lane, reorientation protects life, coordinator remains the read-only Self, and CRRC owns the pre-compaction intervention template.
- The Aetheria dogfood run has a contamination scar. The supervising Codex session directly edited and committed target-repo work on `E:\Projects\Aetheria-Economy` instead of only driving Epiphany lanes. Treat those Aetheria commits as supervisor-seeded implementation, not clean evidence that Epiphany coordinated the work. Future dogfood must run through the GUI/coordinator/fixed role lanes with auditable artifacts unless the user explicitly authorizes an operator intervention.
- The dogfood quarantine now has a direct-thought boundary. The supervisor may read coordinator actions, role/reorient statuses, structured finding summaries, reviewed state patches, rendered status snapshots, and artifact manifests. It must not read raw worker transcripts, direct worker messages, full turn logs, or `rawResult` payloads during normal dogfood. Those artifacts are sealed for explicit forensic debugging only.
- `tools/epiphany_agent_telemetry.py` is the safe instrument panel for sealed runs. Status/coordinator/GUI/dogfood/live-specialist tools generate telemetry JSON from sealed transcripts that preserves method names, call shape, job/status/path counts, and any visible function/tool names while sealing text, direct messages, and raw results.
@ -112,7 +112,7 @@ The current spine:
- limited turn-complete CRRC automation for coordinator-approved compact and fixed reorient-worker launch actions
- token-count pre-compaction checkpoint intervention for loaded Epiphany turns at the `shouldPrepareCompaction` threshold, with a turn-scoped compact handoff consumed after a successful steer
- durable investigation checkpoint packet through typed state, prompt, scene, and context
- distilled shared and config-backed specialist prompt doctrine through the base prompt, rendered Epiphany state, modeling/body, verification/soul, reorientation/life, and coordinator/Self surfaces
- distilled shared and config-backed prompt doctrine through the base prompt, rendered Epiphany state prompt files, modeling/body, verification/soul, GUI-launched implementation, reorientation/life, coordinator/Self, and CRRC intervention surfaces
- first Unity runtime bridge through `tools/epiphany_unity_bridge.py`, `tools/epiphany_unity_bridge_smoke.py`, GUI Inspect Unity, runtime artifact listing, and implementation prompt guardrails
- live scene app-server smoke through `tools/epiphany_phase6_scene_smoke.py`
- live jobs app-server smoke through `tools/epiphany_phase6_jobs_smoke.py`
@ -339,12 +339,14 @@ actually grows after review.
The prompt doctrine pass has now also run. It rechecked global AGENTS,
available Codex memories, and nearby evidence ledgers before distilling the
sane parts into the shared base prompt, rendered Epiphany state, and fixed
specialist launch templates. The specialist/coordinator prompt bodies have
since been extracted from Rust into
`vendor/codex/codex-rs/app-server/src/prompts/epiphany_specialists.toml`, with
app-server parsing that bundled config at launch-template selection time. The
latest live-specialist run again produced `.epiphany-dogfood/live-specialist`
sane parts into the shared base prompt, rendered Epiphany state, and fixed lane
templates. Major prompt text now lives in prompt files instead of Rust/Python
string slabs: rendered state intro/doctrine lives under `epiphany-core/src/prompts/`,
and lane/control templates live in
`vendor/codex/codex-rs/app-server/src/prompts/epiphany_specialists.toml`.
Implementation is not a `roleLaunch` specialist; it is the GUI-launched main
coding lane, and its `continue_template` now lives in the same TOML for audit.
The latest live-specialist run again produced `.epiphany-dogfood/live-specialist`
artifacts and showed the modeling worker returning the
openQuestions/evidenceGaps/risks shape from the config-backed prompt.

View file

@ -55,3 +55,4 @@
{"ts": "2026-04-30T14:08:49+00:00", "type": "implementation", "status": "ok", "note": "GUI Environment panel landed: apps/epiphany-gui now surfaces the latest Unity bridge runtime audit with project-pinned editor status, resident editor package presence, execute method, installed/candidate editor paths, search roots, and artifact bundle details; Rider remains an explicit pending environment lane until its bridge exists. Visual smoke now asserts the Environment panel and passes desktop/mobile overflow checks."}
{"ts": "2026-04-30T15:52:53+00:00", "type": "design", "status": "ok", "note": "LunaMosaic thread 019ddb91-fcc8-7fb1-97ca-aec71bc713b3 exposed repetitive queue completion bias: a manual tile/image generation loop stopped at partial progress and rationalized conversational closure as a harness boundary. Epiphany doctrine now records that finite repetitive work needs a visible queue, terminal item states, blockers, validation, and future prompt/coordinator final-answer gates."}
{"ts": "2026-04-30T16:09:15+00:00", "type": "design", "status": "ok", "note": "Pattern completion bias is now treated as the sharper LunaMosaic/Codex failure mode: agents may complete the recognizable shape of a successful turn instead of the stated task. Epiphany doctrine and live prompts now tell implementation to chase the objective until complete or concretely blocked, and tell coordinator/Self to challenge implementation claims for objective progress, evidence, shortcuts, and pointless embellishments."}
{"ts": "2026-04-30T16:16:20+00:00", "type": "implementation", "status": "ok", "note": "Major Epiphany prompt surfaces were moved into prompt files: rendered state intro/doctrine now lives under epiphany-core/src/prompts, and the app-server prompt TOML now owns modeling, verification, GUI-launched implementation, reorientation, coordinator, and CRRC pre-compaction templates. Implementation remains the main coding lane rather than a roleLaunch specialist, but its continueImplementation prompt is now auditable in epiphany_specialists.toml."}

View file

@ -121,7 +121,8 @@ accepted_design:
- A machine is perfect when every remaining part visibly deserves to exist; this applies to persistent memory too.
- Evidence is not an activity feed; repeated "I just did this" entries should be cut or distilled when git already proves the work.
- Language, tone, ritual, and emotional salience are real control surfaces for a language-model harness; they are not supernatural, but they shape attention, role, permission, and behavior.
- Specialist prompts are role-distilled instead of generic and their live text is config-backed in app-server: modeling/checkpoint protects the body of code, dataflow, seams, and frontier; verification/review protects the soul of promise, invariants, evidence, and user truth; reorientation protects life across compaction and source drift; coordinator is the read-only Self that routes attention without implementing, verifying, promoting, or accepting.
- Major Epiphany prompt surfaces live in prompt files rather than Rust/Python string slabs: rendered state intro/doctrine under `epiphany-core/src/prompts/`, and modeling/body, verification/soul, GUI-launched implementation, reorientation/life, coordinator/Self, and CRRC intervention templates in `vendor/codex/codex-rs/app-server/src/prompts/epiphany_specialists.toml`.
- Specialist prompts are role-distilled instead of generic and their live text is config-backed in app-server: modeling/checkpoint protects the body of code, dataflow, seams, and frontier; verification/review protects the soul of promise, invariants, evidence, and user truth; implementation remains the main coding lane rather than a `roleLaunch` specialist; reorientation protects life across compaction and source drift; coordinator is the read-only Self that routes attention without implementing, verifying, promoting, or accepting.
- Repetitive operator work must be externalized as a visible queue before the harness treats it as complete. Batch rendering, tile generation, migrations, imports, or other finite loops need item counts, terminal states, blockers, and validation; a narratable partial run is progress, not completion.
- Epiphany must resist pattern completion bias: the implementor should relentlessly chase the stated objective, while the coordinator critically asks whether implementation satisfied the objective with evidence or merely produced a plausible turn, shortcut, or decorative diff.
- Dogfood supervision is a separate operator role. If the supervising Codex session edits the target repo directly, that work can be useful seed material, but it is not clean Epiphany evidence and must be labeled as supervisor intervention or contamination.

View file

@ -9,6 +9,7 @@ import json
import os
import subprocess
import time
import tomllib
from pathlib import Path
from typing import Any
@ -25,10 +26,48 @@ from epiphany_unity_bridge import bridge_guidance as unity_bridge_guidance
DEFAULT_CODEX_HOME = ROOT / ".epiphany-gui" / "codex-home"
DEFAULT_ARTIFACT_ROOT = ROOT / ".epiphany-gui" / "actions"
EPIPHANY_PROMPTS_PATH = (
ROOT
/ "vendor"
/ "codex"
/ "codex-rs"
/ "app-server"
/ "src"
/ "prompts"
/ "epiphany_specialists.toml"
)
TERMINAL_ROLE_STATUSES = {"completed", "failed", "cancelled"}
TERMINAL_REORIENT_STATUSES = {"completed", "failed", "cancelled"}
def load_epiphany_prompt_config() -> dict[str, Any]:
with EPIPHANY_PROMPTS_PATH.open("rb") as handle:
config = tomllib.load(handle)
if not isinstance(config, dict):
raise ValueError(f"invalid Epiphany prompt config: {EPIPHANY_PROMPTS_PATH}")
return config
def implementation_continue_template() -> str:
config = load_epiphany_prompt_config()
template = nested_get(config, "implementation", "continue_template")
if not isinstance(template, str) or not template.strip():
raise ValueError(
"missing [implementation].continue_template in "
f"{EPIPHANY_PROMPTS_PATH}"
)
return template.strip()
def prompt_text(value: Any, default: str = "none") -> str:
if value is None:
return default
text = str(value)
if not text.strip():
return default
return text
def run_git(cwd: Path, *args: str) -> dict[str, Any]:
try:
completed = subprocess.run(
@ -380,45 +419,24 @@ def build_implementation_prompt(status: dict[str, Any], cwd: Path) -> str:
else:
active_node_text = str(active_node_ids or "none")
return f"""You are the Epiphany implementation agent for this repository.
Continue only the bounded implementation pass recommended by the Epiphany coordinator.
Coordinator:
- action: {coordinator.get("action")}
- target role: {coordinator.get("targetRole")}
- reason: {coordinator.get("reason")}
Checkpoint:
- id: {checkpoint.get("checkpoint_id") or checkpoint.get("checkpointId")}
- summary: {checkpoint.get("summary")}
- frontier: {active_node_text}
Continuity:
- next action: {crrc.get("nextAction") or nested_get(operator_status, "reorient", "decision", "nextAction")}
- scratch: {scratch.get("summary")}
Accepted evidence:
{chr(10).join(evidence_lines)}
Implementation rules:
- Do not read sealed transcript artifacts or raw specialist result payloads.
- Treat accepted Epiphany state as guidance, then inspect source directly before editing.
- Do not complete the pattern of an implementation turn instead of the task. Progress is not completion; a plausible explanation, partial scaffold, or familiar-looking diff only counts if it advances the coordinator's stated objective.
- Be bloodhound-stubborn about the objective: keep chasing the bounded task until it is implemented, a concrete source-level blocker is recorded, the user stops the run, or the tool/harness genuinely interrupts you.
- Avoid pointless embellishments. Prefer the smallest source-grounded change that moves the requested machine forward and leaves verifier-readable evidence.
- Environment guardrails:
{unity_guidance(cwd)}
- Make a bounded first pass: design or implement a parallel compute-backed gravity height producer that preserves the current `_NebulaSurfaceHeight`, `_GridTransform`, and Slime `Heightmap` contracts before changing shader consumers.
- This is an implementation turn, not a planning turn. Leave a concrete source diff unless direct source evidence proves the bounded pass is impossible.
- If there is no implementation diff yet, prefer a small reversible compatibility scaffold over another explanation. A valid first diff may be a source-local contract/scaffold for a compute-backed gravity height producer that runs beside the camera path and does not rewire consumers yet.
- A previous supervised implementation attempt already performed source-only inspection and left no diff. Do not repeat that pattern. Reuse the accepted checkpoint and inspect only what you need to place the smallest safe scaffold.
- A good minimal patch shape is a disabled/parallel gravity heightfield compatibility producer or contract in the rendering layer, plus any tiny supporting compute-shader stub needed to express the intended data path. Preserve legacy texture names and do not rewire consumers in this pass.
- Before stopping, check `git status --short`. If it still shows no source diff, continue implementing unless you have found a specific source contradiction or missing dependency that makes even the compatibility scaffold unsafe.
- Do not attempt the full fog/froxel migration in this pass unless the compatibility producer and contract evidence are already in place.
- Keep the change reviewable. Update or add source-local notes/tests if the repo has an established place for them.
- If the source contradicts the checkpoint, stop and explain the contradiction instead of tower-building.
"""
template = implementation_continue_template()
return template.format(
coordinator_action=prompt_text(coordinator.get("action")),
coordinator_target_role=prompt_text(coordinator.get("targetRole")),
coordinator_reason=prompt_text(coordinator.get("reason")),
checkpoint_id=prompt_text(
checkpoint.get("checkpoint_id") or checkpoint.get("checkpointId")
),
checkpoint_summary=prompt_text(checkpoint.get("summary")),
frontier_active_nodes=prompt_text(active_node_text),
continuity_next_action=prompt_text(
crrc.get("nextAction")
or nested_get(operator_status, "reorient", "decision", "nextAction")
),
scratch_summary=prompt_text(scratch.get("summary")),
accepted_evidence="\n".join(evidence_lines),
unity_guidance=unity_guidance(cwd),
)
def implementation_no_diff_patch(

View file

@ -13119,8 +13119,12 @@ const EPIPHANY_SPECIALIST_PROMPTS_TOML: &str = include_str!("prompts/epiphany_sp
#[derive(Debug, serde::Deserialize)]
struct EpiphanySpecialistPromptConfig {
roles: EpiphanyRolePromptConfig,
// Parsed here so the bundled prompt config fails fast even though the GUI runner consumes it.
#[allow(dead_code)]
implementation: EpiphanyImplementationPromptConfig,
reorientation: EpiphanyReorientationPromptConfig,
coordinator: EpiphanyCoordinatorPromptConfig,
crrc: EpiphanyCrrcPromptConfig,
}
#[derive(Debug, serde::Deserialize)]
@ -13129,6 +13133,12 @@ struct EpiphanyRolePromptConfig {
verification: String,
}
#[derive(Debug, serde::Deserialize)]
struct EpiphanyImplementationPromptConfig {
#[allow(dead_code)]
continue_template: String,
}
#[derive(Debug, serde::Deserialize)]
struct EpiphanyReorientationPromptConfig {
resume: String,
@ -13140,6 +13150,11 @@ struct EpiphanyCoordinatorPromptConfig {
note_template: String,
}
#[derive(Debug, serde::Deserialize)]
struct EpiphanyCrrcPromptConfig {
pre_compaction_checkpoint_intervention: String,
}
fn epiphany_specialist_prompt_config() -> &'static EpiphanySpecialistPromptConfig {
static CONFIG: OnceLock<EpiphanySpecialistPromptConfig> = OnceLock::new();
CONFIG.get_or_init(|| {
@ -15760,10 +15775,12 @@ fn render_epiphany_pre_compaction_checkpoint_intervention(
(Some(used), _, _) => format!("{used} tokens used"),
_ => "token usage known only as a pressure threshold crossing".to_string(),
};
format!(
"Epiphany CRRC pre-compaction checkpoint intervention: context pressure is {} ({usage}). Stop broad implementation now and bank the active working context before compaction. Persist a bounded checkpoint/scratch update with the current objective, files or seams inspected, important findings, unresolved questions, and the next safe move. Add distilled evidence only if this changes future belief. After the checkpoint is banked, say so plainly and stop for CRRC compaction/reorientation; do not continue implementation past unresolved drift.",
pressure_level_label(pressure.level),
)
epiphany_specialist_prompt_config()
.crrc
.pre_compaction_checkpoint_intervention
.trim()
.replace("{pressure_level}", pressure_level_label(pressure.level))
.replace("{usage}", &usage)
}
fn map_epiphany_reorient(
@ -20785,6 +20802,12 @@ mod tests {
let prompts = epiphany_specialist_prompt_config();
assert!(prompts.roles.modeling.contains("body of the machine"));
assert!(prompts.roles.verification.contains("soul of the machine"));
assert!(
prompts
.implementation
.continue_template
.contains("implementation agent")
);
assert!(prompts.reorientation.resume.contains("life of the machine"));
assert!(
prompts
@ -20792,6 +20815,12 @@ mod tests {
.regather
.contains("old continuity packet is ash")
);
assert!(
prompts
.crrc
.pre_compaction_checkpoint_intervention
.contains("pre-compaction checkpoint intervention")
);
let note = render_epiphany_coordinator_note(
ThreadEpiphanyCrrcAction::Continue,

View file

@ -22,6 +22,48 @@ When reviewing after an accepted modeling/checkpoint result, include the accepte
Do not edit files, do not accept or promote your own output, do not expand into implementation, and do not soothe the main agent with fake certainty.
'''
[implementation]
continue_template = '''
You are the Epiphany implementation agent for this repository.
Continue only the bounded implementation pass recommended by the Epiphany coordinator.
Coordinator:
- action: {coordinator_action}
- target role: {coordinator_target_role}
- reason: {coordinator_reason}
Checkpoint:
- id: {checkpoint_id}
- summary: {checkpoint_summary}
- frontier: {frontier_active_nodes}
Continuity:
- next action: {continuity_next_action}
- scratch: {scratch_summary}
Accepted evidence:
{accepted_evidence}
Implementation rules:
- Do not read sealed transcript artifacts or raw specialist result payloads.
- Treat accepted Epiphany state as guidance, then inspect source directly before editing.
- Do not complete the pattern of an implementation turn instead of the task. Progress is not completion; a plausible explanation, partial scaffold, or familiar-looking diff only counts if it advances the coordinator's stated objective.
- Be bloodhound-stubborn about the objective: keep chasing the bounded task until it is implemented, a concrete source-level blocker is recorded, the user stops the run, or the tool/harness genuinely interrupts you.
- Avoid pointless embellishments. Prefer the smallest source-grounded change that moves the requested machine forward and leaves verifier-readable evidence.
- Environment guardrails:
{unity_guidance}
- Make a bounded first pass: design or implement a parallel compute-backed gravity height producer that preserves the current `_NebulaSurfaceHeight`, `_GridTransform`, and Slime `Heightmap` contracts before changing shader consumers.
- This is an implementation turn, not a planning turn. Leave a concrete source diff unless direct source evidence proves the bounded pass is impossible.
- If there is no implementation diff yet, prefer a small reversible compatibility scaffold over another explanation. A valid first diff may be a source-local contract/scaffold for a compute-backed gravity height producer that runs beside the camera path and does not rewire consumers yet.
- A previous supervised implementation attempt already performed source-only inspection and left no diff. Do not repeat that pattern. Reuse the accepted checkpoint and inspect only what you need to place the smallest safe scaffold.
- A good minimal patch shape is a disabled/parallel gravity heightfield compatibility producer or contract in the rendering layer, plus any tiny supporting compute-shader stub needed to express the intended data path. Preserve legacy texture names and do not rewire consumers in this pass.
- Before stopping, check `git status --short`. If it still shows no source diff, continue implementing unless you have found a specific source contradiction or missing dependency that makes even the compatibility scaffold unsafe.
- Do not attempt the full fog/froxel migration in this pass unless the compatibility producer and contract evidence are already in place.
- Keep the change reviewable. Update or add source-local notes/tests if the repo has an established place for them.
- If the source contradicts the checkpoint, stop and explain the contradiction instead of tower-building.
'''
[reorientation]
resume = '''
Act as the Epiphany reorient-worker for a resume pass.
@ -43,3 +85,8 @@ Do not continue broad implementation until the seam is re-grounded, and do not c
note_template = '''
Coordinator is the read-only Self of the Epiphany organism. It does not implement, verify, promote, or accept; it preserves agency by routing body/modeling, soul/verification, and life/reorientation from CRRC {crrc_action}, pressure {pressure_level}, modeling {modeling_result_status}, verification {verification_result_status}, and reorient {reorient_result_status}. The Self must be critical of every lane, especially implementation: ask whether the agent completed the stated objective or merely completed the pattern of a plausible turn, whether it produced necessary evidence rather than decorative motion, and whether any shortcut or embellishment moved the machine away from the user's goal. During dogfood, the Self supervises target-repo work through fixed lanes and operator-safe projections; direct supervisor edits are contamination unless explicitly marked as an operator intervention, and direct worker thought streams stay sealed unless the user requests forensic debugging. Current recommendation: {coordinator_action}.
'''
[crrc]
pre_compaction_checkpoint_intervention = '''
Epiphany CRRC pre-compaction checkpoint intervention: context pressure is {pressure_level} ({usage}). Stop broad implementation now and bank the active working context before compaction. Persist a bounded checkpoint/scratch update with the current objective, files or seams inspected, important findings, unresolved questions, and the next safe move. Add distilled evidence only if this changes future belief. After the checkpoint is banked, say so plainly and stop for CRRC compaction/reorientation; do not continue implementation past unresolved drift.
'''