Render anti-Jenga discipline in Epiphany prompt
This commit is contained in:
parent
6adeeaec26
commit
f9207cbfa9
6 changed files with 18 additions and 0 deletions
|
|
@ -23,6 +23,12 @@ const OBSERVATION_LIMIT: usize = 3;
|
|||
const EVIDENCE_LIMIT: usize = 3;
|
||||
const CODE_REF_LIMIT: usize = 2;
|
||||
const DIRTY_PATH_LIMIT: usize = 4;
|
||||
const OPERATING_DISCIPLINE_SECTION: &str = concat!(
|
||||
"## Operating Discipline\n",
|
||||
"- Do not build the Jenga tower: one regression or benchmark hypothesis gets one real measurement.\n",
|
||||
"- If a fix attempt does not fix the regression or move the benchmark, revert it before trying the next hypothesis.\n",
|
||||
"- If the diff grows while understanding shrinks, stop implementation and switch to diagnosis."
|
||||
);
|
||||
|
||||
pub fn render_epiphany_state(state: &EpiphanyThreadState) -> String {
|
||||
let mut sections = vec![concat!(
|
||||
|
|
@ -34,6 +40,7 @@ pub fn render_epiphany_state(state: &EpiphanyThreadState) -> String {
|
|||
.to_string()];
|
||||
|
||||
sections.push(render_overview(state));
|
||||
sections.push(OPERATING_DISCIPLINE_SECTION.to_string());
|
||||
|
||||
if let Some(subgoals) = render_subgoals(state) {
|
||||
sections.push(subgoals);
|
||||
|
|
@ -765,6 +772,8 @@ mod tests {
|
|||
|
||||
assert!(rendered.contains("`arch-session`"));
|
||||
assert!(rendered.contains("`flow-build-context`"));
|
||||
assert!(rendered.contains("Do not build the Jenga tower"));
|
||||
assert!(rendered.contains("revert it before trying the next hypothesis"));
|
||||
assert!(!rendered.contains("## Scratch"));
|
||||
assert!(!rendered.contains("## Invariants"));
|
||||
assert!(rendered.contains("`core/src/session/mod.rs:2433-2617`"));
|
||||
|
|
|
|||
|
|
@ -401,6 +401,7 @@ Regression and benchmark discipline:
|
|||
- if a change is made to fix a regression or move a benchmark and it does not fix that regression or move that benchmark, revert it immediately
|
||||
- do not let failed hypotheses accumulate as maybe-useful scaffolding
|
||||
- record the rejected path when the lesson matters, then try the next bounded hypothesis from a clean diff
|
||||
- this is also rendered by `epiphany-core::render_epiphany_state(...)` in hydrated Epiphany developer context, because runtime harness pressure beats wall art
|
||||
|
||||
## Verification That Already Happened
|
||||
|
||||
|
|
|
|||
|
|
@ -95,3 +95,4 @@
|
|||
{"ts": "2026-04-24T19:00:15+00:00", "type": "verification", "status": "ok", "note": "Traced the codex-app-server stack overflow after bb557d1. The original failing in_process thread/start test overflowed after the processor completed thread/start and before response routing; RUST_MIN_STACK=64MB made exact failures pass. Additional exact failures in guardian and thread-start tracing tests confirmed app-server test-thread stack pressure on Windows rather than one semantic Epiphany path failure. Added Cargo config RUST_MIN_STACK=67108864 and boxed large JSON/in-process request futures plus thread-start/promote futures; full cargo test -p codex-app-server --lib now passes 232/232 without setting RUST_MIN_STACK in the shell."}
|
||||
{"ts": "2026-04-24T19:23:29+00:00", "type": "verification", "status": "ok", "note": "Reduced the app-server stack fix to the minimal verified culprit. Removed the boxed-future request-dispatch experiments from codex_message_processor.rs, in_process.rs, and message_processor.rs while keeping repo-local Cargo RUST_MIN_STACK=67108864. Exact overflow repros and full cargo test -p codex-app-server --lib pass without shell RUST_MIN_STACK, so the boxes were cruft and should stay gone."}
|
||||
{"ts": "2026-04-24T19:30:07+00:00", "type": "decision", "status": "ok", "note": "Persisted anti-cruft regression discipline: when a change is made to fix a regression or move a benchmark and it does not fix that regression or move that benchmark, immediately revert it before trying the next hypothesis. Failed hypotheses are not souvenirs; record the rejected path only when the lesson matters."}
|
||||
{"ts": "2026-04-24T19:38:51+00:00", "type": "implementation", "status": "ok", "note": "Moved the anti-Jenga regression/benchmark discipline from repo prose into runtime Epiphany prompt pressure. epiphany-core::render_epiphany_state now renders an Operating Discipline section in the developer-state block: one measured hypothesis at a time, revert failed regression/benchmark fixes before the next hypothesis, and stop when diff grows while understanding shrinks. Verified with epiphany-core tests and codex-core epiphany tests."}
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ accepted_design:
|
|||
- use natural language and metaphor in algorithmic maps only after source-grounding the relevant mechanism; the metaphor should compress verified control flow, not decorate a guess
|
||||
- treat meticulous workflow discipline as part of the product, not as slowdown: rehydrate before acting, source-ground maps before prose, keep each slice bounded, verify the real seam, then persist map/evidence/handoff before moving on
|
||||
- enforce immediate anti-cruft reverts for regression and benchmark work: if a fix attempt does not fix the regression or move the benchmark, revert it before trying the next hypothesis and record the rejected path when useful
|
||||
- render the anti-Jenga regression/benchmark discipline inside the Epiphany developer-state prompt so hydrated Epiphany turns carry the operational rule at runtime instead of relying on AGENTS prose alone
|
||||
- live app-server smoke verified the explicit Qdrant indexing path against a loaded ephemeral thread rooted at `epiphany-core`; env/default Qdrant/Ollama backend config is good enough for the current slice, so defer a first-class config surface until it hurts for a real reason
|
||||
- land Epiphany's first explicit typed state-update surface as `thread/epiphany/update`: loaded-thread-only, revision-checked when requested, append observations/evidence, replace bounded map/scratch/churn fields, persist an immediate `RolloutItem::EpiphanyState`, and keep retrieval read-only
|
||||
- land Epiphany's first typed distillation/proposal surface as `thread/epiphany/distill`: loaded-thread-only, read-only, deterministic observation/evidence patch generation with a concrete `expectedRevision`, and explicit promotion through `thread/epiphany/update`
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ This file is intentionally disposable.
|
|||
- do not add metaphors or natural-language modeling prose to an algorithmic map until the relevant source is in context and the prose is anchored to concrete refs
|
||||
- meticulous workflow discipline is not ceremony for its own sake; the useful loop is rehydrate, bound the slice, read the code being described, make the smallest coherent change, verify the seam that matters, and persist the learned state before charging onward
|
||||
- for regression or benchmark work, failed hypotheses are not souvenirs: if a change does not fix the regression or move the benchmark, revert it immediately before trying the next hypothesis
|
||||
- the anti-Jenga rule is now rendered by `epiphany-core/src/prompt.rs` in the Epiphany developer-state block, which is closer to behavior than more AGENTS repetition
|
||||
- Source-grounded Epiphany map audit on 2026-04-24 reread the cited protocol/session/rollout/prompt/thread/app-server/retrieval code before editing:
|
||||
- sharpened the distinction between full core resume reconstruction and the narrower `epiphany-core` stored-thread replay helper
|
||||
- removed unsupported broad wording around thread hydration surfaces and anchored the actual live/reconstructed paths
|
||||
|
|
|
|||
|
|
@ -74,6 +74,11 @@ Treat this as the current structured thread understanding. Use it to stay orient
|
|||
- Last updated turn: `phase2-turn`
|
||||
- Frontier focus: `arch-session`, `flow-prompt`
|
||||
|
||||
## Operating Discipline
|
||||
- Do not build the Jenga tower: one regression or benchmark hypothesis gets one real measurement.
|
||||
- If a fix attempt does not fix the regression or move the benchmark, revert it before trying the next hypothesis.
|
||||
- If the diff grows while understanding shrinks, stop implementation and switch to diagnosis.
|
||||
|
||||
## Subgoals
|
||||
- `phase2-prompt` [in_progress; active]: Inject the structured state into build_initial_context.
|
||||
summary: Wire a compact developer fragment into the initial prompt bundle.
|
||||
|
|
|
|||
Reference in a new issue