From 360dfea6e47aedc1da1830e8f2bf2f0af79ca996 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 24 Apr 2026 02:45:02 +0100 Subject: [PATCH] Land Epiphany Phase 4 hybrid retrieval slice --- notes/codex-epiphany-mode-plan.md | 73 +- notes/epiphany-current-algorithmic-map.md | 92 +- notes/fresh-workspace-handoff.md | 130 ++- state/evidence.jsonl | 15 + state/map.yaml | 13 +- state/scratch.md | 67 +- vendor/codex/codex-rs/Cargo.lock | 2 + .../schema/json/ServerNotification.json | 715 +++++++++++++++ .../codex_app_server_protocol.schemas.json | 862 ++++++++++++++++++ .../codex_app_server_protocol.v2.schemas.json | 862 ++++++++++++++++++ .../schema/json/v2/ThreadForkResponse.json | 715 +++++++++++++++ .../schema/json/v2/ThreadListResponse.json | 715 +++++++++++++++ .../json/v2/ThreadMetadataUpdateResponse.json | 715 +++++++++++++++ .../schema/json/v2/ThreadReadResponse.json | 715 +++++++++++++++ .../schema/json/v2/ThreadResumeResponse.json | 715 +++++++++++++++ .../json/v2/ThreadRollbackResponse.json | 715 +++++++++++++++ .../schema/json/v2/ThreadStartResponse.json | 715 +++++++++++++++ .../json/v2/ThreadStartedNotification.json | 715 +++++++++++++++ .../json/v2/ThreadUnarchiveResponse.json | 715 +++++++++++++++ .../typescript/EpiphanyRetrievalStatus.ts | 5 + .../schema/typescript/EpiphanyThreadState.ts | 5 + .../schema/typescript/index.ts | 2 + .../schema/typescript/v2/Thread.ts | 6 + .../v2/ThreadEpiphanyRetrieveIndexSummary.ts | 8 + .../v2/ThreadEpiphanyRetrieveResult.ts | 6 + .../v2/ThreadEpiphanyRetrieveResultKind.ts | 5 + .../v2/ThreadEpiphanyRetrieveShardSummary.ts | 6 + .../schema/typescript/v2/index.ts | 4 + .../app-server-protocol/src/export.rs | 3 + .../src/protocol/common.rs | 103 +++ .../app-server-protocol/src/protocol/v2.rs | 78 ++ vendor/codex/codex-rs/app-server/README.md | 6 +- .../app-server/src/codex_message_processor.rs | 225 ++++- vendor/codex/codex-rs/core/Cargo.toml | 2 + .../codex/codex-rs/core/src/codex_thread.rs | 22 + .../codex-rs/core/src/epiphany_retrieval.rs | 558 ++++++++++++ vendor/codex/codex-rs/core/src/lib.rs | 7 + .../codex/codex-rs/core/src/session/tests.rs | 1 + .../codex/codex-rs/protocol/src/protocol.rs | 122 +++ 39 files changed, 10378 insertions(+), 62 deletions(-) create mode 100644 vendor/codex/codex-rs/app-server-protocol/schema/typescript/EpiphanyRetrievalStatus.ts create mode 100644 vendor/codex/codex-rs/app-server-protocol/schema/typescript/EpiphanyThreadState.ts create mode 100644 vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveIndexSummary.ts create mode 100644 vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveResult.ts create mode 100644 vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveResultKind.ts create mode 100644 vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveShardSummary.ts create mode 100644 vendor/codex/codex-rs/core/src/epiphany_retrieval.rs diff --git a/notes/codex-epiphany-mode-plan.md b/notes/codex-epiphany-mode-plan.md index cfa592a4..29388532 100644 --- a/notes/codex-epiphany-mode-plan.md +++ b/notes/codex-epiphany-mode-plan.md @@ -2,13 +2,14 @@ ## Status -Planned on 2026-04-23 after landing and verifying: +Updated on 2026-04-24 after verifying the first bounded Phase 4 slice in the working tree: - Phase 1 durable Epiphany thread state - Phase 2 prompt integration - a minimal Phase 3 typed client read surface via `Thread.epiphanyState` +- a verified Phase 4 slice 1 query-time hybrid retriever across protocol, core, app-server protocol, and app-server -The next job is to give Epiphany a real repo retrieval organ instead of making every future role rediscover the workspace with shell commands and optimism. +The next job is no longer to prove the retriever exists. That part is done. The next job is to keep the landing zone honest: do not casually turn `thread/epiphany/retrieve` into a durable Epiphany-state writer just because the state object has a `retrieval` field, and do not regress into another blob-shaped persistent semantic store when the time comes to add one. ## Summary @@ -41,6 +42,51 @@ Do not build "vector search" as a separate novelty organ off to the side. Build a **hybrid repo retrieval subsystem** with one typed query shape and one typed result shape. Exact lookup and semantic lookup should be different modes of the same machine, not rival religions. +## Recovered bounded decision + +After rehydrating from the repo state and the lone dirty working-tree diff, the first bounded Phase 4 slice should be: + +- query-time +- loaded-thread-first +- read-only +- hybrid from day one + +Concrete choice for the first implementation: + +- reuse existing `codex_file_search` substrate for exact/path-ish lookup +- use workspace-local BM25 chunk search as the initial semantic backend +- defer embeddings, vector stores, persistent indexing, and watcher-driven invalidation + +Updated follow-up direction after landing the verified slice: + +- keep the BM25 implementation as the proven baseline/fallback +- for the first persistent semantic backend, prefer Qdrant over JSON/blob/postgres-thrash designs, but do not make it a hard requirement for basic Epiphany use +- do not turn retrieval into vector-only soup; exact/path lookup remains first-class and BM25 remains useful as bootstrap/control/fallback when Qdrant is unavailable + +Preflight note: + +- use tracked source as the corpus estimate, not raw working-tree disk usage +- at `vendor/codex` HEAD `d45ab10`, tracked `codex-rs` source is `3642` files / `31.09 MB` +- raw working-tree size under `codex-rs` can be heavily inflated by build artifacts and will lie to the design + +Current in-flight implementation note: + +- the protocol scaffold still exists in `vendor/codex/codex-rs/protocol/src/protocol.rs` +- it is now wired through the working tree across: + - `core/src/epiphany_retrieval.rs` + - `core/src/codex_thread.rs` + - `core/src/session/tests.rs` + - `app-server-protocol/src/protocol/common.rs` + - `app-server-protocol/src/protocol/v2.rs` + - `app-server-protocol/src/export.rs` + - `app-server/src/codex_message_processor.rs` +- the slice is now formatted and verified in the working tree: + - `cargo fmt --all` passed + - targeted no-run compile for `codex-core`, `codex-app-server-protocol`, and `codex-app-server` passed + - targeted Phase 4 tests passed in core, app-server protocol, and app-server + - full `cargo test -p codex-app-server-protocol` passed after regenerating stable schema fixtures +- stable schema fixtures are the safe checked-in state for this slice; `write_schema_fixtures --experimental` rewrites the same tree and cannot be left behind as the repo state + ## Key Changes ### 1. Extend Epiphany state with retrieval metadata @@ -89,14 +135,14 @@ Do not make the first cut depend on prompt parsing or transcript scraping. ### 3. Keep the first semantic backend small and local -The first semantic backend should be workspace-local, sharded, and incremental-friendly in storage layout, even if the initial indexing policy is still crude. +The first semantic backend should be workspace-local BM25 chunk retrieval built at query time over the tracked source corpus. Requirements: -- do not store everything in one giant JSON blob -- prefer per-workspace or per-subsystem shards -- track index revision and freshness explicitly - keep chunk text line-anchored and path-aware +- keep the implementation bounded enough to understand in one sitting +- track retrieval/index freshness metadata explicitly in typed state +- do not introduce a monolithic persistent blob just to feel sophisticated If the first semantic backend needs to be intentionally narrow, that is fine. A small honest subsystem beats a magical blob with terrible write behavior. @@ -154,12 +200,15 @@ Add tests for: ## Immediate Next Step After This Plan -Implement the smallest useful retrieval baseline: +Treat the current retrieval baseline as real and ship it cleanly: -1. extend `EpiphanyThreadState` with retrieval metadata -2. add a core hybrid retrieval facade -3. expose one typed `thread/epiphany/retrieve` read method -4. document it in `app-server/README.md` -5. verify with targeted protocol/core/app-server tests +1. clean up, stage, and push the current verified query-time hybrid retriever as the Phase 4 slice 1 landing zone +2. do not add durable retrieval-summary writes from `thread/epiphany/retrieve` without a clean out-of-band rollout/update semantic +3. if a later follow-up is needed, keep it tight: + - retrieval freshness/persistence semantics + - probably a dedicated Epiphany update path + - Qdrant-backed persistent semantic indexing as the preferred backend, with BM25 fallback for no-Qdrant or degraded mode + - not GUI work + - not watcher-driven invalidation Do not start with GUI. Do not start with automatic graph invalidation. Do not pretend shell transcripts are a retrieval strategy. diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index 4b6b1c3c..57fd327d 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -2,17 +2,17 @@ This note is not a full machine map for Codex. We already have that in [E:/Projects/EpiphanyAgent/notes/codex-repository-algorithmic-map.md](E:/Projects/EpiphanyAgent/notes/codex-repository-algorithmic-map.md). -This one is narrower and meaner: it documents where the current Epiphany prototype already diverges from upstream Codex in the code we have actually landed. +This one is narrower and meaner: it documents where the current Epiphany prototype already diverges from upstream Codex in the code we actually have in the working tree. -Scope: current state after Phase 1, Phase 2, and the minimal Phase 3 typed read surface. It does **not** describe planned retrieval, invalidation, GUI reflection, or multi-agent scheduling as if they already exist. +Scope: current state after Phase 1, Phase 2, the minimal Phase 3 typed read surface, and the first bounded Phase 4 repo-local hybrid retrieval slice. It does **not** describe planned invalidation, GUI reflection, or multi-agent scheduling as if they already exist. ## Mental model in one sentence -Current Epiphany is a thin but real overlay on Codex's thread harness: Codex now carries a structured thread-state snapshot through persistence, replay, prompt assembly, and hydrated client thread payloads. +Current Epiphany is a thin but real overlay on Codex's thread harness: Codex now carries structured thread state through persistence, replay, prompt assembly, hydrated client thread payloads, and one typed repo-local hybrid retrieval surface. ## Divergence summary -Today Epiphany differs from plain Codex in four shipped places: +Today Epiphany differs from plain Codex in five currently active places: 1. **Durable state exists** - Codex rollout/history now has a first-class `EpiphanyThreadState` snapshot. @@ -26,6 +26,9 @@ Today Epiphany differs from plain Codex in four shipped places: 4. **Replay semantics respect rollback and compaction** - the "latest Epiphany state" is not "last one in the file." It is reconstructed using turn/rollback boundaries. +5. **Repo-local hybrid retrieval now exists behind one typed surface** + - loaded threads can answer structured repo queries through exact/path lookup plus BM25 chunk retrieval. + That is already a meaningful divergence from stock Codex, even if the more glamorous organs are still missing. ## The delta flow @@ -41,6 +44,9 @@ flowchart TD B --> H["app-server stored-thread reads reconstruct latest surviving Epiphany state from rollout"] G --> I["Client can read typed state"] H --> I + D --> J["CodexThread exposes epiphany_retrieve() and epiphany_retrieval_state()"] + J --> K["app-server routes thread/epiphany/retrieve"] + K --> L["Hybrid exact/path + BM25 chunk results"] ``` The important thing is that the same state is now flowing through three layers: @@ -49,7 +55,7 @@ The important thing is that the same state is now flowing through three layers: - prompt construction - typed client reads -That is the current Epiphany spine. +That is the current Epiphany spine, and retrieval now hangs off it instead of living as shell archaeology. ## Divergence 1: durable typed Epiphany state @@ -207,19 +213,75 @@ We do **not** yet have: - `thread/epiphany/read` - `thread/epiphany/update` -- `thread/epiphany/retrieve` - `thread/epiphany/stateUpdated` - `thread/epiphany/evidenceAppended` So the client can now see the state, but cannot yet steer or subscribe to it as a first-class live surface. +## Divergence 5: repo-local hybrid retrieval + +### What changed + +Loaded threads now expose a typed retrieval surface that combines exact/path-ish lookup with semantic chunk retrieval: + +- [E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/protocol/src/protocol.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/protocol/src/protocol.rs) +- [E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/epiphany_retrieval.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/epiphany_retrieval.rs) +- [E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/codex_thread.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/codex_thread.rs) +- [E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs) +- [E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs) +- [E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs) + +Current behavior: + +- `EpiphanyThreadState` now has retrieval metadata via `retrieval` +- `CodexThread` exposes: + - `epiphany_retrieval_state()` + - `epiphany_retrieve(...)` +- app-server protocol exposes experimental `thread/epiphany/retrieve` +- the retrieval machine is hybrid from day one: + - exact/path-ish hits via existing `codex_file_search` + - semantic hits via workspace-local BM25 chunk search over a gitignore-respecting corpus +- live `thread.epiphanyState` hydration backfills a lightweight retrieval summary when the thread has Epiphany state but no persisted retrieval metadata yet + +### How this differs from plain Codex + +Plain Codex has pieces of repo search substrate scattered around: + +- fuzzy/exact-ish file search +- BM25 usage in tool-search paths +- shell access if the operator wants to rummage manually + +What it does not have is one Epiphany-owned retrieval organ that says: + +- this query is for repo understanding +- this thread/workspace is the scope +- exact and semantic lookup are the same machine +- results come back in a typed shape instead of as transcript confetti + +### Why it matters + +This is the first time Epiphany can ask a structured repo question without falling back to file-by-file terminal spelunking. + +That changes the shape of the harness. The map is no longer just a notebook the prompt can read. It now has a first retrieval organ hanging off the same typed spine. + +### Important limits + +This slice is intentionally small and honest: + +- query-time only +- loaded-thread-first +- read-only +- local BM25 rather than embeddings +- no watcher-driven invalidation +- no persistent vector store +- no explicit retrieval update/write path yet + ## What has *not* diverged yet This matters because the spec is ahead of the code in a few obvious places. ### Not yet shipped -- no retrieval subsystem - no code-intelligence layer - no watcher-driven semantic invalidation - no observation-promotion machinery beyond the data model @@ -250,6 +312,7 @@ input -> rollout + epiphany_state snapshot -> replay-aware epiphany restoration -> hydrated client thread payload with epiphanyState +-> optional typed repo retrieval through thread/epiphany/retrieve ``` That is the real delta. @@ -258,7 +321,7 @@ The transcript is no longer the only thing with continuity. ## Where the divergence is already meaningful -Even without retrieval or GUI, the divergence is already structurally important in three ways: +Even without invalidation or GUI, the divergence is already structurally important in four ways: 1. **Understanding has a durable object now** - not just prose and replayed vibes @@ -269,12 +332,19 @@ Even without retrieval or GUI, the divergence is already structurally important 3. **Clients can read that understanding directly** - not by scraping the prompt or reverse-engineering transcript fragments +4. **The harness has one typed repo retrieval organ now** + - not just shell archaeology plus vibes + That is not the full Epiphany vision yet, but it is no longer cosmetic either. ## Recommended next companion note -Once Phase 4 lands, this file should get a new section: +If the next bounded slice lands, the useful follow-on section for this file is probably not "more retrieval exists." -- `Divergence 5: repo-local hybrid retrieval` +It is more likely one of these: -That will probably be the moment the divergence starts feeling less like a careful extension and more like a different operating philosophy living inside the same harness. +- retrieval freshness/persistence semantics +- structured observation promotion from retrieval/tool output into durable Epiphany state +- Qdrant-backed persistent semantic indexing as a preferred backend, with BM25 fallback instead of a hard dependency + +Those would be the next places where the machine stops being a better notebook and starts being a more opinionated harness. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index e26684fb..822fbe28 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -45,6 +45,91 @@ Current architectural/spec notes: - `notes/epiphany-current-algorithmic-map.md` - `notes/epiphany-core-harness-surfaces.md` +## Current In-Flight Work + +Phase 4 repo-local hybrid retrieval is now verified in the working tree. It is still uncommitted, but it is no longer a vague scaffold or a maybe. + +Current working-tree implementation spans: + +- `vendor/codex/codex-rs/protocol/src/protocol.rs` +- `vendor/codex/codex-rs/core/src/epiphany_retrieval.rs` +- `vendor/codex/codex-rs/core/src/codex_thread.rs` +- `vendor/codex/codex-rs/core/src/lib.rs` +- `vendor/codex/codex-rs/core/Cargo.toml` +- `vendor/codex/codex-rs/core/src/session/tests.rs` +- `vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs` +- `vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs` +- `vendor/codex/codex-rs/app-server-protocol/src/export.rs` +- `vendor/codex/codex-rs/app-server/src/codex_message_processor.rs` +- `vendor/codex/codex-rs/app-server/README.md` +- regenerated stable fixtures under `vendor/codex/codex-rs/app-server-protocol/schema/` + +What is wired right now: + +- `EpiphanyThreadState` already has retrieval metadata fields and types in protocol +- `codex-core` now has a new `epiphany_retrieval.rs` module +- the core retriever is query-time and hybrid: + - exact/path-ish lookup via `codex_file_search` + - semantic lookup via BM25 chunk search over a local gitignore-respecting corpus +- `CodexThread` now exposes: + - `epiphany_retrieval_state()` + - `epiphany_retrieve(...)` +- app-server protocol now declares experimental `thread/epiphany/retrieve` +- app-server message handling now routes that method to the core retriever +- live hydrated `thread.epiphanyState` reads now backfill a lightweight retrieval summary when the thread already has Epiphany state but no persisted retrieval summary yet +- basic protocol/core/app-server unit tests were added for the new types and mapping layer + +Important recovery facts: + +- existing exact/path lookup substrate already exists through `codex_file_search` +- app-server fuzzy search currently uses it in `vendor/codex/codex-rs/app-server/src/fuzzy_file_search.rs` +- `codex-core` already depends on `bm25` +- `vendor/codex/codex-rs/core/src/tools/handlers/tool_search.rs` already shows how BM25 is used in-tree +- tracked corpus preflight for `vendor/codex/codex-rs` at `vendor/codex` HEAD `d45ab10` is `3642` files / `31.09 MB` +- raw working-tree size under `codex-rs` is polluted by build artifacts and should not be used as the retrieval corpus estimate + +Recovered bounded design decision: + +- the first Phase 4 slice should be a query-time hybrid retriever +- reuse `codex_file_search` for exact/path-ish lookup +- use workspace-local BM25 chunk search as the initial semantic backend +- keep the first slice loaded-thread-only and read-only +- defer embeddings, vector stores, persistent indexing, and watcher-driven invalidation for later slices + +Updated follow-up direction: + +- the verified BM25 slice is still the right first landing zone +- the first persistent semantic store after that should target Qdrant rather than another blob-thrashing JSON/Postgres embedding store +- Qdrant should be the preferred persistent semantic backend later, not a hard requirement for basic Epiphany use +- exact/path lookup stays first-class +- BM25 should stay around as bootstrap/fallback/control for users who do not want Qdrant or when Qdrant is unavailable instead of turning the machine into vector-only confidence soup + +What got verified: + +- `cargo fmt --all` passed +- `cargo test -p codex-core -p codex-app-server-protocol -p codex-app-server --lib --no-run` passed with `CARGO_TARGET_DIR=C:\Users\Meta\.cargo-target-codex` +- targeted Phase 4 tests passed: + - `cargo test -p codex-core --lib retrieve_workspace_` + - `cargo test -p codex-app-server-protocol --lib thread_epiphany_retrieve` + - `cargo test -p codex-app-server --lib map_epiphany_retrieve_response_preserves_summary_and_results` +- full `cargo test -p codex-app-server-protocol` passed after regenerating stable schema fixtures + +Notable verification fixes: + +- `codex_message_processor.rs` needed the live-thread retrieval helper call to stop pretending `&CodexThread` needed `.as_ref()` +- `core/src/session/tests.rs` needed `retrieval: None` in the prompt fixture Epiphany state +- the exact-hit retrieval test fixture needed a genuinely matchable file name (`session_checkpoint.rs`) +- `EpiphanyThreadState` needed an explicit exemption in the protocol export test because sparse durable thread state intentionally uses optional fields + +Important schema caveat: + +- `cargo run -p codex-app-server-protocol --bin write_schema_fixtures -- --experimental` rewrites the same checked-in schema tree as stable generation +- leaving the repo in that state makes stable protocol tests fail +- the safe checked-in state for this slice is the stable fixture generation output +- after inspection, do not bolt durable Epiphany-state writes onto `thread/epiphany/retrieve` just because the retrieval summary exists: + - current Epiphany snapshots are persisted on real user-turn boundaries + - out-of-band durable retrieval writes would need new rollout semantics and are a larger machine than this slice deserves + ## What Already Landed Phase 1 is done. @@ -119,8 +204,8 @@ Use it when you need the answer to "how does current Epiphany differ from plain If a future session wakes up from compaction and starts bluffing, this is the part to staple to its forehead. - Phase 1, Phase 2, and the minimal Phase 3 read surface are all landed and verified. -- The latest pushed implementation anchor before this handoff sync is `640e063`: - - `Document pre-compaction Epiphany workflow` +- The latest local implementation anchor before the current in-flight retrieval slice is `d45ab10`: + - `Add Epiphany delta algorithmic map` - `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 @@ -135,6 +220,15 @@ If a future session wakes up from compaction and starts bluffing, this is the pa - The next phase is **Phase 4 repo-local hybrid retrieval**: - give Epiphany a real repo retrieval subsystem instead of repeated file-by-file shell archaeology - keep it typed, additive, and GUI-friendly +- Phase 4 slice 1 is now verified in the working tree: + - protocol/core/app-server wiring exists and passes targeted verification + - stable app-server protocol schema fixtures were regenerated + - `write_schema_fixtures --experimental` is a trap if it is left as the checked-in tree +- The recovered bounded implementation choice for the first slice is: + - exact/path lookup via existing `codex_file_search` + - semantic lookup via local BM25 chunk search + - query-time, read-only, loaded-thread-first behavior + - no embeddings or persistent vector store yet - 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: @@ -181,6 +275,13 @@ Verified: - `cargo test -p codex-core --lib latest_epiphany_state_from_rollout_items` - `cargo test -p codex-app-server --lib load_epiphany_state_from_rollout_path_reads_latest_snapshot` - `cargo test -p codex-app-server-protocol --lib serialize_client_response` +- `cargo fmt --all` passed for the Phase 4 retrieval slice +- `cargo test -p codex-core -p codex-app-server-protocol -p codex-app-server --lib --no-run` passed for the Phase 4 retrieval slice when `CARGO_TARGET_DIR=C:\Users\Meta\.cargo-target-codex` +- targeted Phase 4 tests passed: + - `cargo test -p codex-core --lib retrieve_workspace_` + - `cargo test -p codex-app-server-protocol --lib thread_epiphany_retrieve` + - `cargo test -p codex-app-server --lib map_epiphany_retrieve_response_preserves_summary_and_results` +- full `cargo test -p codex-app-server-protocol` passed after restoring stable schema fixtures Important Windows footgun: @@ -192,23 +293,20 @@ Without that, you get to learn about `symlink_dir failed: ... A required privile ## Recommended Next Implementation -Do **Phase 4 repo-local hybrid retrieval** next. +Do not restart verification from superstition. The current Phase 4 slice is already verified in the working tree. -The durable state seam exists, the turn loop now reads it, and clients can now load typed Epiphany state directly. The next clean move is to stop making every future agent rediscover the repo with shell spelunking. +The durable state seam exists, the turn loop reads it, clients can load typed Epiphany state directly, and the first retrieval slice is now real. The next clean move is to ship that verified slice cleanly instead of widening it before Qdrant is even online. -Planned slice: +Current next implementation move: -1. define retrieval state and shard/index summaries in typed Epiphany state -2. add a bounded hybrid retrieval surface that combines exact search with semantic chunk lookup -3. keep the first retrieval slice additive and internal/dev-usable first -4. leave watcher-driven invalidation, heavy GUI reflection, and specialist-agent scheduling for later slices - -Main files for the next slice: - -- `vendor/codex/codex-rs/protocol/src/` -- `vendor/codex/codex-rs/core/src/` -- `vendor/codex/codex-rs/app-server/src/` -- `vendor/codex/codex-rs/app-server-protocol/src/` +1. clean up, stage, commit, and push the current verified query-time hybrid retriever as the Phase 4 slice 1 landing zone +2. do not casually add durable retrieval-summary writes to `thread/epiphany/retrieve` +3. if a follow-up is needed later, keep it narrow: + - retrieval persistence/freshness semantics + - probably via a dedicated Epiphany update path + - Qdrant-backed persistent semantic indexing as the preferred backend, with BM25 fallback for no-Qdrant or degraded mode + - not GUI work + - not watcher-driven invalidation ## What Not To Do Next diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 5fce6a86..d286dead 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -38,3 +38,18 @@ {"ts": "2026-04-24T00:44:53+01:00", "type": "decision", "status": "ok", "note": "Patched the Epiphany spec and handoff workflow to make compaction pressure-aware instead of purely reactive. Added the rule that the harness should detect rising context pressure before the hard limit, checkpoint at the next safe point when pressure is high, and persist immediately when pressure is critical rather than waiting for forced compaction to erase live reasoning."} {"ts": "2026-04-24T00:47:37+01:00", "type": "decision", "status": "ok", "note": "Updated the repo-local AGENTS.md to carry the operational bootstrap and re-entry protocol explicitly. Fresh sessions and post-compaction resumes should reread the persisted state files, run tools/epiphany_state.py status immediately, restate the persisted next action before edits, and treat rising context pressure as a cue to checkpoint before forced compaction."} {"ts": "2026-04-24T00:50:33+01:00", "type": "decision", "status": "ok", "note": "Added a dedicated current-state Epiphany algorithmic delta map in notes/epiphany-current-algorithmic-map.md. The note documents only the currently landed divergence from plain Codex: durable Epiphany state in protocol/rollout, replay-aware restoration, prompt injection through build_initial_context, and typed app-server Thread.epiphanyState hydration, while explicitly calling out what has not diverged yet."} +{"ts": "2026-04-24T00:03:39+00:00", "type": "research", "status": "ok", "note": "Recovered from source that existing exact/path lookup substrate already exists through codex_file_search in vendored Codex, currently used by app-server fuzzy search in vendor/codex/codex-rs/app-server/src/fuzzy_file_search.rs."} +{"ts": "2026-04-24T00:03:39+00:00", "type": "research", "status": "ok", "note": "Recovered from source that codex-core already depends on bm25 and uses it in vendor/codex/codex-rs/core/src/tools/handlers/tool_search.rs, so a bounded local BM25 retrieval backend can reuse in-tree library precedent instead of inventing a new search dependency."} +{"ts": "2026-04-24T00:03:39+00:00", "type": "research", "status": "ok", "note": "Preflighted the tracked Phase 4 source corpus using git-tracked files rather than raw working-tree disk usage. At vendor/codex HEAD d45ab10, tracked vendor/codex/codex-rs source is 3642 files / 31.09 MB; raw working-tree size is polluted by build artifacts and should not drive retrieval design."} +{"ts": "2026-04-24T00:03:39+00:00", "type": "decision", "status": "ok", "note": "Chose the first bounded Phase 4 retrieval backend as a query-time hybrid retriever: reuse codex_file_search for exact/path-ish lookup, use workspace-local BM25 chunk search as the initial semantic backend, keep the slice loaded-thread-first and read-only, and defer embeddings, vector stores, persistent indexing, and watcher-driven invalidation."} +{"ts": "2026-04-24T00:03:39+00:00", "type": "implementation", "status": "in_progress", "note": "The current working tree contains an unverified protocol scaffold for Phase 4 in vendor/codex/codex-rs/protocol/src/protocol.rs. It adds EpiphanyThreadState.retrieval plus EpiphanyRetrievalState, EpiphanyRetrievalStatus, and EpiphanyRetrievalShardSummary, but core/app-server wiring and test verification are still pending."} +{"ts": "2026-04-24T00:22:05+00:00", "type": "decision", "status": "ok", "note": "Live hydrated thread epiphanyState now backfills a lightweight retrieval summary when the thread already has Epiphany state but no persisted retrieval metadata yet; this keeps the first slice loaded-thread-first and read-only without inventing a write path."} +{"ts": "2026-04-24T00:22:05+00:00", "type": "implementation", "status": "in_progress", "note": "Phase 4 working tree now wires query-time hybrid retrieval across core and app-server: new core epiphany_retrieval module, CodexThread retrieval entry points, experimental app-server protocol method thread/epiphany/retrieve, and app-server request handling/mapping are all present but not formatted or verified yet."} +{"ts": "2026-04-24T00:22:05+00:00", "type": "verification", "status": "pending", "note": "Phase 4 retrieval wiring still needs cargo fmt and targeted Windows-safe Rust verification for codex-core, codex-app-server-protocol, and codex-app-server; no tests have been run on the current wider diff yet."} +{"ts": "2026-04-24T02:07:46+01:00", "type": "implementation", "status": "ok", "note": "Finished the first bounded Phase 4 query-time hybrid retrieval slice in the working tree. Fixed the live-thread mapping fallout in codex_message_processor.rs, added retrieval: None to the prompt fixture Epiphany state, tightened the exact-hit retrieval test fixture to a genuinely matchable path, and kept the retrieval surface additive and read-only with live retrieval-summary backfill rather than inventing a write path."} +{"ts": "2026-04-24T02:07:46+01:00", "type": "verification", "status": "ok", "note": "Verified the Phase 4 slice with the Windows CARGO_TARGET_DIR workaround. cargo fmt --all passed; cargo test -p codex-core -p codex-app-server-protocol -p codex-app-server --lib --no-run passed; targeted tests passed for codex-core retrieve_workspace_*, codex-app-server-protocol thread_epiphany_retrieve*, and codex-app-server map_epiphany_retrieve_response_preserves_summary_and_results; full cargo test -p codex-app-server-protocol passed after stable schema regeneration."} +{"ts": "2026-04-24T02:07:46+01:00", "type": "decision", "status": "ok", "note": "Stable app-server protocol schema fixtures are the only safe checked-in schema state for the Phase 4 slice. Running write_schema_fixtures with --experimental rewrites the same schema tree, causes stable protocol tests to fail if left in place, and therefore must be followed by stable fixture regeneration before the repo is left in a landed state."} +{"ts": "2026-04-24T02:07:46+01:00", "type": "decision", "status": "ok", "note": "Kept EpiphanyThreadState sparse at the protocol/export boundary. The protocol export test now explicitly exempts EpiphanyThreadState from the optional-nullable params rule because durable thread state intentionally uses optional fields, and flattening it into a fake params-shaped object would be the worse lie."} +{"ts": "2026-04-24T02:11:38+01:00", "type": "decision", "status": "ok", "note": "Deferred durable retrieval-summary persistence beyond the verified Phase 4 slice. EpiphanyState snapshots are still persisted on real user-turn boundaries, so teaching thread/epiphany/retrieve to append durable state now would require a new out-of-band rollout semantic or a fake turn boundary; keep the current slice as the landing zone instead of widening the machine casually."} +{"ts": "2026-04-24T02:11:38+01:00", "type": "decision", "status": "ok", "note": "Adopted Qdrant as the intended first persistent semantic retrieval backend after the verified BM25 baseline. The rationale is practical rather than fashionable: the user is already moving away from a blob-thrashing Postgres/JSON embedding store in adjacent infrastructure, so Epiphany should target a real vector DB for persistent semantic indexing while keeping exact/path search first-class and retaining BM25 as bootstrap/fallback/control rather than going vector-only."} +{"ts": "2026-04-24T02:43:41+01:00", "type": "decision", "status": "ok", "note": "Resolved the remaining backend policy fork before shipping Phase 4 slice 1: Qdrant is the preferred later persistent semantic backend, but not a hard runtime requirement for basic Epiphany use. The verified BM25 retriever remains the no-hassle bootstrap/fallback/control path for users who do not want Qdrant or when Qdrant is unavailable."} diff --git a/state/map.yaml b/state/map.yaml index b877a7fc..95db0089 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -45,10 +45,9 @@ data_flow: - commit or backtrack active_subgoals: - - Define the Phase 4 repo-local hybrid retrieval slice now that the minimal Phase 3 typed client exposure is landed and verified. - - Use the tiny CLI and typed state files on a small real task. - - Decide whether the next executable artifact should be a patch runner or a verifier helper. - - Run the protocol on a small real task. + - Clean up and ship the verified Phase 4 repo-local hybrid retrieval slice without widening scope. + - Keep the canonical map, handoff note, evidence log, and checked-in stable schema state aligned with the verified landing zone. + - Preserve BM25 as the no-hassle fallback while treating Qdrant as the preferred later persistent semantic backend. accepted_design: - external typed state files @@ -79,6 +78,8 @@ accepted_design: - 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 - compaction handling should be pressure-aware rather than reactive: when context pressure rises, Epiphany should narrow the active move and persist checkpoints before forced compaction actually hits - repo-local AGENTS instructions should carry the session bootstrap and re-entry protocol explicitly, including running epiphany_state.py status on fresh load and after compaction + - implement the first Phase 4 retrieval slice as a query-time hybrid retriever: reuse existing codex_file_search substrate for exact/path lookup and use workspace-local BM25 chunk search as the first semantic backend so the retrieval seam is proven before adding persistence + - for the first persistent semantic retrieval store after the verified BM25 baseline, prefer a real vector database such as Qdrant over JSON/blob/postgres-thrash designs; treat Qdrant as the preferred persistent semantic backend rather than a hard requirement, keep exact/path lookup as a first-class organ, and keep BM25 available as a bootstrap/fallback/control path when Qdrant is unavailable or not configured instead of turning retrieval into vector-only soup rejected_paths: - name: pinned_map_only @@ -95,5 +96,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. Phase 1 durable Epiphany state, Phase 2 prompt integration, and a minimal Phase 3 typed client read surface are all implemented and verified with a real Rust/MSVC toolchain; vendored Codex is tracked directly in the parent repo; app-server Thread payloads can now carry typed Epiphany state without scraping prompt text; and pre-compaction persistence is now an explicit part of the intended Epiphany workflow. - next_action: Write and then implement the first bounded Phase 4 repo-local hybrid retrieval slice so Epiphany can query repo knowledge through typed state and additive query surfaces instead of repeated file-by-file shell archaeology. + 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. Phase 1 durable Epiphany state, Phase 2 prompt integration, and a minimal Phase 3 typed client read surface are all implemented and verified with a real Rust/MSVC toolchain; vendored Codex is tracked directly in the parent repo; app-server Thread payloads can now carry typed Epiphany state without scraping prompt text; pre-compaction persistence is now an explicit part of the intended Epiphany workflow; and the first bounded Phase 4 repo-local hybrid retrieval slice is now wired and verified in the working tree across protocol, core, app-server protocol, and app-server, including stable schema fixture regeneration and the Windows `CARGO_TARGET_DIR` verification path. + next_action: Clean up and push the current verified query-time hybrid retriever as the Phase 4 slice 1 landing zone. Do not bolt durable EpiphanyState writes onto `thread/epiphany/retrieve` without a clean out-of-band rollout semantic; after the push and reboot, the next persistent semantic retrieval slice should target a Qdrant-backed store with explicit freshness/indexing semantics as the preferred semantic backend while BM25 remains the fallback when Qdrant is unavailable. diff --git a/state/scratch.md b/state/scratch.md index 40969c75..5a5dfb97 100644 --- a/state/scratch.md +++ b/state/scratch.md @@ -4,23 +4,66 @@ This file is intentionally disposable. ## Current Subgoal -- Confirm the scaffold is coherent enough to use. -- Decide whether to patch vendored Codex with the lightweight Epiphany preset now. -- Decide whether the next executable artifact should be a patch runner or a verifier helper. +- Clean up, persist, and ship the verified first bounded Phase 4 repo-local hybrid retrieval slice in vendored Codex. ## Working Notes -- The protocol should be usable by any capable model because most of the structure lives outside the model. -- The first test should be small enough to run repeatedly without becoming its own research program. -- If the protocol becomes too ceremonial, it will lose to plain prompting for the most boring reason imaginable: friction. -- The current CLI is intentionally small. It exists to keep state honest, not to impersonate a full agent runtime. -- The Codex repo already has a cleaner-than-expected collaboration-mode preset seam, so a preset-backed Epiphany mode is a tractable first implementation. +- The old lone-diff situation is gone. The current in-flight Phase 4 wiring now spans: + - `vendor/codex/codex-rs/protocol/src/protocol.rs` + - `vendor/codex/codex-rs/core/src/epiphany_retrieval.rs` + - `vendor/codex/codex-rs/core/src/codex_thread.rs` + - `vendor/codex/codex-rs/core/src/lib.rs` + - `vendor/codex/codex-rs/core/Cargo.toml` + - `vendor/codex/codex-rs/core/src/session/tests.rs` + - `vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs` + - `vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs` + - `vendor/codex/codex-rs/app-server-protocol/src/export.rs` + - `vendor/codex/codex-rs/app-server/src/codex_message_processor.rs` + - `vendor/codex/codex-rs/app-server/README.md` + - regenerated stable fixtures under `vendor/codex/codex-rs/app-server-protocol/schema/` +- The current implementation shape is the bounded one we wanted: + - exact/path-ish lookup via `codex_file_search` + - semantic lookup via query-time BM25 chunk search in the new core retrieval module + - additive experimental app-server method `thread/epiphany/retrieve` + - lightweight retrieval-summary backfill for live `thread.epiphanyState` when the thread already has Epiphany state but no persisted retrieval summary yet +- `codex-core` now depends on both `bm25` and `codex-file-search`; `ignore` is used to walk a gitignore-respecting local corpus for semantic chunking. +- The semantic side is intentionally small: + - text-only files + - size cap per file + - fixed line-window chunking with overlap + - no embeddings, no persistent blob, no watcher invalidation +- Corpus preflight for the tracked `vendor/codex/codex-rs` source at `vendor/codex` HEAD `d45ab10`: `3642` tracked files, `31.09 MB`. +- Do not use raw working-tree size as the retrieval denominator here; build artifacts and other debris inflate it badly and will lie to the design. +- Verification is no longer theoretical: + - `cargo fmt --all` passed + - `cargo test -p codex-core -p codex-app-server-protocol -p codex-app-server --lib --no-run` passed with `CARGO_TARGET_DIR=C:\Users\Meta\.cargo-target-codex` + - targeted Phase 4 tests passed in core, app-server protocol, and app-server + - full `cargo test -p codex-app-server-protocol` passed after regenerating stable schema fixtures +- Small fallout that had to be patched: + - `codex_message_processor.rs` had an unnecessary `live_thread.as_ref()` + - `core/src/session/tests.rs` needed `retrieval: None` in the prompt fixture Epiphany state + - the exact-hit retrieval test fixture needed an actually matchable path (`session_checkpoint.rs`) + - `EpiphanyThreadState` needed an explicit exemption in the protocol export test because it is a sparse durable state object, not a params bag +- Important schema footgun: + - `cargo run -p codex-app-server-protocol --bin write_schema_fixtures -- --experimental` rewrites the same checked-in stable schema tree + - leaving the repo in that state makes stable protocol tests fail + - the checked-in repo state must stay on the stable fixture generation path + - despite the giant `git status` scream wall, the real schema content diff is small and expected: + - `git diff --numstat` shows actual content changes in `15` generated schema files + - plus the new untracked Epiphany TypeScript schema files + - the broader wall is mostly line-ending/worktree noise, not extra logical surface area +- After inspecting the live code path, do not widen `thread/epiphany/retrieve` into a durable Epiphany-state write right now: + - durable `EpiphanyState` snapshots are currently persisted on real user-turn boundaries + - making retrieval calls append durable snapshots would require a new out-of-band rollout semantic or a fake turn boundary + - that is a bigger machine than this slice deserves +- New infrastructure direction: + - for the first persistent semantic backend after this verified BM25 slice, use Qdrant instead of inventing another monolithic JSON/blob/postgres-embedding store + - Qdrant should be the preferred persistent semantic backend later, not a hard runtime requirement for basic Epiphany use + - exact/path lookup stays first-class + - BM25 should stay available as a bootstrap/fallback/control path for users who do not want Qdrant or when Qdrant is unavailable ## Open Questions -- What is the smallest useful verifier stack? -- Which coding task will expose drift quickly? -- How much branch management is enough before it turns into paperwork? -- Should the first in-Codex implementation be instructions-only, or should it also add a tiny state helper tool? +- When retrieval freshness/persistence semantics come later, should they ride a dedicated Epiphany update path instead of piggybacking on a read/query method? Do not promote anything from here into the map unless it survives verification or repeated reuse without contradiction. diff --git a/vendor/codex/codex-rs/Cargo.lock b/vendor/codex/codex-rs/Cargo.lock index 74473e17..ab09b046 100644 --- a/vendor/codex/codex-rs/Cargo.lock +++ b/vendor/codex/codex-rs/Cargo.lock @@ -2348,6 +2348,7 @@ dependencies = [ "codex-execpolicy", "codex-features", "codex-feedback", + "codex-file-search", "codex-git-utils", "codex-hooks", "codex-login", @@ -2397,6 +2398,7 @@ dependencies = [ "futures", "http 1.4.0", "iana-time-zone", + "ignore", "image", "indexmap 2.13.0", "insta", diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/ServerNotification.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/ServerNotification.json index aa320f8b..1194a9b6 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/ServerNotification.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/ServerNotification.json @@ -1002,6 +1002,702 @@ ], "type": "string" }, + "EpiphanyChurnState": { + "properties": { + "diff_pressure": { + "type": "string" + }, + "graph_freshness": { + "type": [ + "string", + "null" + ] + }, + "understanding_status": { + "type": "string" + }, + "unexplained_writes": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "warning": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "diff_pressure", + "understanding_status" + ], + "type": "object" + }, + "EpiphanyCodeRef": { + "properties": { + "end_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "start_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "symbol": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "EpiphanyEvidenceRecord": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyGraph": { + "properties": { + "edges": { + "items": { + "$ref": "#/definitions/EpiphanyGraphEdge" + }, + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/definitions/EpiphanyGraphNode" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphCheckpoint": { + "properties": { + "checkpoint_id": { + "type": "string" + }, + "frontier_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "graph_revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "checkpoint_id", + "graph_revision" + ], + "type": "object" + }, + "EpiphanyGraphEdge": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string" + }, + "label": { + "type": [ + "string", + "null" + ] + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + } + }, + "required": [ + "kind", + "source_id", + "target_id" + ], + "type": "object" + }, + "EpiphanyGraphFrontier": { + "properties": { + "active_edge_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "active_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphLink": { + "properties": { + "architecture_node_id": { + "type": "string" + }, + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "dataflow_node_id": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "architecture_node_id", + "dataflow_node_id" + ], + "type": "object" + }, + "EpiphanyGraphNode": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "metaphor": { + "type": [ + "string", + "null" + ] + }, + "purpose": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "purpose", + "title" + ], + "type": "object" + }, + "EpiphanyGraphs": { + "properties": { + "architecture": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "dataflow": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "links": { + "items": { + "$ref": "#/definitions/EpiphanyGraphLink" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyInvariant": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "rationale": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "status" + ], + "type": "object" + }, + "EpiphanyModeState": { + "properties": { + "kind": { + "anyOf": [ + { + "$ref": "#/definitions/ModeKind" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "EpiphanyObservation": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "evidence_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "source_kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "source_kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyRetrievalShardSummary": { + "properties": { + "exact_available": { + "type": "boolean" + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path_prefix": { + "type": "string" + }, + "semantic_available": { + "type": "boolean" + }, + "shard_id": { + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + } + }, + "required": [ + "path_prefix", + "shard_id" + ], + "type": "object" + }, + "EpiphanyRetrievalState": { + "properties": { + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index_revision": { + "type": [ + "string", + "null" + ] + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "last_indexed_at_unix_seconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semantic_available": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/EpiphanyRetrievalShardSummary" + }, + "type": "array" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + }, + "workspace_root": { + "type": "string" + } + }, + "required": [ + "workspace_root" + ], + "type": "object" + }, + "EpiphanyRetrievalStatus": { + "enum": [ + "unavailable", + "ready", + "stale", + "indexing" + ], + "type": "string" + }, + "EpiphanyScratchPad": { + "properties": { + "hypothesis": { + "type": [ + "string", + "null" + ] + }, + "next_probe": { + "type": [ + "string", + "null" + ] + }, + "notes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "EpiphanySubgoal": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "status", + "title" + ], + "type": "object" + }, + "EpiphanyThreadState": { + "properties": { + "active_subgoal_id": { + "type": [ + "string", + "null" + ] + }, + "churn": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyChurnState" + }, + { + "type": "null" + } + ] + }, + "graph_checkpoint": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphCheckpoint" + }, + { + "type": "null" + } + ] + }, + "graph_frontier": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphFrontier" + }, + { + "type": "null" + } + ] + }, + "graphs": { + "$ref": "#/definitions/EpiphanyGraphs" + }, + "invariants": { + "items": { + "$ref": "#/definitions/EpiphanyInvariant" + }, + "type": "array" + }, + "last_updated_turn_id": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyModeState" + }, + { + "type": "null" + } + ] + }, + "objective": { + "type": [ + "string", + "null" + ] + }, + "observations": { + "items": { + "$ref": "#/definitions/EpiphanyObservation" + }, + "type": "array" + }, + "recent_evidence": { + "items": { + "$ref": "#/definitions/EpiphanyEvidenceRecord" + }, + "type": "array" + }, + "retrieval": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalState" + }, + { + "type": "null" + } + ] + }, + "revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "scratch": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyScratchPad" + }, + { + "type": "null" + } + ] + }, + "subgoals": { + "items": { + "$ref": "#/definitions/EpiphanySubgoal" + }, + "type": "array" + } + }, + "required": [ + "revision" + ], + "type": "object" + }, "ErrorNotification": { "properties": { "error": { @@ -2227,6 +2923,14 @@ } ] }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "enum": [ + "plan", + "default" + ], + "type": "string" + }, "ModelRerouteReason": { "enum": [ "highRiskCyberActivity" @@ -2881,6 +3585,17 @@ "description": "Whether the thread is ephemeral and should not be materialized on disk.", "type": "boolean" }, + "epiphanyState": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyThreadState" + }, + { + "type": "null" + } + ], + "description": "Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and notifications/responses that reuse those hydrated thread payloads." + }, "forkedFromId": { "description": "Source thread id when this thread was created by forking another thread.", "type": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index e16d84ca..bd36effc 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -7831,6 +7831,702 @@ ], "type": "object" }, + "EpiphanyChurnState": { + "properties": { + "diff_pressure": { + "type": "string" + }, + "graph_freshness": { + "type": [ + "string", + "null" + ] + }, + "understanding_status": { + "type": "string" + }, + "unexplained_writes": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "warning": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "diff_pressure", + "understanding_status" + ], + "type": "object" + }, + "EpiphanyCodeRef": { + "properties": { + "end_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "start_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "symbol": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "EpiphanyEvidenceRecord": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/v2/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyGraph": { + "properties": { + "edges": { + "items": { + "$ref": "#/definitions/v2/EpiphanyGraphEdge" + }, + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/definitions/v2/EpiphanyGraphNode" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphCheckpoint": { + "properties": { + "checkpoint_id": { + "type": "string" + }, + "frontier_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "graph_revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "checkpoint_id", + "graph_revision" + ], + "type": "object" + }, + "EpiphanyGraphEdge": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/v2/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string" + }, + "label": { + "type": [ + "string", + "null" + ] + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + } + }, + "required": [ + "kind", + "source_id", + "target_id" + ], + "type": "object" + }, + "EpiphanyGraphFrontier": { + "properties": { + "active_edge_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "active_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphLink": { + "properties": { + "architecture_node_id": { + "type": "string" + }, + "code_refs": { + "items": { + "$ref": "#/definitions/v2/EpiphanyCodeRef" + }, + "type": "array" + }, + "dataflow_node_id": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "architecture_node_id", + "dataflow_node_id" + ], + "type": "object" + }, + "EpiphanyGraphNode": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/v2/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "metaphor": { + "type": [ + "string", + "null" + ] + }, + "purpose": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "purpose", + "title" + ], + "type": "object" + }, + "EpiphanyGraphs": { + "properties": { + "architecture": { + "$ref": "#/definitions/v2/EpiphanyGraph" + }, + "dataflow": { + "$ref": "#/definitions/v2/EpiphanyGraph" + }, + "links": { + "items": { + "$ref": "#/definitions/v2/EpiphanyGraphLink" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyInvariant": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "rationale": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "status" + ], + "type": "object" + }, + "EpiphanyModeState": { + "properties": { + "kind": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ModeKind" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "EpiphanyObservation": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/v2/EpiphanyCodeRef" + }, + "type": "array" + }, + "evidence_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "source_kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "source_kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyRetrievalShardSummary": { + "properties": { + "exact_available": { + "type": "boolean" + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path_prefix": { + "type": "string" + }, + "semantic_available": { + "type": "boolean" + }, + "shard_id": { + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/v2/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + } + }, + "required": [ + "path_prefix", + "shard_id" + ], + "type": "object" + }, + "EpiphanyRetrievalState": { + "properties": { + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index_revision": { + "type": [ + "string", + "null" + ] + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "last_indexed_at_unix_seconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semantic_available": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/v2/EpiphanyRetrievalShardSummary" + }, + "type": "array" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/v2/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + }, + "workspace_root": { + "type": "string" + } + }, + "required": [ + "workspace_root" + ], + "type": "object" + }, + "EpiphanyRetrievalStatus": { + "enum": [ + "unavailable", + "ready", + "stale", + "indexing" + ], + "type": "string" + }, + "EpiphanyScratchPad": { + "properties": { + "hypothesis": { + "type": [ + "string", + "null" + ] + }, + "next_probe": { + "type": [ + "string", + "null" + ] + }, + "notes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "EpiphanySubgoal": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "status", + "title" + ], + "type": "object" + }, + "EpiphanyThreadState": { + "properties": { + "active_subgoal_id": { + "type": [ + "string", + "null" + ] + }, + "churn": { + "anyOf": [ + { + "$ref": "#/definitions/v2/EpiphanyChurnState" + }, + { + "type": "null" + } + ] + }, + "graph_checkpoint": { + "anyOf": [ + { + "$ref": "#/definitions/v2/EpiphanyGraphCheckpoint" + }, + { + "type": "null" + } + ] + }, + "graph_frontier": { + "anyOf": [ + { + "$ref": "#/definitions/v2/EpiphanyGraphFrontier" + }, + { + "type": "null" + } + ] + }, + "graphs": { + "$ref": "#/definitions/v2/EpiphanyGraphs" + }, + "invariants": { + "items": { + "$ref": "#/definitions/v2/EpiphanyInvariant" + }, + "type": "array" + }, + "last_updated_turn_id": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/v2/EpiphanyModeState" + }, + { + "type": "null" + } + ] + }, + "objective": { + "type": [ + "string", + "null" + ] + }, + "observations": { + "items": { + "$ref": "#/definitions/v2/EpiphanyObservation" + }, + "type": "array" + }, + "recent_evidence": { + "items": { + "$ref": "#/definitions/v2/EpiphanyEvidenceRecord" + }, + "type": "array" + }, + "retrieval": { + "anyOf": [ + { + "$ref": "#/definitions/v2/EpiphanyRetrievalState" + }, + { + "type": "null" + } + ] + }, + "revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "scratch": { + "anyOf": [ + { + "$ref": "#/definitions/v2/EpiphanyScratchPad" + }, + { + "type": "null" + } + ] + }, + "subgoals": { + "items": { + "$ref": "#/definitions/v2/EpiphanySubgoal" + }, + "type": "array" + } + }, + "required": [ + "revision" + ], + "type": "object" + }, "ErrorNotification": { "$schema": "http://json-schema.org/draft-07/schema#", "properties": { @@ -13906,6 +14602,17 @@ "description": "Whether the thread is ephemeral and should not be materialized on disk.", "type": "boolean" }, + "epiphanyState": { + "anyOf": [ + { + "$ref": "#/definitions/v2/EpiphanyThreadState" + }, + { + "type": "null" + } + ], + "description": "Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and notifications/responses that reuse those hydrated thread payloads." + }, "forkedFromId": { "description": "Source thread id when this thread was created by forking another thread.", "type": [ @@ -14084,6 +14791,161 @@ "title": "ThreadCompactStartResponse", "type": "object" }, + "ThreadEpiphanyRetrieveIndexSummary": { + "properties": { + "dirtyPaths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "indexRevision": { + "type": [ + "string", + "null" + ] + }, + "indexedChunkCount": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexedFileCount": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "lastIndexedAtUnixSeconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semanticAvailable": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/v2/ThreadEpiphanyRetrieveShardSummary" + }, + "type": "array" + }, + "status": { + "$ref": "#/definitions/v2/EpiphanyRetrievalStatus" + }, + "workspaceRoot": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + }, + "required": [ + "dirtyPaths", + "semanticAvailable", + "shards", + "status", + "workspaceRoot" + ], + "type": "object" + }, + "ThreadEpiphanyRetrieveResult": { + "properties": { + "excerpt": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "$ref": "#/definitions/v2/ThreadEpiphanyRetrieveResultKind" + }, + "lineEnd": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "lineStart": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path": { + "type": "string" + }, + "score": { + "format": "float", + "type": "number" + } + }, + "required": [ + "kind", + "path", + "score" + ], + "type": "object" + }, + "ThreadEpiphanyRetrieveResultKind": { + "enum": [ + "exactFile", + "exactDirectory", + "semanticChunk" + ], + "type": "string" + }, + "ThreadEpiphanyRetrieveShardSummary": { + "properties": { + "exactAvailable": { + "type": "boolean" + }, + "indexedChunkCount": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexedFileCount": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "pathPrefix": { + "type": "string" + }, + "semanticAvailable": { + "type": "boolean" + }, + "shardId": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/v2/EpiphanyRetrievalStatus" + } + }, + "required": [ + "exactAvailable", + "pathPrefix", + "semanticAvailable", + "shardId", + "status" + ], + "type": "object" + }, "ThreadForkParams": { "$schema": "http://json-schema.org/draft-07/schema#", "description": "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.", diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index 20e0f8f6..cefdb6be 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -4411,6 +4411,702 @@ ], "type": "object" }, + "EpiphanyChurnState": { + "properties": { + "diff_pressure": { + "type": "string" + }, + "graph_freshness": { + "type": [ + "string", + "null" + ] + }, + "understanding_status": { + "type": "string" + }, + "unexplained_writes": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "warning": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "diff_pressure", + "understanding_status" + ], + "type": "object" + }, + "EpiphanyCodeRef": { + "properties": { + "end_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "start_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "symbol": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "EpiphanyEvidenceRecord": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyGraph": { + "properties": { + "edges": { + "items": { + "$ref": "#/definitions/EpiphanyGraphEdge" + }, + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/definitions/EpiphanyGraphNode" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphCheckpoint": { + "properties": { + "checkpoint_id": { + "type": "string" + }, + "frontier_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "graph_revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "checkpoint_id", + "graph_revision" + ], + "type": "object" + }, + "EpiphanyGraphEdge": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string" + }, + "label": { + "type": [ + "string", + "null" + ] + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + } + }, + "required": [ + "kind", + "source_id", + "target_id" + ], + "type": "object" + }, + "EpiphanyGraphFrontier": { + "properties": { + "active_edge_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "active_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphLink": { + "properties": { + "architecture_node_id": { + "type": "string" + }, + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "dataflow_node_id": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "architecture_node_id", + "dataflow_node_id" + ], + "type": "object" + }, + "EpiphanyGraphNode": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "metaphor": { + "type": [ + "string", + "null" + ] + }, + "purpose": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "purpose", + "title" + ], + "type": "object" + }, + "EpiphanyGraphs": { + "properties": { + "architecture": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "dataflow": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "links": { + "items": { + "$ref": "#/definitions/EpiphanyGraphLink" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyInvariant": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "rationale": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "status" + ], + "type": "object" + }, + "EpiphanyModeState": { + "properties": { + "kind": { + "anyOf": [ + { + "$ref": "#/definitions/ModeKind" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "EpiphanyObservation": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "evidence_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "source_kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "source_kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyRetrievalShardSummary": { + "properties": { + "exact_available": { + "type": "boolean" + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path_prefix": { + "type": "string" + }, + "semantic_available": { + "type": "boolean" + }, + "shard_id": { + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + } + }, + "required": [ + "path_prefix", + "shard_id" + ], + "type": "object" + }, + "EpiphanyRetrievalState": { + "properties": { + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index_revision": { + "type": [ + "string", + "null" + ] + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "last_indexed_at_unix_seconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semantic_available": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/EpiphanyRetrievalShardSummary" + }, + "type": "array" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + }, + "workspace_root": { + "type": "string" + } + }, + "required": [ + "workspace_root" + ], + "type": "object" + }, + "EpiphanyRetrievalStatus": { + "enum": [ + "unavailable", + "ready", + "stale", + "indexing" + ], + "type": "string" + }, + "EpiphanyScratchPad": { + "properties": { + "hypothesis": { + "type": [ + "string", + "null" + ] + }, + "next_probe": { + "type": [ + "string", + "null" + ] + }, + "notes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "EpiphanySubgoal": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "status", + "title" + ], + "type": "object" + }, + "EpiphanyThreadState": { + "properties": { + "active_subgoal_id": { + "type": [ + "string", + "null" + ] + }, + "churn": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyChurnState" + }, + { + "type": "null" + } + ] + }, + "graph_checkpoint": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphCheckpoint" + }, + { + "type": "null" + } + ] + }, + "graph_frontier": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphFrontier" + }, + { + "type": "null" + } + ] + }, + "graphs": { + "$ref": "#/definitions/EpiphanyGraphs" + }, + "invariants": { + "items": { + "$ref": "#/definitions/EpiphanyInvariant" + }, + "type": "array" + }, + "last_updated_turn_id": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyModeState" + }, + { + "type": "null" + } + ] + }, + "objective": { + "type": [ + "string", + "null" + ] + }, + "observations": { + "items": { + "$ref": "#/definitions/EpiphanyObservation" + }, + "type": "array" + }, + "recent_evidence": { + "items": { + "$ref": "#/definitions/EpiphanyEvidenceRecord" + }, + "type": "array" + }, + "retrieval": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalState" + }, + { + "type": "null" + } + ] + }, + "revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "scratch": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyScratchPad" + }, + { + "type": "null" + } + ] + }, + "subgoals": { + "items": { + "$ref": "#/definitions/EpiphanySubgoal" + }, + "type": "array" + } + }, + "required": [ + "revision" + ], + "type": "object" + }, "ErrorNotification": { "$schema": "http://json-schema.org/draft-07/schema#", "properties": { @@ -11793,6 +12489,17 @@ "description": "Whether the thread is ephemeral and should not be materialized on disk.", "type": "boolean" }, + "epiphanyState": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyThreadState" + }, + { + "type": "null" + } + ], + "description": "Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and notifications/responses that reuse those hydrated thread payloads." + }, "forkedFromId": { "description": "Source thread id when this thread was created by forking another thread.", "type": [ @@ -11971,6 +12678,161 @@ "title": "ThreadCompactStartResponse", "type": "object" }, + "ThreadEpiphanyRetrieveIndexSummary": { + "properties": { + "dirtyPaths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "indexRevision": { + "type": [ + "string", + "null" + ] + }, + "indexedChunkCount": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexedFileCount": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "lastIndexedAtUnixSeconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semanticAvailable": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/ThreadEpiphanyRetrieveShardSummary" + }, + "type": "array" + }, + "status": { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + }, + "workspaceRoot": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "required": [ + "dirtyPaths", + "semanticAvailable", + "shards", + "status", + "workspaceRoot" + ], + "type": "object" + }, + "ThreadEpiphanyRetrieveResult": { + "properties": { + "excerpt": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "$ref": "#/definitions/ThreadEpiphanyRetrieveResultKind" + }, + "lineEnd": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "lineStart": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path": { + "type": "string" + }, + "score": { + "format": "float", + "type": "number" + } + }, + "required": [ + "kind", + "path", + "score" + ], + "type": "object" + }, + "ThreadEpiphanyRetrieveResultKind": { + "enum": [ + "exactFile", + "exactDirectory", + "semanticChunk" + ], + "type": "string" + }, + "ThreadEpiphanyRetrieveShardSummary": { + "properties": { + "exactAvailable": { + "type": "boolean" + }, + "indexedChunkCount": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexedFileCount": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "pathPrefix": { + "type": "string" + }, + "semanticAvailable": { + "type": "boolean" + }, + "shardId": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + }, + "required": [ + "exactAvailable", + "pathPrefix", + "semanticAvailable", + "shardId", + "status" + ], + "type": "object" + }, "ThreadForkParams": { "$schema": "http://json-schema.org/draft-07/schema#", "description": "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.", diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json index f62d6002..613aab67 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json @@ -449,6 +449,702 @@ ], "type": "string" }, + "EpiphanyChurnState": { + "properties": { + "diff_pressure": { + "type": "string" + }, + "graph_freshness": { + "type": [ + "string", + "null" + ] + }, + "understanding_status": { + "type": "string" + }, + "unexplained_writes": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "warning": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "diff_pressure", + "understanding_status" + ], + "type": "object" + }, + "EpiphanyCodeRef": { + "properties": { + "end_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "start_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "symbol": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "EpiphanyEvidenceRecord": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyGraph": { + "properties": { + "edges": { + "items": { + "$ref": "#/definitions/EpiphanyGraphEdge" + }, + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/definitions/EpiphanyGraphNode" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphCheckpoint": { + "properties": { + "checkpoint_id": { + "type": "string" + }, + "frontier_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "graph_revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "checkpoint_id", + "graph_revision" + ], + "type": "object" + }, + "EpiphanyGraphEdge": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string" + }, + "label": { + "type": [ + "string", + "null" + ] + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + } + }, + "required": [ + "kind", + "source_id", + "target_id" + ], + "type": "object" + }, + "EpiphanyGraphFrontier": { + "properties": { + "active_edge_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "active_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphLink": { + "properties": { + "architecture_node_id": { + "type": "string" + }, + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "dataflow_node_id": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "architecture_node_id", + "dataflow_node_id" + ], + "type": "object" + }, + "EpiphanyGraphNode": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "metaphor": { + "type": [ + "string", + "null" + ] + }, + "purpose": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "purpose", + "title" + ], + "type": "object" + }, + "EpiphanyGraphs": { + "properties": { + "architecture": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "dataflow": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "links": { + "items": { + "$ref": "#/definitions/EpiphanyGraphLink" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyInvariant": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "rationale": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "status" + ], + "type": "object" + }, + "EpiphanyModeState": { + "properties": { + "kind": { + "anyOf": [ + { + "$ref": "#/definitions/ModeKind" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "EpiphanyObservation": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "evidence_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "source_kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "source_kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyRetrievalShardSummary": { + "properties": { + "exact_available": { + "type": "boolean" + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path_prefix": { + "type": "string" + }, + "semantic_available": { + "type": "boolean" + }, + "shard_id": { + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + } + }, + "required": [ + "path_prefix", + "shard_id" + ], + "type": "object" + }, + "EpiphanyRetrievalState": { + "properties": { + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index_revision": { + "type": [ + "string", + "null" + ] + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "last_indexed_at_unix_seconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semantic_available": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/EpiphanyRetrievalShardSummary" + }, + "type": "array" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + }, + "workspace_root": { + "type": "string" + } + }, + "required": [ + "workspace_root" + ], + "type": "object" + }, + "EpiphanyRetrievalStatus": { + "enum": [ + "unavailable", + "ready", + "stale", + "indexing" + ], + "type": "string" + }, + "EpiphanyScratchPad": { + "properties": { + "hypothesis": { + "type": [ + "string", + "null" + ] + }, + "next_probe": { + "type": [ + "string", + "null" + ] + }, + "notes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "EpiphanySubgoal": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "status", + "title" + ], + "type": "object" + }, + "EpiphanyThreadState": { + "properties": { + "active_subgoal_id": { + "type": [ + "string", + "null" + ] + }, + "churn": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyChurnState" + }, + { + "type": "null" + } + ] + }, + "graph_checkpoint": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphCheckpoint" + }, + { + "type": "null" + } + ] + }, + "graph_frontier": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphFrontier" + }, + { + "type": "null" + } + ] + }, + "graphs": { + "$ref": "#/definitions/EpiphanyGraphs" + }, + "invariants": { + "items": { + "$ref": "#/definitions/EpiphanyInvariant" + }, + "type": "array" + }, + "last_updated_turn_id": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyModeState" + }, + { + "type": "null" + } + ] + }, + "objective": { + "type": [ + "string", + "null" + ] + }, + "observations": { + "items": { + "$ref": "#/definitions/EpiphanyObservation" + }, + "type": "array" + }, + "recent_evidence": { + "items": { + "$ref": "#/definitions/EpiphanyEvidenceRecord" + }, + "type": "array" + }, + "retrieval": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalState" + }, + { + "type": "null" + } + ] + }, + "revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "scratch": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyScratchPad" + }, + { + "type": "null" + } + ] + }, + "subgoals": { + "items": { + "$ref": "#/definitions/EpiphanySubgoal" + }, + "type": "array" + } + }, + "required": [ + "revision" + ], + "type": "object" + }, "FileSystemAccessMode": { "enum": [ "read", @@ -817,6 +1513,14 @@ } ] }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "enum": [ + "plan", + "default" + ], + "type": "string" + }, "NetworkAccess": { "enum": [ "restricted", @@ -1317,6 +2021,17 @@ "description": "Whether the thread is ephemeral and should not be materialized on disk.", "type": "boolean" }, + "epiphanyState": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyThreadState" + }, + { + "type": "null" + } + ], + "description": "Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and notifications/responses that reuse those hydrated thread payloads." + }, "forkedFromId": { "description": "Source thread id when this thread was created by forking another thread.", "type": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json index d3da9b7b..f7a6ed66 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json @@ -390,6 +390,702 @@ ], "type": "string" }, + "EpiphanyChurnState": { + "properties": { + "diff_pressure": { + "type": "string" + }, + "graph_freshness": { + "type": [ + "string", + "null" + ] + }, + "understanding_status": { + "type": "string" + }, + "unexplained_writes": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "warning": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "diff_pressure", + "understanding_status" + ], + "type": "object" + }, + "EpiphanyCodeRef": { + "properties": { + "end_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "start_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "symbol": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "EpiphanyEvidenceRecord": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyGraph": { + "properties": { + "edges": { + "items": { + "$ref": "#/definitions/EpiphanyGraphEdge" + }, + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/definitions/EpiphanyGraphNode" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphCheckpoint": { + "properties": { + "checkpoint_id": { + "type": "string" + }, + "frontier_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "graph_revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "checkpoint_id", + "graph_revision" + ], + "type": "object" + }, + "EpiphanyGraphEdge": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string" + }, + "label": { + "type": [ + "string", + "null" + ] + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + } + }, + "required": [ + "kind", + "source_id", + "target_id" + ], + "type": "object" + }, + "EpiphanyGraphFrontier": { + "properties": { + "active_edge_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "active_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphLink": { + "properties": { + "architecture_node_id": { + "type": "string" + }, + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "dataflow_node_id": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "architecture_node_id", + "dataflow_node_id" + ], + "type": "object" + }, + "EpiphanyGraphNode": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "metaphor": { + "type": [ + "string", + "null" + ] + }, + "purpose": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "purpose", + "title" + ], + "type": "object" + }, + "EpiphanyGraphs": { + "properties": { + "architecture": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "dataflow": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "links": { + "items": { + "$ref": "#/definitions/EpiphanyGraphLink" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyInvariant": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "rationale": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "status" + ], + "type": "object" + }, + "EpiphanyModeState": { + "properties": { + "kind": { + "anyOf": [ + { + "$ref": "#/definitions/ModeKind" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "EpiphanyObservation": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "evidence_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "source_kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "source_kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyRetrievalShardSummary": { + "properties": { + "exact_available": { + "type": "boolean" + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path_prefix": { + "type": "string" + }, + "semantic_available": { + "type": "boolean" + }, + "shard_id": { + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + } + }, + "required": [ + "path_prefix", + "shard_id" + ], + "type": "object" + }, + "EpiphanyRetrievalState": { + "properties": { + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index_revision": { + "type": [ + "string", + "null" + ] + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "last_indexed_at_unix_seconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semantic_available": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/EpiphanyRetrievalShardSummary" + }, + "type": "array" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + }, + "workspace_root": { + "type": "string" + } + }, + "required": [ + "workspace_root" + ], + "type": "object" + }, + "EpiphanyRetrievalStatus": { + "enum": [ + "unavailable", + "ready", + "stale", + "indexing" + ], + "type": "string" + }, + "EpiphanyScratchPad": { + "properties": { + "hypothesis": { + "type": [ + "string", + "null" + ] + }, + "next_probe": { + "type": [ + "string", + "null" + ] + }, + "notes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "EpiphanySubgoal": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "status", + "title" + ], + "type": "object" + }, + "EpiphanyThreadState": { + "properties": { + "active_subgoal_id": { + "type": [ + "string", + "null" + ] + }, + "churn": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyChurnState" + }, + { + "type": "null" + } + ] + }, + "graph_checkpoint": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphCheckpoint" + }, + { + "type": "null" + } + ] + }, + "graph_frontier": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphFrontier" + }, + { + "type": "null" + } + ] + }, + "graphs": { + "$ref": "#/definitions/EpiphanyGraphs" + }, + "invariants": { + "items": { + "$ref": "#/definitions/EpiphanyInvariant" + }, + "type": "array" + }, + "last_updated_turn_id": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyModeState" + }, + { + "type": "null" + } + ] + }, + "objective": { + "type": [ + "string", + "null" + ] + }, + "observations": { + "items": { + "$ref": "#/definitions/EpiphanyObservation" + }, + "type": "array" + }, + "recent_evidence": { + "items": { + "$ref": "#/definitions/EpiphanyEvidenceRecord" + }, + "type": "array" + }, + "retrieval": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalState" + }, + { + "type": "null" + } + ] + }, + "revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "scratch": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyScratchPad" + }, + { + "type": "null" + } + ] + }, + "subgoals": { + "items": { + "$ref": "#/definitions/EpiphanySubgoal" + }, + "type": "array" + } + }, + "required": [ + "revision" + ], + "type": "object" + }, "FileUpdateChange": { "properties": { "diff": { @@ -547,6 +1243,14 @@ } ] }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "enum": [ + "plan", + "default" + ], + "type": "string" + }, "NonSteerableTurnKind": { "enum": [ "review", @@ -809,6 +1513,17 @@ "description": "Whether the thread is ephemeral and should not be materialized on disk.", "type": "boolean" }, + "epiphanyState": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyThreadState" + }, + { + "type": "null" + } + ], + "description": "Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and notifications/responses that reuse those hydrated thread payloads." + }, "forkedFromId": { "description": "Source thread id when this thread was created by forking another thread.", "type": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json index 33207ca1..4915d0ce 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json @@ -390,6 +390,702 @@ ], "type": "string" }, + "EpiphanyChurnState": { + "properties": { + "diff_pressure": { + "type": "string" + }, + "graph_freshness": { + "type": [ + "string", + "null" + ] + }, + "understanding_status": { + "type": "string" + }, + "unexplained_writes": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "warning": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "diff_pressure", + "understanding_status" + ], + "type": "object" + }, + "EpiphanyCodeRef": { + "properties": { + "end_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "start_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "symbol": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "EpiphanyEvidenceRecord": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyGraph": { + "properties": { + "edges": { + "items": { + "$ref": "#/definitions/EpiphanyGraphEdge" + }, + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/definitions/EpiphanyGraphNode" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphCheckpoint": { + "properties": { + "checkpoint_id": { + "type": "string" + }, + "frontier_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "graph_revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "checkpoint_id", + "graph_revision" + ], + "type": "object" + }, + "EpiphanyGraphEdge": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string" + }, + "label": { + "type": [ + "string", + "null" + ] + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + } + }, + "required": [ + "kind", + "source_id", + "target_id" + ], + "type": "object" + }, + "EpiphanyGraphFrontier": { + "properties": { + "active_edge_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "active_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphLink": { + "properties": { + "architecture_node_id": { + "type": "string" + }, + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "dataflow_node_id": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "architecture_node_id", + "dataflow_node_id" + ], + "type": "object" + }, + "EpiphanyGraphNode": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "metaphor": { + "type": [ + "string", + "null" + ] + }, + "purpose": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "purpose", + "title" + ], + "type": "object" + }, + "EpiphanyGraphs": { + "properties": { + "architecture": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "dataflow": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "links": { + "items": { + "$ref": "#/definitions/EpiphanyGraphLink" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyInvariant": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "rationale": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "status" + ], + "type": "object" + }, + "EpiphanyModeState": { + "properties": { + "kind": { + "anyOf": [ + { + "$ref": "#/definitions/ModeKind" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "EpiphanyObservation": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "evidence_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "source_kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "source_kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyRetrievalShardSummary": { + "properties": { + "exact_available": { + "type": "boolean" + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path_prefix": { + "type": "string" + }, + "semantic_available": { + "type": "boolean" + }, + "shard_id": { + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + } + }, + "required": [ + "path_prefix", + "shard_id" + ], + "type": "object" + }, + "EpiphanyRetrievalState": { + "properties": { + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index_revision": { + "type": [ + "string", + "null" + ] + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "last_indexed_at_unix_seconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semantic_available": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/EpiphanyRetrievalShardSummary" + }, + "type": "array" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + }, + "workspace_root": { + "type": "string" + } + }, + "required": [ + "workspace_root" + ], + "type": "object" + }, + "EpiphanyRetrievalStatus": { + "enum": [ + "unavailable", + "ready", + "stale", + "indexing" + ], + "type": "string" + }, + "EpiphanyScratchPad": { + "properties": { + "hypothesis": { + "type": [ + "string", + "null" + ] + }, + "next_probe": { + "type": [ + "string", + "null" + ] + }, + "notes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "EpiphanySubgoal": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "status", + "title" + ], + "type": "object" + }, + "EpiphanyThreadState": { + "properties": { + "active_subgoal_id": { + "type": [ + "string", + "null" + ] + }, + "churn": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyChurnState" + }, + { + "type": "null" + } + ] + }, + "graph_checkpoint": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphCheckpoint" + }, + { + "type": "null" + } + ] + }, + "graph_frontier": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphFrontier" + }, + { + "type": "null" + } + ] + }, + "graphs": { + "$ref": "#/definitions/EpiphanyGraphs" + }, + "invariants": { + "items": { + "$ref": "#/definitions/EpiphanyInvariant" + }, + "type": "array" + }, + "last_updated_turn_id": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyModeState" + }, + { + "type": "null" + } + ] + }, + "objective": { + "type": [ + "string", + "null" + ] + }, + "observations": { + "items": { + "$ref": "#/definitions/EpiphanyObservation" + }, + "type": "array" + }, + "recent_evidence": { + "items": { + "$ref": "#/definitions/EpiphanyEvidenceRecord" + }, + "type": "array" + }, + "retrieval": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalState" + }, + { + "type": "null" + } + ] + }, + "revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "scratch": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyScratchPad" + }, + { + "type": "null" + } + ] + }, + "subgoals": { + "items": { + "$ref": "#/definitions/EpiphanySubgoal" + }, + "type": "array" + } + }, + "required": [ + "revision" + ], + "type": "object" + }, "FileUpdateChange": { "properties": { "diff": { @@ -547,6 +1243,14 @@ } ] }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "enum": [ + "plan", + "default" + ], + "type": "string" + }, "NonSteerableTurnKind": { "enum": [ "review", @@ -809,6 +1513,17 @@ "description": "Whether the thread is ephemeral and should not be materialized on disk.", "type": "boolean" }, + "epiphanyState": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyThreadState" + }, + { + "type": "null" + } + ], + "description": "Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and notifications/responses that reuse those hydrated thread payloads." + }, "forkedFromId": { "description": "Source thread id when this thread was created by forking another thread.", "type": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json index 9ba44065..d874ae14 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json @@ -390,6 +390,702 @@ ], "type": "string" }, + "EpiphanyChurnState": { + "properties": { + "diff_pressure": { + "type": "string" + }, + "graph_freshness": { + "type": [ + "string", + "null" + ] + }, + "understanding_status": { + "type": "string" + }, + "unexplained_writes": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "warning": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "diff_pressure", + "understanding_status" + ], + "type": "object" + }, + "EpiphanyCodeRef": { + "properties": { + "end_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "start_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "symbol": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "EpiphanyEvidenceRecord": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyGraph": { + "properties": { + "edges": { + "items": { + "$ref": "#/definitions/EpiphanyGraphEdge" + }, + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/definitions/EpiphanyGraphNode" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphCheckpoint": { + "properties": { + "checkpoint_id": { + "type": "string" + }, + "frontier_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "graph_revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "checkpoint_id", + "graph_revision" + ], + "type": "object" + }, + "EpiphanyGraphEdge": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string" + }, + "label": { + "type": [ + "string", + "null" + ] + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + } + }, + "required": [ + "kind", + "source_id", + "target_id" + ], + "type": "object" + }, + "EpiphanyGraphFrontier": { + "properties": { + "active_edge_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "active_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphLink": { + "properties": { + "architecture_node_id": { + "type": "string" + }, + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "dataflow_node_id": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "architecture_node_id", + "dataflow_node_id" + ], + "type": "object" + }, + "EpiphanyGraphNode": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "metaphor": { + "type": [ + "string", + "null" + ] + }, + "purpose": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "purpose", + "title" + ], + "type": "object" + }, + "EpiphanyGraphs": { + "properties": { + "architecture": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "dataflow": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "links": { + "items": { + "$ref": "#/definitions/EpiphanyGraphLink" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyInvariant": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "rationale": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "status" + ], + "type": "object" + }, + "EpiphanyModeState": { + "properties": { + "kind": { + "anyOf": [ + { + "$ref": "#/definitions/ModeKind" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "EpiphanyObservation": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "evidence_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "source_kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "source_kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyRetrievalShardSummary": { + "properties": { + "exact_available": { + "type": "boolean" + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path_prefix": { + "type": "string" + }, + "semantic_available": { + "type": "boolean" + }, + "shard_id": { + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + } + }, + "required": [ + "path_prefix", + "shard_id" + ], + "type": "object" + }, + "EpiphanyRetrievalState": { + "properties": { + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index_revision": { + "type": [ + "string", + "null" + ] + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "last_indexed_at_unix_seconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semantic_available": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/EpiphanyRetrievalShardSummary" + }, + "type": "array" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + }, + "workspace_root": { + "type": "string" + } + }, + "required": [ + "workspace_root" + ], + "type": "object" + }, + "EpiphanyRetrievalStatus": { + "enum": [ + "unavailable", + "ready", + "stale", + "indexing" + ], + "type": "string" + }, + "EpiphanyScratchPad": { + "properties": { + "hypothesis": { + "type": [ + "string", + "null" + ] + }, + "next_probe": { + "type": [ + "string", + "null" + ] + }, + "notes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "EpiphanySubgoal": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "status", + "title" + ], + "type": "object" + }, + "EpiphanyThreadState": { + "properties": { + "active_subgoal_id": { + "type": [ + "string", + "null" + ] + }, + "churn": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyChurnState" + }, + { + "type": "null" + } + ] + }, + "graph_checkpoint": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphCheckpoint" + }, + { + "type": "null" + } + ] + }, + "graph_frontier": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphFrontier" + }, + { + "type": "null" + } + ] + }, + "graphs": { + "$ref": "#/definitions/EpiphanyGraphs" + }, + "invariants": { + "items": { + "$ref": "#/definitions/EpiphanyInvariant" + }, + "type": "array" + }, + "last_updated_turn_id": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyModeState" + }, + { + "type": "null" + } + ] + }, + "objective": { + "type": [ + "string", + "null" + ] + }, + "observations": { + "items": { + "$ref": "#/definitions/EpiphanyObservation" + }, + "type": "array" + }, + "recent_evidence": { + "items": { + "$ref": "#/definitions/EpiphanyEvidenceRecord" + }, + "type": "array" + }, + "retrieval": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalState" + }, + { + "type": "null" + } + ] + }, + "revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "scratch": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyScratchPad" + }, + { + "type": "null" + } + ] + }, + "subgoals": { + "items": { + "$ref": "#/definitions/EpiphanySubgoal" + }, + "type": "array" + } + }, + "required": [ + "revision" + ], + "type": "object" + }, "FileUpdateChange": { "properties": { "diff": { @@ -547,6 +1243,14 @@ } ] }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "enum": [ + "plan", + "default" + ], + "type": "string" + }, "NonSteerableTurnKind": { "enum": [ "review", @@ -809,6 +1513,17 @@ "description": "Whether the thread is ephemeral and should not be materialized on disk.", "type": "boolean" }, + "epiphanyState": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyThreadState" + }, + { + "type": "null" + } + ], + "description": "Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and notifications/responses that reuse those hydrated thread payloads." + }, "forkedFromId": { "description": "Source thread id when this thread was created by forking another thread.", "type": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json index 710a701f..f845433f 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json @@ -449,6 +449,702 @@ ], "type": "string" }, + "EpiphanyChurnState": { + "properties": { + "diff_pressure": { + "type": "string" + }, + "graph_freshness": { + "type": [ + "string", + "null" + ] + }, + "understanding_status": { + "type": "string" + }, + "unexplained_writes": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "warning": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "diff_pressure", + "understanding_status" + ], + "type": "object" + }, + "EpiphanyCodeRef": { + "properties": { + "end_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "start_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "symbol": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "EpiphanyEvidenceRecord": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyGraph": { + "properties": { + "edges": { + "items": { + "$ref": "#/definitions/EpiphanyGraphEdge" + }, + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/definitions/EpiphanyGraphNode" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphCheckpoint": { + "properties": { + "checkpoint_id": { + "type": "string" + }, + "frontier_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "graph_revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "checkpoint_id", + "graph_revision" + ], + "type": "object" + }, + "EpiphanyGraphEdge": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string" + }, + "label": { + "type": [ + "string", + "null" + ] + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + } + }, + "required": [ + "kind", + "source_id", + "target_id" + ], + "type": "object" + }, + "EpiphanyGraphFrontier": { + "properties": { + "active_edge_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "active_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphLink": { + "properties": { + "architecture_node_id": { + "type": "string" + }, + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "dataflow_node_id": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "architecture_node_id", + "dataflow_node_id" + ], + "type": "object" + }, + "EpiphanyGraphNode": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "metaphor": { + "type": [ + "string", + "null" + ] + }, + "purpose": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "purpose", + "title" + ], + "type": "object" + }, + "EpiphanyGraphs": { + "properties": { + "architecture": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "dataflow": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "links": { + "items": { + "$ref": "#/definitions/EpiphanyGraphLink" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyInvariant": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "rationale": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "status" + ], + "type": "object" + }, + "EpiphanyModeState": { + "properties": { + "kind": { + "anyOf": [ + { + "$ref": "#/definitions/ModeKind" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "EpiphanyObservation": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "evidence_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "source_kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "source_kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyRetrievalShardSummary": { + "properties": { + "exact_available": { + "type": "boolean" + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path_prefix": { + "type": "string" + }, + "semantic_available": { + "type": "boolean" + }, + "shard_id": { + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + } + }, + "required": [ + "path_prefix", + "shard_id" + ], + "type": "object" + }, + "EpiphanyRetrievalState": { + "properties": { + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index_revision": { + "type": [ + "string", + "null" + ] + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "last_indexed_at_unix_seconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semantic_available": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/EpiphanyRetrievalShardSummary" + }, + "type": "array" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + }, + "workspace_root": { + "type": "string" + } + }, + "required": [ + "workspace_root" + ], + "type": "object" + }, + "EpiphanyRetrievalStatus": { + "enum": [ + "unavailable", + "ready", + "stale", + "indexing" + ], + "type": "string" + }, + "EpiphanyScratchPad": { + "properties": { + "hypothesis": { + "type": [ + "string", + "null" + ] + }, + "next_probe": { + "type": [ + "string", + "null" + ] + }, + "notes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "EpiphanySubgoal": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "status", + "title" + ], + "type": "object" + }, + "EpiphanyThreadState": { + "properties": { + "active_subgoal_id": { + "type": [ + "string", + "null" + ] + }, + "churn": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyChurnState" + }, + { + "type": "null" + } + ] + }, + "graph_checkpoint": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphCheckpoint" + }, + { + "type": "null" + } + ] + }, + "graph_frontier": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphFrontier" + }, + { + "type": "null" + } + ] + }, + "graphs": { + "$ref": "#/definitions/EpiphanyGraphs" + }, + "invariants": { + "items": { + "$ref": "#/definitions/EpiphanyInvariant" + }, + "type": "array" + }, + "last_updated_turn_id": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyModeState" + }, + { + "type": "null" + } + ] + }, + "objective": { + "type": [ + "string", + "null" + ] + }, + "observations": { + "items": { + "$ref": "#/definitions/EpiphanyObservation" + }, + "type": "array" + }, + "recent_evidence": { + "items": { + "$ref": "#/definitions/EpiphanyEvidenceRecord" + }, + "type": "array" + }, + "retrieval": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalState" + }, + { + "type": "null" + } + ] + }, + "revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "scratch": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyScratchPad" + }, + { + "type": "null" + } + ] + }, + "subgoals": { + "items": { + "$ref": "#/definitions/EpiphanySubgoal" + }, + "type": "array" + } + }, + "required": [ + "revision" + ], + "type": "object" + }, "FileSystemAccessMode": { "enum": [ "read", @@ -817,6 +1513,14 @@ } ] }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "enum": [ + "plan", + "default" + ], + "type": "string" + }, "NetworkAccess": { "enum": [ "restricted", @@ -1317,6 +2021,17 @@ "description": "Whether the thread is ephemeral and should not be materialized on disk.", "type": "boolean" }, + "epiphanyState": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyThreadState" + }, + { + "type": "null" + } + ], + "description": "Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and notifications/responses that reuse those hydrated thread payloads." + }, "forkedFromId": { "description": "Source thread id when this thread was created by forking another thread.", "type": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json index b531ed04..9fd9a993 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json @@ -390,6 +390,702 @@ ], "type": "string" }, + "EpiphanyChurnState": { + "properties": { + "diff_pressure": { + "type": "string" + }, + "graph_freshness": { + "type": [ + "string", + "null" + ] + }, + "understanding_status": { + "type": "string" + }, + "unexplained_writes": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "warning": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "diff_pressure", + "understanding_status" + ], + "type": "object" + }, + "EpiphanyCodeRef": { + "properties": { + "end_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "start_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "symbol": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "EpiphanyEvidenceRecord": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyGraph": { + "properties": { + "edges": { + "items": { + "$ref": "#/definitions/EpiphanyGraphEdge" + }, + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/definitions/EpiphanyGraphNode" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphCheckpoint": { + "properties": { + "checkpoint_id": { + "type": "string" + }, + "frontier_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "graph_revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "checkpoint_id", + "graph_revision" + ], + "type": "object" + }, + "EpiphanyGraphEdge": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string" + }, + "label": { + "type": [ + "string", + "null" + ] + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + } + }, + "required": [ + "kind", + "source_id", + "target_id" + ], + "type": "object" + }, + "EpiphanyGraphFrontier": { + "properties": { + "active_edge_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "active_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphLink": { + "properties": { + "architecture_node_id": { + "type": "string" + }, + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "dataflow_node_id": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "architecture_node_id", + "dataflow_node_id" + ], + "type": "object" + }, + "EpiphanyGraphNode": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "metaphor": { + "type": [ + "string", + "null" + ] + }, + "purpose": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "purpose", + "title" + ], + "type": "object" + }, + "EpiphanyGraphs": { + "properties": { + "architecture": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "dataflow": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "links": { + "items": { + "$ref": "#/definitions/EpiphanyGraphLink" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyInvariant": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "rationale": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "status" + ], + "type": "object" + }, + "EpiphanyModeState": { + "properties": { + "kind": { + "anyOf": [ + { + "$ref": "#/definitions/ModeKind" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "EpiphanyObservation": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "evidence_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "source_kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "source_kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyRetrievalShardSummary": { + "properties": { + "exact_available": { + "type": "boolean" + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path_prefix": { + "type": "string" + }, + "semantic_available": { + "type": "boolean" + }, + "shard_id": { + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + } + }, + "required": [ + "path_prefix", + "shard_id" + ], + "type": "object" + }, + "EpiphanyRetrievalState": { + "properties": { + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index_revision": { + "type": [ + "string", + "null" + ] + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "last_indexed_at_unix_seconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semantic_available": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/EpiphanyRetrievalShardSummary" + }, + "type": "array" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + }, + "workspace_root": { + "type": "string" + } + }, + "required": [ + "workspace_root" + ], + "type": "object" + }, + "EpiphanyRetrievalStatus": { + "enum": [ + "unavailable", + "ready", + "stale", + "indexing" + ], + "type": "string" + }, + "EpiphanyScratchPad": { + "properties": { + "hypothesis": { + "type": [ + "string", + "null" + ] + }, + "next_probe": { + "type": [ + "string", + "null" + ] + }, + "notes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "EpiphanySubgoal": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "status", + "title" + ], + "type": "object" + }, + "EpiphanyThreadState": { + "properties": { + "active_subgoal_id": { + "type": [ + "string", + "null" + ] + }, + "churn": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyChurnState" + }, + { + "type": "null" + } + ] + }, + "graph_checkpoint": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphCheckpoint" + }, + { + "type": "null" + } + ] + }, + "graph_frontier": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphFrontier" + }, + { + "type": "null" + } + ] + }, + "graphs": { + "$ref": "#/definitions/EpiphanyGraphs" + }, + "invariants": { + "items": { + "$ref": "#/definitions/EpiphanyInvariant" + }, + "type": "array" + }, + "last_updated_turn_id": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyModeState" + }, + { + "type": "null" + } + ] + }, + "objective": { + "type": [ + "string", + "null" + ] + }, + "observations": { + "items": { + "$ref": "#/definitions/EpiphanyObservation" + }, + "type": "array" + }, + "recent_evidence": { + "items": { + "$ref": "#/definitions/EpiphanyEvidenceRecord" + }, + "type": "array" + }, + "retrieval": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalState" + }, + { + "type": "null" + } + ] + }, + "revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "scratch": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyScratchPad" + }, + { + "type": "null" + } + ] + }, + "subgoals": { + "items": { + "$ref": "#/definitions/EpiphanySubgoal" + }, + "type": "array" + } + }, + "required": [ + "revision" + ], + "type": "object" + }, "FileUpdateChange": { "properties": { "diff": { @@ -547,6 +1243,14 @@ } ] }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "enum": [ + "plan", + "default" + ], + "type": "string" + }, "NonSteerableTurnKind": { "enum": [ "review", @@ -809,6 +1513,17 @@ "description": "Whether the thread is ephemeral and should not be materialized on disk.", "type": "boolean" }, + "epiphanyState": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyThreadState" + }, + { + "type": "null" + } + ], + "description": "Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and notifications/responses that reuse those hydrated thread payloads." + }, "forkedFromId": { "description": "Source thread id when this thread was created by forking another thread.", "type": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json index 9fe3bc62..6858a77c 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json @@ -449,6 +449,702 @@ ], "type": "string" }, + "EpiphanyChurnState": { + "properties": { + "diff_pressure": { + "type": "string" + }, + "graph_freshness": { + "type": [ + "string", + "null" + ] + }, + "understanding_status": { + "type": "string" + }, + "unexplained_writes": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "warning": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "diff_pressure", + "understanding_status" + ], + "type": "object" + }, + "EpiphanyCodeRef": { + "properties": { + "end_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "start_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "symbol": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "EpiphanyEvidenceRecord": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyGraph": { + "properties": { + "edges": { + "items": { + "$ref": "#/definitions/EpiphanyGraphEdge" + }, + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/definitions/EpiphanyGraphNode" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphCheckpoint": { + "properties": { + "checkpoint_id": { + "type": "string" + }, + "frontier_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "graph_revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "checkpoint_id", + "graph_revision" + ], + "type": "object" + }, + "EpiphanyGraphEdge": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string" + }, + "label": { + "type": [ + "string", + "null" + ] + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + } + }, + "required": [ + "kind", + "source_id", + "target_id" + ], + "type": "object" + }, + "EpiphanyGraphFrontier": { + "properties": { + "active_edge_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "active_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphLink": { + "properties": { + "architecture_node_id": { + "type": "string" + }, + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "dataflow_node_id": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "architecture_node_id", + "dataflow_node_id" + ], + "type": "object" + }, + "EpiphanyGraphNode": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "metaphor": { + "type": [ + "string", + "null" + ] + }, + "purpose": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "purpose", + "title" + ], + "type": "object" + }, + "EpiphanyGraphs": { + "properties": { + "architecture": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "dataflow": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "links": { + "items": { + "$ref": "#/definitions/EpiphanyGraphLink" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyInvariant": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "rationale": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "status" + ], + "type": "object" + }, + "EpiphanyModeState": { + "properties": { + "kind": { + "anyOf": [ + { + "$ref": "#/definitions/ModeKind" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "EpiphanyObservation": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "evidence_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "source_kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "source_kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyRetrievalShardSummary": { + "properties": { + "exact_available": { + "type": "boolean" + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path_prefix": { + "type": "string" + }, + "semantic_available": { + "type": "boolean" + }, + "shard_id": { + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + } + }, + "required": [ + "path_prefix", + "shard_id" + ], + "type": "object" + }, + "EpiphanyRetrievalState": { + "properties": { + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index_revision": { + "type": [ + "string", + "null" + ] + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "last_indexed_at_unix_seconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semantic_available": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/EpiphanyRetrievalShardSummary" + }, + "type": "array" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + }, + "workspace_root": { + "type": "string" + } + }, + "required": [ + "workspace_root" + ], + "type": "object" + }, + "EpiphanyRetrievalStatus": { + "enum": [ + "unavailable", + "ready", + "stale", + "indexing" + ], + "type": "string" + }, + "EpiphanyScratchPad": { + "properties": { + "hypothesis": { + "type": [ + "string", + "null" + ] + }, + "next_probe": { + "type": [ + "string", + "null" + ] + }, + "notes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "EpiphanySubgoal": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "status", + "title" + ], + "type": "object" + }, + "EpiphanyThreadState": { + "properties": { + "active_subgoal_id": { + "type": [ + "string", + "null" + ] + }, + "churn": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyChurnState" + }, + { + "type": "null" + } + ] + }, + "graph_checkpoint": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphCheckpoint" + }, + { + "type": "null" + } + ] + }, + "graph_frontier": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphFrontier" + }, + { + "type": "null" + } + ] + }, + "graphs": { + "$ref": "#/definitions/EpiphanyGraphs" + }, + "invariants": { + "items": { + "$ref": "#/definitions/EpiphanyInvariant" + }, + "type": "array" + }, + "last_updated_turn_id": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyModeState" + }, + { + "type": "null" + } + ] + }, + "objective": { + "type": [ + "string", + "null" + ] + }, + "observations": { + "items": { + "$ref": "#/definitions/EpiphanyObservation" + }, + "type": "array" + }, + "recent_evidence": { + "items": { + "$ref": "#/definitions/EpiphanyEvidenceRecord" + }, + "type": "array" + }, + "retrieval": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalState" + }, + { + "type": "null" + } + ] + }, + "revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "scratch": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyScratchPad" + }, + { + "type": "null" + } + ] + }, + "subgoals": { + "items": { + "$ref": "#/definitions/EpiphanySubgoal" + }, + "type": "array" + } + }, + "required": [ + "revision" + ], + "type": "object" + }, "FileSystemAccessMode": { "enum": [ "read", @@ -817,6 +1513,14 @@ } ] }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "enum": [ + "plan", + "default" + ], + "type": "string" + }, "NetworkAccess": { "enum": [ "restricted", @@ -1317,6 +2021,17 @@ "description": "Whether the thread is ephemeral and should not be materialized on disk.", "type": "boolean" }, + "epiphanyState": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyThreadState" + }, + { + "type": "null" + } + ], + "description": "Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and notifications/responses that reuse those hydrated thread payloads." + }, "forkedFromId": { "description": "Source thread id when this thread was created by forking another thread.", "type": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json index 165b4a31..cc67decb 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json @@ -390,6 +390,702 @@ ], "type": "string" }, + "EpiphanyChurnState": { + "properties": { + "diff_pressure": { + "type": "string" + }, + "graph_freshness": { + "type": [ + "string", + "null" + ] + }, + "understanding_status": { + "type": "string" + }, + "unexplained_writes": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "warning": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "diff_pressure", + "understanding_status" + ], + "type": "object" + }, + "EpiphanyCodeRef": { + "properties": { + "end_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "start_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "symbol": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "EpiphanyEvidenceRecord": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyGraph": { + "properties": { + "edges": { + "items": { + "$ref": "#/definitions/EpiphanyGraphEdge" + }, + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/definitions/EpiphanyGraphNode" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphCheckpoint": { + "properties": { + "checkpoint_id": { + "type": "string" + }, + "frontier_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "graph_revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "checkpoint_id", + "graph_revision" + ], + "type": "object" + }, + "EpiphanyGraphEdge": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string" + }, + "label": { + "type": [ + "string", + "null" + ] + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + } + }, + "required": [ + "kind", + "source_id", + "target_id" + ], + "type": "object" + }, + "EpiphanyGraphFrontier": { + "properties": { + "active_edge_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "active_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphLink": { + "properties": { + "architecture_node_id": { + "type": "string" + }, + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "dataflow_node_id": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "architecture_node_id", + "dataflow_node_id" + ], + "type": "object" + }, + "EpiphanyGraphNode": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "metaphor": { + "type": [ + "string", + "null" + ] + }, + "purpose": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "purpose", + "title" + ], + "type": "object" + }, + "EpiphanyGraphs": { + "properties": { + "architecture": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "dataflow": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "links": { + "items": { + "$ref": "#/definitions/EpiphanyGraphLink" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyInvariant": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "rationale": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "status" + ], + "type": "object" + }, + "EpiphanyModeState": { + "properties": { + "kind": { + "anyOf": [ + { + "$ref": "#/definitions/ModeKind" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "EpiphanyObservation": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "evidence_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "source_kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "source_kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyRetrievalShardSummary": { + "properties": { + "exact_available": { + "type": "boolean" + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path_prefix": { + "type": "string" + }, + "semantic_available": { + "type": "boolean" + }, + "shard_id": { + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + } + }, + "required": [ + "path_prefix", + "shard_id" + ], + "type": "object" + }, + "EpiphanyRetrievalState": { + "properties": { + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index_revision": { + "type": [ + "string", + "null" + ] + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "last_indexed_at_unix_seconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semantic_available": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/EpiphanyRetrievalShardSummary" + }, + "type": "array" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + }, + "workspace_root": { + "type": "string" + } + }, + "required": [ + "workspace_root" + ], + "type": "object" + }, + "EpiphanyRetrievalStatus": { + "enum": [ + "unavailable", + "ready", + "stale", + "indexing" + ], + "type": "string" + }, + "EpiphanyScratchPad": { + "properties": { + "hypothesis": { + "type": [ + "string", + "null" + ] + }, + "next_probe": { + "type": [ + "string", + "null" + ] + }, + "notes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "EpiphanySubgoal": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "status", + "title" + ], + "type": "object" + }, + "EpiphanyThreadState": { + "properties": { + "active_subgoal_id": { + "type": [ + "string", + "null" + ] + }, + "churn": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyChurnState" + }, + { + "type": "null" + } + ] + }, + "graph_checkpoint": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphCheckpoint" + }, + { + "type": "null" + } + ] + }, + "graph_frontier": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphFrontier" + }, + { + "type": "null" + } + ] + }, + "graphs": { + "$ref": "#/definitions/EpiphanyGraphs" + }, + "invariants": { + "items": { + "$ref": "#/definitions/EpiphanyInvariant" + }, + "type": "array" + }, + "last_updated_turn_id": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyModeState" + }, + { + "type": "null" + } + ] + }, + "objective": { + "type": [ + "string", + "null" + ] + }, + "observations": { + "items": { + "$ref": "#/definitions/EpiphanyObservation" + }, + "type": "array" + }, + "recent_evidence": { + "items": { + "$ref": "#/definitions/EpiphanyEvidenceRecord" + }, + "type": "array" + }, + "retrieval": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalState" + }, + { + "type": "null" + } + ] + }, + "revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "scratch": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyScratchPad" + }, + { + "type": "null" + } + ] + }, + "subgoals": { + "items": { + "$ref": "#/definitions/EpiphanySubgoal" + }, + "type": "array" + } + }, + "required": [ + "revision" + ], + "type": "object" + }, "FileUpdateChange": { "properties": { "diff": { @@ -547,6 +1243,14 @@ } ] }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "enum": [ + "plan", + "default" + ], + "type": "string" + }, "NonSteerableTurnKind": { "enum": [ "review", @@ -809,6 +1513,17 @@ "description": "Whether the thread is ephemeral and should not be materialized on disk.", "type": "boolean" }, + "epiphanyState": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyThreadState" + }, + { + "type": "null" + } + ], + "description": "Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and notifications/responses that reuse those hydrated thread payloads." + }, "forkedFromId": { "description": "Source thread id when this thread was created by forking another thread.", "type": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json index 0b414ef4..caeb73e4 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json @@ -390,6 +390,702 @@ ], "type": "string" }, + "EpiphanyChurnState": { + "properties": { + "diff_pressure": { + "type": "string" + }, + "graph_freshness": { + "type": [ + "string", + "null" + ] + }, + "understanding_status": { + "type": "string" + }, + "unexplained_writes": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "warning": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "diff_pressure", + "understanding_status" + ], + "type": "object" + }, + "EpiphanyCodeRef": { + "properties": { + "end_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "start_line": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "symbol": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "EpiphanyEvidenceRecord": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyGraph": { + "properties": { + "edges": { + "items": { + "$ref": "#/definitions/EpiphanyGraphEdge" + }, + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/definitions/EpiphanyGraphNode" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphCheckpoint": { + "properties": { + "checkpoint_id": { + "type": "string" + }, + "frontier_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "graph_revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "checkpoint_id", + "graph_revision" + ], + "type": "object" + }, + "EpiphanyGraphEdge": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string" + }, + "label": { + "type": [ + "string", + "null" + ] + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": "string" + }, + "target_id": { + "type": "string" + } + }, + "required": [ + "kind", + "source_id", + "target_id" + ], + "type": "object" + }, + "EpiphanyGraphFrontier": { + "properties": { + "active_edge_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "active_node_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_gap_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "open_question_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyGraphLink": { + "properties": { + "architecture_node_id": { + "type": "string" + }, + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "dataflow_node_id": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "architecture_node_id", + "dataflow_node_id" + ], + "type": "object" + }, + "EpiphanyGraphNode": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "mechanism": { + "type": [ + "string", + "null" + ] + }, + "metaphor": { + "type": [ + "string", + "null" + ] + }, + "purpose": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "purpose", + "title" + ], + "type": "object" + }, + "EpiphanyGraphs": { + "properties": { + "architecture": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "dataflow": { + "$ref": "#/definitions/EpiphanyGraph" + }, + "links": { + "items": { + "$ref": "#/definitions/EpiphanyGraphLink" + }, + "type": "array" + } + }, + "type": "object" + }, + "EpiphanyInvariant": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "rationale": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "status" + ], + "type": "object" + }, + "EpiphanyModeState": { + "properties": { + "kind": { + "anyOf": [ + { + "$ref": "#/definitions/ModeKind" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "EpiphanyObservation": { + "properties": { + "code_refs": { + "items": { + "$ref": "#/definitions/EpiphanyCodeRef" + }, + "type": "array" + }, + "evidence_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "source_kind": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "required": [ + "id", + "source_kind", + "status", + "summary" + ], + "type": "object" + }, + "EpiphanyRetrievalShardSummary": { + "properties": { + "exact_available": { + "type": "boolean" + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "path_prefix": { + "type": "string" + }, + "semantic_available": { + "type": "boolean" + }, + "shard_id": { + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + } + }, + "required": [ + "path_prefix", + "shard_id" + ], + "type": "object" + }, + "EpiphanyRetrievalState": { + "properties": { + "dirty_paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index_revision": { + "type": [ + "string", + "null" + ] + }, + "indexed_chunk_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "indexed_file_count": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "last_indexed_at_unix_seconds": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "semantic_available": { + "type": "boolean" + }, + "shards": { + "items": { + "$ref": "#/definitions/EpiphanyRetrievalShardSummary" + }, + "type": "array" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalStatus" + } + ], + "default": "unavailable" + }, + "workspace_root": { + "type": "string" + } + }, + "required": [ + "workspace_root" + ], + "type": "object" + }, + "EpiphanyRetrievalStatus": { + "enum": [ + "unavailable", + "ready", + "stale", + "indexing" + ], + "type": "string" + }, + "EpiphanyScratchPad": { + "properties": { + "hypothesis": { + "type": [ + "string", + "null" + ] + }, + "next_probe": { + "type": [ + "string", + "null" + ] + }, + "notes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "summary": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "EpiphanySubgoal": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "summary": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "status", + "title" + ], + "type": "object" + }, + "EpiphanyThreadState": { + "properties": { + "active_subgoal_id": { + "type": [ + "string", + "null" + ] + }, + "churn": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyChurnState" + }, + { + "type": "null" + } + ] + }, + "graph_checkpoint": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphCheckpoint" + }, + { + "type": "null" + } + ] + }, + "graph_frontier": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyGraphFrontier" + }, + { + "type": "null" + } + ] + }, + "graphs": { + "$ref": "#/definitions/EpiphanyGraphs" + }, + "invariants": { + "items": { + "$ref": "#/definitions/EpiphanyInvariant" + }, + "type": "array" + }, + "last_updated_turn_id": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyModeState" + }, + { + "type": "null" + } + ] + }, + "objective": { + "type": [ + "string", + "null" + ] + }, + "observations": { + "items": { + "$ref": "#/definitions/EpiphanyObservation" + }, + "type": "array" + }, + "recent_evidence": { + "items": { + "$ref": "#/definitions/EpiphanyEvidenceRecord" + }, + "type": "array" + }, + "retrieval": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyRetrievalState" + }, + { + "type": "null" + } + ] + }, + "revision": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "scratch": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyScratchPad" + }, + { + "type": "null" + } + ] + }, + "subgoals": { + "items": { + "$ref": "#/definitions/EpiphanySubgoal" + }, + "type": "array" + } + }, + "required": [ + "revision" + ], + "type": "object" + }, "FileUpdateChange": { "properties": { "diff": { @@ -547,6 +1243,14 @@ } ] }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "enum": [ + "plan", + "default" + ], + "type": "string" + }, "NonSteerableTurnKind": { "enum": [ "review", @@ -809,6 +1513,17 @@ "description": "Whether the thread is ephemeral and should not be materialized on disk.", "type": "boolean" }, + "epiphanyState": { + "anyOf": [ + { + "$ref": "#/definitions/EpiphanyThreadState" + }, + { + "type": "null" + } + ], + "description": "Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and notifications/responses that reuse those hydrated thread payloads." + }, "forkedFromId": { "description": "Source thread id when this thread was created by forking another thread.", "type": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/EpiphanyRetrievalStatus.ts b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/EpiphanyRetrievalStatus.ts new file mode 100644 index 00000000..8e1b6616 --- /dev/null +++ b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/EpiphanyRetrievalStatus.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type EpiphanyRetrievalStatus = "unavailable" | "ready" | "stale" | "indexing"; diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/EpiphanyThreadState.ts b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/EpiphanyThreadState.ts new file mode 100644 index 00000000..d5ef75b8 --- /dev/null +++ b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/EpiphanyThreadState.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type EpiphanyThreadState = { revision: bigint, objective?: string | null, active_subgoal_id?: string | null, subgoals?: Array, invariants?: Array, graphs?: EpiphanyGraphs, graph_frontier?: EpiphanyGraphFrontier | null, graph_checkpoint?: EpiphanyGraphCheckpoint | null, retrieval?: EpiphanyRetrievalState | null, scratch?: EpiphanyScratchPad | null, observations?: Array, recent_evidence?: Array, churn?: EpiphanyChurnState | null, mode?: EpiphanyModeState | null, last_updated_turn_id?: string | null, }; diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/index.ts b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/index.ts index 7bbb417f..0d647352 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/index.ts +++ b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/index.ts @@ -12,6 +12,8 @@ export type { CollaborationMode } from "./CollaborationMode"; export type { ContentItem } from "./ContentItem"; export type { ConversationGitInfo } from "./ConversationGitInfo"; export type { ConversationSummary } from "./ConversationSummary"; +export type { EpiphanyRetrievalStatus } from "./EpiphanyRetrievalStatus"; +export type { EpiphanyThreadState } from "./EpiphanyThreadState"; export type { ExecCommandApprovalParams } from "./ExecCommandApprovalParams"; export type { ExecCommandApprovalResponse } from "./ExecCommandApprovalResponse"; export type { ExecPolicyAmendment } from "./ExecPolicyAmendment"; diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/Thread.ts b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/Thread.ts index 8c4c9394..324805ac 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/Thread.ts +++ b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/Thread.ts @@ -2,6 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; +import type { EpiphanyThreadState } from "../EpiphanyThreadState"; import type { GitInfo } from "./GitInfo"; import type { SessionSource } from "./SessionSource"; import type { ThreadStatus } from "./ThreadStatus"; @@ -68,6 +69,11 @@ gitInfo: GitInfo | null, * Optional user-facing thread title. */ name: string | null, +/** + * Only populated on `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, + * and notifications/responses that reuse those hydrated thread payloads. + */ +epiphanyState?: EpiphanyThreadState, /** * Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` * (when `includeTurns` is true) responses. diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveIndexSummary.ts b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveIndexSummary.ts new file mode 100644 index 00000000..041080b2 --- /dev/null +++ b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveIndexSummary.ts @@ -0,0 +1,8 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AbsolutePathBuf } from "../AbsolutePathBuf"; +import type { EpiphanyRetrievalStatus } from "../EpiphanyRetrievalStatus"; +import type { ThreadEpiphanyRetrieveShardSummary } from "./ThreadEpiphanyRetrieveShardSummary"; + +export type ThreadEpiphanyRetrieveIndexSummary = { workspaceRoot: AbsolutePathBuf, indexRevision: string | null, status: EpiphanyRetrievalStatus, semanticAvailable: boolean, lastIndexedAtUnixSeconds: number | null, indexedFileCount: number | null, indexedChunkCount: number | null, shards: Array, dirtyPaths: Array, }; diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveResult.ts b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveResult.ts new file mode 100644 index 00000000..7574bdfb --- /dev/null +++ b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveResult.ts @@ -0,0 +1,6 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ThreadEpiphanyRetrieveResultKind } from "./ThreadEpiphanyRetrieveResultKind"; + +export type ThreadEpiphanyRetrieveResult = { kind: ThreadEpiphanyRetrieveResultKind, path: string, score: number, lineStart: number | null, lineEnd: number | null, excerpt: string | null, }; diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveResultKind.ts b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveResultKind.ts new file mode 100644 index 00000000..5437ec44 --- /dev/null +++ b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveResultKind.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ThreadEpiphanyRetrieveResultKind = "exactFile" | "exactDirectory" | "semanticChunk"; diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveShardSummary.ts b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveShardSummary.ts new file mode 100644 index 00000000..17388146 --- /dev/null +++ b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/ThreadEpiphanyRetrieveShardSummary.ts @@ -0,0 +1,6 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { EpiphanyRetrievalStatus } from "../EpiphanyRetrievalStatus"; + +export type ThreadEpiphanyRetrieveShardSummary = { shardId: string, pathPrefix: string, indexedFileCount: number | null, indexedChunkCount: number | null, status: EpiphanyRetrievalStatus, exactAvailable: boolean, semanticAvailable: boolean, }; diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/index.ts b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/index.ts index aa0ed36d..b8a561dd 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/index.ts +++ b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/index.ts @@ -317,6 +317,10 @@ export type { ThreadArchivedNotification } from "./ThreadArchivedNotification"; export type { ThreadClosedNotification } from "./ThreadClosedNotification"; export type { ThreadCompactStartParams } from "./ThreadCompactStartParams"; export type { ThreadCompactStartResponse } from "./ThreadCompactStartResponse"; +export type { ThreadEpiphanyRetrieveIndexSummary } from "./ThreadEpiphanyRetrieveIndexSummary"; +export type { ThreadEpiphanyRetrieveResult } from "./ThreadEpiphanyRetrieveResult"; +export type { ThreadEpiphanyRetrieveResultKind } from "./ThreadEpiphanyRetrieveResultKind"; +export type { ThreadEpiphanyRetrieveShardSummary } from "./ThreadEpiphanyRetrieveShardSummary"; export type { ThreadForkParams } from "./ThreadForkParams"; export type { ThreadForkResponse } from "./ThreadForkResponse"; export type { ThreadInjectItemsParams } from "./ThreadInjectItemsParams"; diff --git a/vendor/codex/codex-rs/app-server-protocol/src/export.rs b/vendor/codex/codex-rs/app-server-protocol/src/export.rs index 96bb8d17..c2deb4d8 100644 --- a/vendor/codex/codex-rs/app-server-protocol/src/export.rs +++ b/vendor/codex/codex-rs/app-server-protocol/src/export.rs @@ -2113,6 +2113,9 @@ mod tests { .is_some_and(|stem| { stem.ends_with("Params") || stem == "InitializeCapabilities" + // EpiphanyThreadState is durable sparse state rather than a conventional + // request/response envelope, so optional fields are intentional there. + || stem == "EpiphanyThreadState" || matches!( stem, "CollabAgentRef" diff --git a/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs b/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs index a15fbc48..c4cfc328 100644 --- a/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs +++ b/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs @@ -336,6 +336,11 @@ client_request_definitions! { params: v2::ThreadReadParams, response: v2::ThreadReadResponse, }, + #[experimental("thread/epiphany/retrieve")] + ThreadEpiphanyRetrieve => "thread/epiphany/retrieve" { + params: v2::ThreadEpiphanyRetrieveParams, + response: v2::ThreadEpiphanyRetrieveResponse, + }, ThreadTurnsList => "thread/turns/list" { params: v2::ThreadTurnsListParams, response: v2::ThreadTurnsListResponse, @@ -1547,6 +1552,88 @@ mod tests { Ok(()) } + #[test] + fn serialize_thread_epiphany_retrieve_response() -> Result<()> { + let response = ClientResponse::ThreadEpiphanyRetrieve { + request_id: RequestId::Integer(8), + response: v2::ThreadEpiphanyRetrieveResponse { + query: "checkpoint frontier".to_string(), + index_summary: v2::ThreadEpiphanyRetrieveIndexSummary { + workspace_root: absolute_path("/workspace"), + index_revision: Some("query-time-bm25-v1".to_string()), + status: codex_protocol::protocol::EpiphanyRetrievalStatus::Ready, + semantic_available: true, + last_indexed_at_unix_seconds: Some(1_744_500_000), + indexed_file_count: Some(12), + indexed_chunk_count: Some(34), + shards: vec![v2::ThreadEpiphanyRetrieveShardSummary { + shard_id: "workspace".to_string(), + path_prefix: PathBuf::from("."), + indexed_file_count: Some(12), + indexed_chunk_count: Some(34), + status: codex_protocol::protocol::EpiphanyRetrievalStatus::Ready, + exact_available: true, + semantic_available: true, + }], + dirty_paths: vec![PathBuf::from("src/session/mod.rs")], + }, + results: vec![v2::ThreadEpiphanyRetrieveResult { + kind: v2::ThreadEpiphanyRetrieveResultKind::SemanticChunk, + path: PathBuf::from("notes/design.md"), + score: 2.5, + line_start: Some(3), + line_end: Some(9), + excerpt: Some("checkpoint frontier".to_string()), + }], + }, + }; + + assert_eq!(response.id(), &RequestId::Integer(8)); + assert_eq!(response.method(), "thread/epiphany/retrieve"); + assert_eq!( + json!({ + "method": "thread/epiphany/retrieve", + "id": 8, + "response": { + "query": "checkpoint frontier", + "indexSummary": { + "workspaceRoot": absolute_path_string("workspace"), + "indexRevision": "query-time-bm25-v1", + "status": "ready", + "semanticAvailable": true, + "lastIndexedAtUnixSeconds": 1744500000, + "indexedFileCount": 12, + "indexedChunkCount": 34, + "shards": [ + { + "shardId": "workspace", + "pathPrefix": ".", + "indexedFileCount": 12, + "indexedChunkCount": 34, + "status": "ready", + "exactAvailable": true, + "semanticAvailable": true + } + ], + "dirtyPaths": ["src/session/mod.rs"] + }, + "results": [ + { + "kind": "semanticChunk", + "path": "notes/design.md", + "score": 2.5, + "lineStart": 3, + "lineEnd": 9, + "excerpt": "checkpoint frontier" + } + ] + } + }), + serde_json::to_value(&response)?, + ); + Ok(()) + } + #[test] fn serialize_config_requirements_read() -> Result<()> { let request = ClientRequest::ConfigRequirementsRead { @@ -2042,6 +2129,22 @@ mod tests { let reason = crate::experimental_api::ExperimentalApi::experimental_reason(&request); assert_eq!(reason, Some("mock/experimentalMethod")); } + + #[test] + fn thread_epiphany_retrieve_is_marked_experimental() { + let request = ClientRequest::ThreadEpiphanyRetrieve { + request_id: RequestId::Integer(1), + params: v2::ThreadEpiphanyRetrieveParams { + thread_id: "thr_123".to_string(), + query: "checkpoint frontier".to_string(), + limit: Some(5), + path_prefixes: vec![PathBuf::from("notes")], + }, + }; + let reason = crate::experimental_api::ExperimentalApi::experimental_reason(&request); + assert_eq!(reason, Some("thread/epiphany/retrieve")); + } + #[test] fn thread_realtime_start_is_marked_experimental() { let request = ClientRequest::ThreadRealtimeStart { diff --git a/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs b/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs index 82b540c1..03df20f7 100644 --- a/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs +++ b/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs @@ -57,6 +57,7 @@ use codex_protocol::protocol::AgentStatus as CoreAgentStatus; use codex_protocol::protocol::AskForApproval as CoreAskForApproval; use codex_protocol::protocol::CodexErrorInfo as CoreCodexErrorInfo; use codex_protocol::protocol::CreditsSnapshot as CoreCreditsSnapshot; +use codex_protocol::protocol::EpiphanyRetrievalStatus as CoreEpiphanyRetrievalStatus; use codex_protocol::protocol::EpiphanyThreadState as CoreEpiphanyThreadState; use codex_protocol::protocol::ExecCommandSource as CoreExecCommandSource; use codex_protocol::protocol::ExecCommandStatus as CoreExecCommandStatus; @@ -3903,6 +3904,83 @@ pub struct ThreadReadResponse { pub thread: Thread, } +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] +#[serde(rename_all = "camelCase")] +#[ts(export_to = "v2/")] +pub struct ThreadEpiphanyRetrieveParams { + pub thread_id: String, + pub query: String, + #[ts(optional = nullable)] + pub limit: Option, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub path_prefixes: Vec, +} + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] +#[serde(rename_all = "camelCase")] +#[ts(export_to = "v2/")] +pub struct ThreadEpiphanyRetrieveResponse { + pub query: String, + pub index_summary: ThreadEpiphanyRetrieveIndexSummary, + pub results: Vec, +} + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] +#[serde(rename_all = "camelCase")] +#[ts(export_to = "v2/")] +pub struct ThreadEpiphanyRetrieveIndexSummary { + pub workspace_root: AbsolutePathBuf, + pub index_revision: Option, + pub status: CoreEpiphanyRetrievalStatus, + pub semantic_available: bool, + #[ts(type = "number | null")] + pub last_indexed_at_unix_seconds: Option, + #[ts(type = "number | null")] + pub indexed_file_count: Option, + #[ts(type = "number | null")] + pub indexed_chunk_count: Option, + pub shards: Vec, + pub dirty_paths: Vec, +} + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] +#[serde(rename_all = "camelCase")] +#[ts(export_to = "v2/")] +pub struct ThreadEpiphanyRetrieveShardSummary { + pub shard_id: String, + pub path_prefix: PathBuf, + #[ts(type = "number | null")] + pub indexed_file_count: Option, + #[ts(type = "number | null")] + pub indexed_chunk_count: Option, + pub status: CoreEpiphanyRetrievalStatus, + pub exact_available: bool, + pub semantic_available: bool, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] +#[serde(rename_all = "camelCase")] +#[ts(rename_all = "camelCase", export_to = "v2/")] +pub enum ThreadEpiphanyRetrieveResultKind { + ExactFile, + ExactDirectory, + SemanticChunk, +} + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] +#[serde(rename_all = "camelCase")] +#[ts(export_to = "v2/")] +pub struct ThreadEpiphanyRetrieveResult { + pub kind: ThreadEpiphanyRetrieveResultKind, + pub path: PathBuf, + pub score: f32, + #[ts(type = "number | null")] + pub line_start: Option, + #[ts(type = "number | null")] + pub line_end: Option, + pub excerpt: Option, +} + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] #[serde(rename_all = "camelCase")] #[ts(export_to = "v2/")] diff --git a/vendor/codex/codex-rs/app-server/README.md b/vendor/codex/codex-rs/app-server/README.md index 46f242dd..65d6450a 100644 --- a/vendor/codex/codex-rs/app-server/README.md +++ b/vendor/codex/codex-rs/app-server/README.md @@ -136,7 +136,11 @@ Example with notification opt-out: ## API Overview -Hydrated thread responses such as `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and `thread/unarchive` may include `thread.epiphanyState` when the thread has persisted Epiphany state. When the thread is currently loaded, app-server prefers the live in-memory value; otherwise it reconstructs the latest surviving snapshot from rollout items using the same rollback/compaction semantics as core session replay. +Hydrated thread responses such as `thread/start`, `thread/resume`, `thread/fork`, `thread/read`, and `thread/unarchive` may include `thread.epiphanyState` when the thread has persisted Epiphany state. When the thread is currently loaded, app-server prefers the live in-memory value; otherwise it reconstructs the latest surviving snapshot from rollout items using the same rollback/compaction semantics as core session replay. For live threads with Epiphany state but no persisted retrieval summary yet, app-server backfills a lightweight query-time retrieval summary instead of pretending the retrieval field is absent. + +Experimental Epiphany retrieval: + +- `thread/epiphany/retrieve` runs a loaded-thread-only hybrid repo query that combines `codex_file_search` path hits with BM25 chunk retrieval and returns typed result metadata plus an Epiphany retrieval summary. - `thread/start` — create a new thread; emits `thread/started` (including the current `thread.status`) and auto-subscribes you to turn/item events for that thread. When the request includes a `cwd` and the resolved sandbox is `workspace-write` or full access, app-server also marks that project as trusted in the user `config.toml`. Pass `sessionStartSource: "clear"` when starting a replacement thread after clearing the current session so `SessionStart` hooks receive `source: "clear"` instead of the default `"startup"`. For permissions, prefer `permissionProfile`; the legacy `sandbox` shorthand is still accepted but cannot be combined with `permissionProfile`. - `thread/resume` — reopen an existing thread by id so subsequent `turn/start` calls append to it. Accepts the same permission override rules as `thread/start`. diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs index fd3c199e..2e88201e 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs @@ -146,6 +146,12 @@ use codex_app_server_protocol::ThreadCompactStartParams; use codex_app_server_protocol::ThreadCompactStartResponse; use codex_app_server_protocol::ThreadDecrementElicitationParams; use codex_app_server_protocol::ThreadDecrementElicitationResponse; +use codex_app_server_protocol::ThreadEpiphanyRetrieveIndexSummary; +use codex_app_server_protocol::ThreadEpiphanyRetrieveParams; +use codex_app_server_protocol::ThreadEpiphanyRetrieveResponse; +use codex_app_server_protocol::ThreadEpiphanyRetrieveResult; +use codex_app_server_protocol::ThreadEpiphanyRetrieveResultKind; +use codex_app_server_protocol::ThreadEpiphanyRetrieveShardSummary; use codex_app_server_protocol::ThreadForkParams; use codex_app_server_protocol::ThreadForkResponse; use codex_app_server_protocol::ThreadIncrementElicitationParams; @@ -220,6 +226,12 @@ use codex_chatgpt::connectors; use codex_config::types::McpServerTransportConfig; use codex_core::CodexThread; use codex_core::CodexThreadTurnContextOverrides; +use codex_core::EPIPHANY_RETRIEVAL_DEFAULT_LIMIT; +use codex_core::EPIPHANY_RETRIEVAL_MAX_LIMIT; +use codex_core::EpiphanyRetrieveQuery; +use codex_core::EpiphanyRetrieveResponse as CoreEpiphanyRetrieveResponse; +use codex_core::EpiphanyRetrieveResult as CoreEpiphanyRetrieveResult; +use codex_core::EpiphanyRetrieveResultKind as CoreEpiphanyRetrieveResultKind; use codex_core::ForkSnapshot; use codex_core::NewThread; use codex_core::RolloutRecorder; @@ -952,6 +964,10 @@ impl CodexMessageProcessor { self.thread_read(to_connection_request_id(request_id), params) .await; } + ClientRequest::ThreadEpiphanyRetrieve { request_id, params } => { + self.thread_epiphany_retrieve(to_connection_request_id(request_id), params) + .await; + } ClientRequest::ThreadTurnsList { request_id, params } => { self.thread_turns_list(to_connection_request_id(request_id), params) .await; @@ -3990,6 +4006,82 @@ impl CodexMessageProcessor { self.outgoing.send_response(request_id, response).await; } + async fn thread_epiphany_retrieve( + &self, + request_id: ConnectionRequestId, + params: ThreadEpiphanyRetrieveParams, + ) { + let ThreadEpiphanyRetrieveParams { + thread_id, + query, + limit, + path_prefixes, + } = params; + + let thread_uuid = match ThreadId::from_string(&thread_id) { + Ok(id) => id, + Err(err) => { + self.send_invalid_request_error(request_id, format!("invalid thread id: {err}")) + .await; + return; + } + }; + + let query = query.trim().to_string(); + if query.is_empty() { + self.send_invalid_request_error(request_id, "query must not be empty".to_string()) + .await; + return; + } + + if matches!(limit, Some(0)) { + self.send_invalid_request_error( + request_id, + "limit must be greater than zero".to_string(), + ) + .await; + return; + } + + let thread = match self.thread_manager.get_thread(thread_uuid).await { + Ok(thread) => thread, + Err(_) => { + self.send_invalid_request_error( + request_id, + format!("thread not loaded: {thread_uuid}"), + ) + .await; + return; + } + }; + + let limit = limit + .map(|value| value as usize) + .unwrap_or(EPIPHANY_RETRIEVAL_DEFAULT_LIMIT) + .clamp(1, EPIPHANY_RETRIEVAL_MAX_LIMIT); + let response = match thread + .epiphany_retrieve(EpiphanyRetrieveQuery { + query, + limit, + path_prefixes, + }) + .await + .and_then(map_epiphany_retrieve_response) + { + Ok(response) => response, + Err(err) => { + self.send_internal_error( + request_id, + format!("failed to retrieve Epiphany results for {thread_uuid}: {err}"), + ) + .await; + return; + } + }; + + self.outgoing.send_response(request_id, response).await; + } + /// Builds the API view for `thread/read` from persisted metadata plus optional live state. async fn read_thread_view( &self, @@ -4113,7 +4205,7 @@ impl CodexMessageProcessor { loaded_thread: Option<&Arc>, ) -> Result<(), ThreadReadViewError> { if let Some(loaded_thread) = loaded_thread { - thread.epiphany_state = loaded_thread.epiphany_state().await; + thread.epiphany_state = live_thread_epiphany_state(loaded_thread).await; return Ok(()); } @@ -4938,7 +5030,7 @@ impl CodexMessageProcessor { ) .await?; self.attach_thread_name(thread_id, &mut thread).await; - thread.epiphany_state = live_thread.epiphany_state().await; + thread.epiphany_state = live_thread_epiphany_state(live_thread).await; Ok(thread) } @@ -5210,7 +5302,7 @@ impl CodexMessageProcessor { return; } - thread.epiphany_state = forked_thread.epiphany_state().await; + thread.epiphany_state = live_thread_epiphany_state(forked_thread.as_ref()).await; self.thread_watch_manager .upsert_thread_silently(thread.clone()) @@ -7555,7 +7647,8 @@ impl CodexMessageProcessor { match read_summary_from_rollout(rollout_path.as_path(), fallback_provider).await { Ok(summary) => { let mut thread = summary_to_thread(summary, &self.config.cwd); - thread.epiphany_state = review_thread.epiphany_state().await; + thread.epiphany_state = + live_thread_epiphany_state(review_thread.as_ref()).await; self.thread_watch_manager .upsert_thread_silently(thread.clone()) .await; @@ -9896,6 +9989,82 @@ fn build_thread_from_snapshot( } } +async fn live_thread_epiphany_state(thread: &CodexThread) -> Option { + let mut epiphany_state = thread.epiphany_state().await; + if let Some(state) = epiphany_state.as_mut() + && state.retrieval.is_none() + { + state.retrieval = Some(thread.epiphany_retrieval_state().await); + } + epiphany_state +} + +fn map_epiphany_retrieve_response( + response: CoreEpiphanyRetrieveResponse, +) -> anyhow::Result { + Ok(ThreadEpiphanyRetrieveResponse { + query: response.query, + index_summary: map_epiphany_retrieve_index_summary(response.index_summary)?, + results: response + .results + .into_iter() + .map(map_epiphany_retrieve_result) + .collect(), + }) +} + +fn map_epiphany_retrieve_index_summary( + summary: codex_protocol::protocol::EpiphanyRetrievalState, +) -> anyhow::Result { + Ok(ThreadEpiphanyRetrieveIndexSummary { + workspace_root: AbsolutePathBuf::from_absolute_path(summary.workspace_root) + .map_err(anyhow::Error::from)?, + index_revision: summary.index_revision, + status: summary.status, + semantic_available: summary.semantic_available, + last_indexed_at_unix_seconds: summary.last_indexed_at_unix_seconds, + indexed_file_count: summary.indexed_file_count, + indexed_chunk_count: summary.indexed_chunk_count, + shards: summary + .shards + .into_iter() + .map(|shard| ThreadEpiphanyRetrieveShardSummary { + shard_id: shard.shard_id, + path_prefix: shard.path_prefix, + indexed_file_count: shard.indexed_file_count, + indexed_chunk_count: shard.indexed_chunk_count, + status: shard.status, + exact_available: shard.exact_available, + semantic_available: shard.semantic_available, + }) + .collect(), + dirty_paths: summary.dirty_paths, + }) +} + +fn map_epiphany_retrieve_result( + result: CoreEpiphanyRetrieveResult, +) -> ThreadEpiphanyRetrieveResult { + ThreadEpiphanyRetrieveResult { + kind: match result.kind { + CoreEpiphanyRetrieveResultKind::ExactFile => { + ThreadEpiphanyRetrieveResultKind::ExactFile + } + CoreEpiphanyRetrieveResultKind::ExactDirectory => { + ThreadEpiphanyRetrieveResultKind::ExactDirectory + } + CoreEpiphanyRetrieveResultKind::SemanticChunk => { + ThreadEpiphanyRetrieveResultKind::SemanticChunk + } + }, + path: result.path, + score: result.score, + line_start: result.line_start, + line_end: result.line_end, + excerpt: result.excerpt, + } +} + pub(crate) fn summary_to_thread( summary: ConversationSummary, fallback_cwd: &AbsolutePathBuf, @@ -11070,6 +11239,54 @@ mod tests { Ok(()) } + #[test] + fn map_epiphany_retrieve_response_preserves_summary_and_results() -> Result<()> { + let response = map_epiphany_retrieve_response(codex_core::EpiphanyRetrieveResponse { + query: "checkpoint frontier".to_string(), + index_summary: codex_protocol::protocol::EpiphanyRetrievalState { + workspace_root: test_path_buf("/repo"), + index_revision: Some("query-time-bm25-v1".to_string()), + status: codex_protocol::protocol::EpiphanyRetrievalStatus::Ready, + semantic_available: true, + last_indexed_at_unix_seconds: Some(1_744_500_000), + indexed_file_count: Some(12), + indexed_chunk_count: Some(34), + shards: vec![codex_protocol::protocol::EpiphanyRetrievalShardSummary { + shard_id: "workspace".to_string(), + path_prefix: PathBuf::from("."), + indexed_file_count: Some(12), + indexed_chunk_count: Some(34), + status: codex_protocol::protocol::EpiphanyRetrievalStatus::Ready, + exact_available: true, + semantic_available: true, + }], + dirty_paths: vec![PathBuf::from("src/session/mod.rs")], + }, + results: vec![codex_core::EpiphanyRetrieveResult { + kind: codex_core::EpiphanyRetrieveResultKind::SemanticChunk, + path: PathBuf::from("notes/design.md"), + score: 2.5, + line_start: Some(3), + line_end: Some(9), + excerpt: Some("checkpoint frontier".to_string()), + }], + })?; + + assert_eq!(response.query, "checkpoint frontier"); + assert_eq!( + response.index_summary.workspace_root, + test_path_buf("/repo").abs() + ); + assert_eq!(response.index_summary.indexed_chunk_count, Some(34)); + assert_eq!(response.results.len(), 1); + assert_eq!( + response.results[0].kind, + ThreadEpiphanyRetrieveResultKind::SemanticChunk + ); + assert_eq!(response.results[0].path, PathBuf::from("notes/design.md")); + Ok(()) + } + #[tokio::test] async fn aborting_pending_request_clears_pending_state() -> Result<()> { let thread_id = ThreadId::from_string("bfd12a78-5900-467b-9bc5-d3d35df08191")?; diff --git a/vendor/codex/codex-rs/core/Cargo.toml b/vendor/codex/codex-rs/core/Cargo.toml index dccd1f9c..2e42ca8f 100644 --- a/vendor/codex/codex-rs/core/Cargo.toml +++ b/vendor/codex/codex-rs/core/Cargo.toml @@ -38,6 +38,7 @@ codex-core-skills = { workspace = true } codex-exec-server = { workspace = true } codex-features = { workspace = true } codex-feedback = { workspace = true } +codex-file-search = { workspace = true } codex-login = { workspace = true } codex-mcp = { workspace = true } codex-model-provider-info = { workspace = true } @@ -83,6 +84,7 @@ futures = { workspace = true } http = { workspace = true } iana-time-zone = { workspace = true } image = { workspace = true, features = ["jpeg", "png", "webp"] } +ignore = { workspace = true } indexmap = { workspace = true } libc = { workspace = true } notify = { workspace = true } diff --git a/vendor/codex/codex-rs/core/src/codex_thread.rs b/vendor/codex/codex-rs/core/src/codex_thread.rs index daa14b5a..e9f0ea0f 100644 --- a/vendor/codex/codex-rs/core/src/codex_thread.rs +++ b/vendor/codex/codex-rs/core/src/codex_thread.rs @@ -1,5 +1,8 @@ use crate::agent::AgentStatus; use crate::config::ConstraintResult; +use crate::epiphany_retrieval; +use crate::epiphany_retrieval::EpiphanyRetrieveQuery; +use crate::epiphany_retrieval::EpiphanyRetrieveResponse; use crate::file_watcher::WatchRegistration; use crate::session::Codex; use crate::session::SessionSettingsUpdate; @@ -20,6 +23,7 @@ use codex_protocol::models::ResponseInputItem; use codex_protocol::models::ResponseItem; use codex_protocol::openai_models::ReasoningEffort; use codex_protocol::protocol::AskForApproval; +use codex_protocol::protocol::EpiphanyRetrievalState; use codex_protocol::protocol::EpiphanyThreadState; use codex_protocol::protocol::Event; use codex_protocol::protocol::Op; @@ -320,6 +324,24 @@ impl CodexThread { self.codex.session.epiphany_state().await } + pub async fn epiphany_retrieval_state(&self) -> EpiphanyRetrievalState { + let config = self.codex.thread_config_snapshot().await; + epiphany_retrieval::retrieval_state_for_workspace(config.cwd.as_path()) + } + + pub async fn epiphany_retrieve( + &self, + query: EpiphanyRetrieveQuery, + ) -> anyhow::Result { + let config = self.codex.thread_config_snapshot().await; + let workspace_root = config.cwd.to_path_buf(); + tokio::task::spawn_blocking(move || { + epiphany_retrieval::retrieve_workspace(&workspace_root, query) + }) + .await + .map_err(|err| anyhow::anyhow!("epiphany retrieval worker failed: {err}"))? + } + pub async fn read_mcp_resource( &self, server: &str, diff --git a/vendor/codex/codex-rs/core/src/epiphany_retrieval.rs b/vendor/codex/codex-rs/core/src/epiphany_retrieval.rs new file mode 100644 index 00000000..4ad48261 --- /dev/null +++ b/vendor/codex/codex-rs/core/src/epiphany_retrieval.rs @@ -0,0 +1,558 @@ +use anyhow::Context; +use anyhow::Result; +use bm25::Document; +use bm25::Language; +use bm25::SearchEngineBuilder; +use codex_file_search as file_search; +use codex_protocol::protocol::EpiphanyRetrievalShardSummary; +use codex_protocol::protocol::EpiphanyRetrievalState; +use codex_protocol::protocol::EpiphanyRetrievalStatus; +use ignore::WalkBuilder; +use std::cmp::Ordering; +use std::fs; +use std::num::NonZero; +use std::path::Component; +use std::path::Path; +use std::path::PathBuf; + +pub const EPIPHANY_RETRIEVAL_DEFAULT_LIMIT: usize = 10; +pub const EPIPHANY_RETRIEVAL_MAX_LIMIT: usize = 50; + +const EXACT_SEARCH_CANDIDATE_MULTIPLIER: usize = 5; +const EXACT_SEARCH_MAX_CANDIDATES: usize = 250; +const FILE_SEARCH_MAX_THREADS: usize = 12; +const QUERY_TIME_INDEX_REVISION: &str = "query-time-bm25-v1"; +const MAX_TEXT_FILE_BYTES: u64 = 256 * 1024; +const CHUNK_LINE_COUNT: usize = 24; +const CHUNK_LINE_OVERLAP: usize = 8; +const WORKSPACE_SHARD_ID: &str = "workspace"; + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct EpiphanyRetrieveQuery { + pub query: String, + pub limit: usize, + pub path_prefixes: Vec, +} + +impl EpiphanyRetrieveQuery { + pub fn new(query: String) -> Self { + Self { + query, + limit: EPIPHANY_RETRIEVAL_DEFAULT_LIMIT, + path_prefixes: Vec::new(), + } + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum EpiphanyRetrieveResultKind { + ExactFile, + ExactDirectory, + SemanticChunk, +} + +#[derive(Clone, Debug, PartialEq)] +pub struct EpiphanyRetrieveResult { + pub kind: EpiphanyRetrieveResultKind, + pub path: PathBuf, + pub score: f32, + pub line_start: Option, + pub line_end: Option, + pub excerpt: Option, +} + +#[derive(Clone, Debug, PartialEq)] +pub struct EpiphanyRetrieveResponse { + pub query: String, + pub index_summary: EpiphanyRetrievalState, + pub results: Vec, +} + +pub fn retrieval_state_for_workspace(workspace_root: &Path) -> EpiphanyRetrievalState { + let available = workspace_root.is_dir(); + let status = if available { + EpiphanyRetrievalStatus::Ready + } else { + EpiphanyRetrievalStatus::Unavailable + }; + + EpiphanyRetrievalState { + workspace_root: workspace_root.to_path_buf(), + index_revision: Some(QUERY_TIME_INDEX_REVISION.to_string()), + status, + semantic_available: available, + last_indexed_at_unix_seconds: None, + indexed_file_count: None, + indexed_chunk_count: None, + shards: vec![EpiphanyRetrievalShardSummary { + shard_id: WORKSPACE_SHARD_ID.to_string(), + path_prefix: PathBuf::from("."), + indexed_file_count: None, + indexed_chunk_count: None, + status, + exact_available: available, + semantic_available: available, + }], + dirty_paths: Vec::new(), + } +} + +pub fn retrieve_workspace( + workspace_root: &Path, + query: EpiphanyRetrieveQuery, +) -> Result { + if !workspace_root.is_dir() { + anyhow::bail!( + "workspace root does not exist: {}", + workspace_root.display() + ); + } + + let query_text = query.query.trim(); + if query_text.is_empty() { + anyhow::bail!("query must not be empty"); + } + + let limit = query.limit.clamp(1, EPIPHANY_RETRIEVAL_MAX_LIMIT); + let path_prefixes = normalize_path_prefixes(workspace_root, &query.path_prefixes); + + let exact_results = run_exact_search(workspace_root, query_text, limit, &path_prefixes) + .context("exact retrieval failed")?; + let semantic_corpus = collect_semantic_corpus(workspace_root, &path_prefixes) + .context("semantic corpus collection failed")?; + let semantic_results = search_semantic_chunks(query_text, limit, &semantic_corpus); + + let mut results = Vec::with_capacity(exact_results.len() + semantic_results.len()); + results.extend(exact_results); + results.extend(semantic_results); + sort_results(&mut results); + results.truncate(limit); + + Ok(EpiphanyRetrieveResponse { + query: query_text.to_string(), + index_summary: query_time_retrieval_state( + workspace_root, + semantic_corpus.searchable_file_count, + semantic_corpus.chunks.len(), + ), + results, + }) +} + +fn run_exact_search( + workspace_root: &Path, + query: &str, + limit: usize, + path_prefixes: &[PathBuf], +) -> Result> { + let candidate_limit = if path_prefixes.is_empty() { + limit + } else { + limit + .saturating_mul(EXACT_SEARCH_CANDIDATE_MULTIPLIER) + .min(EXACT_SEARCH_MAX_CANDIDATES) + }; + #[expect(clippy::expect_used)] + let candidate_limit = + NonZero::new(candidate_limit.max(1)).expect("candidate limit should be non-zero"); + + let search_results = file_search::run( + query, + vec![workspace_root.to_path_buf()], + file_search::FileSearchOptions { + limit: candidate_limit, + threads: search_threads(), + compute_indices: false, + ..Default::default() + }, + /*cancel_flag*/ None, + )?; + + let mut results = search_results + .matches + .into_iter() + .filter_map(|file_match| { + let relative_path = file_match + .full_path() + .strip_prefix(workspace_root) + .ok()? + .to_path_buf(); + if !matches_path_prefixes(&relative_path, path_prefixes) { + return None; + } + + Some(EpiphanyRetrieveResult { + kind: match file_match.match_type { + file_search::MatchType::File => EpiphanyRetrieveResultKind::ExactFile, + file_search::MatchType::Directory => EpiphanyRetrieveResultKind::ExactDirectory, + }, + path: relative_path, + score: file_match.score as f32, + line_start: None, + line_end: None, + excerpt: None, + }) + }) + .collect::>(); + + results.truncate(limit); + Ok(results) +} + +fn search_threads() -> NonZero { + let cores = std::thread::available_parallelism() + .map(NonZero::get) + .unwrap_or(1); + #[expect(clippy::expect_used)] + NonZero::new(cores.min(FILE_SEARCH_MAX_THREADS).max(1)) + .expect("file-search threads should be non-zero") +} + +struct SemanticCorpus { + searchable_file_count: usize, + chunks: Vec, +} + +#[derive(Clone, Debug)] +struct SemanticChunk { + path: PathBuf, + line_start: u32, + line_end: u32, + excerpt: String, + search_text: String, +} + +fn collect_semantic_corpus( + workspace_root: &Path, + path_prefixes: &[PathBuf], +) -> Result { + let mut builder = WalkBuilder::new(workspace_root); + builder.hidden(false); + + let mut searchable_file_count = 0usize; + let mut chunks = Vec::new(); + for entry in builder.build() { + let Ok(entry) = entry else { + continue; + }; + if !entry + .file_type() + .is_some_and(|file_type| file_type.is_file()) + { + continue; + } + + let path = entry.path(); + let Ok(relative_path) = path.strip_prefix(workspace_root) else { + continue; + }; + if should_skip_relative_path(relative_path) { + continue; + } + if !matches_path_prefixes(relative_path, path_prefixes) { + continue; + } + + let Ok(metadata) = fs::metadata(path) else { + continue; + }; + if metadata.len() > MAX_TEXT_FILE_BYTES { + continue; + } + + let Ok(contents) = fs::read_to_string(path) else { + continue; + }; + let file_chunks = build_semantic_chunks(relative_path, &contents); + if file_chunks.is_empty() { + continue; + } + + searchable_file_count += 1; + chunks.extend(file_chunks); + } + + Ok(SemanticCorpus { + searchable_file_count, + chunks, + }) +} + +fn build_semantic_chunks(relative_path: &Path, contents: &str) -> Vec { + let lines = contents.lines().collect::>(); + if lines.is_empty() { + return Vec::new(); + } + + let step = CHUNK_LINE_COUNT.saturating_sub(CHUNK_LINE_OVERLAP).max(1); + let mut chunks = Vec::new(); + let mut start = 0usize; + while start < lines.len() { + let end = (start + CHUNK_LINE_COUNT).min(lines.len()); + let excerpt = lines[start..end].join("\n").trim().to_string(); + if !excerpt.is_empty() { + chunks.push(SemanticChunk { + path: relative_path.to_path_buf(), + line_start: (start + 1) as u32, + line_end: end as u32, + search_text: format!("{}\n{}", relative_path.display(), excerpt), + excerpt, + }); + } + + if end == lines.len() { + break; + } + start += step; + } + + chunks +} + +fn search_semantic_chunks( + query: &str, + limit: usize, + semantic_corpus: &SemanticCorpus, +) -> Vec { + if semantic_corpus.chunks.is_empty() { + return Vec::new(); + } + + let documents = semantic_corpus + .chunks + .iter() + .enumerate() + .map(|(index, chunk)| Document::new(index, chunk.search_text.clone())) + .collect::>(); + let search_engine = + SearchEngineBuilder::::with_documents(Language::English, documents).build(); + + search_engine + .search(query, limit) + .into_iter() + .filter_map(|result| { + semantic_corpus + .chunks + .get(result.document.id) + .map(|chunk| EpiphanyRetrieveResult { + kind: EpiphanyRetrieveResultKind::SemanticChunk, + path: chunk.path.clone(), + score: result.score, + line_start: Some(chunk.line_start), + line_end: Some(chunk.line_end), + excerpt: Some(chunk.excerpt.clone()), + }) + }) + .collect() +} + +fn query_time_retrieval_state( + workspace_root: &Path, + searchable_file_count: usize, + chunk_count: usize, +) -> EpiphanyRetrievalState { + let indexed_file_count = u32::try_from(searchable_file_count).ok(); + let indexed_chunk_count = u32::try_from(chunk_count).ok(); + + EpiphanyRetrievalState { + workspace_root: workspace_root.to_path_buf(), + index_revision: Some(QUERY_TIME_INDEX_REVISION.to_string()), + status: EpiphanyRetrievalStatus::Ready, + semantic_available: chunk_count > 0, + last_indexed_at_unix_seconds: Some(chrono::Utc::now().timestamp()), + indexed_file_count, + indexed_chunk_count, + shards: vec![EpiphanyRetrievalShardSummary { + shard_id: WORKSPACE_SHARD_ID.to_string(), + path_prefix: PathBuf::from("."), + indexed_file_count, + indexed_chunk_count, + status: EpiphanyRetrievalStatus::Ready, + exact_available: true, + semantic_available: chunk_count > 0, + }], + dirty_paths: Vec::new(), + } +} + +fn sort_results(results: &mut [EpiphanyRetrieveResult]) { + results.sort_by(|left, right| { + result_priority(&right.kind) + .cmp(&result_priority(&left.kind)) + .then_with(|| { + right + .score + .partial_cmp(&left.score) + .unwrap_or(Ordering::Equal) + }) + .then_with(|| left.path.cmp(&right.path)) + .then_with(|| { + left.line_start + .unwrap_or(u32::MAX) + .cmp(&right.line_start.unwrap_or(u32::MAX)) + }) + }); +} + +fn result_priority(kind: &EpiphanyRetrieveResultKind) -> u8 { + match kind { + EpiphanyRetrieveResultKind::ExactFile => 3, + EpiphanyRetrieveResultKind::SemanticChunk => 2, + EpiphanyRetrieveResultKind::ExactDirectory => 1, + } +} + +fn normalize_path_prefixes(workspace_root: &Path, path_prefixes: &[PathBuf]) -> Vec { + let mut normalized = path_prefixes + .iter() + .filter_map(|prefix| normalize_path_prefix(workspace_root, prefix.as_path())) + .collect::>(); + normalized.sort(); + normalized.dedup(); + normalized +} + +fn normalize_path_prefix(workspace_root: &Path, prefix: &Path) -> Option { + if prefix.as_os_str().is_empty() || prefix == Path::new(".") { + return None; + } + + let relative = if prefix.is_absolute() { + prefix.strip_prefix(workspace_root).ok()? + } else { + prefix + }; + + let mut normalized = PathBuf::new(); + for component in relative.components() { + match component { + Component::Normal(value) => normalized.push(value), + Component::CurDir => {} + Component::ParentDir | Component::Prefix(_) | Component::RootDir => return None, + } + } + + if normalized.as_os_str().is_empty() || normalized == Path::new(".") { + None + } else { + Some(normalized) + } +} + +fn matches_path_prefixes(path: &Path, path_prefixes: &[PathBuf]) -> bool { + path_prefixes.is_empty() || path_prefixes.iter().any(|prefix| path.starts_with(prefix)) +} + +fn should_skip_relative_path(relative_path: &Path) -> bool { + relative_path + .components() + .any(|component| matches!(component, Component::Normal(value) if value == ".git")) +} + +#[cfg(test)] +mod tests { + use super::*; + use anyhow::Result; + use pretty_assertions::assert_eq; + use tempfile::TempDir; + + #[test] + fn retrieve_workspace_prioritizes_exact_hits_without_losing_semantic_chunks() -> Result<()> { + let temp_dir = TempDir::new()?; + fs::create_dir_all(temp_dir.path().join("src"))?; + fs::create_dir_all(temp_dir.path().join("notes"))?; + fs::write( + temp_dir.path().join("src").join("session_checkpoint.rs"), + "pub fn route_session() {}\n", + )?; + fs::write( + temp_dir.path().join("notes").join("design.md"), + "The compaction checkpoint keeps the field notebook alive.\n\ + Retrieval should honor the checkpoint before the next pass.\n", + )?; + + let response = retrieve_workspace( + temp_dir.path(), + EpiphanyRetrieveQuery { + query: "session checkpoint".to_string(), + limit: 5, + path_prefixes: Vec::new(), + }, + )?; + + assert_eq!( + response.results.first().map(|result| &result.kind), + Some(&EpiphanyRetrieveResultKind::ExactFile) + ); + assert!( + response + .results + .iter() + .any(|result| result.kind == EpiphanyRetrieveResultKind::SemanticChunk), + "expected at least one semantic chunk result" + ); + Ok(()) + } + + #[test] + fn retrieve_workspace_finds_semantic_match_without_path_match() -> Result<()> { + let temp_dir = TempDir::new()?; + fs::create_dir_all(temp_dir.path().join("src"))?; + fs::write( + temp_dir.path().join("src").join("engine.rs"), + "The frontier checkpoint preserves the machine map before compaction.\n\ + Keep the durable spine and discard disposable scratch.\n", + )?; + + let response = retrieve_workspace( + temp_dir.path(), + EpiphanyRetrieveQuery { + query: "durable spine compaction checkpoint".to_string(), + limit: 3, + path_prefixes: Vec::new(), + }, + )?; + + assert!( + response.results.iter().any(|result| { + result.kind == EpiphanyRetrieveResultKind::SemanticChunk + && result.path == PathBuf::from("src").join("engine.rs") + }), + "expected semantic retrieval to find engine.rs" + ); + Ok(()) + } + + #[test] + fn retrieve_workspace_respects_path_prefixes() -> Result<()> { + let temp_dir = TempDir::new()?; + fs::create_dir_all(temp_dir.path().join("src"))?; + fs::create_dir_all(temp_dir.path().join("docs"))?; + fs::write( + temp_dir.path().join("src").join("router.rs"), + "checkpoint frontier checkpoint frontier\n", + )?; + fs::write( + temp_dir.path().join("docs").join("guide.md"), + "checkpoint frontier checkpoint frontier\n", + )?; + + let response = retrieve_workspace( + temp_dir.path(), + EpiphanyRetrieveQuery { + query: "checkpoint frontier".to_string(), + limit: 10, + path_prefixes: vec![PathBuf::from("docs")], + }, + )?; + + assert!( + response + .results + .iter() + .all(|result| result.path.starts_with("docs")), + "all results should stay inside the requested path prefix" + ); + Ok(()) + } +} diff --git a/vendor/codex/codex-rs/core/src/lib.rs b/vendor/codex/codex-rs/core/src/lib.rs index 0adf3397..0d87c9d3 100644 --- a/vendor/codex/codex-rs/core/src/lib.rs +++ b/vendor/codex/codex-rs/core/src/lib.rs @@ -17,10 +17,17 @@ pub(crate) mod session; pub use session::SteerInputError; mod codex_thread; mod compact_remote; +mod epiphany_retrieval; mod epiphany_rollout; pub use codex_thread::CodexThread; pub use codex_thread::CodexThreadTurnContextOverrides; pub use codex_thread::ThreadConfigSnapshot; +pub use epiphany_retrieval::EPIPHANY_RETRIEVAL_DEFAULT_LIMIT; +pub use epiphany_retrieval::EPIPHANY_RETRIEVAL_MAX_LIMIT; +pub use epiphany_retrieval::EpiphanyRetrieveQuery; +pub use epiphany_retrieval::EpiphanyRetrieveResponse; +pub use epiphany_retrieval::EpiphanyRetrieveResult; +pub use epiphany_retrieval::EpiphanyRetrieveResultKind; pub use epiphany_rollout::latest_epiphany_state_from_rollout_items; mod agent; mod codex_delegate; diff --git a/vendor/codex/codex-rs/core/src/session/tests.rs b/vendor/codex/codex-rs/core/src/session/tests.rs index 04460bbd..383ca53b 100644 --- a/vendor/codex/codex-rs/core/src/session/tests.rs +++ b/vendor/codex/codex-rs/core/src/session/tests.rs @@ -410,6 +410,7 @@ fn sample_epiphany_state_for_prompt() -> EpiphanyThreadState { warning: Some("Keep the fragment bounded; do not turn it into another transcript dump.".to_string()), unexplained_writes: Some(0), }), + retrieval: None, mode: Some(EpiphanyModeState { name: "epiphany".to_string(), kind: Some(ModeKind::Default), diff --git a/vendor/codex/codex-rs/protocol/src/protocol.rs b/vendor/codex/codex-rs/protocol/src/protocol.rs index 21fc9d02..e098992f 100644 --- a/vendor/codex/codex-rs/protocol/src/protocol.rs +++ b/vendor/codex/codex-rs/protocol/src/protocol.rs @@ -2972,30 +2972,46 @@ pub struct EpiphanyStateItem { pub struct EpiphanyThreadState { pub revision: u64, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub objective: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub active_subgoal_id: Option, #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] pub subgoals: Vec, #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] pub invariants: Vec, #[serde(default, skip_serializing_if = "EpiphanyGraphs::is_empty")] + #[ts(type = "EpiphanyGraphs")] pub graphs: EpiphanyGraphs, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "EpiphanyGraphFrontier | null")] pub graph_frontier: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "EpiphanyGraphCheckpoint | null")] pub graph_checkpoint: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "EpiphanyRetrievalState | null")] + pub retrieval: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "EpiphanyScratchPad | null")] pub scratch: Option, #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] pub observations: Vec, #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] pub recent_evidence: Vec, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "EpiphanyChurnState | null")] pub churn: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "EpiphanyModeState | null")] pub mode: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub last_updated_turn_id: Option, } @@ -3005,6 +3021,7 @@ pub struct EpiphanySubgoal { pub title: String, pub status: String, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub summary: Option, } @@ -3014,6 +3031,7 @@ pub struct EpiphanyInvariant { pub description: String, pub status: String, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub rationale: Option, } @@ -3053,12 +3071,16 @@ pub struct EpiphanyGraphNode { pub title: String, pub purpose: String, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub mechanism: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub metaphor: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub status: Option, #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] pub code_refs: Vec, } @@ -3068,12 +3090,16 @@ pub struct EpiphanyGraphEdge { pub target_id: String, pub kind: String, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub label: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub mechanism: Option, #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] pub code_refs: Vec, } @@ -3082,8 +3108,10 @@ pub struct EpiphanyGraphLink { pub dataflow_node_id: String, pub architecture_node_id: String, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub relationship: Option, #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] pub code_refs: Vec, } @@ -3091,12 +3119,16 @@ pub struct EpiphanyGraphLink { pub struct EpiphanyCodeRef { pub path: PathBuf, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "number | null")] pub start_line: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "number | null")] pub end_line: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub symbol: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub note: Option, } @@ -3119,24 +3151,91 @@ pub struct EpiphanyGraphCheckpoint { pub checkpoint_id: String, pub graph_revision: u64, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub summary: Option, #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] pub frontier_node_ids: Vec, #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] pub open_question_ids: Vec, #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] pub open_gap_ids: Vec, } +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] +pub struct EpiphanyRetrievalState { + pub workspace_root: PathBuf, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] + pub index_revision: Option, + #[serde(default)] + pub status: EpiphanyRetrievalStatus, + #[serde(default, skip_serializing_if = "std::ops::Not::not")] + #[ts(type = "boolean")] + pub semantic_available: bool, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "bigint | null")] + pub last_indexed_at_unix_seconds: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "number | null")] + pub indexed_file_count: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "number | null")] + pub indexed_chunk_count: Option, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] + pub shards: Vec, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] + pub dirty_paths: Vec, +} + +#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, JsonSchema, TS, Default)] +#[serde(rename_all = "snake_case")] +#[ts(rename_all = "snake_case")] +pub enum EpiphanyRetrievalStatus { + #[default] + Unavailable, + Ready, + Stale, + Indexing, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] +pub struct EpiphanyRetrievalShardSummary { + pub shard_id: String, + pub path_prefix: PathBuf, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "number | null")] + pub indexed_file_count: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "number | null")] + pub indexed_chunk_count: Option, + #[serde(default)] + pub status: EpiphanyRetrievalStatus, + #[serde(default, skip_serializing_if = "std::ops::Not::not")] + #[ts(type = "boolean")] + pub exact_available: bool, + #[serde(default, skip_serializing_if = "std::ops::Not::not")] + #[ts(type = "boolean")] + pub semantic_available: bool, +} + #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] pub struct EpiphanyScratchPad { #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub summary: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub hypothesis: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub next_probe: Option, #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] pub notes: Vec, } @@ -3167,10 +3266,13 @@ pub struct EpiphanyChurnState { pub understanding_status: String, pub diff_pressure: String, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub graph_freshness: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "string | null")] pub warning: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "number | null")] pub unexplained_writes: Option, } @@ -3178,6 +3280,7 @@ pub struct EpiphanyChurnState { pub struct EpiphanyModeState { pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(type = "ModeKind | null")] pub kind: Option, } @@ -5537,6 +5640,25 @@ mod tests { open_question_ids: vec!["q1".to_string()], open_gap_ids: vec!["g1".to_string()], }), + retrieval: Some(EpiphanyRetrievalState { + workspace_root: test_path_buf("/repo"), + index_revision: Some("bm25-v1".to_string()), + status: EpiphanyRetrievalStatus::Ready, + semantic_available: true, + last_indexed_at_unix_seconds: Some(1_744_500_000), + indexed_file_count: Some(12), + indexed_chunk_count: Some(34), + shards: vec![EpiphanyRetrievalShardSummary { + shard_id: "workspace".to_string(), + path_prefix: PathBuf::from("."), + indexed_file_count: Some(12), + indexed_chunk_count: Some(34), + status: EpiphanyRetrievalStatus::Ready, + exact_available: true, + semantic_available: true, + }], + dirty_paths: vec![test_path_buf("/repo/core/src/session/mod.rs")], + }), scratch: Some(EpiphanyScratchPad { summary: Some("Persist first, get fancy later".to_string()), hypothesis: Some("One extra rollout item is enough for Phase 1".to_string()),