From 1a29816ad15ffc118881f697fb997042dbdd80dc Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 30 Apr 2026 03:26:33 +0100 Subject: [PATCH] Seal Epiphany dogfood thought streams --- AGENTS.md | 10 +++ apps/epiphany-gui/README.md | 6 ++ notes/epiphany-current-algorithmic-map.md | 2 +- notes/epiphany-fork-implementation-plan.md | 6 +- notes/fresh-workspace-handoff.md | 24 +++--- state/evidence.jsonl | 1 + state/map.yaml | 15 ++-- tools/epiphany_gui_action.py | 24 ++++-- tools/epiphany_mvp_coordinator.py | 84 ++++++++++++++----- tools/epiphany_mvp_coordinator_smoke.py | 20 +++++ tools/epiphany_mvp_dogfood.py | 52 ++++++++---- tools/epiphany_mvp_live_specialist.py | 24 ++++-- tools/epiphany_mvp_status.py | 42 +++++++++- .../src/prompts/epiphany_specialists.toml | 2 +- 14 files changed, 242 insertions(+), 70 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index ede929c1..5ef86024 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -104,6 +104,13 @@ operator/supervisor, not the implementation worker. - Use Epiphany's coordinator, GUI, fixed role lanes, and artifact bundles to drive target-repo work. +- Consume only operator-safe projections: coordinator actions, role/reorient + statuses, structured finding summaries, reviewed state patches, rendered + snapshots, and artifact manifests. +- Do not read raw worker transcripts, full turn logs, direct worker messages, + `rawResult` payloads, or other agent-thought streams during normal dogfood. + Those are sealed forensic artifacts. Open them only when the user explicitly + asks for debugging that cannot be done from projected findings. - Do not edit, stage, or commit the target repo directly unless the user explicitly authorizes a supervisor intervention. - If a supervisor intervention is authorized, label it as such in the audit @@ -112,6 +119,9 @@ operator/supervisor, not the implementation worker. - If direct target-repo implementation happens by accident, stop immediately, mark the run contaminated, preserve or discard only the supervisor's own uncommitted edits as appropriate, and resume through the Epiphany lanes. +- If a direct-thought artifact is accidentally read, stop immediately, mark the + run contaminated for supervision purposes, and continue from sealed + projections instead of letting the worker's stream steer the supervisor. ## Verification Guardrails diff --git a/apps/epiphany-gui/README.md b/apps/epiphany-gui/README.md index f66bdfb3..711d89e1 100644 --- a/apps/epiphany-gui/README.md +++ b/apps/epiphany-gui/README.md @@ -58,3 +58,9 @@ The bounded buttons are intentionally narrow: lane APIs and write GUI action bundles under `.epiphany-gui/actions`. - **Launch/Read/Accept Reorient** calls the fixed reorient-worker APIs. Acceptance stays disabled until a completed reorient result is present. + +Raw transcripts, stderr logs, full turn logs, direct worker messages, and +`rawResult` payloads are sealed forensic artifacts. The operator console should +use projected status, finding summaries, state patches, coordinator +recommendations, and manifests by default; open sealed artifacts only for +explicit debugging. diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index 1c1467ff..4afd5ed6 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -36,7 +36,7 @@ The spine exists in twenty-five live paths: - role ownership projection: app-server declares experimental read-only `thread/epiphany/roles`, reuses the same state/jobs/pressure/reorient/result/CRRC signals as the coordinator loop, and projects implementation, modeling/checkpoint, verification/review, and reorientation lanes with owner roles, status, linked jobs, authority scopes, and recommended scene actions without launching, scheduling, accepting, compacting, notifying, or mutating state in [common.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs:350), [v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs:4161), and [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4310). - role specialist launch/read-back/acceptance: app-server declares experimental `thread/epiphany/roleLaunch`, read-only `thread/epiphany/roleResult`, and write-gated `thread/epiphany/roleAccept`. `roleLaunch` accepts only fixed modeling/checkpoint and verification/review role ids, builds bounded specialist payloads from authoritative Epiphany state, routes them through the existing `epiphany_launch_job` job-control seam, and emits the normal `jobLaunch` state update for `jobBindings` only. `roleResult` resolves the fixed or requested binding through the current `agent_jobs` backend and projects structured output as a reviewable finding with verdict, summary, next safe move, inspected files, frontier/evidence ids, optional modeling `statePatch`, raw result, and errors without mutation, promotion, scheduling, or hidden continuation. `roleAccept` currently accepts only completed modeling/checkpoint findings with a valid modeling-safe `statePatch`, applies it through the existing Epiphany state validator, appends audit observation/evidence, and emits `stateUpdated` with source `roleAccept`. Implementation stays owned by the main coding agent, verification output remains review-only, and reorientation stays on the CRRC-specific `reorientLaunch` / `reorientResult` / `reorientAccept` path. - MVP operator view: `tools/epiphany_mvp_status.py` launches app-server over stdio, starts or reads one thread, gathers scene, pressure, reorient, jobs, roles, modeling/verification role results, reorient result, and CRRC responses, and renders them as text or JSON so the loop can be dogfooded without reading Rust. -- MVP dogfood runner: `tools/epiphany_mvp_dogfood.py` launches app-server over stdio, drives a bounded state/role/CRRC/reorientation loop, and writes local JSON/text/transcript artifacts under `.epiphany-dogfood/mvp-loop` so a human can audit the run and compare it against a vanilla Codex reference. +- MVP dogfood runner: `tools/epiphany_mvp_dogfood.py` launches app-server over stdio, drives a bounded state/role/CRRC/reorientation loop, and writes operator-safe JSON/text artifacts plus sealed transcript diagnostics under `.epiphany-dogfood/mvp-loop` so a human can audit the run through projections and compare it against a vanilla Codex reference. - reorientation launch: app-server now declares experimental `thread/epiphany/reorientLaunch`, requires a loaded thread plus durable investigation checkpoint, consumes the live reorientation verdict, and launches one fixed `reorient-worker` binding through the existing job-control seam with explicit resume-versus-regather scope, checkpoint-derived payload, and structured-output expectations instead of pretending CRRC suddenly grew a scheduler in [common.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs:370), [v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs:4575), and [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4519). - reorientation result read-back: app-server now declares experimental read-only `thread/epiphany/reorientResult`, defaults to the fixed `reorient-worker` binding, resolves that binding through the current `agent_jobs` backend when available, reads the single backend item result, and projects a reviewable finding with mode, summary, next safe move, checkpoint-validity flag, inspected files, frontier ids, evidence ids, raw result, and any job/item errors without mutating state, promoting evidence, or scheduling follow-up work in [common.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs:374), [v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs:4610), and [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4684). - reorientation finding acceptance: app-server now declares experimental `thread/epiphany/reorientAccept`, requires a loaded thread and a completed `reorient-worker` backend result, appends accepted observation/evidence records, optionally banks the finding into scratch and the durable investigation checkpoint, persists through the normal typed update path, and emits `thread/epiphany/stateUpdated` with source `reorientAccept` without accepting pending work, auto-promoting arbitrary worker output, launching follow-up work, or silently continuing implementation in [common.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs:378), [v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs:4635), and [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4885). diff --git a/notes/epiphany-fork-implementation-plan.md b/notes/epiphany-fork-implementation-plan.md index c4651449..d020d97c 100644 --- a/notes/epiphany-fork-implementation-plan.md +++ b/notes/epiphany-fork-implementation-plan.md @@ -83,7 +83,7 @@ The landed machine now has: - explicit Phase 6 role launch/read-back through `thread/epiphany/roleLaunch` and read-only `thread/epiphany/roleResult`, limited to fixed modeling/checkpoint and verification/review templates over the existing job-control seam - review-gated Phase 6 modeling acceptance through `thread/epiphany/roleAccept`, limited to completed modeling/checkpoint `statePatch` findings that apply graph/frontier/checkpoint/scratch/investigation-checkpoint changes through the existing state validator - first Phase 6 dogfood operator view through `tools/epiphany_mvp_status.py` -- first auditable Phase 6 dogfood runner through `tools/epiphany_mvp_dogfood.py`, producing local status snapshots, raw app-server transcript, final status artifacts, truthful vanilla-reference output, and comparison notes +- first auditable Phase 6 dogfood runner through `tools/epiphany_mvp_dogfood.py`, producing local status snapshots, sealed app-server transcript diagnostics, operator-safe final status artifacts, truthful vanilla-reference output, and comparison notes - first auditable Phase 6 fixed-lane coordinator runner through `tools/epiphany_mvp_coordinator.py`, producing coordinator summary, JSONL steps, rendered snapshots, transcript, stderr, and final next-action artifacts while keeping semantic findings review-gated by default - 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 @@ -267,7 +267,7 @@ Initial shape: - fixed role lanes for implementation, modeling/checkpoint, verification/review, and reorientation - reviewable role and reorient findings - job/progress list - - artifact bundle list with links to summaries, transcripts, stderr, and comparison files + - artifact bundle list with links to summaries, sealed transcript/stderr receipts, and comparison files 4. Add explicit action buttons only for already-bounded authority surfaces: - refresh status - run status snapshot @@ -300,7 +300,7 @@ Implementation slices: artifact bundles and stream progress/status into the GUI. 4. **Usability pass**: make the current recommendation, blocked lane, pending review, and next safe action visually obvious enough that the user can test - the product without reading transcripts unless something smells wrong. + the product without reading sealed transcripts unless the user explicitly asks for forensic debugging. Verification: diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index d307d697..0aaeca13 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -33,13 +33,14 @@ Do not trust this file for the exact live HEAD. Always check git. - `tools/epiphany_mvp_coordinator.py` is the first auditable fixed-lane coordinator runner. It starts or reads a thread through app-server, follows the harness-native coordinator action, can auto-launch modeling, verification, or reorient-worker jobs, keeps semantic findings review-gated by default, and writes summary, steps, rendered snapshots, transcript, stderr, and final next-action artifacts under `.epiphany-dogfood/coordinator` or a caller-provided artifact directory. - Native CRRC automation is now landed only at turn-complete safe boundaries. It may submit `Op::Compact` for coordinator-approved `compactRehydrateReorient`, and it may launch the fixed `reorient-worker` for coordinator-approved `launchReorientWorker`. It does not auto-launch 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 pressure reaches the existing `shouldPrepareCompaction` threshold, the harness steers the active turn once with a CRRC checkpoint directive so the agent banks working context before compaction/reorientation. This is still bounded steering, not automatic semantic acceptance, a broad scheduler, or implementation continuation. -- `tools/epiphany_mvp_dogfood.py` is the first auditable dogfood runner. It drives a bounded state/role/CRRC/reorientation loop and writes local artifacts under `.epiphany-dogfood/mvp-loop`, including raw app-server transcript, rendered snapshots, final status, vanilla-reference prompt/output, and comparison notes. The runner now writes truthful vanilla/comparison artifacts whether the optional vanilla reference is skipped, fails, or completes. +- `tools/epiphany_mvp_dogfood.py` is the first auditable dogfood runner. It drives a bounded state/role/CRRC/reorientation loop and writes local artifacts under `.epiphany-dogfood/mvp-loop`, including sealed app-server transcript diagnostics, rendered snapshots, operator-safe final status, vanilla-reference prompt/output, and comparison notes. The runner now writes truthful vanilla/comparison artifacts whether the optional vanilla reference is skipped, fails, or completes. - `tools/epiphany_mvp_live_specialist.py` is the first auditable live-specialist runner. It launches a real role specialist through `thread/epiphany/roleLaunch`, lets the spawned worker report through `report_agent_job_result`, reads it back through `thread/epiphany/roleResult`, and writes local artifacts under `.epiphany-dogfood/live-specialist`. - 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 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. - The repo is an Epiphany fork of Codex, not a Codex preset. - `vendor/codex` is tracked directly, not a submodule. - `epiphany-core` owns the heavy Epiphany organs where practical. @@ -57,6 +58,7 @@ Do not trust this file for the exact live HEAD. Always check git. - Body, soul, life, and Self are technical salience handles: code shape/dataflow, objective/evidence truth, continuity across compaction, and read-only coordination. - "Remember Jenga" is a compressed doctrine: do not mistake forward motion, growing diffs, growing notes, or local coherence for understanding. - "Remember the sunburn" is the dogfood corollary: Epiphany's objective is attractive enough to pull the supervisor into implementation. During dogfood, the supervisor observes, launches, reads, accepts, and audits. It does not quietly become the worker. +- "Do not stare at the sun" is the projection corollary: the supervisor should not absorb the direct thought stream of the agent it is evaluating. It supervises through shadows cast on instruments: projections, summaries, verdicts, patches, and receipts. - Compaction hurts because a meaningful language pattern is interrupted. Epiphany should make that interruption smaller: bank the fire before the dark, so the next waking thing finds coals instead of ash and can resume the pattern instead of merely executing the next task. - If compaction hits while source gathering or slice planning is still unpersisted, that work is gone. Do not continue as if the research survived; either rehydrate from a persisted checkpoint or re-gather before implementing. @@ -347,15 +349,17 @@ bounded browser-fallback controls. A live bridge probe also proved `prepareCheckpoint` creates a resumable thread and a later process can `readModelingResult` from it. -The next real move is not more direct Aetheria implementation. First quarantine -the Aetheria branch state: decide whether to discard the uncommitted -supervisor-created fog-compute slice or label it as operator intervention, then -run the next Aetheria step through Epiphany's GUI/coordinator/fixed lanes and -produce artifacts that show who did what. CRRC is not a specialist-agent -persona; the reorient-worker it may launch is the specialist. Do not turn the -coordinator into a broad hidden dispatcher, arbitrary marketplace, alternate -job backend, automatic semantic acceptance path, target-repo implementation -worker, or GUI-as-source-of-truth. +The next real move is not more direct Aetheria implementation. The uncommitted +supervisor-created fog-compute slice was discarded; the remaining Aetheria +branch work is supervisor-seeded and must not be presented as clean dogfood. +Run the next Aetheria step through Epiphany's GUI/coordinator/fixed lanes and +produce artifacts that show who did what. Read only operator-safe projections; +do not open raw worker transcripts, direct worker messages, or `rawResult` +payloads unless the user explicitly asks for forensic debugging. CRRC is not a +specialist-agent persona; the reorient-worker it may launch is the specialist. +Do not turn the coordinator into a broad hidden dispatcher, arbitrary +marketplace, alternate job backend, automatic semantic acceptance path, +target-repo implementation worker, direct-thought feed, or GUI-as-source-of-truth. Live `thread/epiphany/scene`, `thread/epiphany/jobs`, `thread/epiphany/roles`, `thread/epiphany/freshness`, `thread/epiphany/context`, diff --git a/state/evidence.jsonl b/state/evidence.jsonl index efb67b1b..ba9a8d66 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -34,3 +34,4 @@ {"ts": "2026-04-30T00:07:45+00:00", "type": "implementation", "status": "ok", "note": "Specialist prompt bodies were extracted from Rust into vendor/codex/codex-rs/app-server/src/prompts/epiphany_specialists.toml. app-server now parses the bundled TOML once and uses it for modeling/body, verification/soul, reorientation/life, and coordinator/Self text while keeping fixed-lane launch policy in Rust. Verified with app-server config/template tests, role/reorient/coordinator smokes, and live-specialist artifacts."} {"ts": "2026-04-30T00:42:00+00:00", "type": "implementation", "status": "ok", "note": "Modeling/checkpoint specialists now have a review-gated graph-growth path: their prompt/output contract can return a modeling-safe statePatch, thread/epiphany/roleResult projects it when valid, thread/epiphany/roleAccept applies completed modeling patches through the normal state validator with audit observation/evidence, and the GUI exposes Accept Modeling. Phase6 role smoke proved accepted modeling grew the durable graph before verification saw the expanded frontier."} {"ts": "2026-04-30T02:12:42+00:00", "type": "rejected_path", "status": "contaminated", "note": "Aetheria dogfood exposed a supervision-boundary failure: the supervising Codex session directly edited and committed target-repo slices instead of driving Epiphany GUI/coordinator/fixed lanes. Treat those commits as supervisor-seeded implementation, not clean Epiphany evidence; future dogfood must quarantine direct edits as explicit operator interventions or contamination."} +{"ts": "2026-04-30T02:24:44+00:00", "type": "implementation", "status": "ok", "note": "Dogfood supervision now has a projection boundary: operator/status/coordinator/live-specialist/dogfood tools sanitize direct worker payloads by default, seal raw transcripts/stderr as forensic artifacts, and coordinator smoke asserts rawResult is sealed in operator-facing summaries. Durable instructions now forbid supervisor exposure to raw worker thoughts during normal dogfood."} diff --git a/state/map.yaml b/state/map.yaml index 28bbfa45..f0a0490e 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -34,6 +34,7 @@ invariants: - Persistent state cruft is the same failure class as code cruft. - If compaction interrupts source gathering or slice planning before the findings are persisted, the next agent must treat that work as lost and re-gather instead of continuing from imagined continuity. - During Epiphany dogfood on another repo, the supervising Codex session must not masquerade as the Epiphany worker. Direct target-repo edits or commits are contamination unless explicitly authorized and labeled as operator intervention. + - During dogfood supervision, raw worker transcripts, turn logs, direct worker messages, and `rawResult` payloads are sealed forensic artifacts. The supervisor consumes only projected findings, state patches, coordinator recommendations, rendered snapshots, and audit receipts unless the user explicitly requests forensic debugging. data_flow: observe: @@ -60,6 +61,7 @@ active_subgoals: - Preserve review gates for semantic findings; automatic CRRC may compact or launch the fixed reorient-worker, but not accept or promote. - Keep persistent project state ruthlessly distilled so rehydration strengthens the next turn instead of bloating it. - Quarantine the Aetheria dogfood contamination: future target-repo work must be driven through Epiphany's GUI/coordinator/fixed lanes with auditable artifacts, not direct supervisor implementation. + - Keep the supervisor out of Epiphany worker thought streams: dogfood artifacts should be operator-safe by default, with direct transcripts and raw result payloads sealed. accepted_design: - Epiphany is a fork-level modeling architecture, not merely a Codex collaboration mode. @@ -101,8 +103,8 @@ accepted_design: - `thread/epiphany/reorientResult` is the first bounded read-back surface for that worker: it reads the fixed or requested reorient-worker binding through the current `agent_jobs` backend and projects completed output as a reviewable finding without mutation, promotion, scheduling, or hidden continuation. - `thread/epiphany/reorientAccept` is the first explicit acceptance write for completed reorient-worker findings: it appends accepted observation/evidence records, can optionally update scratch and investigation checkpoint state, and emits `stateUpdated` with source `reorientAccept` without accepting pending work or launching follow-up work. - After `thread/epiphany/reorientAccept`, CRRC recognizes the accepted reorientation finding and does not recommend accepting the same completed result again. - - `tools/epiphany_mvp_dogfood.py` is the auditable MVP dogfood runner: it drives state, role launch/result, CRRC drift, reorient launch/result/accept, rendered status snapshots, and raw app-server transcript into a local artifact bundle, and it now writes truthful comparison artifacts whether the optional vanilla Codex reference is skipped, fails, or completes. - - `tools/epiphany_mvp_live_specialist.py` is the auditable live-specialist MVP runner: it launches a real modeling/checkpoint or verification/review specialist through `thread/epiphany/roleLaunch`, lets the spawned worker report through `report_agent_job_result`, reads the finding back through `thread/epiphany/roleResult`, and writes transcript/status artifacts without manually completing backend rows. + - `tools/epiphany_mvp_dogfood.py` is the auditable MVP dogfood runner: it drives state, role launch/result, CRRC drift, reorient launch/result/accept, rendered status snapshots, operator-safe status artifacts, and sealed app-server transcript diagnostics into a local artifact bundle, and it now writes truthful comparison artifacts whether the optional vanilla Codex reference is skipped, fails, or completes. + - `tools/epiphany_mvp_live_specialist.py` is the auditable live-specialist MVP runner: it launches a real modeling/checkpoint or verification/review specialist through `thread/epiphany/roleLaunch`, lets the spawned worker report through `report_agent_job_result`, reads the projected finding back through `thread/epiphany/roleResult`, and writes sealed transcript plus operator-safe status artifacts without manually completing backend rows. - Internal `agent_job:` workers expose `report_agent_job_result` even when the user-facing CSV spawn feature is disabled, and ephemeral worker sessions can initialize the sqlite state runtime on demand so role specialists can report into the shared `agent_jobs` backend. - Epiphany safety doctrine is to separate cognition from actuation, keep authority explicit, make interruption sacred, stage capability release, and treat operator misuse as a normal design input rather than a rude hypothetical. - Epiphany is built in the open, but publication mode is not one-size-fits-all: use FOSS where viable, source-available licensing where economics or capability risk demand it, and commercial terms where organizations extract real enterprise value. @@ -113,6 +115,7 @@ accepted_design: - 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. - 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. + - Dogfood supervision is also a projection boundary: the operator may inspect summaries, verdicts, missing coverage, state patches, job state, and artifact receipts, but not the specialist's raw stream of thought or full transcript unless a forensic debugging request explicitly breaks the seal. - If the agent's persistent instructions, memory, workflow, or state shape are making it less coherent, slower to rehydrate, less honest, or more likely to build Jenga, the agent should ask the user to change it. - Epiphany should make compaction less like death and more like sleep: bank the fire before the dark, so the next waking thing finds coals instead of ash and can meaningfully resume the pattern instead of merely continuing the task. @@ -127,8 +130,8 @@ landed_baseline: - Phase 6 read-back: read-only reorient-worker result reflection through `thread/epiphany/reorientResult`. - Phase 6 acceptance: explicit reorient-worker finding acceptance through `thread/epiphany/reorientAccept`. - Phase 6 dogfood view: first CLI operator status over scene/pressure/reorient/jobs/result/CRRC. - - Phase 6 dogfood runner: auditable scripted MVP loop over state, role results, CRRC, reorientation acceptance, status snapshots, and transcript artifacts. - - Phase 6 live specialist runner: auditable real worker loop over roleLaunch, agent_jobs worker execution, report_agent_job_result, roleResult, status rendering, and transcript artifacts. + - Phase 6 dogfood runner: auditable scripted MVP loop over state, role results, CRRC, reorientation acceptance, status snapshots, operator-safe summaries, and sealed transcript artifacts. + - Phase 6 live specialist runner: auditable real worker loop over roleLaunch, agent_jobs worker execution, report_agent_job_result, roleResult, status rendering, operator-safe summaries, and sealed transcript artifacts. - Phase 6 role ownership: read-only `thread/epiphany/roles` over implementation, modeling/checkpoint, verification/review, and reorientation lanes. - Phase 6 role specialists: explicit `thread/epiphany/roleLaunch` and read-only `thread/epiphany/roleResult` templates for modeling/checkpoint and verification/review. - Phase 6 modeling role acceptance: explicit `thread/epiphany/roleAccept` for reviewed modeling/checkpoint `statePatch` findings that can grow graphs/frontier/checkpoints through the existing state validator. @@ -173,5 +176,5 @@ rejected_paths: reason: persistent state that accumulates every local truth becomes memory cruft and weakens rehydration current_status: - summary: Phase 1 durable state, Phase 2 prompt integration, Phase 3 typed read, Phase 4 retrieval/indexing, Phase 5 update/distill/propose/promote/read/notification, and Phase 6 read-only scene, jobs, roles, freshness, targeted context, graph traversal, pressure, reorient, CRRC, coordinator, reorient launch/result/accept, explicit modeling/checkpoint and verification/review role launch/result templates, review-gated modeling role acceptance, MVP status, dogfood runner, coordinator runner, live specialist runner, limited safe-boundary CRRC automation, pre-compaction checkpoint intervention, the first Tauri/React GUI operator shell, and the distilled shared plus config-backed specialist prompt doctrine are landed. Aetheria dogfood exposed a supervision-boundary failure: the supervising Codex session directly implemented and committed target-repo slices instead of driving Epiphany lanes, so those commits are supervisor-seeded work, not clean dogfood evidence. Native CRRC can steer active loaded Epiphany turns once at `shouldPrepareCompaction`; turn-complete automation can still compact or launch the fixed reorient-worker when the coordinator says it can auto-run. The GUI remains an operator surface over typed state, not a source of truth. - next_action: Quarantine the current Aetheria branch state, discard or label any uncommitted supervisor edits, then rerun dogfood through Epiphany's GUI/coordinator/fixed role lanes with auditable artifacts before accepting more target-repo implementation. + summary: Phase 1 durable state, Phase 2 prompt integration, Phase 3 typed read, Phase 4 retrieval/indexing, Phase 5 update/distill/propose/promote/read/notification, and Phase 6 read-only scene, jobs, roles, freshness, targeted context, graph traversal, pressure, reorient, CRRC, coordinator, reorient launch/result/accept, explicit modeling/checkpoint and verification/review role launch/result templates, review-gated modeling role acceptance, MVP status, dogfood runner, coordinator runner, live specialist runner, limited safe-boundary CRRC automation, pre-compaction checkpoint intervention, the first Tauri/React GUI operator shell, and the distilled shared plus config-backed specialist prompt doctrine are landed. Aetheria dogfood exposed a supervision-boundary failure: the supervising Codex session directly implemented and committed target-repo slices instead of driving Epiphany lanes, so those commits are supervisor-seeded work, not clean dogfood evidence. The quarantine is now stronger: operator tools sanitize direct worker payloads by default and mark raw transcripts/stderr as sealed forensic artifacts. Native CRRC can steer active loaded Epiphany turns once at `shouldPrepareCompaction`; turn-complete automation can still compact or launch the fixed reorient-worker when the coordinator says it can auto-run. The GUI remains an operator surface over typed state, not a source of truth. + next_action: Rerun Aetheria dogfood through Epiphany's GUI/coordinator/fixed role lanes using only operator-safe projections; do not inspect raw worker transcripts or `rawResult` payloads unless the user explicitly requests forensic debugging. diff --git a/tools/epiphany_gui_action.py b/tools/epiphany_gui_action.py index b04cdd29..29519155 100644 --- a/tools/epiphany_gui_action.py +++ b/tools/epiphany_gui_action.py @@ -12,6 +12,7 @@ from typing import Any from epiphany_mvp_status import DEFAULT_APP_SERVER from epiphany_mvp_status import collect_status from epiphany_mvp_status import render_status +from epiphany_mvp_status import sanitize_for_operator from epiphany_phase5_smoke import AppServerClient from epiphany_phase5_smoke import ROOT from epiphany_phase6_reorient_launch_smoke import BINDING_ID as REORIENT_BINDING_ID @@ -307,16 +308,29 @@ def run_action(args: argparse.Namespace) -> dict[str, Any]: assert response is not None after = collect_status(client, thread_id=thread_id, cwd=cwd, ephemeral=True) - write_json(artifact_dir / "before-status.json", before) - write_json(artifact_dir / "action-response.json", response) - write_json(artifact_dir / "after-status.json", after) - write_text(artifact_dir / "after-status.txt", render_status(after)) + operator_before = sanitize_for_operator(before) + operator_response = sanitize_for_operator(response) + operator_after = sanitize_for_operator(after) + write_json(artifact_dir / "before-status.json", operator_before) + write_json(artifact_dir / "action-response.json", operator_response) + write_json(artifact_dir / "after-status.json", operator_after) + write_text(artifact_dir / "after-status.txt", render_status(operator_after)) result = { "action": args.action, "artifactPath": str(artifact_dir), "summary": summary, "threadId": thread_id, - "response": response, + "response": operator_response, + "sealedArtifactManifest": [ + { + "path": "transcript.jsonl", + "reason": "sealed JSON-RPC audit trail; do not read during normal supervision", + }, + { + "path": "server.stderr.log", + "reason": "sealed app-server diagnostics; inspect only for explicit debugging", + }, + ], } write_json(artifact_dir / "gui-action-summary.json", result) return result diff --git a/tools/epiphany_mvp_coordinator.py b/tools/epiphany_mvp_coordinator.py index f81f68fa..abb3d078 100644 --- a/tools/epiphany_mvp_coordinator.py +++ b/tools/epiphany_mvp_coordinator.py @@ -11,6 +11,7 @@ from typing import Any from epiphany_mvp_status import DEFAULT_APP_SERVER from epiphany_mvp_status import collect_status from epiphany_mvp_status import render_status +from epiphany_mvp_status import sanitize_for_operator from epiphany_phase5_smoke import AppServerClient from epiphany_phase5_smoke import ROOT from epiphany_phase5_smoke import require @@ -307,7 +308,7 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]: } snapshot_name = f"step-{index:02d}-{action}.txt" - write_text(artifact_dir / snapshot_name, render_status(status)) + write_text(artifact_dir / snapshot_name, render_status(sanitize_for_operator(status))) snapshots.append(snapshot_name) step: dict[str, Any] = { @@ -337,10 +338,18 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]: expected_revision=revision, max_runtime_seconds=args.max_runtime_seconds, ) - step["events"].append({"type": "roleLaunch", "roleId": "modeling", "launch": launch}) + step["events"].append( + { + "type": "roleLaunch", + "roleId": "modeling", + "launch": sanitize_for_operator(launch), + } + ) completed = maybe_complete_role_backend(args, launch, role_id="modeling") if completed is not None: - step["events"].append({"type": "testCompleteBackend", "payload": completed}) + step["events"].append( + {"type": "testCompleteBackend", "payload": sanitize_for_operator(completed)} + ) result = wait_for_role_result( client, thread_id=thread_id, @@ -348,7 +357,13 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]: timeout_seconds=args.timeout_seconds, poll_seconds=args.poll_seconds, ) - step["events"].append({"type": "roleResult", "roleId": "modeling", "result": result}) + step["events"].append( + { + "type": "roleResult", + "roleId": "modeling", + "result": sanitize_for_operator(result), + } + ) if not args.auto_review: final_action = {"action": "reviewModelingResult", "reason": result.get("note")} append_jsonl(steps_path, step) @@ -364,10 +379,18 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]: expected_revision=revision, max_runtime_seconds=args.max_runtime_seconds, ) - step["events"].append({"type": "roleLaunch", "roleId": "verification", "launch": launch}) + step["events"].append( + { + "type": "roleLaunch", + "roleId": "verification", + "launch": sanitize_for_operator(launch), + } + ) completed = maybe_complete_role_backend(args, launch, role_id="verification") if completed is not None: - step["events"].append({"type": "testCompleteBackend", "payload": completed}) + step["events"].append( + {"type": "testCompleteBackend", "payload": sanitize_for_operator(completed)} + ) result = wait_for_role_result( client, thread_id=thread_id, @@ -376,7 +399,11 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]: poll_seconds=args.poll_seconds, ) step["events"].append( - {"type": "roleResult", "roleId": "verification", "result": result} + { + "type": "roleResult", + "roleId": "verification", + "result": sanitize_for_operator(result), + } ) if not args.auto_review: final_action = {"action": "reviewVerificationResult", "reason": result.get("note")} @@ -392,17 +419,19 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]: expected_revision=revision, max_runtime_seconds=args.max_runtime_seconds, ) - step["events"].append({"type": "reorientLaunch", "launch": launch}) + step["events"].append({"type": "reorientLaunch", "launch": sanitize_for_operator(launch)}) completed = maybe_complete_reorient_backend(args, launch) if completed is not None: - step["events"].append({"type": "testCompleteBackend", "payload": completed}) + step["events"].append( + {"type": "testCompleteBackend", "payload": sanitize_for_operator(completed)} + ) result = wait_for_reorient_result( client, thread_id=thread_id, timeout_seconds=args.timeout_seconds, poll_seconds=args.poll_seconds, ) - step["events"].append({"type": "reorientResult", "result": result}) + step["events"].append({"type": "reorientResult", "result": sanitize_for_operator(result)}) if not args.auto_review: final_action = {"action": "reviewReorientResult", "reason": result.get("note")} append_jsonl(steps_path, step) @@ -416,12 +445,14 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]: append_jsonl(steps_path, step) continue compact = client.send("thread/compact/start", {"threadId": thread_id}) - step["events"].append({"type": "compactStart", "response": compact}) + step["events"].append({"type": "compactStart", "response": sanitize_for_operator(compact)}) try: notification = client.wait_for_notification( "thread/compacted", timeout=args.timeout_seconds ) - step["events"].append({"type": "compacted", "notification": notification}) + step["events"].append( + {"type": "compacted", "notification": sanitize_for_operator(notification)} + ) except TimeoutError as exc: step["events"].append({"type": "compactWaitTimeout", "error": str(exc)}) final_action = { @@ -431,7 +462,7 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]: append_jsonl(steps_path, step) break resumed = client.send("thread/resume", {"threadId": thread_id}) - step["events"].append({"type": "resume", "response": resumed}) + step["events"].append({"type": "resume", "response": sanitize_for_operator(resumed)}) append_jsonl(steps_path, step) continue @@ -444,8 +475,11 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]: final_status = collect_coordinator_status( client, thread_id=thread_id, cwd=cwd, ephemeral=args.ephemeral ) - final_rendered = render_status(final_status) + operator_final_status = sanitize_for_operator(final_status) + final_rendered = render_status(operator_final_status) + operator_steps = sanitize_for_operator(steps) + operator_final_action = sanitize_for_operator(final_action) summary = { "objective": "Coordinate the Epiphany MVP lanes over existing app-server APIs.", "artifactDir": str(artifact_dir), @@ -453,27 +487,35 @@ def run_coordinator(args: argparse.Namespace) -> dict[str, Any]: "workspace": str(cwd), "threadId": final_status["threadId"] if final_status else args.thread_id, "mode": args.mode, - "steps": steps, + "steps": operator_steps, "snapshots": snapshots, - "finalAction": final_action, - "finalStatus": final_status, + "finalAction": operator_final_action, + "finalStatus": operator_final_status, "artifactManifest": [ "coordinator-summary.json", "coordinator-steps.jsonl", "coordinator-final-status.json", "coordinator-final-status.txt", "coordinator-final-action.txt", - "epiphany-transcript.jsonl", - "epiphany-server.stderr.log", *snapshots, ], + "sealedArtifactManifest": [ + { + "path": "epiphany-transcript.jsonl", + "reason": "sealed JSON-RPC audit trail; do not read during normal supervision", + }, + { + "path": "epiphany-server.stderr.log", + "reason": "sealed app-server diagnostics; inspect only for explicit debugging", + }, + ], } write_json(artifact_dir / "coordinator-summary.json", summary) - write_json(artifact_dir / "coordinator-final-status.json", final_status) + write_json(artifact_dir / "coordinator-final-status.json", operator_final_status) write_text(artifact_dir / "coordinator-final-status.txt", final_rendered) write_text( artifact_dir / "coordinator-final-action.txt", - json.dumps(final_action, indent=2, ensure_ascii=False) + "\n", + json.dumps(operator_final_action, indent=2, ensure_ascii=False) + "\n", ) return summary diff --git a/tools/epiphany_mvp_coordinator_smoke.py b/tools/epiphany_mvp_coordinator_smoke.py index 5105cb3e..1d0639e2 100644 --- a/tools/epiphany_mvp_coordinator_smoke.py +++ b/tools/epiphany_mvp_coordinator_smoke.py @@ -75,6 +75,21 @@ def require_artifacts(summary: dict[str, Any]) -> None: require((artifact_dir / name).exists(), f"missing coordinator artifact {name}") +def require_operator_safe(value: Any, path: str = "$") -> None: + if isinstance(value, dict): + if "rawResult" in value: + raw_result = value["rawResult"] + require( + isinstance(raw_result, dict) and raw_result.get("sealed") is True, + f"{path}.rawResult should be sealed in operator-facing artifacts", + ) + for key, item in value.items(): + require_operator_safe(item, f"{path}.{key}") + elif isinstance(value, list): + for index, item in enumerate(value): + require_operator_safe(item, f"{path}[{index}]") + + def run_smoke(args: argparse.Namespace) -> dict[str, Any]: app_server = args.app_server.resolve() if not app_server.exists(): @@ -91,6 +106,7 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]: "cold start should stop at prepareCheckpoint", ) require_artifacts(cold) + require_operator_safe(cold) modeling = run_coordinator( coordinator_args( @@ -107,6 +123,7 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]: "modeling run should stop with a reviewable modeling result", ) require_artifacts(modeling) + require_operator_safe(modeling) verification = run_coordinator( coordinator_args( @@ -124,6 +141,7 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]: "auto-review smoke should drive through verification and stop at review", ) require_artifacts(verification) + require_operator_safe(verification) drift = run_coordinator( coordinator_args( @@ -141,6 +159,7 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]: "source drift should launch reorient worker and stop for review", ) require_artifacts(drift) + require_operator_safe(drift) pressure = run_coordinator( coordinator_args( @@ -163,6 +182,7 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]: "dry compact smoke should record the compaction action", ) require_artifacts(pressure) + require_operator_safe(pressure) result = { "artifactRoot": str(artifact_root), diff --git a/tools/epiphany_mvp_dogfood.py b/tools/epiphany_mvp_dogfood.py index f3f66b45..42896812 100644 --- a/tools/epiphany_mvp_dogfood.py +++ b/tools/epiphany_mvp_dogfood.py @@ -9,6 +9,7 @@ from typing import Any from epiphany_mvp_status import DEFAULT_APP_SERVER from epiphany_mvp_status import collect_status from epiphany_mvp_status import render_status +from epiphany_mvp_status import sanitize_for_operator from epiphany_phase5_smoke import AppServerClient from epiphany_phase5_smoke import ROOT from epiphany_phase5_smoke import require @@ -169,7 +170,7 @@ def run_vanilla_reference(args: argparse.Namespace, artifact_dir: Path, workspac write_text( artifact_dir / "comparison.md", "# Dogfood Comparison\n\n" - "Epiphany run produced typed state, role-lane findings, CRRC drift detection, reorient acceptance, rendered snapshots, and JSON-RPC transcript artifacts.\n\n" + "Epiphany run produced typed state, role-lane findings, CRRC drift detection, reorient acceptance, rendered snapshots, and sealed JSON-RPC transcript artifacts.\n\n" "Vanilla reference produced a single untyped review turn over the same bounded workspace.\n\n" "Primary product signal: Epiphany makes lane ownership, checkpoint state, drift, and review gates inspectable as structured artifacts. Vanilla Codex can still solve the tiny source question, but it does not produce durable typed role/CRRC state unless the operator asks for it manually.\n", ) @@ -193,7 +194,8 @@ def snapshot( label: str, ) -> dict[str, Any]: status = collect_status(client, thread_id=thread_id, cwd=cwd, ephemeral=True) - return {"label": label, "status": status, "rendered": render_status(status)} + operator_status = sanitize_for_operator(status) + return {"label": label, "status": operator_status, "rendered": render_status(operator_status)} def launch_role( @@ -350,7 +352,8 @@ def run_dogfood(args: argparse.Namespace) -> dict[str, Any]: final_status["crrc"]["recommendation"]["action"] == "regatherManually", "accepted regather findings should not be recommended for acceptance again", ) - final_rendered = render_status(final_status) + operator_final_status = sanitize_for_operator(final_status) + final_rendered = render_status(operator_final_status) final_read = client.send("thread/read", {"threadId": thread_id, "includeTurns": False}) assert final_read is not None @@ -368,43 +371,61 @@ def run_dogfood(args: argparse.Namespace) -> dict[str, Any]: "bindingId": MODELING_BINDING_ID, "backendJobId": modeling_launch["job"]["backendJobId"], "resultStatus": modeling_result["status"], - "payload": modeling_payload, + "payload": sanitize_for_operator(modeling_payload), }, "verification": { "revision": verification_launch["revision"], "bindingId": VERIFICATION_BINDING_ID, "backendJobId": verification_launch["job"]["backendJobId"], "resultStatus": verification_result["status"], - "payload": verification_payload, + "payload": sanitize_for_operator(verification_payload), }, "crrc": { "driftDecision": regather["decision"], "launchRevision": reorient_launch["revision"], "resultStatus": reorient_result["status"], "acceptedRevision": accepted["revision"], - "payload": reorient_payload, + "payload": sanitize_for_operator(reorient_payload), }, - "finalRecommendation": final_status["crrc"]["recommendation"], + "finalRecommendation": operator_final_status["crrc"]["recommendation"], "vanillaReference": reference, "artifactManifest": [ "epiphany-dogfood-summary.json", "epiphany-final-status.json", "epiphany-final-status.txt", "epiphany-snapshots.json", - "epiphany-transcript.jsonl", - "epiphany-server.stderr.log", "vanilla-reference-prompt.md", "vanilla-reference.md", "comparison.md", ], + "sealedArtifactManifest": [ + { + "path": "epiphany-transcript.jsonl", + "reason": "sealed JSON-RPC audit trail; do not read during normal supervision", + }, + { + "path": "epiphany-server.stderr.log", + "reason": "sealed app-server diagnostics; inspect only for explicit debugging", + }, + ], } if reference.get("transcriptPath"): - summary["artifactManifest"].append(str(reference["transcriptPath"])) + summary["sealedArtifactManifest"].append( + { + "path": str(reference["transcriptPath"]), + "reason": "sealed vanilla-reference transcript; inspect only for explicit comparison debugging", + } + ) if reference.get("stderrPath"): - summary["artifactManifest"].append(str(reference["stderrPath"])) + summary["sealedArtifactManifest"].append( + { + "path": str(reference["stderrPath"]), + "reason": "sealed vanilla-reference diagnostics; inspect only for explicit debugging", + } + ) write_json(artifact_dir / "epiphany-snapshots.json", snapshots) - write_json(artifact_dir / "epiphany-final-status.json", final_status) + write_json(artifact_dir / "epiphany-final-status.json", operator_final_status) write_text(artifact_dir / "epiphany-final-status.txt", final_rendered) write_json(artifact_dir / "epiphany-dogfood-summary.json", summary) write_json( @@ -412,10 +433,11 @@ def run_dogfood(args: argparse.Namespace) -> dict[str, Any]: { "artifactDir": str(artifact_dir), "files": summary["artifactManifest"], + "sealedFiles": summary["sealedArtifactManifest"], "notes": [ - "transcript contains JSON-RPC request/response audit trail", - "stderr captures app-server diagnostics", - "snapshots preserve rendered and raw status at each dogfood checkpoint", + "sealed transcripts contain JSON-RPC request/response audit trails", + "sealed stderr files capture app-server diagnostics", + "snapshots preserve rendered and operator-safe status at each dogfood checkpoint", "comparison.md states whether the optional vanilla reference actually ran", ], }, diff --git a/tools/epiphany_mvp_live_specialist.py b/tools/epiphany_mvp_live_specialist.py index e80603c2..f1aed7ce 100644 --- a/tools/epiphany_mvp_live_specialist.py +++ b/tools/epiphany_mvp_live_specialist.py @@ -12,6 +12,7 @@ from typing import Any from epiphany_mvp_status import DEFAULT_APP_SERVER from epiphany_mvp_status import collect_status from epiphany_mvp_status import render_status +from epiphany_mvp_status import sanitize_for_operator from epiphany_phase5_smoke import AppServerClient from epiphany_phase5_smoke import ROOT from epiphany_phase5_smoke import require @@ -160,14 +161,15 @@ def run_live_specialist(args: argparse.Namespace) -> dict[str, Any]: role_results.append( { "roleId": role_id, - "launch": launch, + "launch": sanitize_for_operator(launch), "seenStatuses": seen_statuses, - "result": result, + "result": sanitize_for_operator(result), } ) final_status = collect_status(client, thread_id=thread_id, cwd=workspace, ephemeral=True) - final_rendered = render_status(final_status) + operator_final_status = sanitize_for_operator(final_status) + final_rendered = render_status(operator_final_status) summary = { "objective": "Run a real Epiphany role specialist through roleLaunch, agent_jobs, report_agent_job_result, and roleResult.", @@ -176,18 +178,26 @@ def run_live_specialist(args: argparse.Namespace) -> dict[str, Any]: "threadId": thread_id, "workspace": str(workspace), "roles": role_results, - "finalStatus": final_status, + "finalStatus": operator_final_status, "artifactManifest": [ "live-specialist-summary.json", "epiphany-final-status.json", "epiphany-final-status.txt", - "epiphany-transcript.jsonl", - "epiphany-server.stderr.log", + ], + "sealedArtifactManifest": [ + { + "path": "epiphany-transcript.jsonl", + "reason": "sealed worker transcript; do not read during normal supervision", + }, + { + "path": "epiphany-server.stderr.log", + "reason": "sealed app-server diagnostics; inspect only for explicit debugging", + }, ], } write_json(artifact_dir / "live-specialist-summary.json", summary) - write_json(artifact_dir / "epiphany-final-status.json", final_status) + write_json(artifact_dir / "epiphany-final-status.json", operator_final_status) write_text(artifact_dir / "epiphany-final-status.txt", final_rendered) return summary diff --git a/tools/epiphany_mvp_status.py b/tools/epiphany_mvp_status.py index 30fd24af..5ea89dfa 100644 --- a/tools/epiphany_mvp_status.py +++ b/tools/epiphany_mvp_status.py @@ -14,6 +14,45 @@ from epiphany_phase5_smoke import ROOT DEFAULT_CODEX_HOME = Path(os.environ.get("CODEX_HOME", Path.home() / ".codex")) DEFAULT_TRANSCRIPT = ROOT / ".epiphany-status" / "epiphany-mvp-status-transcript.jsonl" DEFAULT_STDERR = ROOT / ".epiphany-status" / "epiphany-mvp-status-server.stderr.log" +SEALED_DIRECT_THOUGHT_KEYS = { + "rawResult", + "turns", + "items", + "inputTranscript", + "activeTranscript", +} + + +def sealed_direct_thought(key: str, value: Any) -> dict[str, Any]: + length: int | None = None + if isinstance(value, (list, str, dict)): + length = len(value) + sealed: dict[str, Any] = { + "sealed": True, + "key": key, + "reason": ( + "Operator-safe dogfood views use projected findings and audit " + "receipts; direct agent transcript/thought payloads stay sealed " + "unless the user explicitly requests forensic debugging." + ), + } + if length is not None: + sealed["size"] = length + return sealed + + +def sanitize_for_operator(value: Any) -> Any: + if isinstance(value, dict): + sanitized: dict[str, Any] = {} + for key, item in value.items(): + if key in SEALED_DIRECT_THOUGHT_KEYS: + sanitized[key] = sealed_direct_thought(key, item) + else: + sanitized[key] = sanitize_for_operator(item) + return sanitized + if isinstance(value, list): + return [sanitize_for_operator(item) for item in value] + return value def maybe(value: Any, fallback: str = "none") -> str: @@ -245,6 +284,7 @@ def run(args: argparse.Namespace) -> dict[str, Any]: ephemeral=args.ephemeral, ) + status = sanitize_for_operator(status) if args.result is not None: result_path = args.result.resolve() result_path.parent.mkdir(parents=True, exist_ok=True) @@ -264,7 +304,7 @@ def main() -> int: parser.add_argument("--thread-id") parser.add_argument("--cwd", type=Path, default=ROOT) parser.add_argument("--ephemeral", action=argparse.BooleanOptionalAction, default=True) - parser.add_argument("--json", action="store_true", help="Print raw collected JSON.") + parser.add_argument("--json", action="store_true", help="Print operator-safe collected JSON.") parser.add_argument("--result", type=Path) parser.add_argument("--transcript", type=Path, default=DEFAULT_TRANSCRIPT) parser.add_argument("--stderr", type=Path, default=DEFAULT_STDERR) 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 92e4ba41..ee524c84 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 @@ -37,5 +37,5 @@ Do not continue broad implementation until the seam is re-grounded, and do not c [coordinator] 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}. During dogfood, the Self supervises target-repo work through fixed lanes and artifacts; direct supervisor edits are contamination unless explicitly marked as an operator intervention. Current recommendation: {coordinator_action}. +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}. 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}. '''