Delete aggregate thread state authority

This commit is contained in:
Meta Vens 2026-08-18 04:29:44 +02:00
commit 07d891ba6c
19 changed files with 112 additions and 5441 deletions

View file

@ -1,12 +1,14 @@
use anyhow::{Context, Result, anyhow, bail};
use epiphany_core::{EpiphanyCoordinatorService, RepoFrontierUserProposalInput};
use epiphany_core::{
RepoFrontierUserProposalInput, intake_user_repo_frontier_proposal,
select_repo_frontier_work_proposal_for_modeling,
};
use serde_json::json;
use std::{collections::BTreeMap, path::PathBuf};
fn main() -> Result<()> {
let args = Args::parse(std::env::args().skip(1))?;
let service = EpiphanyCoordinatorService::new(&args.store);
let proposal = service.intake_user_repo_frontier_proposal(RepoFrontierUserProposalInput {
let proposal = intake_user_repo_frontier_proposal(&args.store, RepoFrontierUserProposalInput {
proposal_id: args.required("--proposal-id")?,
source_actor: args.required("--source-actor")?,
source_ref: args.required("--source-ref")?,
@ -24,7 +26,8 @@ fn main() -> Result<()> {
proposed_at: args.required("--proposed-at")?,
private_state_included: false,
})?;
let selection = service.select_repo_frontier_proposal_for_modeling(
let selection = select_repo_frontier_work_proposal_for_modeling(
&args.store,
&proposal.proposal_id,
&args.required("--selected-at")?,
)?;

View file

@ -2,7 +2,7 @@ use anyhow::{Context, Result, bail};
use epiphany_core::*;
use epiphany_state_model::{
EpiphanyMemoryDomain, EpiphanyMemoryLifecycle, EpiphanyMemoryNode, EpiphanyMemoryNodeKind,
EpiphanyMemoryProfile, EpiphanyThreadState,
EpiphanyMemoryProfile,
};
use std::{
collections::{BTreeMap, BTreeSet},
@ -76,41 +76,16 @@ fn main() -> Result<()> {
{
bail!("consideration lost classified source provenance");
}
let mut runtime = runtime_spine_cache(&runtime_store)?;
runtime.pull_all_backing_stores()?;
let state = runtime
.get::<EpiphanyThreadStateEntry>(THREAD_STATE_KEY)?
.context("fixture runtime lost its current thread state")?
.state()?;
let launch = build_epiphany_imagination_consideration_launch_request(
"fixture-thread",
Some(state.revision),
Some(30),
&state,
request.request_id.clone(),
)
.map_err(anyhow::Error::msg)?;
let job = format!("fixture-imagination-{}", feedback.feedback_id);
let plan = plan_coordinator_job_launch(
&state,
&launch,
let job_id = launch_current_imagination_consideration_work(
&runtime_store,
format!("launcher-{job}"),
job.clone(),
)?;
let committed = commit_coordinator_job_launch(
&runtime_store,
"fixture-thread",
&state,
&launch,
&plan,
AT.into(),
&request.request_id,
AT,
)?;
let candidate = ImaginationConsiderationCandidate {
schema_version: IMAGINATION_CONSIDERATION_CANDIDATE_SCHEMA_VERSION.into(),
candidate_id: imagination_consideration_candidate_id_for_launch(
&request.request_id,
&committed.backend_job_id,
&job_id,
),
request_id: request.request_id.clone(),
feedback_id: request.feedback_id.clone(),
@ -135,21 +110,6 @@ fn main() -> Result<()> {
contract: IMAGINATION_CONSIDERATION_CANDIDATE_CONTRACT.into(),
};
validate_imagination_consideration_candidate(&request, &candidate)?;
let mut runtime = runtime_spine_cache(&runtime_store)?;
runtime.pull_all_backing_stores()?;
let current = runtime
.get::<EpiphanyThreadStateEntry>(THREAD_STATE_KEY)?
.context("fixture runtime lost launched thread state")?
.state()?;
EpiphanyCoordinatorService::new(&runtime_store).interrupt_job(
"fixture-thread",
&current,
EpiphanyJobInterruptRequest {
expected_revision: Some(current.revision),
binding_id: committed.binding_id,
reason: Some("fixture advances to the next classified feedback".into()),
},
)?;
}
for (path, original) in before {
if bytes(&path)? != original {
@ -171,13 +131,6 @@ fn seed_fixture_runtime(store: &Path) -> Result<()> {
created_at: AT.into(),
},
)?;
let state = EpiphanyThreadState::default();
let mut cache = runtime_spine_cache(store)?;
cache.put(
THREAD_STATE_KEY,
&EpiphanyThreadStateEntry::from_state("fixture-thread", &state)?,
)?;
drop(cache);
let seed = EpiphanyRepoModelSeed::new(
"fixture-model-seed",
"fixture-model",

View file

@ -78,29 +78,78 @@ fn prepare_authority_family(store: &Path) -> Result<EpiphanyToolInvocationIntent
created_at: "2026-08-13T00:00:00Z".into(),
},
)?;
let state = EpiphanyThreadState::default();
let launch = build_epiphany_role_launch_request(
"public-source-no-grant-thread",
EpiphanyRoleResultRoleId::Research,
Some(state.revision),
Some(60),
&state,
)
.map_err(anyhow::Error::msg)?;
let plan = plan_coordinator_job_launch(
&state,
&launch,
let launch_document = EpiphanyWorkerLaunchDocument::Role(EpiphanyRoleWorkerLaunchDocument {
thread_id: "public-source-no-grant-thread".into(),
role_id: "research".into(),
state_revision: 0,
objective: Some("Prove the exact public-source grant boundary.".into()),
dynamic_prompt_context: None,
repository_body_observation_basis: None,
proposal_modeling_context: None,
frontier_verdict_modeling_context: None,
frontier_planning_context: None,
frontier_research_context: None,
frontier_verification_context: None,
frontier_plan_mind_context: None,
imagination_consideration_context: None,
admitted_model_direction_consideration_context: None,
active_subgoal_id: None,
active_subgoals: Vec::new(),
active_graph_node_ids: Vec::new(),
investigation_checkpoint: None,
scratch: None,
invariants: Vec::new(),
graphs: None,
recent_evidence: Vec::new(),
recent_observations: Vec::new(),
graph_frontier: None,
graph_checkpoint: None,
planning: None,
churn: None,
});
let authority_scope = "epiphany.eyes.public_source_gate_probe";
open_runtime_spine_heartbeat_job(
store,
"public-source-no-grant-launcher".into(),
WORKER_JOB_ID.into(),
RuntimeSpineHeartbeatJobOptions {
runtime_id: "public-source-no-grant-probe".into(),
display_name: "Public source no-grant probe".into(),
session_id: EPIPHANY_RUNTIME_ROOT_SESSION_ID.into(),
objective: "Prove the exact public-source grant boundary.".into(),
coordinator_note: "isolated gate probe".into(),
job_id: WORKER_JOB_ID.into(),
role: EPIPHANY_RESEARCH_OWNER_ROLE.into(),
binding_id: EPIPHANY_RESEARCH_ROLE_BINDING_ID.into(),
authority_scope: authority_scope.into(),
instruction: "Attempt one immutable public source lookup.".into(),
output_contract_id: ROLE_WORKER_OUTPUT_CONTRACT_ID.into(),
organ_launch_contract: default_launch_organ_contract(
authority_scope,
"role",
ROLE_WORKER_OUTPUT_CONTRACT_ID,
),
launch_document,
proposal_modeling_request_id: None,
frontier_planning_request_id: None,
frontier_plan_mind_request_id: None,
imagination_consideration_request_id: None,
admitted_model_direction_consideration_request_id: None,
repo_frontier_modeling_request_id: None,
repo_frontier_research_request_id: None,
repo_frontier_verification_request_id: None,
created_at: "2026-08-13T00:00:01Z".into(),
},
)?;
commit_coordinator_job_launch(
store,
"public-source-no-grant-thread",
&state,
&launch,
&plan,
"2026-08-13T00:00:01Z".into(),
runtime_spine_cache(store)?.put(
&format!("substrate-grant-{WORKER_JOB_ID}"),
&substrate_gate_repo_access_grant_for_worker(
format!("substrate-grant-{WORKER_JOB_ID}"),
WORKER_JOB_ID.into(),
EPIPHANY_RESEARCH_ROLE_BINDING_ID.into(),
EPIPHANY_RESEARCH_OWNER_ROLE.into(),
authority_scope.into(),
true,
"2026-08-13T00:00:01Z".into(),
),
)?;
let mut model_request = EpiphanyModelRequest::new(