Add Epiphany role ownership surface

This commit is contained in:
Meta Vens 2026-04-28 15:01:05 +01:00
commit a36e2b4a4b
18 changed files with 856 additions and 100 deletions

View file

@ -15988,6 +15988,84 @@
],
"type": "object"
},
"ThreadEpiphanyRoleId": {
"enum": [
"implementation",
"modeling",
"verification",
"reorientation"
],
"type": "string"
},
"ThreadEpiphanyRoleLane": {
"properties": {
"authorityScopes": {
"items": {
"type": "string"
},
"type": "array"
},
"id": {
"$ref": "#/definitions/v2/ThreadEpiphanyRoleId"
},
"jobs": {
"items": {
"$ref": "#/definitions/v2/ThreadEpiphanyJob"
},
"type": "array"
},
"note": {
"type": "string"
},
"ownerRole": {
"type": "string"
},
"recommendedAction": {
"anyOf": [
{
"$ref": "#/definitions/v2/ThreadEpiphanySceneAction"
},
{
"type": "null"
}
]
},
"status": {
"$ref": "#/definitions/v2/ThreadEpiphanyRoleStatus"
},
"title": {
"type": "string"
}
},
"required": [
"id",
"note",
"ownerRole",
"status",
"title"
],
"type": "object"
},
"ThreadEpiphanyRoleStatus": {
"enum": [
"ready",
"needed",
"blocked",
"running",
"completed",
"waiting",
"review",
"unavailable"
],
"type": "string"
},
"ThreadEpiphanyRolesSource": {
"enum": [
"stored",
"live"
],
"type": "string"
},
"ThreadEpiphanyScene": {
"properties": {
"activeSubgoal": {
@ -16094,6 +16172,7 @@
"distill",
"context",
"jobs",
"roles",
"jobLaunch",
"jobInterrupt",
"freshness",

View file

@ -13875,6 +13875,84 @@
],
"type": "object"
},
"ThreadEpiphanyRoleId": {
"enum": [
"implementation",
"modeling",
"verification",
"reorientation"
],
"type": "string"
},
"ThreadEpiphanyRoleLane": {
"properties": {
"authorityScopes": {
"items": {
"type": "string"
},
"type": "array"
},
"id": {
"$ref": "#/definitions/ThreadEpiphanyRoleId"
},
"jobs": {
"items": {
"$ref": "#/definitions/ThreadEpiphanyJob"
},
"type": "array"
},
"note": {
"type": "string"
},
"ownerRole": {
"type": "string"
},
"recommendedAction": {
"anyOf": [
{
"$ref": "#/definitions/ThreadEpiphanySceneAction"
},
{
"type": "null"
}
]
},
"status": {
"$ref": "#/definitions/ThreadEpiphanyRoleStatus"
},
"title": {
"type": "string"
}
},
"required": [
"id",
"note",
"ownerRole",
"status",
"title"
],
"type": "object"
},
"ThreadEpiphanyRoleStatus": {
"enum": [
"ready",
"needed",
"blocked",
"running",
"completed",
"waiting",
"review",
"unavailable"
],
"type": "string"
},
"ThreadEpiphanyRolesSource": {
"enum": [
"stored",
"live"
],
"type": "string"
},
"ThreadEpiphanyScene": {
"properties": {
"activeSubgoal": {
@ -13981,6 +14059,7 @@
"distill",
"context",
"jobs",
"roles",
"jobLaunch",
"jobInterrupt",
"freshness",

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 ThreadEpiphanyRoleId = "implementation" | "modeling" | "verification" | "reorientation";

View file

@ -0,0 +1,9 @@
// 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 { ThreadEpiphanyJob } from "./ThreadEpiphanyJob";
import type { ThreadEpiphanyRoleId } from "./ThreadEpiphanyRoleId";
import type { ThreadEpiphanyRoleStatus } from "./ThreadEpiphanyRoleStatus";
import type { ThreadEpiphanySceneAction } from "./ThreadEpiphanySceneAction";
export type ThreadEpiphanyRoleLane = { id: ThreadEpiphanyRoleId, title: string, ownerRole: string, status: ThreadEpiphanyRoleStatus, note: string, jobs?: Array<ThreadEpiphanyJob>, authorityScopes?: Array<string>, recommendedAction?: ThreadEpiphanySceneAction | 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 ThreadEpiphanyRoleStatus = "ready" | "needed" | "blocked" | "running" | "completed" | "waiting" | "review" | "unavailable";

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 ThreadEpiphanyRolesSource = "stored" | "live";

View file

@ -2,4 +2,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type ThreadEpiphanySceneAction = "index" | "retrieve" | "distill" | "context" | "jobs" | "jobLaunch" | "jobInterrupt" | "freshness" | "pressure" | "reorient" | "crrc" | "reorientLaunch" | "reorientResult" | "reorientAccept" | "propose" | "promote" | "update";
export type ThreadEpiphanySceneAction = "index" | "retrieve" | "distill" | "context" | "jobs" | "roles" | "jobLaunch" | "jobInterrupt" | "freshness" | "pressure" | "reorient" | "crrc" | "reorientLaunch" | "reorientResult" | "reorientAccept" | "propose" | "promote" | "update";

View file

@ -355,6 +355,10 @@ export type { ThreadEpiphanyRetrieveIndexSummary } from "./ThreadEpiphanyRetriev
export type { ThreadEpiphanyRetrieveResult } from "./ThreadEpiphanyRetrieveResult";
export type { ThreadEpiphanyRetrieveResultKind } from "./ThreadEpiphanyRetrieveResultKind";
export type { ThreadEpiphanyRetrieveShardSummary } from "./ThreadEpiphanyRetrieveShardSummary";
export type { ThreadEpiphanyRoleId } from "./ThreadEpiphanyRoleId";
export type { ThreadEpiphanyRoleLane } from "./ThreadEpiphanyRoleLane";
export type { ThreadEpiphanyRoleStatus } from "./ThreadEpiphanyRoleStatus";
export type { ThreadEpiphanyRolesSource } from "./ThreadEpiphanyRolesSource";
export type { ThreadEpiphanyScene } from "./ThreadEpiphanyScene";
export type { ThreadEpiphanySceneAction } from "./ThreadEpiphanySceneAction";
export type { ThreadEpiphanySceneChurn } from "./ThreadEpiphanySceneChurn";

View file

@ -346,6 +346,11 @@ client_request_definitions! {
params: v2::ThreadEpiphanyJobsParams,
response: v2::ThreadEpiphanyJobsResponse,
},
#[experimental("thread/epiphany/roles")]
ThreadEpiphanyRoles => "thread/epiphany/roles" {
params: v2::ThreadEpiphanyRolesParams,
response: v2::ThreadEpiphanyRolesResponse,
},
#[experimental("thread/epiphany/freshness")]
ThreadEpiphanyFreshness => "thread/epiphany/freshness" {
params: v2::ThreadEpiphanyFreshnessParams,
@ -1726,6 +1731,7 @@ mod tests {
v2::ThreadEpiphanySceneAction::Distill,
v2::ThreadEpiphanySceneAction::Context,
v2::ThreadEpiphanySceneAction::Jobs,
v2::ThreadEpiphanySceneAction::Roles,
v2::ThreadEpiphanySceneAction::JobLaunch,
v2::ThreadEpiphanySceneAction::Freshness,
v2::ThreadEpiphanySceneAction::Pressure,
@ -1827,6 +1833,7 @@ mod tests {
"distill",
"context",
"jobs",
"roles",
"jobLaunch",
"freshness",
"pressure",
@ -1910,6 +1917,87 @@ mod tests {
Ok(())
}
#[test]
fn serialize_thread_epiphany_roles_response() -> Result<()> {
let response = ClientResponse::ThreadEpiphanyRoles {
request_id: RequestId::Integer(8),
response: v2::ThreadEpiphanyRolesResponse {
thread_id: "thr_123".to_string(),
source: v2::ThreadEpiphanyRolesSource::Live,
state_status: v2::ThreadEpiphanyReorientStateStatus::Ready,
state_revision: Some(3),
roles: vec![v2::ThreadEpiphanyRoleLane {
id: v2::ThreadEpiphanyRoleId::Verification,
title: "Verification / Review".to_string(),
owner_role: "epiphany-verifier".to_string(),
status: v2::ThreadEpiphanyRoleStatus::Needed,
note: "Review evidence before promotion.".to_string(),
jobs: vec![v2::ThreadEpiphanyJob {
id: "verification".to_string(),
kind: v2::ThreadEpiphanyJobKind::Verification,
scope: "invariant verification".to_string(),
owner_role: "epiphany-verifier".to_string(),
launcher_job_id: None,
authority_scope: None,
backend_kind: None,
backend_job_id: None,
status: v2::ThreadEpiphanyJobStatus::Needed,
runtime_agent_job_id: None,
items_processed: None,
items_total: None,
progress_note: None,
last_checkpoint_at_unix_seconds: None,
blocking_reason: None,
active_thread_ids: Vec::new(),
linked_subgoal_ids: Vec::new(),
linked_graph_node_ids: Vec::new(),
}],
authority_scopes: vec!["thread/epiphany/promote".to_string()],
recommended_action: Some(v2::ThreadEpiphanySceneAction::Promote),
}],
note: "Role ownership is derived read-only.".to_string(),
},
};
assert_eq!(response.id(), &RequestId::Integer(8));
assert_eq!(response.method(), "thread/epiphany/roles");
assert_eq!(
json!({
"method": "thread/epiphany/roles",
"id": 8,
"response": {
"threadId": "thr_123",
"source": "live",
"stateStatus": "ready",
"stateRevision": 3,
"roles": [
{
"id": "verification",
"title": "Verification / Review",
"ownerRole": "epiphany-verifier",
"status": "needed",
"note": "Review evidence before promotion.",
"jobs": [
{
"id": "verification",
"kind": "verification",
"scope": "invariant verification",
"ownerRole": "epiphany-verifier",
"status": "needed"
}
],
"authorityScopes": ["thread/epiphany/promote"],
"recommendedAction": "promote"
}
],
"note": "Role ownership is derived read-only."
}
}),
serde_json::to_value(&response)?,
);
Ok(())
}
#[test]
fn serialize_thread_epiphany_freshness_response() -> Result<()> {
let response = ClientResponse::ThreadEpiphanyFreshness {
@ -3880,6 +3968,18 @@ mod tests {
assert_eq!(reason, Some("thread/epiphany/jobs"));
}
#[test]
fn thread_epiphany_roles_is_marked_experimental() {
let request = ClientRequest::ThreadEpiphanyRoles {
request_id: RequestId::Integer(1),
params: v2::ThreadEpiphanyRolesParams {
thread_id: "thr_123".to_string(),
},
};
let reason = crate::experimental_api::ExperimentalApi::experimental_reason(&request);
assert_eq!(reason, Some("thread/epiphany/roles"));
}
#[test]
fn thread_epiphany_freshness_is_marked_experimental() {
let request = ClientRequest::ThreadEpiphanyFreshness {

View file

@ -3997,6 +3997,7 @@ pub enum ThreadEpiphanySceneAction {
Distill,
Context,
Jobs,
Roles,
JobLaunch,
JobInterrupt,
Freshness,
@ -4155,6 +4156,77 @@ pub struct ThreadEpiphanyJobsResponse {
pub jobs: Vec<ThreadEpiphanyJob>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct ThreadEpiphanyRolesParams {
pub thread_id: String,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct ThreadEpiphanyRolesResponse {
pub thread_id: String,
pub source: ThreadEpiphanyRolesSource,
pub state_status: ThreadEpiphanyReorientStateStatus,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional = nullable)]
pub state_revision: Option<u64>,
pub roles: Vec<ThreadEpiphanyRoleLane>,
pub note: String,
}
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub enum ThreadEpiphanyRolesSource {
Stored,
Live,
}
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub enum ThreadEpiphanyRoleId {
Implementation,
Modeling,
Verification,
Reorientation,
}
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub enum ThreadEpiphanyRoleStatus {
Ready,
Needed,
Blocked,
Running,
Completed,
Waiting,
Review,
Unavailable,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct ThreadEpiphanyRoleLane {
pub id: ThreadEpiphanyRoleId,
pub title: String,
pub owner_role: String,
pub status: ThreadEpiphanyRoleStatus,
pub note: String,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub jobs: Vec<ThreadEpiphanyJob>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub authority_scopes: Vec<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional = nullable)]
pub recommended_action: Option<ThreadEpiphanySceneAction>,
}
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]