Harden source output distillation

This commit is contained in:
Meta Vens 2026-04-25 04:18:17 +01:00
commit ecf3815008
6 changed files with 136 additions and 23 deletions

View file

@ -28,6 +28,7 @@ pub struct EpiphanyDistillProposal {
pub fn distill_observation(input: EpiphanyDistillInput) -> Result<EpiphanyDistillProposal> {
let source_kind = normalize_required("sourceKind", &input.source_kind)?;
let status = normalize_required("status", &input.status)?;
let raw_text = input.text.as_str();
let text = normalize_required("text", &input.text)?;
let subject = input
.subject
@ -40,7 +41,7 @@ pub fn distill_observation(input: EpiphanyDistillInput) -> Result<EpiphanyDistil
.map(normalize_text)
.filter(|value| !value.is_empty())
.unwrap_or_else(|| default_evidence_kind(&source_kind).to_string());
let summary = summarize(subject.as_deref(), &text);
let summary = summarize(&source_kind, subject.as_deref(), raw_text, &text);
let fingerprint = fingerprint(&source_kind, &status, subject.as_deref(), &text);
let evidence_id = format!("ev-{fingerprint}");
let observation = EpiphanyObservation {
@ -78,14 +79,74 @@ fn normalize_text(value: &str) -> String {
value.split_whitespace().collect::<Vec<_>>().join(" ")
}
fn summarize(subject: Option<&str>, text: &str) -> String {
fn summarize(
source_kind: &str,
subject: Option<&str>,
raw_text: &str,
normalized_text: &str,
) -> String {
let distilled = if should_distill_source_output(source_kind) {
summarize_source_output(raw_text).unwrap_or_else(|| normalized_text.to_string())
} else {
normalized_text.to_string()
};
let summary = match subject {
Some(subject) if !subject.is_empty() => format!("{subject}: {text}"),
_ => text.to_string(),
Some(subject) if !subject.is_empty() => format!("{subject}: {distilled}"),
_ => distilled,
};
truncate_chars(&summary, SUMMARY_LIMIT)
}
fn should_distill_source_output(source_kind: &str) -> bool {
let lower = source_kind.to_ascii_lowercase();
lower.contains("tool")
|| lower.contains("command")
|| lower.contains("shell")
|| lower.contains("model")
|| lower.contains("assistant")
}
fn summarize_source_output(text: &str) -> Option<String> {
let lines = normalized_lines(text);
if lines.is_empty() {
return None;
}
let mut selected = Vec::new();
for line in &lines {
if is_salient_output_line(line) {
selected.push(line.clone());
}
if selected.len() >= 3 {
break;
}
}
if selected.is_empty() {
selected.extend(lines.into_iter().take(2));
}
Some(selected.join(" | "))
}
fn normalized_lines(text: &str) -> Vec<String> {
text.lines()
.map(normalize_text)
.filter(|line| !line.is_empty())
.collect()
}
fn is_salient_output_line(line: &str) -> bool {
let lower = line.to_ascii_lowercase();
lower.contains("exit code")
|| lower.contains("test result")
|| lower.contains("finished")
|| lower.contains("passed")
|| lower.contains("failed")
|| lower.contains("error")
|| lower.contains("warning")
}
fn fingerprint(source_kind: &str, status: &str, subject: Option<&str>, text: &str) -> String {
let mut hasher = Sha1::new();
hasher.update(source_kind.as_bytes());
@ -116,6 +177,10 @@ fn default_evidence_kind(source_kind: &str) -> &'static str {
let lower = source_kind.to_ascii_lowercase();
if lower.contains("test") || lower.contains("smoke") || lower.contains("verification") {
"verification"
} else if lower.contains("tool") || lower.contains("command") || lower.contains("shell") {
"tool-output"
} else if lower.contains("model") || lower.contains("assistant") {
"model-output"
} else {
"observation"
}
@ -171,4 +236,46 @@ mod tests {
assert!(err.to_string().contains("text must not be empty"));
}
#[test]
fn distill_observation_summarizes_noisy_tool_output() {
let proposal = distill_observation(EpiphanyDistillInput {
source_kind: "shell-tool".to_string(),
status: "ok".to_string(),
subject: Some("cargo test".to_string()),
text: r#"
Compiling epiphany-core v0.1.0
running 36 tests
lots of harmless output
test result: ok. 36 passed; 0 failed; 0 ignored
Finished `test` profile
"#
.to_string(),
..Default::default()
})
.expect("distill noisy tool output");
assert_eq!(proposal.evidence.kind, "tool-output");
assert_eq!(
proposal.observation.summary,
"cargo test: test result: ok. 36 passed; 0 failed; 0 ignored | Finished `test` profile"
);
}
#[test]
fn distill_observation_types_model_output_as_model_evidence() {
let proposal = distill_observation(EpiphanyDistillInput {
source_kind: "model-output".to_string(),
status: "accepted".to_string(),
text: "The candidate map delta is coherent.".to_string(),
..Default::default()
})
.expect("distill model output");
assert_eq!(proposal.evidence.kind, "model-output");
assert_eq!(
proposal.observation.summary,
"The candidate map delta is coherent."
);
}
}

View file

@ -17,7 +17,7 @@ The spine exists in ten live paths:
- prompt injection: `build_initial_context` reads the optional state and adds a bounded `<epiphany_state>` developer fragment in [session/mod.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/session/mod.rs:2434).
- per-turn persistence: normal turn setup persists one `RolloutItem::EpiphanyState` after the `TurnContext` when state exists in [session/mod.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/session/mod.rs:2677).
- 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 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 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 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).
@ -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 the first match-kind-aware map-delta judgment slice, the next pressure belongs in richer typed observation distillation from real tool/model output and promotion policy that can consume those 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 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.
## Natural Language Spine
@ -619,6 +619,8 @@ Distillation is the pencil-draft path. It turns one explicit thing the client cl
That restraint is the point. This surface is not "the transcript became truth." It is "here is a shaped candidate; now choose whether to promote it." The current implementation is deterministic and boring on purpose: normalize whitespace, attach code refs, choose a stable id, and return a patch. No hidden model call, no watcher magic, no tiny bureaucracy pretending it is wisdom.
For source kinds that smell like real output from a tool, command, shell, model, or assistant, the distiller now keeps the same read-only patch boundary but makes the summary less like a bucket of stdout. It extracts a few salient lines such as exit code, test result, finished, passed, failed, error, or warning, and defaults the evidence kind to `tool-output` or `model-output` when the caller did not provide one. That gives later proposal/promotion logic typed signal without making the raw transcript canonical.
Protocol shape:
- `threadId`
@ -659,9 +661,9 @@ The app-server handler:
1. normalizes required `sourceKind`, `status`, and `text`.
2. rejects empty required fields.
3. normalizes optional `subject` and `evidenceKind`.
4. builds a bounded summary from `subject: text` or just `text`.
5. fingerprints source/status/subject/text into stable observation/evidence ids.
6. defaults evidence kind to `verification` for test/smoke/verification sources, otherwise `observation`.
4. builds a bounded summary from `subject: text` or just `text`; for tool/command/shell/model/assistant sources it preserves raw line structure long enough to select salient output lines before truncation.
5. fingerprints normalized source/status/subject/text into stable observation/evidence ids.
6. defaults evidence kind to `verification` for test/smoke/verification sources, `tool-output` for tool/command/shell sources, `model-output` for model/assistant sources, and otherwise `observation`.
7. copies code refs into both records so the proposal carries its anchors.
Code refs:
@ -873,7 +875,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. The missing organ is broader judgment from fresh tool/model output, watcher/freshness inputs, promotion policy that can reason over richer deltas, 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. 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.
```text
model/tool observations
@ -884,7 +886,7 @@ model/tool observations
-> durable evidence/map/churn mutation
```
The typed write path exists, the first deterministic observation/evidence distillation path exists, 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 or that contain structurally broken subgoal, invariant, graph, frontier, checkpoint, or churn fields.
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.

View file

@ -2,7 +2,7 @@
## Status
Updated on 2026-04-25 after landing match-kind-aware map-delta judgment inside the Phase 5 read-only proposal path.
Updated on 2026-04-25 after landing source-output-aware observation distillation inside the Phase 5 read-only distill 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.
@ -22,9 +22,10 @@ This note tracks Epiphany as a fork of Codex with an opinionated modeling archit
- a graph-semantic proposal hardening slice that scores selected observations/evidence, uses the strongest selected signal for proposal wording, and can reuse unanchored architecture graph nodes through strict unique semantic overlap while refusing ambiguous matches and leaving code-anchored nodes under concrete ref/path/id matching
- 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`
- 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, or make proposal pressure understand match kinds. Those parts are landed. The next job is to keep the landing zone honest: improve typed observation distillation from real tool/model outputs and 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, 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.
## Summary
@ -274,14 +275,13 @@ 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, and match-kind-aware map-delta judgment 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?", or "can it distinguish exact refinement from same-path broadening or semantic anchoring?" It can. The next gap is "can Epiphany distill richer tool/model outputs and promote 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, 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?"
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
3. keep the new `epiphany-core` boundary honest instead of letting vendored Codex re-accumulate the heavy implementation
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:
- richer typed observation distillation from tool/model outputs
- 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

View file

@ -87,6 +87,7 @@ Current verified typed state/promotion layer:
- experimental loaded-thread-only `thread/epiphany/propose`
- typed patch shape for observations, evidence, objective, subgoals, invariants, graphs, graph frontier/checkpoint, scratch, churn, and mode
- 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`
- core `CodexThread.epiphany_update_state(...)` applies the patch to live `SessionState`, bumps revision, persists `RolloutItem::EpiphanyState`, and flushes rollout
@ -358,8 +359,9 @@ If a future session wakes up from compaction and starts bluffing, this is the pa
- proposal selection now rejects observations without accepting `recent_evidence`, and churn pressure now reflects match-kind-aware map-delta shape
- 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
- 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 richer typed observation distillation from real tool/model output or promotion policy over richer deltas, not proving the retriever exists again
- the next bounded follow-up is promotion policy over richer deltas, 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`:
@ -454,9 +456,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, and match-kind-aware map-delta churn pressure 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, and source-output-aware distillation 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, 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 richer typed observation distillation from real tool/model output or 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, 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.
Current Phase 5 implementation move:
@ -464,7 +466,6 @@ 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:
- richer map/churn patch generation from verified observations and tool/model outputs
- 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
- verifier-backed acceptance/rejection evidence
@ -506,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 proposal can now auto-select a bounded evidence-backed observation cluster when ids are omitted 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 richer typed observation distillation or 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, 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.

View file

@ -118,3 +118,5 @@
{"ts": "2026-04-25T02:59:31+00:00", "type": "verification", "status": "ok", "note": "Full source-grounded audit of notes/epiphany-current-algorithmic-map.md cross-referenced each documented flow against protocol, core session state, prompt rendering, rollout replay, app-server hydration, retrieval/indexing, distillation, proposal, promotion, and update code. Stale semantic line anchors were corrected; the current typed spine is coherent, and the next Perfect Machine move remains richer map-delta judgment above the existing read-only proposal path rather than adding new writers, GUI, watchers, or specialist scheduling."}
{"ts": "2026-04-25T03:09:21+00:00", "type": "implementation", "status": "ok", "note": "Landed match-kind-aware map-delta judgment in epiphany-core proposal path. Read-only propose_map_update now carries an internal MapDeltaJudgment that distinguishes exact-ref refinements, same-path broadening, deterministic-node reuse, semantic unanchored-node reuse, and new candidate surfaces before setting graph freshness, churn warning, and diff_pressure; retrieval/distill/propose remain read-only."}
{"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)."}

View file

@ -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: richer typed observation distillation from real tool/model output and promotion policy over richer deltas, while keeping verifier-backed acceptance/rejection explicit and keeping retrieval/distill/propose read-only.
- 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.
accepted_design:
- external typed state files
@ -104,6 +104,7 @@ accepted_design:
- harden proposal observation selection incrementally: when `observationIds` is omitted, read-only `thread/epiphany/propose` should choose a bounded coherent path cluster from existing verified, evidence-backed observations using source/evidence quality plus graph-frontier focus, without mutating state or bypassing promotion
- 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
rejected_paths:
- name: pinned_map_only
@ -120,5 +121,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, 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`: richer typed observation distillation from real tool/model output and 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 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.