Collapse Epiphany CRRC reads into view

This commit is contained in:
Meta Vens 2026-05-12 06:17:12 +01:00
commit 32d6eed2d8
14 changed files with 117 additions and 1169 deletions

View file

@ -120,8 +120,8 @@ fn run_smoke(args: &Args) -> Result<Value> {
let notification_start = client.notification_len();
let response = client.send(
"thread/epiphany/pressure",
Some(json!({"threadId": thread_id})),
"thread/epiphany/view",
Some(json!({"threadId": thread_id, "lenses": ["pressure"]})),
true,
)?;
require(
@ -148,7 +148,7 @@ fn run_smoke(args: &Args) -> Result<Value> {
let result = json!({
"threadId": thread_id,
"codexHome": codex_home,
"source": response["source"],
"source": "thread/epiphany/view",
"status": response["pressure"]["status"],
"level": response["pressure"]["level"],
"basis": response["pressure"]["basis"],
@ -164,10 +164,6 @@ fn run_smoke(args: &Args) -> Result<Value> {
}
fn assert_unknown_pressure(response: &Value) -> Result<()> {
require(
response.get("source").and_then(Value::as_str) == Some("live"),
"fresh pressure should report live source",
)?;
let pressure = response
.get("pressure")
.ok_or_else(|| anyhow!("pressure response missing pressure object"))?;

View file

@ -129,11 +129,14 @@ fn run_smoke(args: &Args) -> Result<Value> {
.to_string();
let missing_notification_start = client.notification_len();
let missing_response = client.send(
"thread/epiphany/reorient",
Some(json!({"threadId": thread_id})),
let missing_view = client.send(
"thread/epiphany/view",
Some(json!({"threadId": thread_id, "lenses": ["reorient"]})),
true,
)?;
let missing_response = missing_view
.get("reorient")
.ok_or_else(|| anyhow!("view response missing reorient lens"))?;
assert_missing_reorient(&missing_response)?;
client.require_no_notification(
"thread/epiphany/stateUpdated",
@ -162,11 +165,14 @@ fn run_smoke(args: &Args) -> Result<Value> {
)?;
let ready_notification_start = client.notification_len();
let ready_response = client.send(
"thread/epiphany/reorient",
Some(json!({"threadId": thread_id})),
let ready_view = client.send(
"thread/epiphany/view",
Some(json!({"threadId": thread_id, "lenses": ["reorient"]})),
true,
)?;
let ready_response = ready_view
.get("reorient")
.ok_or_else(|| anyhow!("view response missing reorient lens"))?;
assert_ready_reorient(&ready_response)?;
client.require_no_notification(
"thread/epiphany/stateUpdated",
@ -368,12 +374,15 @@ fn wait_for_regather_reorient(
let mut last_response = Value::Null;
while Instant::now() < deadline {
let response = client.send(
"thread/epiphany/reorient",
Some(json!({"threadId": thread_id})),
"thread/epiphany/view",
Some(json!({"threadId": thread_id, "lenses": ["reorient"]})),
true,
)?;
if response.pointer("/decision/action").and_then(Value::as_str) == Some("regather") {
return Ok(response);
let reorient = response
.get("reorient")
.ok_or_else(|| anyhow!("view response missing reorient lens"))?;
if reorient.pointer("/decision/action").and_then(Value::as_str) == Some("regather") {
return Ok(reorient.clone());
}
last_response = response;
thread::sleep(Duration::from_millis(200));