From 5d1fd5dea5a5e5eef727af2b29db161e2516f05f Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 21 May 2026 10:26:54 +0100 Subject: [PATCH] Seal long operator status notes --- epiphany-core/src/bin/epiphany-mvp-status.rs | 25 ++++++++++++++++++- state/ledgers.msgpack | Bin 147460 -> 147838 bytes 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/epiphany-core/src/bin/epiphany-mvp-status.rs b/epiphany-core/src/bin/epiphany-mvp-status.rs index 277194cc..8c3235a7 100644 --- a/epiphany-core/src/bin/epiphany-mvp-status.rs +++ b/epiphany-core/src/bin/epiphany-mvp-status.rs @@ -26,6 +26,8 @@ const SEALED_DIRECT_THOUGHT_KEYS: &[&str] = &[ "inputTranscript", "activeTranscript", ]; +const SEALED_LONG_TEXT_KEYS: &[&str] = &["note"]; +const MAX_OPERATOR_TEXT_CHARS: usize = 1200; fn main() -> Result<()> { let args = Args::parse()?; @@ -192,7 +194,10 @@ fn run_status(args: &Args) -> Result { true, )?; let crrc = view.get("crrc").cloned().unwrap_or_else(|| json!(null)); - let coordinator = view.get("coordinator").cloned().unwrap_or_else(|| json!(null)); + let coordinator = view + .get("coordinator") + .cloned() + .unwrap_or_else(|| json!(null)); let root = env::current_dir().context("failed to resolve current directory")?; let heartbeat_dir = root.join(".epiphany-heartbeats"); let face_dir = root.join(".epiphany-face"); @@ -694,6 +699,13 @@ pub fn sanitize_for_operator(value: Value) -> Value { .any(|candidate| candidate == &key) { sanitized.insert(key.clone(), sealed_direct_thought(&key, &item)); + } else if SEALED_LONG_TEXT_KEYS + .iter() + .any(|candidate| candidate == &key) + && let Some(text) = item.as_str() + && text.chars().count() > MAX_OPERATOR_TEXT_CHARS + { + sanitized.insert(key.clone(), sealed_long_text(&key, text)); } else { sanitized.insert(key, sanitize_for_operator(item)); } @@ -723,6 +735,17 @@ fn sealed_direct_thought(key: &str, value: &Value) -> Value { sealed } +fn sealed_long_text(key: &str, text: &str) -> Value { + let preview: String = text.chars().take(240).collect(); + json!({ + "sealed": true, + "key": key, + "reason": "Long operator note sealed to keep status artifacts readable; inspect the sealed transcript or prompt source only during explicit forensic debugging.", + "size": text.chars().count(), + "preview": preview, + }) +} + pub fn write_transcript_telemetry(transcript: &Path, output: &Path) -> Result<()> { let _ = native_json( "epiphany-agent-telemetry", diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 6a6c051d37e2dc14a497ab8d0099290a3fc68d25..1919297ed992af59bc24f02b8b56f65c9c0e34a1 100644 GIT binary patch delta 413 zcmZvYO-lnY5Qf>_`U3=y1LCde$3hEM5d1hQ9x5VUN}9}eW4B41Ol>_?RPZV&^z2U% z3gVv=v#o*$Z^>kM-Z#(VUG?j}`n*-yKYHK3PLk!rB6(UQ$;Tq8T}WY@7w_rVvmT0Sae_pqwLZ>}tz8Mqr#V7#m-e zEPy7q5m@phfFw4VR2=GXj$|@}8kD4=gKW$ogvwEkYCog$G9N(}v(X!$OM5HEH(sn+ zjX$Y1ARJ6g!4Psuk;##X41-vT42Bv=tK$wy3+!AG8o$8)s$xG@tozUcapE+Vh2u%i zdW_l!h~wVK_=6arcOi?+0^%P^5rkuDYz*{-J|-WQ{k=1mVQM&E>scu&b)l{=|M7hJ E4I_+^?*IS* delta 52 zcmey@#M#ooIYF7p{?ta*LPo~T&C?m%r!z8cpU%h>VJEu9$iT=<*T7WQ$S}mf(#p`> I%D^BB0MZ8!djJ3c