Land Epiphany Phase 4 hybrid retrieval slice

This commit is contained in:
Meta Vens 2026-04-24 02:45:02 +01:00
commit 360dfea6e4
39 changed files with 10378 additions and 62 deletions

2
vendor/codex/codex-rs/Cargo.lock generated vendored
View file

@ -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",

View file

@ -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": [

View file

@ -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.",

View file

@ -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.",

View file

@ -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": [

View file

@ -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": [

View file

@ -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": [

View file

@ -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": [

View file

@ -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": [

View file

@ -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": [

View file

@ -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": [

View file

@ -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": [

View file

@ -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": [

View file

@ -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";

View file

@ -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<EpiphanySubgoal>, invariants?: Array<EpiphanyInvariant>, graphs?: EpiphanyGraphs, graph_frontier?: EpiphanyGraphFrontier | null, graph_checkpoint?: EpiphanyGraphCheckpoint | null, retrieval?: EpiphanyRetrievalState | null, scratch?: EpiphanyScratchPad | null, observations?: Array<EpiphanyObservation>, recent_evidence?: Array<EpiphanyEvidenceRecord>, churn?: EpiphanyChurnState | null, mode?: EpiphanyModeState | null, last_updated_turn_id?: string | null, };

View file

@ -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";

View file

@ -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.

View file

@ -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<ThreadEpiphanyRetrieveShardSummary>, dirtyPaths: Array<string>, };

View file

@ -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, };

View file

@ -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";

View file

@ -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, };

View file

@ -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";

View file

@ -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"

View file

@ -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 {

View file

@ -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<u32>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub path_prefixes: Vec<PathBuf>,
}
#[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<ThreadEpiphanyRetrieveResult>,
}
#[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<String>,
pub status: CoreEpiphanyRetrievalStatus,
pub semantic_available: bool,
#[ts(type = "number | null")]
pub last_indexed_at_unix_seconds: Option<i64>,
#[ts(type = "number | null")]
pub indexed_file_count: Option<u32>,
#[ts(type = "number | null")]
pub indexed_chunk_count: Option<u32>,
pub shards: Vec<ThreadEpiphanyRetrieveShardSummary>,
pub dirty_paths: Vec<PathBuf>,
}
#[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<u32>,
#[ts(type = "number | null")]
pub indexed_chunk_count: Option<u32>,
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<u32>,
#[ts(type = "number | null")]
pub line_end: Option<u32>,
pub excerpt: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]

View file

@ -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`.

View file

@ -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<CodexThread>>,
) -> 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<EpiphanyThreadState> {
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<ThreadEpiphanyRetrieveResponse> {
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<ThreadEpiphanyRetrieveIndexSummary> {
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")?;

View file

@ -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 }

View file

@ -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<EpiphanyRetrieveResponse> {
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,

View file

@ -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<PathBuf>,
}
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<u32>,
pub line_end: Option<u32>,
pub excerpt: Option<String>,
}
#[derive(Clone, Debug, PartialEq)]
pub struct EpiphanyRetrieveResponse {
pub query: String,
pub index_summary: EpiphanyRetrievalState,
pub results: Vec<EpiphanyRetrieveResult>,
}
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<EpiphanyRetrieveResponse> {
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<Vec<EpiphanyRetrieveResult>> {
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::<Vec<_>>();
results.truncate(limit);
Ok(results)
}
fn search_threads() -> NonZero<usize> {
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<SemanticChunk>,
}
#[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<SemanticCorpus> {
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<SemanticChunk> {
let lines = contents.lines().collect::<Vec<_>>();
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<EpiphanyRetrieveResult> {
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::<Vec<_>>();
let search_engine =
SearchEngineBuilder::<usize>::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<PathBuf> {
let mut normalized = path_prefixes
.iter()
.filter_map(|prefix| normalize_path_prefix(workspace_root, prefix.as_path()))
.collect::<Vec<_>>();
normalized.sort();
normalized.dedup();
normalized
}
fn normalize_path_prefix(workspace_root: &Path, prefix: &Path) -> Option<PathBuf> {
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(())
}
}

View file

@ -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;

View file

@ -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),

View file

@ -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<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "string | null")]
pub active_subgoal_id: Option<String>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<EpiphanySubgoal>")]
pub subgoals: Vec<EpiphanySubgoal>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<EpiphanyInvariant>")]
pub invariants: Vec<EpiphanyInvariant>,
#[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<EpiphanyGraphFrontier>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "EpiphanyGraphCheckpoint | null")]
pub graph_checkpoint: Option<EpiphanyGraphCheckpoint>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "EpiphanyRetrievalState | null")]
pub retrieval: Option<EpiphanyRetrievalState>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "EpiphanyScratchPad | null")]
pub scratch: Option<EpiphanyScratchPad>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<EpiphanyObservation>")]
pub observations: Vec<EpiphanyObservation>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<EpiphanyEvidenceRecord>")]
pub recent_evidence: Vec<EpiphanyEvidenceRecord>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "EpiphanyChurnState | null")]
pub churn: Option<EpiphanyChurnState>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "EpiphanyModeState | null")]
pub mode: Option<EpiphanyModeState>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "string | null")]
pub last_updated_turn_id: Option<String>,
}
@ -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<String>,
}
@ -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<String>,
}
@ -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<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "string | null")]
pub metaphor: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "string | null")]
pub status: Option<String>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<EpiphanyCodeRef>")]
pub code_refs: Vec<EpiphanyCodeRef>,
}
@ -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<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "string | null")]
pub label: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "string | null")]
pub mechanism: Option<String>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<EpiphanyCodeRef>")]
pub code_refs: Vec<EpiphanyCodeRef>,
}
@ -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<String>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<EpiphanyCodeRef>")]
pub code_refs: Vec<EpiphanyCodeRef>,
}
@ -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<u32>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "number | null")]
pub end_line: Option<u32>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "string | null")]
pub symbol: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "string | null")]
pub note: Option<String>,
}
@ -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<String>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<string>")]
pub frontier_node_ids: Vec<String>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<string>")]
pub open_question_ids: Vec<String>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<string>")]
pub open_gap_ids: Vec<String>,
}
#[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<String>,
#[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<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "number | null")]
pub indexed_file_count: Option<u32>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "number | null")]
pub indexed_chunk_count: Option<u32>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<EpiphanyRetrievalShardSummary>")]
pub shards: Vec<EpiphanyRetrievalShardSummary>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<string>")]
pub dirty_paths: Vec<PathBuf>,
}
#[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<u32>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "number | null")]
pub indexed_chunk_count: Option<u32>,
#[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<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "string | null")]
pub hypothesis: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "string | null")]
pub next_probe: Option<String>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[ts(type = "Array<string>")]
pub notes: Vec<String>,
}
@ -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<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "string | null")]
pub warning: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(type = "number | null")]
pub unexplained_writes: Option<u32>,
}
@ -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<ModeKind>,
}
@ -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()),