diff --git a/README.md b/README.md index bbc3efc4..5d73e174 100644 --- a/README.md +++ b/README.md @@ -37,17 +37,20 @@ The working design now is: - use specialist agents with shared typed state and private scratch, not one heroic context trying to cosplay a whole team - add repo-local hybrid retrieval instead of making every role rediscover the repo with `rg` and raw stubbornness - treat compaction as a role-specific state transition with safe points and explicit checkpoints, not hidden brain damage +- bake an explicit pre-compaction persistence workflow into the process, because forgetting to write down what matters and then acting surprised is not a serious engineering method +- make Epiphany an opinionated software development agent, not a generic assistant with some extra tags bolted on ## Current Repository State -- `vendor/codex` is the real target and is tracked as a gitlink/submodule-style nested repo +- `vendor/codex` is the real target and is tracked directly in the parent repo - third-party OpenCodex forks were audited and removed - the Codex machine map and Epiphany harness spec have both been written and iterated enough to stop hand-waving -- the next concrete step is the internal/dev-usable Phase 1 slice in vendored Codex +- Phase 1 durable Epiphany state and Phase 2 prompt integration are both landed and verified +- the next concrete step is typed app-server/protocol state exposure for clients -## Phase 1 +## Current Slice Status -Phase 1 is intentionally small and dull: +Phase 1 landed: - add minimal Epiphany protocol types - store Epiphany state in Codex `SessionState` @@ -56,7 +59,18 @@ Phase 1 is intentionally small and dull: - patch exhaustive `RolloutItem` matches - add persistence/replay compatibility tests -No GUI yet. No prompt integration yet. No specialist scheduling yet. First the engine learns how to remember what it thinks without dropping pieces on the floor. +Phase 2 landed: + +- add a dedicated `EpiphanyStateInstructions` developer fragment +- render a bounded `` summary from `SessionState.epiphany_state` +- inject it during `Session::build_initial_context` +- verify inclusion, omission, resume, and snapshot behavior + +Phase 3 is next: + +- expose typed Epiphany state to clients over app-server/protocol surfaces +- keep it additive and internal/dev-usable first +- do not make prompt text the source of truth for GUI state ## Basic Loop @@ -68,6 +82,19 @@ No GUI yet. No prompt integration yet. No specialist scheduling yet. First the e 6. Record evidence. 7. Commit, compare branches, or backtrack. +## Pre-Compaction Discipline + +This part is not optional if the work is nontrivial. + +Before compaction, handoff, or a deliberate phase boundary: + +1. sync `state/map.yaml` +2. append `state/evidence.jsonl` +3. refresh `notes/fresh-workspace-handoff.md` +4. state the next action plainly + +Epiphany should eventually make this automatic. Until then, we do it on purpose. + ## Why This Exists Pinned notes inside one giant prompt are better than nothing, but they are still one token soup. This workspace treats map, scratch, and output as different artifacts with different write rules. diff --git a/notes/epiphany-core-harness-surfaces.md b/notes/epiphany-core-harness-surfaces.md index 57c495c7..49953da9 100644 --- a/notes/epiphany-core-harness-surfaces.md +++ b/notes/epiphany-core-harness-surfaces.md @@ -63,6 +63,21 @@ So the rule is: If any one of those is missing, the map gets dumber than it needs to be. +## Opinionated workflow principle + +Epiphany should be an **opinionated software development agent**. + +That means the workflow is part of the design, not a polite suggestion left to the operator's memory. The harness should have defaults about how real work is done: + +- restate the objective, current mechanism, invariants, and intended change before substantial edits +- prefer one bounded hypothesis at a time +- persist durable state before compaction, handoff, or phase changes +- treat compaction as a checkpointed transition, not hidden thought loss +- resume from typed state and explicit next actions, not transcript osmosis +- stop implementation when understanding is shrinking and switch to mapping, diagnosis, or simplification + +If Epiphany does not enforce some amount of process discipline, then it is just a fancier prompt pile. + ## Multi-agent harness principle Codex should not stay one overstuffed context forever. @@ -221,6 +236,28 @@ The policy is: If a compaction wipes the graph spine and leaves only a prose aftertaste, Epiphany has failed. +## Pre-compaction checkpoint protocol + +Before compaction, handoff, or an intentional phase boundary, Epiphany should persist a minimal checkpoint on purpose. + +That checkpoint should include: + +- current objective +- active subgoal +- current next action +- latest stable graph frontier/checkpoint +- fresh evidence since the last checkpoint +- current blockers or open mechanism gaps +- verification status for the active slice + +In the current repo prototype that means updating: + +- `state/map.yaml` +- `state/evidence.jsonl` +- `notes/fresh-workspace-handoff.md` + +Later, the harness should automate that checkpointing instead of relying on the operator to remember it after the context window is already on fire. + ## Proposed state model Epiphany needs both thread-scoped state and turn-scoped intent. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 50ae55eb..1418bf3d 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -24,6 +24,7 @@ Recent anchor commits before the current in-flight work: - `2042687e3035c5a86d7f6aa66306d87abcc10f2d` - vendored Codex and landed the Phase 1 Epiphany core state slice - `c823815` - persisted the Phase 2 implementation plan and refreshed the project handoff/state +- `efd1420` - landed and pushed the Phase 2 prompt-integration slice Do not trust this note for the exact current HEAD; use `git log --oneline -1` if you need the live commit. @@ -84,6 +85,44 @@ Main touched files for Phase 2: - `vendor/codex/codex-rs/core/src/session/snapshots/codex_core__session__build_initial_context_epiphany_state.snap` - `vendor/codex/codex-rs/protocol/src/protocol.rs` +## What Must Be Remembered Before Compaction + +If a future session wakes up from compaction and starts bluffing, this is the part to staple to its forehead. + +- Phase 1 and Phase 2 are both landed, verified, committed, and pushed. +- The latest pushed implementation anchor before this handoff sync is `efd1420`: + - `Land Phase 2 Epiphany prompt integration` +- `vendor/codex` is ordinary tracked repo content, not a submodule. +- Phase 2 means Codex now **reads** Epiphany state during turn construction: + - `SessionState.epiphany_state` is the internal activation signal + - `Session::build_initial_context` injects a bounded `` developer fragment + - resumed sessions reuse the restored Epiphany snapshot in the prompt path +- The next phase is **not** GUI work. +- The next phase is **Phase 3 typed state exposure**: + - expose Epiphany thread state to clients over typed app-server/protocol surfaces + - keep it additive and internal/dev-usable first + - do not make prompt text the canonical GUI data source +- Important Windows verification footgun still stands: + - use `CARGO_TARGET_DIR=C:\Users\Meta\.cargo-target-codex` for `codex-core` work on this machine +- Snapshot hygiene note: + - the new Epiphany prompt snapshot normalizes temp skill-root paths in the test harness so it stays stable across runs + +## Opinionated Workflow Rule + +Epiphany should be an **opinionated software development agent**, not a generic chat model wearing a hard hat. + +That means this persistence workflow is not optional ceremony. It should be part of the harness: + +1. before compaction, phase boundaries, or handoff: + - sync the canonical map + - append evidence + - refresh the handoff note + - make the next action explicit +2. compaction should happen from a known checkpoint, not at some random point in the middle of an implementation trance +3. resumed work should start from the persisted checkpoint and next action, not from vibes and transcript archaeology + +If the harness cannot do that by default later, it is not opinionated enough yet. + ## Verification That Already Happened Rust and VS Build Tools were installed specifically so this would stop being interpretive dance. @@ -164,4 +203,4 @@ cmd /c "\"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxi The repo is in a good state. -Phase 1 and Phase 2 are landed and verified. `vendor/codex` is first-class in the parent repo now. The next clean move is typed state exposure for clients, not GUI paint and not another architectural detour. +Phase 1 and Phase 2 are landed and verified. `vendor/codex` is first-class in the parent repo now. The next clean move is typed state exposure for clients, not GUI paint and not another architectural detour. Also: pre-compaction persistence is now an explicit design rule, not a lucky habit. diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 862e82d0..fc6048df 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -31,3 +31,4 @@ {"ts": "2026-04-23T23:19:29+01:00", "type": "decision", "status": "ok", "note": "Flattened vendor/codex into the parent repository by removing the gitlink/submodule wiring and nested .git metadata so the Codex Phase 1 Epiphany harness changes can be reviewed and committed as ordinary tracked files alongside the project state."} {"ts": "2026-04-23T23:25:52+01:00", "type": "decision", "status": "ok", "note": "Replaced the stale Phase 1 plan and stale workspace handoff with current persisted guidance. The new notes pin the next slice as Phase 2 prompt integration: render a bounded Epiphany developer-context summary from SessionState.epiphany_state, inject it during Session::build_initial_context, keep activation internal-only via state presence, and verify it with prompt-facing tests and a snapshot before touching GUI or retrieval."} {"ts": "2026-04-23T22:48:30+00:00", "type": "implementation", "status": "ok", "note": "Implemented the Phase 2 prompt-integration slice in vendored Codex. Added a dedicated EpiphanyStateInstructions developer fragment, rendered a bounded summary from SessionState.epiphany_state, injected it into Session::build_initial_context after collaboration-mode instructions, and added prompt-facing inclusion/omission/resume coverage plus a stable snapshot."} +{"ts": "2026-04-23T22:55:33+00:00", "type": "decision", "status": "ok", "note": "Documented the pre-compaction persistence workflow as an explicit Epiphany design rule. Updated the core harness spec, README, handoff note, and canonical map to state that Epiphany should be an opinionated software development agent: before compaction or handoff it should persist map, evidence, blockers, and next action on purpose rather than relying on transcript continuity."} diff --git a/state/map.yaml b/state/map.yaml index e3e65954..63955730 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -74,6 +74,7 @@ accepted_design: - vendor Codex directly into the parent repo instead of keeping it as a gitlink/submodule so Epiphany harness changes can be reviewed and committed atomically with the surrounding project state - for Phase 2, treat the presence of SessionState.epiphany_state as the internal activation signal and inject a bounded Epiphany summary into the developer-context path during build_initial_context rather than inventing a public operator surface early - Phase 2 is landed: a dedicated EpiphanyStateInstructions fragment now renders bounded Epiphany thread state into the developer prompt path during build_initial_context, with omission/inclusion/resume coverage and a stable snapshot + - Epiphany should be an opinionated software development agent: pre-compaction and pre-handoff persistence of map, evidence, and next action are part of the workflow, not optional operator folklore rejected_paths: - name: pinned_map_only @@ -90,5 +91,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, a tiny CLI, a git repo, fresh-workspace handoff notes, architecture rationale, a Codex algorithmic map note, an Epiphany core-harness surface spec, and a rolling implementation plan against vendored Codex. The Phase 1 internal/dev-usable Epiphany core state slice and the Phase 2 prompt-integration slice are both implemented and verified with a real Rust/MSVC toolchain; vendored Codex is tracked directly in the parent repo; and the next move is to expose typed Epiphany state to clients without making prompt text the source of truth. + summary: Workspace initialized with protocol files, typed state, a tiny CLI, a git repo, fresh-workspace handoff notes, architecture rationale, a Codex algorithmic map note, an Epiphany core-harness surface spec, and a rolling implementation plan against vendored Codex. The Phase 1 internal/dev-usable Epiphany core state slice and the Phase 2 prompt-integration slice are both implemented and verified with a real Rust/MSVC toolchain; vendored Codex is tracked directly in the parent repo; the next move is to expose typed Epiphany state to clients without making prompt text the source of truth; and pre-compaction persistence is now an explicit part of the intended Epiphany workflow. next_action: Decide and plan the Phase 3 typed app-server/protocol exposure slice so clients can read Epiphany thread state directly, keeping the surface additive and internal/dev-usable before GUI ergonomics or retrieval work.