From 76378030154a8030f00d594d3baddfda67a0d43d Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 25 Apr 2026 04:22:06 +0100 Subject: [PATCH] Harden risky delta promotion policy --- epiphany-core/src/promotion.rs | 124 +++++++++++++++++++++ notes/epiphany-current-algorithmic-map.md | 16 ++- notes/epiphany-fork-implementation-plan.md | 11 +- notes/fresh-workspace-handoff.md | 14 +-- state/evidence.jsonl | 2 + state/map.yaml | 7 +- 6 files changed, 153 insertions(+), 21 deletions(-) diff --git a/epiphany-core/src/promotion.rs b/epiphany-core/src/promotion.rs index fc52b9cc..9a81d6e8 100644 --- a/epiphany-core/src/promotion.rs +++ b/epiphany-core/src/promotion.rs @@ -75,6 +75,7 @@ pub fn evaluate_promotion(input: EpiphanyPromotionInput) -> EpiphanyPromotionDec } } validate_state_replacements(&input, &mut reasons); + validate_delta_promotion_policy(&input, &mut reasons); EpiphanyPromotionDecision { accepted: reasons.is_empty(), @@ -153,6 +154,34 @@ fn validate_state_replacements(input: &EpiphanyPromotionInput, reasons: &mut Vec } } +fn validate_delta_promotion_policy(input: &EpiphanyPromotionInput, reasons: &mut Vec) { + let Some(churn) = input.churn.as_ref() else { + return; + }; + if !is_risky_delta(churn) { + return; + } + + if churn + .warning + .as_deref() + .map(str::trim) + .unwrap_or_default() + .is_empty() + { + reasons.push( + "medium/high churn promotions must include patch.churn.warning explaining the delta" + .to_string(), + ); + } + if !is_strong_verifier_kind(&input.verifier_evidence.kind) { + reasons.push(format!( + "medium/high churn promotions require verifierEvidence.kind to be verification/test/smoke/review, got {:?}", + input.verifier_evidence.kind + )); + } +} + fn validate_subgoals( subgoals: &[EpiphanySubgoal], active_subgoal_id: Option<&str>, @@ -435,6 +464,39 @@ fn is_accepting_status(status: &str) -> bool { ) } +fn is_risky_delta(churn: &EpiphanyChurnState) -> bool { + pressure_rank(&churn.diff_pressure) >= 2 + || churn + .graph_freshness + .as_deref() + .map(|freshness| { + let freshness = freshness.trim().to_ascii_lowercase(); + freshness.contains("broadened") + || freshness.contains("semantic") + || freshness.contains("updated") + }) + .unwrap_or(false) +} + +fn pressure_rank(value: &str) -> u8 { + match value.trim().to_ascii_lowercase().as_str() { + "critical" => 4, + "high" => 3, + "medium" => 2, + "low" => 1, + _ => 0, + } +} + +fn is_strong_verifier_kind(kind: &str) -> bool { + let kind = kind.trim().to_ascii_lowercase(); + kind.contains("verification") + || kind.contains("verifier") + || kind.contains("test") + || kind.contains("smoke") + || kind.contains("review") +} + #[cfg(test)] mod tests { use super::*; @@ -634,4 +696,66 @@ mod tests { assert!(decision.accepted, "{:?}", decision.reasons); } + + #[test] + fn evaluate_promotion_rejects_risky_churn_without_warning() { + let decision = evaluate_promotion(EpiphanyPromotionInput { + churn: Some(EpiphanyChurnState { + understanding_status: "proposal_updates_map".to_string(), + diff_pressure: "high".to_string(), + graph_freshness: Some("proposal-updated".to_string()), + ..Default::default() + }), + ..promotion_input(true, vec![observation()], vec![evidence()], "ok") + }); + + assert!(!decision.accepted); + assert!( + decision + .reasons + .iter() + .any(|reason| reason.contains("patch.churn.warning")) + ); + } + + #[test] + fn evaluate_promotion_rejects_risky_churn_with_weak_verifier_kind() { + let mut input = promotion_input(true, vec![observation()], vec![evidence()], "ok"); + input.churn = Some(EpiphanyChurnState { + understanding_status: "proposal_refines_map".to_string(), + diff_pressure: "medium".to_string(), + graph_freshness: Some("proposal-broadened".to_string()), + warning: Some("Same-path broadening needs explicit verifier review.".to_string()), + ..Default::default() + }); + input.verifier_evidence.kind = "observation".to_string(); + + let decision = evaluate_promotion(input); + + assert!(!decision.accepted); + assert!( + decision + .reasons + .iter() + .any(|reason| reason.contains("verifierEvidence.kind")) + ); + } + + #[test] + fn evaluate_promotion_accepts_risky_churn_with_strong_verifier_and_warning() { + let decision = evaluate_promotion(EpiphanyPromotionInput { + churn: Some(EpiphanyChurnState { + understanding_status: "proposal_refines_map".to_string(), + diff_pressure: "medium".to_string(), + graph_freshness: Some("proposal-semantically-anchored".to_string()), + warning: Some( + "Semantic anchoring was verified against source context.".to_string(), + ), + ..Default::default() + }), + ..promotion_input(true, vec![observation()], vec![evidence()], "ok") + }); + + assert!(decision.accepted, "{:?}", decision.reasons); + } } diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index b3c0e64c..70b3477f 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -19,7 +19,7 @@ The spine exists in ten live paths: - client read hydration: app-server thread views attach live or reconstructed `thread.epiphanyState` in [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4599). - explicit distillation proposals: app-server routes read-only `thread/epiphany/distill` through a loaded-thread handler into `epiphany-core` so one explicit observation can become a patch candidate without mutating state; tool/command/shell/model sources now get typed evidence kinds and bounded salient-output summaries instead of dumping raw output into durable state in [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4173) and [distillation.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/distillation.rs:28). - explicit map/churn proposals: app-server routes read-only `thread/epiphany/propose` through a loaded-thread handler into `epiphany-core` so verified observations with code refs and accepting recent evidence can be selected explicitly or auto-selected as a bounded path cluster, prioritize the strongest selected observation, focus or extend architecture graph nodes, rescue unanchored graph nodes through strict semantic overlap, carry linked dataflow nodes and incident graph edges into the frontier, update churn candidates with match-kind-aware map-delta judgment and pressure, and still avoid mutation until promotion in [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4244) and [proposal.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/proposal.rs:115). -- explicit promotion gates: app-server routes `thread/epiphany/promote` through a loaded-thread handler into `epiphany-core` policy evaluation, rejects failed verifier evidence without mutation, and applies accepted candidates through the same durable update path in [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4316) and [promotion.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/promotion.rs:33). +- explicit promotion gates: app-server routes `thread/epiphany/promote` through a loaded-thread handler into `epiphany-core` policy evaluation, rejects failed verifier evidence without mutation, applies accepted candidates through the same durable update path, and now treats medium/high/broadening/semantic churn deltas as needing explicit rationale plus stronger verifier evidence in [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4316) and [promotion.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/promotion.rs:33). - explicit state updates: app-server routes `thread/epiphany/update` through a loaded `CodexThread` update method that mutates live `SessionState`, bumps the revision, and persists an immediate `RolloutItem::EpiphanyState` snapshot in [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4416) and [codex_thread.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/codex_thread.rs:373). - retrieval/indexing: app-server routes `thread/epiphany/retrieve` and `thread/epiphany/index` through loaded `CodexThread` host methods into `epiphany-core` in [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4046), [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4122), [codex_thread.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/codex_thread.rs:438), and [codex_thread.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/codex_thread.rs:456). @@ -104,7 +104,7 @@ Source audit on 2026-04-25 re-read each flow below against the cited code instea The current landed machine is still coherent. The core shape is not ornamental: one protocol state object flows through session state, prompt rendering, rollout persistence, thread hydration, explicit retrieval/indexing, read-only distillation/proposal, verifier-backed promotion, and the single durable update writer. The useful simplification pressure is already present in the boundaries: retrieval reads, indexing writes only the semantic catalog, distillation/proposal draft patches, promotion gates, and update persists. -Nothing in the current typed spine obviously deserves deletion right now. The parts that would turn this into Jenga are still correctly listed as non-flows: automatic tool-output ingestion, watcher invalidation, GUI reflection, specialist scheduling, and an automatic Compact-Rehydrate-Reorient-Continue coordinator. The next Perfect Machine move is therefore not adding another writer or a shiny surface. After match-kind-aware map-delta judgment and source-output-aware distillation, the next pressure belongs in promotion policy that can consume richer deltas, still evidence-backed and still forced through promotion. +Nothing in the current typed spine obviously deserves deletion right now. The parts that would turn this into Jenga are still correctly listed as non-flows: automatic tool-output ingestion, watcher invalidation, GUI reflection, specialist scheduling, and an automatic Compact-Rehydrate-Reorient-Continue coordinator. The next Perfect Machine move is therefore not adding another writer or a shiny surface. After match-kind-aware map-delta judgment, source-output-aware distillation, and first risky-delta promotion policy, the next pressure belongs in live-smoking the richer Phase 5 path and then adding only the smallest missing policy/proposal rule the smoke exposes. ## Natural Language Spine @@ -821,7 +821,7 @@ The app-server handler: 7. calls `CodexThread.epiphany_update_state`. 8. returns the updated `EpiphanyThreadState`. -`evaluate_promotion` currently enforces a deliberately small but now map-aware policy: +`evaluate_promotion` currently enforces a deliberately small but now delta-aware policy: 1. the patch must contain at least one mutation. 2. verifier evidence must have nonempty id/kind/status/summary. @@ -830,6 +830,8 @@ The app-server handler: 5. observations must be nonempty, unique by id, and cite existing evidence ids. 6. state replacement patches, including map/frontier/checkpoint/churn edits, must include at least one explicit observation and at least one patch evidence record. 7. subgoal, invariant, graph, frontier, checkpoint, and churn replacements get lightweight structural validation before they can reach the durable update path. +8. risky churn deltas require an explicit `patch.churn.warning`; risky means medium-or-higher `diff_pressure`, or graph freshness that signals broadening, semantic anchoring, or an update. +9. risky churn deltas require stronger verifier evidence kind: verification, verifier, test, smoke, or review. Generic observation evidence is not enough to stamp a high-pressure map change. Code refs: @@ -838,7 +840,9 @@ Code refs: - [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4363) - [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4393) - [epiphany-core/src/promotion.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/promotion.rs:33) -- [epiphany-core/src/promotion.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/promotion.rs:125) +- [epiphany-core/src/promotion.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/promotion.rs:126) +- [epiphany-core/src/promotion.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/promotion.rs:157) +- [epiphany-core/src/promotion.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/promotion.rs:467) ### Output @@ -875,7 +879,7 @@ stored Epiphany state -> explicit update patches can revise durable map/evidence/churn state ``` -The current remaining missing organ is not the red pen and not the first chewing motion. Those exist. Proposal now has the first bits of map memory, focus, and selection hygiene: it can auto-select a bounded evidence-backed observation cluster when ids are omitted, requires accepting recent evidence behind selected observations, prioritizes stronger selected observations for proposal wording, reuses existing architecture nodes by concrete code-ref/path/id checks before creating new path nodes, can rescue unanchored graph nodes through strict unique semantic overlap, follows graph links and incident edges into the frontier, and reports match-kind-aware churn pressure from the actual proposal shape. Distillation now also has the first source-output-aware teeth for tool/model summaries. The missing organ is promotion policy that can reason over those richer deltas, watcher/freshness inputs, and eventually role-scoped specialist ownership without silently auto-promoting anything. +The current remaining missing organ is not the red pen and not the first chewing motion. Those exist. Proposal now has the first bits of map memory, focus, and selection hygiene: it can auto-select a bounded evidence-backed observation cluster when ids are omitted, requires accepting recent evidence behind selected observations, prioritizes stronger selected observations for proposal wording, reuses existing architecture nodes by concrete code-ref/path/id checks before creating new path nodes, can rescue unanchored graph nodes through strict unique semantic overlap, follows graph links and incident edges into the frontier, and reports match-kind-aware churn pressure from the actual proposal shape. Distillation now also has the first source-output-aware teeth for tool/model summaries. Promotion now notices risky deltas instead of just checking the shape of the envelope. The missing organ is live app-server smoke coverage for the richer Phase 5 chain, watcher/freshness inputs, and eventually role-scoped specialist ownership without silently auto-promoting anything. ```text model/tool observations @@ -886,7 +890,7 @@ model/tool observations -> durable evidence/map/churn mutation ``` -The typed write path exists, the first deterministic observation/evidence distillation path exists, source-output-aware distillation now summarizes noisy tool/model output into typed evidence, the first deterministic map/churn proposal path exists, proposal-quality hardening now auto-selects bounded observation clusters when ids are omitted, requires accepting recent evidence, reuses existing graph nodes by observed code refs, prioritizes stronger selected observations, rescues unanchored graph nodes by strict semantic overlap, focuses linked frontier context, reports match-kind-aware map-delta pressure, and the first verifier-backed promotion gate exists. The first map/churn safety layer also exists: promotion can reject state replacement patches that are not tied to explicit observations/evidence or that contain structurally broken subgoal, invariant, graph, frontier, checkpoint, or churn fields. +The typed write path exists, the first deterministic observation/evidence distillation path exists, source-output-aware distillation now summarizes noisy tool/model output into typed evidence, the first deterministic map/churn proposal path exists, proposal-quality hardening now auto-selects bounded observation clusters when ids are omitted, requires accepting recent evidence, reuses existing graph nodes by observed code refs, prioritizes stronger selected observations, rescues unanchored graph nodes by strict semantic overlap, focuses linked frontier context, reports match-kind-aware map-delta pressure, and the first verifier-backed promotion gate exists. The first map/churn safety layer also exists: promotion can reject state replacement patches that are not tied to explicit observations/evidence, that contain structurally broken subgoal, invariant, graph, frontier, checkpoint, or churn fields, or that try to promote risky churn without a warning and stronger verifier evidence. In natural language: current Epiphany can preserve a map, show a map, retrieve evidence for the map, draft one explicit observation/evidence patch, derive a bounded graph/frontier/churn candidate from verified evidence-backed observations with code refs, choose a small coherent observation set when the caller does not provide one, favor the strongest selected observation when drafting that candidate, reject or accept a verified candidate, apply explicit map/evidence/churn edits, and sanity-check those edits before they hit the ledger. It still does not ingest fresh tool/model output into richer map deltas automatically, invalidate stale graph regions, or coordinate specialist ownership. Teeth are installed; chewing is supervised; the next slices are about taste, not jawbones. diff --git a/notes/epiphany-fork-implementation-plan.md b/notes/epiphany-fork-implementation-plan.md index 6667eb3a..471e1db9 100644 --- a/notes/epiphany-fork-implementation-plan.md +++ b/notes/epiphany-fork-implementation-plan.md @@ -2,7 +2,7 @@ ## Status -Updated on 2026-04-25 after landing source-output-aware observation distillation inside the Phase 5 read-only distill path. +Updated on 2026-04-25 after landing risky-delta promotion policy inside the Phase 5 promote path. This note tracks Epiphany as a fork of Codex with an opinionated modeling architecture. The point is not to offer Codex another collaboration preset. The point is to make the harness force the model to carry explicit structure about the codebase, the active subgoal, the evidence trail, and the machine it is modifying. @@ -23,9 +23,10 @@ This note tracks Epiphany as a fork of Codex with an opinionated modeling archit - an automatic observation-selection slice that lets read-only `thread/epiphany/propose` omit `observationIds`; `epiphany-core` then chooses a bounded coherent path cluster from existing verified, evidence-backed observations using source/evidence quality and current graph-frontier focus - a map-delta judgment slice that distinguishes exact-ref refinement, same-path broadening, deterministic-node reuse, semantic unanchored-node reuse, and new candidate surfaces before setting graph freshness and `diff_pressure` - a source-output distillation slice that keeps `thread/epiphany/distill` read-only while summarizing noisy tool/command/shell/model output into salient lines and defaulting evidence kind to `tool-output` or `model-output` +- a risky-delta promotion policy slice that keeps `thread/epiphany/promote` as the only gate but requires medium/high/broadening/semantic/update churn deltas to carry explicit warning rationale plus strong verifier evidence kind - current phase: Phase 5 semantic distillation/promotion/proposal machinery -The next job is no longer to prove the retriever exists, sketch the persistent follow-up in prose, invent the first red-pen path, build the first observation proposal surface, make promotion notice broken map/churn replacements, ship the first read-only map/churn proposal surface, teach proposal to avoid duplicating already-mapped code surfaces, make proposal frontier focus follow existing graph links, make selected observations evidence-backed with non-haunted churn pressure, rescue unanchored graph nodes with strict semantic matching, let proposal choose a bounded ready observation set when ids are omitted, make proposal pressure understand match kinds, or make the distiller summarize noisy source output. Those parts are landed. The next job is to keep the landing zone honest: improve promotion policy over richer deltas without casually turning `thread/epiphany/retrieve`, `thread/epiphany/distill`, or `thread/epiphany/propose` into durable Epiphany-state writers, and without widening the explicit indexing/update paths into watcher-driven or GUI-shaped machinery before they earn it. +The next job is no longer to prove the retriever exists, sketch the persistent follow-up in prose, invent the first red-pen path, build the first observation proposal surface, make promotion notice broken map/churn replacements, ship the first read-only map/churn proposal surface, teach proposal to avoid duplicating already-mapped code surfaces, make proposal frontier focus follow existing graph links, make selected observations evidence-backed with non-haunted churn pressure, rescue unanchored graph nodes with strict semantic matching, let proposal choose a bounded ready observation set when ids are omitted, make proposal pressure understand match kinds, make the distiller summarize noisy source output, or make promotion notice risky deltas. Those parts are landed. The next job is to keep the landing zone honest: live-smoke the richer Phase 5 chain through app-server before adding more policy, and do not casually turn `thread/epiphany/retrieve`, `thread/epiphany/distill`, or `thread/epiphany/propose` into durable Epiphany-state writers. ## Summary @@ -275,7 +276,7 @@ Add tests for: ## Immediate Next Step -Treat the current retrieval baseline and explicit indexing follow-up as landed Phase 4. Treat the explicit update path, distillation proposal path, read-only map/churn proposal path, verifier-backed promotion gate, structural map/churn promotion validation, graph-node reuse, linked frontier focus, evidence-backed selection, map-delta churn pressure, selected-observation prioritization, strict unanchored-node semantic reuse, automatic bounded observation-set selection, match-kind-aware map-delta judgment, and source-output-aware observation distillation as the active Phase 5 baseline. The next machine gap is no longer "can Epiphany retrieve code?", "can it propose one durable observation patch?", "can it draft one bounded map/churn candidate?", "can it avoid duplicating an existing graph node when an observation points at already-mapped code?", "can it focus linked graph context?", "can it reject selected observations that are not backed by accepting recent evidence?", "can it use graph language when no concrete refs exist yet?", "can it choose a proposal-ready observation set when ids are omitted?", "can it distinguish exact refinement from same-path broadening or semantic anchoring?", or "can it summarize noisy tool/model output as typed evidence?" It can. The next gap is "can promotion policy reason over richer deltas without silently writing them?" +Treat the current retrieval baseline and explicit indexing follow-up as landed Phase 4. Treat the explicit update path, distillation proposal path, read-only map/churn proposal path, verifier-backed promotion gate, structural map/churn promotion validation, graph-node reuse, linked frontier focus, evidence-backed selection, map-delta churn pressure, selected-observation prioritization, strict unanchored-node semantic reuse, automatic bounded observation-set selection, match-kind-aware map-delta judgment, source-output-aware observation distillation, and risky-delta promotion policy as the active Phase 5 baseline. The next machine gap is no longer "can Epiphany retrieve code?", "can it propose one durable observation patch?", "can it draft one bounded map/churn candidate?", "can it avoid duplicating an existing graph node when an observation points at already-mapped code?", "can it focus linked graph context?", "can it reject selected observations that are not backed by accepting recent evidence?", "can it use graph language when no concrete refs exist yet?", "can it choose a proposal-ready observation set when ids are omitted?", "can it distinguish exact refinement from same-path broadening or semantic anchoring?", "can it summarize noisy tool/model output as typed evidence?", or "can promotion policy reason over richer deltas without silently writing them?" It can. The next gap is "does the richer Phase 5 chain behave through the app-server seam?" 1. treat the current verified-and-landed query-time hybrid retriever as the Phase 4 slice 1 baseline 2. treat the verified and live-smoked `thread/epiphany/index` slice as the bounded persistent-semantic follow-up @@ -283,8 +284,8 @@ Treat the current retrieval baseline and explicit indexing follow-up as landed P 4. do not add durable retrieval-summary writes from `thread/epiphany/retrieve` without a clean out-of-band rollout/update semantic 5. continue Phase 5 by hardening the layer above the landed distill/propose/promote/update surfaces: - better proposal heuristics beyond the current exact-code-ref, same-path, deterministic-id, graph-link, accepting-evidence, semantic-unanchored-node, selected-priority, auto-selection, and match-kind-aware map-delta-pressure checks - - promotion policy that can reason over richer delta classes without becoming a second writer - - promotion policy beyond structural validation, but only when it can stay evidence-backed + - live-smoke source-output distillation, proposal, risky-delta rejection, and accepted promotion through the app-server seam + - only after that, add the next smallest promotion/proposal rule the smoke exposes - verifier-backed acceptance/rejection evidence - no hidden retrieval writes - not GUI work diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 41068afd..12b334c1 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -89,7 +89,7 @@ Current verified typed state/promotion layer: - deterministic observation/evidence proposal generation in `epiphany-core` - observation distillation now keeps noisy tool/command/shell/model output bounded by selecting salient output lines and defaulting evidence kind to `tool-output` or `model-output` when the caller did not provide one - deterministic map/churn proposal generation in `epiphany-core`, now with first-pass graph-node reuse by exact code-ref, same-path overlap, or deterministic path-node id before new candidate nodes are created, strict semantic reuse for unanchored architecture nodes, linked frontier focus through graph links and named incident edges, evidence-backed selected observations via accepting `recent_evidence`, selected-observation prioritization, automatic bounded observation selection when ids are omitted, and match-kind-aware churn pressure derived from exact-ref refinement, same-path broadening, deterministic-node reuse, semantic anchoring, or new candidate surfaces -- verifier-backed promotion policy evaluation in `epiphany-core` +- verifier-backed promotion policy evaluation in `epiphany-core`, now rejecting risky churn deltas unless they carry explicit warning rationale and strong verifier evidence kind - core `CodexThread.epiphany_update_state(...)` applies the patch to live `SessionState`, bumps revision, persists `RolloutItem::EpiphanyState`, and flushes rollout - replay helpers in both `codex-core` and `epiphany-core` accept an out-of-band Epiphany snapshot before the first real user turn so seed/update snapshots survive resume - retrieval remains read-only and indexing remains the only persistent semantic write path @@ -360,8 +360,9 @@ If a future session wakes up from compaction and starts bluffing, this is the pa - proposal can now omit `observationIds` and let `epiphany-core` choose a bounded coherent path cluster from existing verified, evidence-backed observations using source/evidence quality plus graph-frontier focus - proposal churn now distinguishes exact-ref refinements from same-path broadening, deterministic-node reuse, semantic unanchored-node reuse, and new candidate surfaces before setting graph freshness and diff pressure - distillation now summarizes noisy tool/command/shell/model output into salient typed evidence rather than preserving raw output sludge as the summary + - promotion now rejects medium/high/broadening/semantic/update churn deltas that lack a warning or only carry weak generic verifier evidence - the Epiphany algorithmic map has been semantically audited flow-by-flow against the cited code; stale line anchors were fixed, and the current typed spine still describes a coherent machine - - the next bounded follow-up is promotion policy over richer deltas, not proving the retriever exists again + - the next bounded follow-up is live-smoke coverage for the richer Phase 5 app-server chain, not proving the retriever exists again - There is still no live `thread/epiphany/*` notification stream. - The next phase is **not** GUI work. - The current pushed baseline also extracted most Epiphany-owned implementation into `epiphany-core`: @@ -456,9 +457,9 @@ Without that, you get to learn about `symlink_dir failed: ... A required privile ## Recommended Next Implementation -Do not restart verification from superstition. Phase 4 retrieval/indexing/core-extraction is already verified, committed, and pushed. Phase 5 distill/propose/promote/update, the first structural promotion safety layer, graph-node reuse, linked frontier focus, evidence-backed proposal selection, selected-observation prioritization, strict unanchored-node semantic reuse, automatic bounded observation selection, match-kind-aware map-delta churn pressure, and source-output-aware distillation are also landed. +Do not restart verification from superstition. Phase 4 retrieval/indexing/core-extraction is already verified, committed, and pushed. Phase 5 distill/propose/promote/update, the first structural promotion safety layer, graph-node reuse, linked frontier focus, evidence-backed proposal selection, selected-observation prioritization, strict unanchored-node semantic reuse, automatic bounded observation selection, match-kind-aware map-delta churn pressure, source-output-aware distillation, and risky-delta promotion policy are also landed. -The durable state seam exists, the turn loop reads it, clients can load typed Epiphany state directly, the first retrieval slice is real, the explicit persistent-semantic indexing path is landed, the distill/propose/promote/update path is live-smoked, promotion now has a first structural map/churn safety layer, distillation summarizes noisy source output into typed evidence, and proposal now reuses existing architecture nodes before creating new path nodes, expands frontier focus through linked graph context, rejects selected observations without accepting recent evidence, prioritizes stronger selected observations for proposal wording, can reuse unanchored architecture nodes through strict semantic overlap, can auto-select a bounded evidence-backed observation cluster when ids are omitted, and reports match-kind-aware churn pressure from the proposal shape. The next clean move is promotion policy over richer deltas, not pretending the already-shipped slices still need ceremony. +The durable state seam exists, the turn loop reads it, clients can load typed Epiphany state directly, the first retrieval slice is real, the explicit persistent-semantic indexing path is landed, the distill/propose/promote/update path is live-smoked, promotion now has a first structural map/churn safety layer and risky-delta policy, distillation summarizes noisy source output into typed evidence, and proposal now reuses existing architecture nodes before creating new path nodes, expands frontier focus through linked graph context, rejects selected observations without accepting recent evidence, prioritizes stronger selected observations for proposal wording, can reuse unanchored architecture nodes through strict semantic overlap, can auto-select a bounded evidence-backed observation cluster when ids are omitted, and reports match-kind-aware churn pressure from the proposal shape. The next clean move is live-smoke coverage for the richer Phase 5 chain, not pretending the already-shipped slices still need ceremony. Current Phase 5 implementation move: @@ -466,8 +467,7 @@ Current Phase 5 implementation move: 2. keep the current env/default Qdrant/Ollama config surface for now 3. keep `thread/epiphany/retrieve`, `thread/epiphany/distill`, and `thread/epiphany/propose` read-only 4. continue Phase 5 by hardening the next layer above the distill/propose/promote/update surfaces: - - promotion policy that can reason over match-kind-aware deltas without becoming a second writer - - promotion policy beyond structural validation only when the evidence path stays explicit + - live-smoke source-output distillation, proposal, risky-delta rejection, and accepted promotion through app-server - verifier-backed acceptance/rejection evidence - no GUI, watcher, or specialist-agent machinery yet @@ -507,4 +507,4 @@ cmd /c "\"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxi The repo is in a good state. -Phase 1, Phase 2, the minimal Phase 3 typed read surface, Phase 4 retrieval/indexing/core-extraction, and the current Phase 5 distill/propose/promote/update baseline are landed and verified. `vendor/codex` is first-class in the parent repo now, with the heavier Epiphany organs living in `epiphany-core`. Read-only distillation now summarizes noisy tool/model output into typed evidence, read-only proposal can auto-select a bounded evidence-backed observation cluster and report match-kind-aware map-delta pressure, and the current Epiphany algorithmic map has been source-audited against the code flow it describes. The next clean move is promotion policy over richer deltas, not GUI paint, watcher magic, or re-proving retrieval. Pre-compaction persistence is now an explicit design rule, not a lucky habit. +Phase 1, Phase 2, the minimal Phase 3 typed read surface, Phase 4 retrieval/indexing/core-extraction, and the current Phase 5 distill/propose/promote/update baseline are landed and verified. `vendor/codex` is first-class in the parent repo now, with the heavier Epiphany organs living in `epiphany-core`. Read-only distillation now summarizes noisy tool/model output into typed evidence, read-only proposal can auto-select a bounded evidence-backed observation cluster and report match-kind-aware map-delta pressure, promotion rejects risky deltas without warning plus strong verifier evidence, and the current Epiphany algorithmic map has been source-audited against the code flow it describes. The next clean move is live-smoke coverage for the richer Phase 5 chain, not GUI paint, watcher magic, or re-proving retrieval. Pre-compaction persistence is now an explicit design rule, not a lucky habit. diff --git a/state/evidence.jsonl b/state/evidence.jsonl index b7f426ba..8983444e 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -120,3 +120,5 @@ {"ts": "2026-04-25T03:09:25+00:00", "type": "verification", "status": "ok", "note": "Verified match-kind-aware proposal delta judgment with cargo fmt --manifest-path .\\epiphany-core\\Cargo.toml, targeted cargo test --manifest-path .\\epiphany-core\\Cargo.toml proposal::tests::propose_map_update (18 tests), and full cargo test --manifest-path .\\epiphany-core\\Cargo.toml (36 tests)."} {"ts": "2026-04-25T03:17:58+00:00", "type": "implementation", "status": "ok", "note": "Landed source-output-aware observation distillation in epiphany-core. Read-only distill_observation now preserves raw line structure long enough to summarize noisy tool/command/shell/model/assistant output into salient bounded lines, defaults evidence kind to tool-output or model-output when appropriate, and still returns only a patch candidate for explicit promotion."} {"ts": "2026-04-25T03:17:58+00:00", "type": "verification", "status": "ok", "note": "Verified source-output-aware distillation with cargo fmt --manifest-path .\\epiphany-core\\Cargo.toml, targeted cargo test --manifest-path .\\epiphany-core\\Cargo.toml distillation::tests (4 tests), and full cargo test --manifest-path .\\epiphany-core\\Cargo.toml (38 tests)."} +{"ts": "2026-04-25T03:21:48+00:00", "type": "implementation", "status": "ok", "note": "Landed risky-delta promotion policy in epiphany-core. evaluate_promotion now treats medium/high diff_pressure and graph freshness that indicates broadening, semantic anchoring, or updates as risky churn deltas requiring patch.churn.warning plus strong verifier evidence kind, while accepted promotions still flow only through the existing durable update path."} +{"ts": "2026-04-25T03:21:48+00:00", "type": "verification", "status": "ok", "note": "Verified risky-delta promotion policy with cargo fmt --manifest-path .\\epiphany-core\\Cargo.toml, targeted cargo test --manifest-path .\\epiphany-core\\Cargo.toml promotion::tests (9 tests), and full cargo test --manifest-path .\\epiphany-core\\Cargo.toml (41 tests)."} diff --git a/state/map.yaml b/state/map.yaml index f27cc94f..79dc5959 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -49,7 +49,7 @@ active_subgoals: - Keep the Phase 5 distill/propose/promote/update work aligned with reality in code and repo memory. - Keep vendored Codex as a thin typed host seam while Epiphany-owned prompt and retrieval/indexing logic live in the repo-owned `epiphany-core` crate. - Preserve exact/path lookup and BM25 fallback while the Qdrant path stays explicit and bounded. - - Harden the next layer above the landed typed distill/propose/promote/update paths: promotion policy over richer deltas, while keeping verifier-backed acceptance/rejection explicit and keeping retrieval/distill/propose read-only. + - Live-smoke the richer Phase 5 distill/propose/promote/update chain through app-server while keeping verifier-backed acceptance/rejection explicit and keeping retrieval/distill/propose read-only. accepted_design: - external typed state files @@ -105,6 +105,7 @@ accepted_design: - a full source-grounded audit of the Epiphany algorithmic map confirmed the current typed spine is coherent: protocol state, prompt rendering, rollout persistence, thread hydration, explicit retrieval/indexing, read-only distillation/proposal, verifier-backed promotion, and the single durable update writer all describe the current control flow; the Perfect Machine pressure belongs above proposal/promotion, not in another writer or shiny surface - harden proposal map-delta judgment incrementally: read-only `thread/epiphany/propose` should distinguish exact-ref refinement, same-path broadening, deterministic-node reuse, semantic unanchored-node reuse, and new candidate surfaces before setting graph freshness and `diff_pressure` - harden observation distillation incrementally: read-only `thread/epiphany/distill` should summarize noisy tool/command/shell/model output into salient bounded evidence and default evidence kind to `tool-output` or `model-output` when appropriate + - harden promotion policy incrementally: `thread/epiphany/promote` should reject risky churn deltas unless they carry explicit warning rationale and strong verifier evidence kind, while still applying accepted candidates only through the durable update path rejected_paths: - name: pinned_map_only @@ -121,5 +122,5 @@ rejected_paths: reason: audited candidates were either terminal-only, stale/aspirational, or incoherent wrappers; the comparison clones were removed from vendor to avoid building on untrusted drift current_status: - summary: Workspace initialized with protocol files, typed state, handoff notes, architecture maps, and a rolling implementation plan against vendored Codex. Phase 1 durable state, Phase 2 prompt integration, the minimal Phase 3 typed read surface, and Phase 4 retrieval/indexing/core-extraction are landed on `main`. Phase 5 semantic distillation/promotion/proposal is now active: the current baseline includes explicit Qdrant indexing with BM25 fallback, typed `thread/epiphany/update`, read-only `thread/epiphany/distill`, read-only `thread/epiphany/propose`, verifier-backed `thread/epiphany/promote`, structural map/churn promotion validation, source-output-aware distillation, graph-node reuse, linked frontier focus, evidence-backed proposal selection, selected-observation prioritization, strict unanchored-node semantic reuse, automatic bounded observation selection, match-kind-aware map-delta churn pressure in `epiphany-core`, and thin vendored Codex host seams. The Windows app-server stack-pressure regression was narrowed to test-thread stack size; repo-local Cargo config sets `RUST_MIN_STACK=67108864`, and boxed-future request-dispatch experiments were removed after config-only verification passed. The repo also has source-available/commercial licensing plus a CLA gate for external contributions. - next_action: Continue Phase 5 by hardening the layer above `thread/epiphany/distill`, `thread/epiphany/propose`, `thread/epiphany/promote`, and `thread/epiphany/update`: promotion policy that can reason over richer deltas, while keeping retrieval/distillation/proposal read-only and avoiding watcher, GUI, or specialist-agent machinery. + summary: Workspace initialized with protocol files, typed state, handoff notes, architecture maps, and a rolling implementation plan against vendored Codex. Phase 1 durable state, Phase 2 prompt integration, the minimal Phase 3 typed read surface, and Phase 4 retrieval/indexing/core-extraction are landed on `main`. Phase 5 semantic distillation/promotion/proposal is now active: the current baseline includes explicit Qdrant indexing with BM25 fallback, typed `thread/epiphany/update`, read-only `thread/epiphany/distill`, read-only `thread/epiphany/propose`, verifier-backed `thread/epiphany/promote`, structural map/churn promotion validation, source-output-aware distillation, graph-node reuse, linked frontier focus, evidence-backed proposal selection, selected-observation prioritization, strict unanchored-node semantic reuse, automatic bounded observation selection, match-kind-aware map-delta churn pressure, risky-delta promotion policy in `epiphany-core`, and thin vendored Codex host seams. The Windows app-server stack-pressure regression was narrowed to test-thread stack size; repo-local Cargo config sets `RUST_MIN_STACK=67108864`, and boxed-future request-dispatch experiments were removed after config-only verification passed. The repo also has source-available/commercial licensing plus a CLA gate for external contributions. + next_action: Live-smoke the richer Phase 5 app-server chain: source-output distillation, proposal, risky-delta rejection, and accepted promotion, while keeping retrieval/distillation/proposal read-only and avoiding watcher, GUI, or specialist-agent machinery.